The mode is the promise on the FILE line: this step will only read, it will build a new file, or it will change rows that are already there. JCL has to make the same promise. CREATE against a shared input data set, or UPDATE with no authority, fails when the file opens, which is after a clean compile.
| Mode | You code | JCL has to |
|---|---|---|
| Read | FILE name, no CREATE or UPDATE | DISP=SHR on an existing data set |
| Create | FILE name CREATE | NEW, or a reusable VSAM cluster |
| Update | FILE name UPDATE, often INDEXED | DISP=SHR and update authority |
| Table | FILE name TABLE | The code file, or INSTREAM data |
| Virtual | FILE name VIRTUAL | EZTVFM space |
12345FILE MASTER FB(80 8000) FILE EXTRACT FB(40 4000) CREATE FILE MASTERK INDEXED UPDATE FILE CODES TABLE FILE WORK VIRTUAL
JOB INPUT MASTER walks the file. You test fields and PRINT or PUT somewhere else. You do not PUT back to MASTER. That file is not opened for output.
CREATE is the extract and the new sequential file. UPDATE is a VSAM master you rewrite, or an SQL file you will DELETE or INSERT. On VSAM, automatic JOB INPUT with UPDATE issues a held read in batch so the record can be rewritten. Leave UPDATE off a read-only report so a bug cannot change production keys.
TABLE is a code list you SEARCH, not a file you print row by row. VIRTUAL is scratch space inside the step. Both still have a FILE name. VIRTUAL draws from EZTVFM. A one-track EZTVFM on a large sort or work file is a space abend, not a logic bug.
Read is looking at the cards. Create is writing new cards into an empty box. Update is erasing a number on a card and writing a new one. Table is a short list you keep on the desk to look codes up. Virtual is scrap paper the program throws away when the job ends.
1. A report that only reads a sequential file needs:
2. CREATE on FILE means:
3. UPDATE is required when:
4. TABLE on FILE means:
5. VIRTUAL storage is backed by: