CICS-Sequential and Random Access

Not only in CICS, in any of the mainframe Technologies, reading of the files can be done in multiple ways.

Especially in CICS, Sequential and Random access are most popular ways of reading files.

Sequential Access: STARTBR (start browse) keeps record at the key position, from where we want to read a record.

READNEXT-will actually read the record into working storage file description area.

Sample syntax:

EXEC CICS STARTBR

   DATASET(‘FILEAA’)

   RIDFILD(REC-IO-KEY)==> Record Key

  GTEQ

END-EXEC.

—-

EXEC CICS READNEXT

   DATASET(‘FILEAA’)

    INTO(FILE-IO-AREA) ==working storage file description at ’01’ level

   RIDFILD(REC-IO-KEY)==>Record Key

   GTEQ

END-EXEC.

Random Access: File reading by this way will be achieved with “READ” command. It reads the record, as per key mentioned, and moves into working storage record area.

Sample syntax:

EXEC CICS READ

   DATASET(‘FILEAA’)

    INTO(FILE-IO-AREA) ==working storage file description at ’01’ level

   RIDFILD(REC-IO-KEY)==>Record Key

   GTEQ

END-EXEC.

These may look simple, but, many people do not have much idea. I am sure it will help you.

In my next posts, I will give how data will be retrieved by using DB2 and IMSDB.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.