Skip to content

ironwork 0.8.0

Choose a tag to compare

@github-actions github-actions released this 04 Oct 15:21
· 237 commits to main since this release
569cee8

Summary

ironwork 0.8.0 runs more of what real Db2 programs and the CCVS85 audit routines do. Varying-list programs describe and fetch through an SQLDA, programs test UPSI switches and CLASS conditions, COPY REPLACING takes IBM's operands, and every catalogued message carries an id a tool can read.

  • Dynamic SQL, finished: DESCRIBE, PREPARE ... INTO and USING DESCRIPTOR fill and read the SQLDA as Db2 13 for z/OS lays it out.
  • Rowsets and CALL: FETCH NEXT ROWSET into host-variable arrays, INSERT ... FOR n ROWS, and CALL of a stored procedure answered from a recording.
  • SPECIAL-NAMES: UPSI switches with their condition-names, SET ... TO ON and OFF, and the UPSI runtime option; CLASS clauses and the class conditions that name them.
  • COPY REPLACING: identifier operands with their qualifiers and subscripts, replacement text copied as written, and debugging lines that take part in matching.
  • Message ids and JSON: every compile message carries an id from ironwork's catalogue, and --diagnostics json writes each message as a JSON object.
  • IBM's documented rules: SSRANGE checks the address a reference's subscripts compose, a MERGE outputs by merge selection without a sequence check, and every assumption once written from memory is checked against IBM's manuals.
  • --assume ID=VALUE: switches one chosen assumption at a time to its documented alternative.

Limit: DESCRIBE INPUT and USING BOTH are refused by name. XML PARSE VALIDATING is refused as IWR0001-S until IBM's Optimized Schema Representation can be read.

Added

  • DESCRIBE [OUTPUT] and PREPARE ... INTO fill the program's SQLDA: SQLDAID, SQLDABC and SQLD always, and an SQLVAR per column when SQLN gives room, from the database's answer to PREPARE. EXECUTE, OPEN and FETCH ... USING DESCRIPTOR take each host variable's type from SQLTYPE and SQLLEN, and its storage and indicator from SQLDATA and SQLIND. An SQLDA they cannot use is -804 with Db2's reason code, and DESCRIBE of a name not prepared is -516 (C403, C404). Recordings keep the columns as : lines.
  • FETCH NEXT ROWSET on a cursor declared WITH ROWSET POSITIONING fills element k of each host-variable array with row k of the rowset. A short rowset is +100 with its rows and SQLERRD(3) their count, later elements left as they were; without FOR n ROWS a FETCH asks for as many rows as the last one did, and a row FETCH after a rowset moves from its first row, as Db2 positions (C420-C422).
  • INSERT ... FOR n ROWS sends one row's INSERT for each, ATOMIC undoing them all when one fails and NOT ATOMIC keeping the rest with -253 or -254 (C424).
  • CALL sends its arguments and assigns what the procedure returns, from a recording whose = line gives a hyphen for an argument it does not return (C423). The PostgreSQL backend refuses CALL by name; +466 sets SQLWARN9 to Z.
  • Under --compliance extended, ACCEPT ... FROM COMMAND-LINE, ARGUMENT-NUMBER and ARGUMENT-VALUE [NOT] ON EXCEPTION, and DISPLAY ... UPON ARGUMENT-NUMBER, read the job step's PARM program arguments, with IWX0010-W.
  • SPECIAL-NAMES UPSI-0 to UPSI-7 with ON and OFF STATUS condition-names, which the mnemonic-name qualifies, and SET mnemonic-name TO ON or OFF. The switches are one copy for the run unit, off unless the PARM's runtime option UPSI(nnnnnnnn) turns them on (C410 to C412).
  • SPECIAL-NAMES CLASS clauses, by characters or by ordinal numbers in the code page, alone or in THROUGH ranges, and the class condition IF item [IS] [NOT] class-name on a USAGE DISPLAY item (C430).
  • --assume ID=VALUE, repeatable: C101, C14, C95, C15, C51, C180 and C262 each take ibm or gnucobol, and C101 also off. The last for an ID wins, and it wins over --dialect. Provenance records the values in force, and the journal keeps each.
  • --diagnostics json on check, run, cics and compile: each message as one JSON object a line, with its file, COPY member, line, column, id, severity and text. docs/messages.md lists the catalogue.
  • Under --compliance extended, PROCEDURE DIVISION RETURNING OMITTED, GnuCOBOL's header for a subprogram that returns no item, with IWX0009-W.
  • CALL finds a program in the -L libraries by its PROGRAM-ID when no file is named for it (C441).
  • fuzz --interface gives the subprogram's files data sets as the main fuzz does: an empty one for a file it reads, a new one for a file it only writes.
  • job writes IEF283I with the reason when a data set's deletion fails.

