Skip to content

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:

  1. Read inputACCEPT PARM-VALUE FROM SYSIN reads an 8-character value from the SYSIN input stream (typically supplied via JCL as a parameter card).
  2. Convert valueMOVE PARM-VALUE TO MVSWAIT-TIME moves the value into a PIC 9(8) COMP numeric field, converting the alphanumeric input into a binary number representing centiseconds.
  3. Perform waitCALL 'MVSWAIT' USING MVSWAIT-TIME invokes an external subprogram (not part of this source file) that performs the actual wait based on the numeric value passed.
  4. TerminateSTOP RUN ends 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 SYSIN is moved directly into a numeric COMP field with no checks for non-numeric or malformed data. If PARM-VALUE contains non-numeric characters, this MOVE could produce undefined/garbage results or abend at runtime, since COBOL numeric-edited moves from alphanumeric fields don't validate content.
  • Fixed-size parameter. PARM-VALUE is PIC X(8), and MVSWAIT-TIME is PIC 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. If MVSWAIT fails 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 DIVISION shown 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