Easytrieve is one of the simplest programming language in mainframe. If you have an idea about Cobol, then Easytrieve is easy to learn. Easytrieve Classic and Easytrieve Plus are the two available versions of this programming language. Here, we will be discussing about Easytrieve Plus. Let’s start with an example.

FILE PERSNL FB(150 1800)

NAME   17           8              A

EMP#    9              5              N

DEPT      1              3              N

GROSS  30           4              P             2

JOB INPUT PERSNL NAME SAMPLE

PRINT PAY-RPT

REPORT PAY-RPT LINESIZE 80

TITLE 01 ‘EMPLOYE REPORT’

LINE 01 DEPT NAME EMP# GROSS

This example is used to get a report. The report generated will look as follows:

Easytrieve

 

File Statement:

This is the first line in the program that describes the input file. It describes how the data is present that is to be processed and how the data is stored.

FILE PERSNL FB(150 1800)

FILE is the keyword. PERSNL is the name of the input file.

FB(150 1800) describes the record length and block size. This is optional in file statement.

Define Statement:

Following the file statement is the define statement.

The define statement consist of Field Name, Starting Position in record, Length, Data type and Number of Decimal Positions.

The define statements can be defined in the beginning of the program or in the middle of the program. While defining in the beginning of the program, define keyword is not a must. While defining in the middle you must use the keyword.

Example:

NAME   17           8              A

OR

DEFINE NAME   17           8              A

A – Alphanumeric

N – Numeric. Stores number in zoned decimal format

P – Packed Decimal. Stores number in packed decimal format.

Job Statement:

The JOB statement provides the input of the program. The keyword INPUT specifies the input, followed by the input file name. The Name specifies the job name which is used for documentation purpose and is optional.

The working storage variables are declared in the same way as that of the define statements, except that in the place of starting position W is given

Eg: NETPAY         W            4              P             2

This is the basic of Easytrieve Programming.In the coming posts we will be describing how DB2 can be used with Easytrieve and some basic calculations.

Easytrieve – Basic Description and Example
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *