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)

The file name may be parenthesized: JOB INPUT (CUSTFILE) and JOB INPUT(CUSTFILE) (with or without a space) both produce a Read file dependency, identical to the unparenthesized form.

JOB INPUT NULL (no-file activity), JOB INPUT PARM (JCL parameter) and JOB INPUT SQL (see the SQL input section below) are not treated as file reads.

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"
}

SQL input (Read file)

An SQL-driven input file is declared with FILE <name> SQL(...) and read via JOB INPUT <name>, producing a "Read file" dependency on that file. The SQL keyword itself is not a file: a bare JOB INPUT SQL produces no dependency.

Example:

FILE ACCTDB SQL(ACCTSCHEMA.ACCOUNTS ACCT)
  ACCT-ID 1 10 A
JOB INPUT ACCTDB

Output:

{
 "dependencyType": "Read file",
 "name": "ACCTDB",
 "path": "Global:FILE:ACCTDB",
 "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"
}

REPORT ... PRINTER (Write file)

A REPORT statement that names a PRINTER file directs its output to that file, producing a "Write file" dependency. The PRINTER parameter is recognized both on the REPORT line and on an indented sub-parameter line of the report.

  • REPORT <name> ... PRINTER <file>

Example:

FILE RPTFILE PRINTER
JOB INPUT INFILE
  PRINT REPT1
REPORT REPT1 SPACE 1 PRINTER RPTFILE NODATE
  LINE 1 IN-ID

Output:

{
 "dependencyType": "Write file",
 "name": "RPTFILE",
 "path": "Global:FILE:RPTFILE",
 "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"
}

 JCL SYSIN control card resolving to EZT

When JCL runs an EZT program through the Easytrieve runtime (EXEC PGM=EZTPA00), the EZT source supplied on the SYSIN DD is resolved as a "Control card" dependency of type EZT on the JCL node. See the JCL documentation (DD DSN) for details.

Example (JCL):

//STEP01  EXEC PGM=EZTPA00
//SYSIN    DD DISP=SHR,
//         DSN=AWS.M2.CARDDEMO.EZTLIB(CUSTREP1)

Output:

{

 "dependencyType": "Control card",

 "name": "CUSTREP1.EZT",

 "path": "dependencies/CUSTREP1.EZT",

 "properties": {

     "JCL.PartitionedDataSet": "AWS.M2.CARDDEMO.EZTLIB"

 },

 "type": "EZT"

}