COBSWAIT
Source: cbl/COBSWAIT.cbl
Type: Batch program
Purpose
COBSWAIT is a small batch utility program used in the CardDemo application to pause (delay) job execution for a configurable amount of time. It reads a wait duration (expressed in centiseconds) as input and delegates the actual wait/sleep logic to an external routine, MVSWAIT. It is run as the WAITSTEP.WAIT step of a batch job, presumably to introduce timing delays between job steps (e.g., for sequencing, throttling, or simulating processing time).
How it works
The program has no named paragraphs — all logic sits directly in the PROCEDURE DIVISION:
- Read input —
ACCEPT PARM-VALUE FROM SYSINreads an 8-character value from theSYSINinput stream (typically supplied via JCL as a parameter card). - Convert value —
MOVE PARM-VALUE TO MVSWAIT-TIMEmoves the value into aPIC 9(8) COMPnumeric field, converting the alphanumeric input into a binary number representing centiseconds. - Perform wait —
CALL 'MVSWAIT' USING MVSWAIT-TIMEinvokes an external subprogram (not part of this source file) that performs the actual wait based on the numeric value passed. - Terminate —
STOP RUNends the program immediately after the call returns.
There is no looping, conditional logic, or error handling — it's a straight-line, three-statement program.
Inputs & outputs
| Item | Type | Purpose |
|---|---|---|
SYSIN |
Input stream (not a file per parser, but a DD/input source) | Supplies the wait duration as an 8-character text value, expected to represent centiseconds. |
MVSWAIT |
External call (program) | Performs the actual wait/delay based on the numeric value passed in MVSWAIT-TIME. Its implementation is outside this source file and not verified here. |
WAITSTEP.WAIT |
Job step | The batch job step that executes this program. |
No files, copybooks, SQL tables, or CICS commands are used — this is confirmed by the parser facts (files: [], copybooks: [], sql_tables: [], cics_commands: []).
Things to know
- No input validation. The value from
SYSINis moved directly into a numericCOMPfield with no checks for non-numeric or malformed data. IfPARM-VALUEcontains non-numeric characters, thisMOVEcould produce undefined/garbage results or abend at runtime, since COBOL numeric-edited moves from alphanumeric fields don't validate content. - Fixed-size parameter.
PARM-VALUEisPIC X(8), andMVSWAIT-TIMEisPIC 9(8) COMP— the wait value must fit within 8 digits (centiseconds), limiting the maximum wait duration. - No error handling. There's no check on the success/failure of the
CALL 'MVSWAIT', nor any return code handling. IfMVSWAITfails or isn't found at runtime, behavior depends entirely on the runtime environment's abend handling. - External dependency. The actual wait behavior lives in
MVSWAIT, which is not part of this source and not verified by the parser — its implementation, units, and behavior can't be confirmed from this file alone (the comment states the parameter is in centiseconds, but this is only documented, not enforced in code). - No paragraphs/structure. The parser found zero named paragraphs, consistent with the flat, unstructured
PROCEDURE DIVISIONshown in the source — there's nothing to decompose or trace beyond the three statements. - Purely a utility/timing mechanism — it has no business logic, file I/O, or database interaction, aligning with its role as a generic "wait" step in a job stream.
Calls
MVSWAIT
Executed by
WAITSTEP.WAIT