Module 6: CICS File Handling
File Definitions
Every file named in the FILE option of an EXEC CICS command must be defined to CICS. The definition lives in the File Control Table (FCT), which today is maintained through resource definition - usually with the CEDA transaction - and installed into the running region.
What a file definition contains
- The definition connects the file name your program uses (the FILE option value) to a real VSAM data set.
- If a program references a file name with no installed definition, every file command against it raises FILENOTFOUND.
- Definitions are created with CEDA DEFINE FILE, grouped into a GROUP, and the group must be added to the startup group list (or installed manually) for the definition to take effect.
- You can inspect a definition with CEDA DISPLAY FILE(name) or CEMT INQUIRE FILE(name).
Key attributes of a file definition
- FILE - the 1 to 8 character name the program uses in the FILE option.
- GROUP - the resource definition group the definition belongs to.
- DSNAME - the VSAM cluster name (data set name) this file maps to.
- DISPOSITION - usually SHR, meaning the data set can be shared.
- OPENTIME - when CICS opens the file: STARTUP (at region start) or FIRSTREF (when first referenced).
- STATUS - ENABLED or DISABLED; a disabled file raises the DISABLED condition on every access.
- RECOVERABLE - YES means the file takes part in backout: if the task abends, CICS undoes the task's file updates automatically.
- For a remote file, SYSID names the region that owns the file and RNAME gives the file's name in that region.
- Example of defining a file:-
CEDA DEFINE FILE(CUSTMAS) GROUP(APPLGRP) DSNAME(PROD.VSAM.CUSTMAS) DISPOSITION(SHR) OPENTIME(FIRSTREF) STATUS(ENABLED) RECOVERABLE(YES)
