Previous Topic: VSAM File DefinitionNext Topic: KSDS Organization


ESDS Organization

Retrieval of records from VSAM files organized as ESDS is sequential only. Establish the 'defineparameters' in the 80-byte Communications Area prior to any GET operation on the file.

Supply the following 'defineparameters' for access to an ESDS VSAM file:

 'ESDS,CAI,SEQ'

If the parameters CAI and SEQ are not specified, the Reporting Facility automatically supplies them as default values. Establish the Communications Area in one of the following two ways prior to access of the file:

The following two Reporting Facility programs illustrate various techniques available for specification of ESDS VSAM file access. Note that both programs produce the same results, but different techniques are used.

        USER 'XYZ COMPANY, INC.'
 MASTER: FILE VSAM 'ESDS' RECORD=100
        DEF  DIVISION                               1-2 X
        DEF  DEPARTMENT                             3-5 X
        DEF  EMPLOYEE-NUMBER                        6-9 N   'EMPNO'
        DEF  EMPLOYEE-NAME                        10-25 X
        REPORT 'ESDS SAMPLE 1'
        SELECT  ALL
        CONTROL EMPLOYEE-NUMBER
        PRINT   DIVISION DEPARTMENT EMPLOYEE-NUMBER
                                            EMPLOYEE-NAME
        END
        USER 'XYZ COMPANY, INC.'
 MASTER: FILE VSAM RECORD=100
        DEF DIVISION                                1-2 X
        DEF DEPARTMENT                              3-5 X
        DEF EMPLOYEE-NUMBER                         6-9 N   'EMPNO'
        DEF EMPLOYEE-NAME                    10 THRU 25 X
        MOVE 'ESDS,CAI,SEQ' TO MASTER.VSAM
        GET MASTER
        GOTO EOJ WHEN MASTER EQ END-OF-FILE
        REPORT 'ESDS SAMPLE 2'
        SELECT  ALL
        CONTROL EMPLOYEE-NUMBER
        PRINT   DIVISION DEPARTMENT EMPLOYEE-NUMBER EMPLOYEE-NAME
        END

Note the following: