Contents

COBOL, copybooks and JCL

The reference for what gitta Enterprise reads in mainframe code, and what counts as a change of meaning. For setup, see the Mainframe guide.

What gitta follows

Many programs share the same copybook, so one change can reach far. Git merges two branches line by line and does not know that a field in a copybook is used in other programs. gitta reads the COBOL and keeps track of what each agent changes and what each agent’s new code uses.

When one agent changes something that another agent’s new code uses, the other agent gets a warning at its next step, and gitta status shows it too. The agent adapts its code, and your tests on the combined code decide the merge.

Copybook change impact

A copybook is shared by every program that copies it. When an agent widens a field, changes a PIC or moves a REDEFINES, each of those programs reads the record in a new layout. Git shows the copybook diff. It shows nothing about the programs that use the field.

gitta follows the field from the copybook to the code that uses it. The impact it reports is the new code of other agents that uses the changed field, condition name or interface. For each one, it names the field, the program and the agent.

IBM watsonx Code Assistant for Z and other AI tools now write and change COBOL (IBM, watsonx Code Assistant for Z). When several of them work on one code base, the copybooks are where their work meets. For a worked case, see What an agent sees.

What gitta supports

PartWhat counts as a change of meaningSymbol in warnings
Data fields in copybooks and programs, levels 01 to 49, 66 and 77, in WORKING-STORAGE, LOCAL-STORAGE, LINKAGE and FILE SECTIONA change of PIC (length, type, sign, decimals), USAGE (for example COMP-3 to COMP, or INDEX, POINTER), OCCURS, VALUE or REDEFINES. A group item changes when one of its fields changes. 9(5) and 99999 are the same layout.ORDREC.ORD-DATE
Tables with OCCURS ... DEPENDING ONA change of the bounds, of the object that holds the count, or of that object’s layout. Index names from INDEXED BY are fields of their own and change with the table.ORDREC.ORD-LINE, ORDREC.ORD-IX
EXTERNAL dataEvery program that declares an item EXTERNAL shares its storage. A layout change in one program counts for new code in each other program that declares it, and for a change to its declaration there.EXTERNAL.CTL-RUN-DATE
Condition names, level 88A changed value. New code that tests the condition relies on the old value.CUSTREC.CUSTOMER-ACTIVE
A whole copybookAny field change. This covers code that holds the record in its own group, for example 01 WS-CUST. COPY CUSTREC.CUSTREC.CUSTREC
Paragraphs and sectionsA removed or renamed paragraph or section. A paragraph that now uses a changed field also counts for code that PERFORMs it.ORDERS.CALC-TOTAL
ProgramsThe interface: PROCEDURE DIVISION USING and RETURNING, and the layout of each LINKAGE SECTION parameter. Applies to CALL 'PROG', CALL identifier when the identifier has a VALUE, and EXEC CICS LINK or XCTL PROGRAM(...).CUSTUPD.CUSTUPD
ENTRY pointsThe USING list of the entry and the layout of its parameters. Applies to CALL 'ENTRY' and SET ... TO ENTRY 'ENTRY'.CUSTUPD.CUSTRST
Several programs in one filePrograms in a row and nested programs (END PROGRAM) each have their own names. A nested program’s interface counts for CALL from the program around it. Its GLOBAL items count for the programs nested in it. INITIAL and RECURSIVE are part of the interface.RPTCALC.RPTCALC, RPTCALC.MAIN-PARA
Object-oriented COBOLA method’s interface (METHOD-ID in a CLASS-ID). INVOKE uses it when the target is a class from the REPOSITORY paragraph, an OBJECT REFERENCE of that class, SELF or SUPER, and the method name is a literal. A method that uses the class’s object data changes when that data changes.REPORT.ADD-LINE
JCLA new or changed step with EXEC PGM= uses the program's interface. A PROC's symbolic parameters are its interface. A new parameter with a default does not count. gitta reads DD DSN= datasets and DD PATH= z/OS UNIX files, and quoted values that continue on the next line.CUSTUPD.CUSTUPD

gitta also reads these parts of the code:

gitta reads COBOL with its own reader, not with a full COBOL grammar. The reader does what a COBOL preprocessor does with COPY and REPLACING, and it follows the column rules of fixed format. A change that only adds comments, renumbers the sequence area or changes case is not a change of meaning.

COBOL and JCL files merge line by line, as with Git. When the lines clash, the merge stops with a conflict.

gitta also protects COBOL Check test suites (.cut files). If an agent deletes a suite or removes EXPECT lines, gitta reports it in the merge output and the audit trail. See Merging.

Files gitta reads

FilesRead as
.cbl, .cob, .cobolA program, or a copybook when the file has no PROGRAM-ID
.cpy, .copy, .cbkA copybook
.jcl, .prcJCL, or a catalogued procedure
Files without an extension in a copybook directoryA copybook. Add the directory to .gitta-copybooks.

A copybook is known by its member name, which is the file name without the extension in upper case. COPY CUSTREC finds copybook/CUSTREC.cpy, copy/custrec.cpy or cpy/CUSTREC.cbl. A program is known by its PROGRAM-ID.

Copybooks without an extension need a .gitta-copybooks file, see Copybook directories.