Easytrieve program consists of three sections: one is optional, one is customary, and one is mandatory.
ENVIRONMENT DEFINITION SECTION (Optional)
LIBRARY SECTION (Customary)
ACTIVITY DEFINITION SECTION (Mandatory)
This section is optional, and if used, must be the first section of your program. It consists of the PARM statement that can be used to establish a customized operating mode for the duration of your program.
This section is also called the data definition section and is usually necessary for file processing and report generation. It follows the PARM statement and contains the FILE statement and field definitions. These statements describe the data to be processed by your program and initialize the required working storage.
This section is required. It contains the Easytrieve statements that accomplish the task for which you created your program. It can consist of any number of either or both of two types of activities - JOB and SORT.
JOB activities read information from input files, examine and manipulate information, write information to output files, and produce printed reports.
SORT activities create sequenced output files that contain all or part of the records from another (input) file.
Your program can contain any number of JOB and SORT activities, in any order. Within each of these activity types are statements, procedures, and subactivities that specify the tasks your program intends to accomplish.
The below diagram illustrates the structure of a Easytrieve program.
A JOB activity is composed of:
A JOB statement
One or more Easytrieve statements
One or more procedures (optional)
One or more report subactivities (optional)
A procedure is composed of:
A PROC statement
One or more Easytrieve statements
An END-PROC statement
A report subactivity is composed of:
A REPORT statement
One or more report declaratives
Report procedures (optional)
A SORT activity is composed of:
A SORT statement
Sort procedures (optional)
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!