File handling is the path from a DD statement to a field you can test. FILE names the file and the layout. JCL supplies the data set. JOB INPUT or GET fills the fields. PUT writes an output record. EOF tells you the last record has already been used, so you do not print whatever is still sitting in the buffer.
| Verb | What it does |
|---|---|
| FILE | Names the file and the fields in the Library |
| JOB INPUT | Reads the primary file once per activity pass |
| GET | Reads the next record of a file you control |
| PUT | Writes the output buffer |
| EOF | True when GET has no next record |
1234567891011FILE MASTER FB(80 8000) EMP-NO 1 5 N STATUS 6 1 A FILE OUTFILE FB(80 8000) CREATE OUT-EMP 1 5 N JOB INPUT MASTER IF STATUS EQ 'A' MOVE EMP-NO TO OUT-EMP PUT OUTFILE END-IF
JOB INPUT already consumed MASTER. A rate table or a second sequential file is GET. After GET, test EOF before you use that file's fields. The buffer still holds the previous record when EOF becomes true.
1234GET RATES IF EOF RATES STOP END-IF
FILE MASTER looks for DD MASTER. SYSNAME is the exception, when the external name cannot match the Easytrieve name. A compile cannot see a missing DD. The open fails at run time.
FILE is the label on the box. JOB INPUT takes the next card out of the box for you. GET is you reaching in yourself. PUT drops a card into a second box. EOF means your hand came back empty, so you stop instead of reading the card you took out last time.
1. Automatic input uses:
2. A second file, read by hand, uses:
3. PUT writes:
4. The file opens:
5. DD MASTER for FILE CLAIMS fails because: