TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

Easytrieve Program Structure

Program Structure:

Easytrieve program consists of three sections: one is optional, one is customary, and one is mandatory.


  2. LIBRARY SECTION (Customary)


Environment Definition Section:

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.

Library Section:

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.

Activity Definition Section:

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.

Easytrieve Program Structure


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!

Are you looking for Job Change? Job Portal