Changed

  • XML PARSE VALIDATING is refused as IWR0001-S at VALIDATING, naming its operand, where it stopped with a generic message.
  • ACCEPT ... FROM reads SYSIN, SYSIPT or CONSOLE, by environment-name or a mnemonic-name for one, as the Language Reference allows. Any other operand is refused under either compliance level, GnuCOBOL's COMMAND-LINE, ARGUMENT-VALUE and the rest by name. CONSOLE is read as SYSIN (C440).
  • Every compile message carries an id from ironwork's catalogue, shown after the position and any severity word as IBM shows IGYPS2121-S, by area: IWS syntax, IWC compile rules, IWO options, IWP EXEC SQL, CICS, DL/I and BMS, IWR a construct ironwork does not run, IWL ironwork's limits, IWX extensions. docs/messages.md lists them.
  • Under SSRANGE a subscripted reference is checked by the address its subscripts compose against its whole table, with every OCCURS at its maximum, as IBM documents, where ironwork checked each subscript against its own dimension (L19). A reference such as E(2, 0) into a table of 3 rows of 8 now runs, as on z/OS.
  • A MERGE no longer checks that its input files are in order: it returns 0 and outputs each record as the merge selects it, the lowest at the head of each file, as IBM's books together describe a COBOL MERGE (S3, operator ruling).
  • An EXEC SQL INTO name written without its colon is refused under --compliance strict with IWP0046, as Db2 13's precompiler refuses it, and read as a host variable under extended with IWX0011-W (SQ7, operator ruling).
  • The 23 assumptions once written from memory are checked against IBM's manuals: 9 are Documented, 13 Chosen, each saying what IBM documents apart from ironwork's own reading, and one stays Recalled.
  • tools/bench.sh and tools/differ.py --cobc compare with cobc -std=ibm-strict.
  • Only the statements Db2 13's PREPARE lists reach the database from a dynamic statement string; any other word is -104, as Db2's parser answers (C402). SQL comments in a statement string are dropped before it is read.
  • The load module format is 0.7, additively: the DESCRIBE, USING DESCRIPTOR, rowset FETCH, multiple-row INSERT and CALL tags, the class-name test, the command line's ACCEPT sources, the SSRANGE table ranges, and the --assume choices for a program compiled with one. 0.5 stays the oldest format read.

Removed

  • ironwork ddl. The Db2-to-PostgreSQL DDL translator serves the SQL backend's tests and is now tools/ddl, which a checkout runs as cargo run -p ironwork-ddl -- FILE.sql.

Fixed

  • COPY REPLACING took an operand that was not pseudo-text as one word, and refused an identifier with qualifiers or subscripts. It joined pseudo-text's words with spaces, which broke PICTURE strings. A debugging line took no part in matching outside debugging mode, as Enterprise COBOL's rules have it do.
  • ironwork dump called a module holding an ASSIGN to a data item malformed.
  • A ledger lock judged stale could be broken twice by racing writers, forking the evidence ledger.
  • A simple comment in a dynamic statement string took every later line with it, a DELETE's WHERE among them.
  • A zoned host variable of 17 to 31 digits stopped the run.
  • SEND MAP took an attribute from a symbolic map's A byte holding a flag RECEIVE MAP leaves (X'80', X'02', X'82'), which could unprotect a protected field; it now takes the field's ATTRB, and a field with no data and no INITIAL is sent as nulls, as CICS builds the output screen.
  • fuzz gives data sets to the files of programs a run reaches by a literal CALL, and an empty existing one to a file opened EXTEND, where their OPENs ended the run IO-35.
  • The PostgreSQL backend kept every distinct statement text prepared for the connection's life; it now keeps at most 1,024.

Upgrading

  • ironwork ddl is gone: run cargo run -p ironwork-ddl -- FILE.sql from a checkout.
  • A program that ACCEPTs FROM a name Enterprise COBOL does not read is refused, where it read SYSIN.
  • A load module that holds dynamic SQL through an SQLDA, a rowset FETCH, a multiple-row INSERT, a CALL, a class-name test, SSRANGE table ranges or --assume choices needs 0.8.0 to run.
  • A dynamic statement string whose first word Db2 does not prepare is -104 where the database used to answer it.
  • A tool that reads ironwork's messages finds each carrying an id after the position; --diagnostics json gives the same as fields.
  • A program run under SSRANGE that referenced an element through an inner subscript outside its dimension, with the address inside the table, now runs where it ended U4038.
  • A MERGE whose input file is out of order returns 0 where it returned 16.
  • A program whose EXEC SQL INTO list names a host variable without its colon is refused by default; --compliance extended reads it.

Install

ironwork for COBOL 0.8.0. Builds for Linux (static), macOS and Windows, and the npm package @portll/ironwork. The ironwork-tls archives are the same builds with TLS for --sql-db (rustls, sslmode=verify-full). The Python package is on PyPI as ironwork, and the crates are on crates.io. Each file carries SLSA build provenance: gh attestation verify -R Portll/ironwork.