If the file contains multiple record formats in one physical record, you can access all the records in the file by using rules statements similar to those that follow. To update a record, you must update the base table after updating the other multiple record format tables. The tables in this rule are the ones defined in
Sample Definition (Record A) and
Sample Definition (Record B).
RULE EDITOR ===> SCROLL: P VSAMREPEAT(NEW_NAME);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL EMPLOYEE_VSAM_A : | 1
_ FORALL EMPLOYEE_VSAM_B(EMPLOYEE_VSAM_A.KEY) : |
_ EMPLOYEE_VSAM_B.LNAME = NEW_NAME; |
_ EMPLOYEE_VSAM_B.FNAME = EMPLOYEE_VSAM_B.FNAME || |
_ ’ STUDENT’; |
_ REPLACE EMPLOYEE_VSAM_B(EMPLOYEE_VSAM_A.KEY); |
_ END; |
_ REPLACE EMPLOYEE_VSAM_A; |
_ END; |
_ ---------------------------------------------------------------------------
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE
RULE EDITOR ===> SCROLL: P INSERT_VSAM;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ EMPLOYEE_A.KEY = 1; | 2
_ EMPLOYEE_A.DEPTNO = 10; | 3
_ EMPLOYEE_B.LNAME = ’DOE’; | 4
_ EMPLOYEE_B.FNAME = ’JOHN’; | 5
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | 6
_ EMPLOYEE_B.LNAME = ’ANN’; | 7
_ EMPLOYEE_B.FNAME = ’MARY’; | 8
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | 9
_ EMPLOYEE_B.LNAME = ’DICK’; | A
_ EMPLOYEE_B.FNAME = ’TRACY’; | B
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | C
_ INSERT EMPLOYEE_A; | D
_ ---------------------------------------------------------------------------
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE