New maintainers search the Language Reference for START and may not find a standalone statement page—Broadcom documents START as the optional START start-proc-name parameter on the JOB statement. That parameter names a procedure Easytrieve performs during JOB initiation before retrieving the first automatic input record. Think of START as the opening shift checklist: zero counters, DISPLAY a banner, POINT an indexed master to today's key, run SQL SELECT when FILE DEFER delayed cursor open, reposition IMS databases, or load small control tables into working storage. FINISH is the closing checklist after the last record; START is the mirror at the front door. You cannot reference fields from the automatic input file inside START because no input record has been read yet—only working storage, other files already accessible, and environmental values are fair game. This page teaches JOB START syntax, implied execution order with OPEN, GOTO JOB interaction inside START, SQL and POINT patterns, contrast with INITIATION on SCREEN, and mistakes that arise when initialization is coded in the JOB body instead of START.
123456789JOB [INPUT file-name | NULL | SQL | (sync list)] + [START start-proc-name] + [FINISH finish-proc-name] + [NAME job-name] + ... start-proc-name. PROC * initialization statements END-PROC
Only JOB activities accept START. SORT activities use BEFORE for prescreening, not START. SCREEN activities use INITIATION screen procedure for one-time online setup—a parallel concept with different name and terminal rules. The procedure label must be followed by PROC and closed with END-PROC per standard procedure grammar.
Broadcom documents implied steps when JOB runs with automatic input: open files, optionally PERFORM START procedure, retrieve input in a loop, run FINISH when input ends, wrap reports, proceed to next activity. START therefore runs after OPEN and before the first GET or automatic read places a record in the input buffer. Coding heavy OPEN-dependent logic in START is correct; coding it in the first line of JOB body still runs after first record arrives when INPUT is automatic—too late for positioning that must precede read.
| Hook | When it runs | Activity |
|---|---|---|
| START procedure | Once before first automatic input record | JOB |
| JOB body loop | Each input record (implied GOTO JOB) | JOB |
| FINISH procedure | After last automatic input record | JOB |
| INITIATION PROC | Once at SCREEN activity start | SCREEN |
| BEFORE-SCREEN PROC | Each screen display cycle | SCREEN |
Initialize accumulators when VALUE on DEFINE is insufficient—TOT-AMT = 0, RECORD-COUNT = 0, HOLD-FIELDS to SPACES. DISPLAY diagnostic banners in test regions. POINT indexed or relative files to a starting key so automatic INPUT begins mid-file for restart jobs. Issue SQL SELECT on DEFERred SQL FILE so default cursor does not open before your dynamic WHERE clause is built. PERFORM small shared PROCs for table LOAD when external TABLE files feed control data. Issue DLI or database positioning statements in IMS-integrated programs per database chapter examples.
123456789JOB INPUT MASTFILE NAME RESTART-JOB START START-PROC * body uses MASTFILE fields after first record arrives PRINT DETAIL-RPT START-PROC. PROC TOT-SALES = 0 DISPLAY 'RESTART JOB BEGIN' POINT MASTFILE KEY RESTART-KEY END-PROC
You cannot reference fields from the automatic input file—the record buffer is empty. Attempts to IF INPUT-FIELD = value in START read uninitialized buffer content or compile diagnostics depending on reference type. Secondary files not on JOB INPUT may be read if already open rules allow, but automatic input file sequential fields are off limits until the first retrieval. GOTO JOB inside START terminates START immediately per JOB statement documentation—use when aborting initialization branch, understanding JOB then proceeds toward input processing without re-running START unless GOTO JOB loops entire JOB including implied re-init (verify release behavior in test—generally avoid GOTO JOB from START except deliberate early entry to body).
NULL inhibits automatic input; you GET or READ manually. START still runs first—ideal for setting up before a DO WHILE GET loop. You must STOP or TRANSFER eventually or NULL jobs loop forever. START initialization of EOF flags and counters matters more in NULL jobs because you control every read explicitly.
Synchronized JOB INPUT aligns multiple files on KEY fields. START may POSITION one file or DISPLAY sync start message before first matched tuple arrives. Matching logic itself runs in JOB body with IF MATCHED conditions after records exist—do not expect MATCHED in START.
INITIATION is the screen procedure special name at SCREEN activity entry—open online files, set terminal defaults, display welcome once. START is the JOB parameter equivalent for batch. Do not label a batch init PROC as INITIATION unless it lives in a SCREEN activity; cross-naming confuses maintainers and breaks special-name invocation rules.
START opens the job; FINISH closes it gracefully after last record. FINISH displays EOJ totals; START displays BOJ banners. STOP EXECUTE in JOB body skips FINISH but cannot undo START already performed. GOTO JOB inside FINISH terminates FINISH early—mirror caution as with START.
START is the before-we-begin checklist on a JOB adventure. The teacher reads START start-proc-name on the JOB sign-up sheet, then runs your checklist proc once: wipe the chalkboard counters, open the right book page with POINT, say we are starting on the loudspeaker with DISPLAY. Only after the checklist does the teacher hand you the first worksheet—that is the first input record. You cannot answer worksheet questions on the checklist because you have not received the paper yet.
1. START on JOB names:
2. Inside START procedure you cannot reference:
3. START procedure runs after:
4. GOTO JOB inside START:
5. Typical START tasks include: