Book a demo

← Documentation

Batch programs

A COBOL batch program converts as one callable unit (cobol-batch). It has no screen and no commarea: it runs with its SYSIN cards and PARM, and returns a return code or an abend.

Import and run in the console

  1. Import, then Import legacy source, choose Batch program (no screens) and drop the .cbl, its copybooks, and the schema.sql / seed.sql of its tables.
  2. Open Player. A batch operation shows a run form instead of Play: a PARM field and a SYSIN editor, one card per line.
  3. Press Run. The console generates the Groovy when the sources changed, then runs the program once against the operation's database. Cancel ends a running program with abend S222.

The result shows the return code (green for 0, amber up to 4, red from 8 or on an abend), the abend code and message, SYSOUT and SYSERR, and how long the program ran. Open database shows the tables the run changed. A run without an abend is committed; a run with one is rolled back.

Console run limitValue
Time limit (then abend S322)30 seconds
SYSIN cards1,000, each at most 80 characters
PARM100 characters
SYSOUT and SYSERR lines shown2,000 together
Runs of one operation at a timeOne

The same run is available over REST: POST /api/applications/{app}/operations/{op}/batch/runs with {"parm": "...", "sysin": ["card", ...]}; DELETE .../batch/runs/current cancels it.

From the CLI, convert with --source-kit cobol-batch.

Abends

AbendWhen
S0C4A subscript out of range, or a linkage area the caller did not pass
S0C7Non-numeric data in an arithmetic or numeric move
S0CBDivision by zero with no ON SIZE ERROR
S806CALL to a program that is not in the conversion
S222, S322Cancelled, or out of time
SQLA statement failed with no SQLCODE the program could test
U4038The run reached a statement the converter did not translate, or another runtime failure

A negative SQLCODE the program does not test is not an abend; the program continues, as on z/OS. Statements the converter does not translate are listed in dropped-statements.md.

Performance

  • Each SQL statement is prepared once and reused; a cursor OPEN runs one query.
  • Run with autocommit off; the program's own COMMIT interval decides the unit of work.

Convert a COBOL batch program, run it in the console with PARM and SYSIN, and read its return code or abend.

Read more

Tell us about yourself

You've been browsing the catalog. Leave your details to keep exploring.

Privacy policy