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.
The call on %macro can implies dependencies on “Macro” file.
%macro-fileWhere 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"
}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.
The following EZT statements produce a "Read file" dependency:
JOB INPUT <file> : Implicit read loop over all records in fileGET <file> : Explicit read of next recordREAD <file> : Keyed read (synonym for GET)POINT <file> : Position cursor in fileSEARCH <table> : Table lookup (read-only access)
Example:
FILE CUSTFILE FB(500 5000)
CUST-ID 1 9 N
JOB INPUT CUSTFILE NAME REPORT-JOBOutput:
{
"dependencyType": "Read file",
"name": "CUSTFILE",
"path": "Global:FILE:CUSTFILE",
"type": "FILE"
}The following EZT statements produce a "Write file" dependency:
PUT <file>: Write a record to fileWRITE <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-RECOutput:
{
"dependencyType": "Write file",
"name": "OUTFILE",
"path": "Global:FILE:OUTFILE",
"type": "FILE"
}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 callerLINK <program>: Same as CALL, with GIVING return valueTRANSFER <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"
}