4.3.1 Adding Records to a File (One at a Time)

Construct a function to add records to one file.

Files Involved

Physical file CUSMST (customer master file)

RDML Program

GROUP_BY   NAME(#CUSTOMER) FIELDS(#CUSTNO #NAME #ADDL1 

           #ADDL2 #ADDL3)

 

BEGIN_LOOP

CHANGE     FIELD(#CUSTOMER) TO(*DEFAULT)

REQUEST    FIELDS(#CUSTOMER) EXIT_KEY(*YES *EXIT) 

           MENU_KEY(*YES *MENU)

INSERT     FIELDS(#CUSTOMER) TO_FILE(CUSMST) 

           VAL_ERROR(*LASTDIS) 

END_LOOP

 

Points to Note: