File Handling


CICS offers file handling features that enable programs to read, write, modify, and delete records in VSAM (Virtual Storage Access Method) datasets.

Points to Note -

  • CICS supports only VSAM and BDAM file types.
  • All files used in a CICS application must be registered in the File Control Table (FCT) with complete attributes. CICS commands utilize the entries in the FCT to retrieve the file Data Set Name (DSN) and perform operations on the files.
  • Files that are not declared in the File Control Table (FCT) will not be recognized by CICS. In CICS, it is unnecessary to have entries in the FILE SECTION or DATA DIVISION for these files, as their information is already available to all users through the FCT.
  • The file attributes defined in FCT can control file operations like read, update, add, browse, and delete. The user can override the file attributes in FCT by using CEMT.

CICS enables both sequential and random reading of VSAM files.

Sequential Access Commands -

Below are the list of the commands for the sequential access of VSAM file -

Command Description
STARTBR Start browsing of a file.
READNEXT Read next record during a file browse.
READPREV Read previous record during a file browse; VSAM and data tables only.
RESETBR Reset the start of a file browse.
ENDBR End the file browse.

Random Access Commands -

Below are the list of the commands for the ramdom access of VSAM file -

Command Description
READ Read a record from a file.
WRITE Write a record to the file.
REWRITE Update a record in a file.
DELETE Delete a record from a file.
UNLOCK Releases the exclusive control on file.