Skip to main content

Crate ironwork_exec

Crate ironwork_exec 

Source
Expand description

ironwork for COBOL: WORKING-STORAGE laid out as IBM lays it out, and an interpreter that runs a program against it in EBCDIC with the numeric model of ironwork-numeric.

Modules§

abend
calendar
The proleptic Gregorian calendar: day counts, civil fields, Lilian days and the epoch offsets.
cics
The CICS region a harness run stands in for: one task, its files, its temporary-storage and transient-data queues, and the time services. The interpreter runs the commands; this holds what they act on.
codec
A numeric item’s storage read as generated code reads it. The interpreter and the SQL runtime share it, so a host variable sends exactly the value a COMPUTE would read.
collating
Collating sequences: the order an ALPHABET clause gives the single-byte characters. PROGRAM COLLATING SEQUENCE makes one the program’s, for its alphanumeric comparisons, HIGH-VALUE, LOW-VALUE, CHAR and ORD; the COLLATING SEQUENCE phrase makes one a SORT’s or MERGE’s.
declaratives
USE AFTER EXCEPTION/ERROR and USE FOR DEBUGGING procedures at compile time: the files, open mode or procedures each serves, and the rules the Language Reference (SC27-8713-03) sets for them. They run in machine::declaratives.
digest
SHA-256 (FIPS 180-4) that hashes a stream in blocks, so a data set is digested without being held in memory, and HMAC-SHA-256 (RFC 2104). Written here because the runtime takes no dependencies.
edit
evidence
Run journals in cobolwork’s evidence format (cobolwork docs/spec/evidence.md §4-6), so one verifier reads both tools: each record is canonical JSON hashed as SHA-256(“cobolwork-evidence/v1\n” || record without “hash”), chained by prev and seq, and each closed run adds its tip to ledger.jsonl. Nothing written holds source text or a secret.
files
Files. ASSIGN names a DD, and only the operator maps a DD to a host file, as JCL does, so a program reaches no file it was not given. A binary DD holds z/OS records byte for byte: fixed-length records back to back, or variable-length records each behind a 4-byte RDW. A text DD holds UTF-8 lines, converted through the program’s code page, and placed as a printer would place them (Open::print). Sequential files stream; indexed and relative files are held in memory (see Keyed).
layout
WORKING-STORAGE as IBM lays it out: sizes by USAGE and PICTURE, REDEFINES sharing storage, OCCURS repeating it, SYNCHRONIZED slack bytes before an item and after each occurrence, and level-66 RENAMES over what is laid out. See numeric::assumptions::WORKING_STORAGE_LAYOUT for where each 01 level starts.
le
Language Environment callable services (SA38-0683-60): which ones ironwork provides, their condition tokens, Lilian dates and seconds, and the picture strings of the date and time services. The CALL side, which reads and writes the arguments, is machine/le_services.rs. What the manual leaves open is numeric::assumptions L1 to L18.
linage
LINAGE: a print file’s logical page (numeric::assumptions::LINAGE_COUNTER). OPEN OUTPUT or EXTEND takes the page body, first footing line and margins from the FD’s integers and data items, and each new page takes the data items’ values again. LINAGE-COUNTER is the line of the page body the printer is at; WRITE moves the paper past the footing area and the margins in lines (numeric::assumptions::LINAGE_PAGE_MOVEMENT).
lower
Lowering (docs/lir.md): a compiled program with every name resolved, every category decided and every transfer of control made explicit, as the LIR a VM runs and a load module holds.
machine
The interpreter: one activation of one program, over the run unit’s memory in EBCDIC. A reference can reach anywhere in that memory, as a program compiled without SSRANGE can on z/OS, but never outside it.
oo
Object-oriented COBOL, compiled and checked. A class written in COBOL becomes code the interpreter runs within the run unit: each method is compiled as a program whose LINKAGE SECTION ends with the records of the OBJECT or FACTORY WORKING-STORAGE it works on, and each INVOKE finds its method by name and Java signature, as the JNI does. Running is in machine/oo.rs; a Java class is checked here and never run.
picture
printer
The printer control character (numeric::assumptions::PRINT_CONTROL_CHARACTER). A sequential file that a WRITE … ADVANCING of the program names, whose FD has LINAGE, or that holds a report is a print file: every record written to it carries a control character, an ASA character when every WRITE … ADVANCING of the file says AFTER, a machine code when one says BEFORE. Under ADV the character is a byte before the record; under NOADV it is the record’s first byte.
report
The report writer at compile time. Enterprise COBOL runs Report Writer only as the Report Writer Precompiler’s generated COBOL (numeric::assumptions::REPORT_WRITER_PRECOMPILER), and this follows it: each report’s lines and fields are placed; its report control area (PAGE-COUNTER, LINE-COUNTER, the writer’s own state and saved controls), its printed fields and its SUM totals become WORKING-STORAGE (numeric::assumptions::REPORT_CONTROL_AREA); and every name is resolved. machine::report runs the result.
sql
The SQL runtime is rt::sql; this adds what needs the compiler’s layout: the host type of a declared item.
strings
The byte-level work of STRING, UNSTRING and INSPECT, apart from storage and operands.
terminal
rt’s 3270 terminal, with its AID bytes checked against the DFHAID copybook syntax serves.
tn3270
A Terminal over a TCP connection speaking TN3270 (RFC 1576): telnet negotiation of the terminal type, EOR and BINARY, then 3270 data streams as records ended by IAC EOR.
unit
The run unit: every program a run calls, sharing one memory as they share an address space on z/OS. A called program keeps its WORKING-STORAGE and open files from one CALL to the next until it is cancelled. A reference or pointer can reach anywhere in this memory, but never outside it.

Structs§

Abend
Compiled
EntryPoint
An alternate entry point: a CALL of name begins at statement statement of paragraph paragraph, the one after the ENTRY statement, with using addressing LINKAGE.

Enums§

Ending

Functions§

compile
Checks and lays out a parsed program. flags are this compiler’s own, such as -silent. A program is refused, with every message, when one stops its object code: under IBM’s default NOCOMPILE(S) one that is S or U, from W under -warnings-block, or as a CBL or PROCESS card’s COMPILE or NOCOMPILE says; otherwise its messages are Compiled::diagnostics.
entry_points
The ENTRY statements of a program, each a sentence of its own paragraph’s.