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
- Import, then Import legacy source, choose Batch program (no screens) and drop the
.cbl, its copybooks, and theschema.sql/seed.sqlof its tables. - Open Player. A batch operation shows a run form instead of Play: a PARM field and a SYSIN editor, one card per line.
- 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 limit | Value |
|---|---|
Time limit (then abend S322) | 30 seconds |
SYSIN cards | 1,000, each at most 80 characters |
PARM | 100 characters |
SYSOUT and SYSERR lines shown | 2,000 together |
| Runs of one operation at a time | One |
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
| Abend | When |
|---|---|
S0C4 | A subscript out of range, or a linkage area the caller did not pass |
S0C7 | Non-numeric data in an arithmetic or numeric move |
S0CB | Division by zero with no ON SIZE ERROR |
S806 | CALL to a program that is not in the conversion |
S222, S322 | Cancelled, or out of time |
SQL | A statement failed with no SQLCODE the program could test |
U4038 | The 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
OPENruns one query. - Run with autocommit off; the program's own
COMMITinterval 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.