EZT

Easytrieve (EZT) is a report generator and looks similar to Cobol styled language. It’s an information retrieval and data management system designed to simplify typical programming tasks. In AWS Transform for mainframe refactor, it handles the below commands/statements.

Macro invocation

The call on %macro can implies dependencies on “Macro” file.

  • %macro-file

Where macro-file is the name of the 'Macro' file in the project. Macro files are Easytrieve source files declared as macro. The tool resolves macros against both `.macro` and `.EZT` file extensions.

Example:
%CUSTMAC

Output:

{
 "dependencyType": "Invoke macro",
 "name": "CUSTMAC.EZT",
 "path": "AWS.M2.CARDDEMO.EZTLIB/CUSTMAC.EZT",
 "type": "EZT"
}

File I/O (Read / Write)

EZT `FILE` declarations define logical file handles that correspond to DD names in JCL. The dependency analyzer detects I/O verbs that read from or write to these files.

Read file

The following EZT statements produce a "Read file" dependency:

JOB INPUT <file> : Implicit read loop over all records in file
GET <file> : Explicit read of next record
READ <file> : Keyed read (synonym for GET)
POINT <file> : Position cursor in file
SEARCH <table> : Table lookup (read-only access)

Example:

FILE CUSTFILE FB(500 5000)
 CUST-ID 1 9 N
JOB INPUT CUSTFILE NAME REPORT-JOB

Output:

{
 "dependencyType": "Read file",
 "name": "CUSTFILE",
 "path": "Global:FILE:CUSTFILE",
 "type": "FILE"
}

Write file

The following EZT statements produce a "Write file" dependency:

PUT <file>: Write a record to file
WRITE <file>: Synonym for PUT

Example:

FILE OUTFILE FB(80 800)
 OUT-REC 1 80 A
JOB INPUT INFILE NAME WRITE-JOB
 PUT OUTFILE FROM DATA-REC

Output:

{
 "dependencyType": "Write file",
 "name": "OUTFILE",
 "path": "Global:FILE:OUTFILE",
 "type": "FILE"
}

SORT (Read + Write)

The SORT statement reads from a source file and writes to a target file:

SORT <source> TO <target> USING (<sort-key>)
 

This produces:
- "Read file" dependency on the source
- "Write file" dependency on the target

Example:

FILE UNSORTED FB(100 1000)
 SORT-KEY 1 8 A
FILE SORTED FB(100 1000) VIRTUAL
 S-KEY 1 8 A
SORT UNSORTED TO SORTED USING (SORT-KEY)

Output:

{
 "dependencyType": "Read file",
 "name": "UNSORTED",
 "path": "Global:FILE:UNSORTED",
 "type": "FILE"
},
{
 "dependencyType": "Write file",
 "name": "SORTED",
 "path": "Global:FILE:SORTED",
 "type": "FILE"
}

EZT can invoke external programs using CALL, LINK, or TRANSFER. The target program can be written in any language (COBOL, PL/I, Assembler, EZT, etc.).

CALL <program>: Invoke program, returns control to caller
LINK <program>: Same as CALL, with GIVING return value
TRANSFER <program>: Invoke program, does not return

Example:

CALL VALIDATE USING CUST-ID CUST-BAL RETURNS RC
LINK SUBPGM01 USING DATA-AREA GIVING RESULT
TRANSFER MAINPGM INPUT TRANS-REC 

Output:

{
 "dependencyType": "Call",
 "name": "VALIDATE.cob",
 "path": "path/to/VALIDATE.cob",
 "type": "COB"
}

If the target program is not found in the codebase:

{
 "dependencyType": "Call",
 "name": "SUBPGM01",
 "path": null,
 "type": "Missing Program"
}