Easytrieve
Easytrieve (EZT for short) offers a kind of COBOL dialect, which could be described as COBOL shorthand. Certain clauses, such as opening and closing files, are handled under the hood and don’t need to be coded separately.
However, it later became apparent that such features don’t necessarily make programs easy to understand.
The following example shows excerpts from an EZT program and corresponding excerpts from the COBOL program generated fully automatically using xformEZT, which is, of course, 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 file declarations and sentence descriptions. The declarations were explicitly generated here – controlled by an option. In a „real“ project, a COPY REPLACING statement could be created here.

As with normal COBOL programs, the file declarations are followed by work fields, in this case some counters. After that come job statements that read and process the entire file.

The same counters can be found in the COBOL equivalent within a WORKING STORAGE SECTION. Additionally, some fields for managing the files are included.

In COBOL, for every initial JOB statement, there is a corresponding PERFORM … UNTIL statement. Before this are PERFORMS for initialization and OPEN, and after are the explicit CLOSE and the program termination.

The EZT program contains several procedural statements that can be directly translated into corresponding COBOL commands.
A procedure called SUM-STAT, which logs the read and written records, is executed at the end of the program.
This is reflected in the COBOL code as follows:

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

The generated Cobol program is only a few lines longer than the EZT program, but is characterized by significantly better readability.
