Easytrieve (EZT for short) offers a kind of COBOL dialect that could be described as COBOL shorthand. Certain clauses, such as opening and closing files, are handled under the hood and do not require any additional coding.
In retrospect, however, it became clear that such features do not necessarily facilitate easy understanding of programs.
The following example shows excerpts from an EZT program and corresponding excerpts from the COBOL program generated fully automatically using ITM’s xformEZT, which, of course, is completely functionally identical to the original program.
The EZT program immediately begins with the data declarations, with the first file description (ICNV2) being generated using a user macro (%COPYCNV2).

The COBOL equivalent shows a classic program start with the file declarations and record descriptions. The declarations were explicitly generated here, controlled by an option. In a „real“ project, this could be a COPY REPLACING statement.

As with normal COBOL programs, the file declarations are followed by the work fields, here some counters. Then there are JOB statements that read and process entire files.

In the COBOL equivalent, the same counters are found in a WORKING-STORAGE SECTION. Additionally, some fields for file management are added here.

In COBOL, there is a corresponding PERFORM … UNTIL statement for each original JOB statement. This is preceded by PERFORMS for initialization and OPEN, followed by the explicit CLOSE and the program end.

The EZT program contains several procedural statements that can be translated directly into corresponding COBOL commands.
A SUM-STAT procedure for a log of the records read or written is called at the end of the program.
This is reflected in COBOL as follows:

For the Cobol program to function correctly, some small subroutines are required and generated at the end of the program:

The generated COBOL program is only a few lines longer than the EZT program, but is significantly more readable.
The Njema refactoring can further streamline the program by moving declarations into a COPY element and omitting unused fields, replacing them with FILLER.

