FILE names every data set, table, or printer the program touches. It lives in the Library section. Activity statements such as GET, PUT, and JOB INPUT refer to that name, and JCL supplies a DD with the same name. This sheet is the parameter list you scan while coding. The FILE tutorial explains each option when the one-line description is not enough.
12345678910FILE file-name [type] [device] [record-format] [options] field-name start length type [decimals] FILE PERSNL FB(150 1800) EMP-NO 1 5 N EMP-NAME 6 20 A FILE MASTER INDEXED UPDATE FILE ERRPRINT PRINTER FILE RATES TABLE
| Type | Use |
|---|---|
| SEQUENTIAL (default) | QSAM or VSAM ESDS, flat extracts |
| INDEXED | VSAM KSDS, access by key |
| RELATIVE | VSAM RRDS, access by relative record number |
| SQL (tables) | Db2 or other SQL; cursor managed by Easytrieve |
| IDMS (subschema) | IDMS database file |
| DLI (...) | IMS, relative PCB or DBD, mainframe only |
| Option | What it does |
|---|---|
| FB(lrecl blksize) | Fixed blocked records |
| VB(lrecl blksize) | Variable blocked records |
| CREATE | Build a new file |
| UPDATE | Change existing records; required for SQL DELETE and INSERT |
| TABLE | Load for SEARCH |
| PRINTER | Report or print output |
| VIRTUAL | Intermediate data, backed by EZTVFM space |
| PASSWORD | Password presented at open |
| SYSNAME | External DD name when it differs from the file-name |
An SQL file accepts UPDATE, DEFER, and CODE from that list. The other options are for conventional files. Specifying SEQUENTIAL also makes FILE-STATUS available for that file.
Each field gives a start position, a length, and a type. N is numeric display, A is character, P is packed. The number after P is decimal positions. Positions are 1-based and must agree with the record length on the FILE line and with the LRECL on the DD.
1234FILE CLAIMS FB(80 8000) CLAIM-NO 1 8 A LOB 9 3 A PAID 12 5 P 2
FILE is the label on a box of cards. The type says whether the cards are in a stack, a drawer with a key, or a database. The lines underneath FILE say which slice of each card is the name and which slice is the money. JCL is someone putting the real box on the shelf with that same label.
1. FILE statements go in the:
2. Omitting the file type means:
3. FB(150 1800) means:
4. UPDATE on FILE allows:
5. The JCL DD name matches: