Easytrieve is an information retrieval and data management system designed to simplify typical programming tasks. Almost any business-oriented task can be accomplished. It is simple enough for a beginner to use without additional training, and sophisticated enough to enable a data processing expert to perform complex tasks.
Easytrieve is an ENGLISH style language somewhat similar to COBOL.
Processing in an Easytrieve environment is in a ‘straight-line’ code from the beginning to the end of the program logic.
Easytrieve program is designed to make it easy for you to manipulate files and produce reports. It is suitable for beginners in data processing techniques because it is easy to learn.
Accepts any number of input files.
Processes SAM, ISAM, VSAM, or IMS/DLI files.
Allows fixed, variable, undefined, or spanned record formats.
Processes data in alphabetic, numeric, packed, packed-unsigned, or binary format.
Searches files and performs logical data selection based on input or calculation.
Edits and updates files.
Matches an unlimited number of files.
Creates subfiles containing selected records from a master file.
Performs extensive computations through user logic; including percentages, averages, and other calculations.
Sorts on any number of keys.
Calls your programs and subroutines written in other languages and integrates them into the job.
Outputs any number of files or reports on one pass of the input file(s).
Automatically formats output with all totals calculated internally.
Provides summary reports and output files with no limits on the number and size of control break fields or total fields.
Makes it easy for you to define and print specially formatted output, such as for W-2 forms, audit confirmations, labels, form letters, and preprinted forms.
Permits you to vary page sizes within a report, and insert additional header and footer information.
Enables you to write reports directly to microfiche.
The below sample program that is used throughout this tutorial to demonstrate the use of Easytrieve statements.
Don't worry if you don't understand anything in below program. At the end of this tutorial, you will be able to understand the program easily
1 PARM DEBUG(FLOW FLDCHK) 2 * 3 FILE PERSNL FB(150 1800) 4 NAME 17 16 A 5 LAST-NAME NAME 8 A 6 PAY-GROSS 94 4 P 2 7 DEPT 98 3 N 8 DATE-OF-HIRE 136 6 N 9 HIRE-MM DATE-OF-HIRE 2 N 10 HIRE-DD DATE-OF-HIRE +2 2 N 11 HIRE-YY DATE-OF-HIRE +4 2 N 12 SALARY W 4 P 2 13 BONUS W 4 P 2 14 RAISE W 4 P 2 15 SERVICE W 2 N 16 CURR-DATE S 6 N 17 CURR-MM CURR-DATE 2 N 18 CURR-DD CURR-DATE +2 2 N 19 CURR-YY CURR-DATE +4 2 N 20 * 21 FILE ERRPRINT PRINTER 22 * 23 JOB INPUT PERSNL 24 %GETDATE CURR-DATE 42 SALARY = PAY-GROSS * 52 43 PERFORM SERVICE-CALC 44 IF SERVICE LT 1 45 GO TO JOB 46 END-IF 47 PERFORM RAISE-CALC 48 BONUS = 0 49 IF SERVICE GT 14 50 PERFORM BONUS-CALC 51 END-IF 52 SALARY = SALARY + RAISE + BONUS 53 PRINT UPD-RPT 54 * 55 SERVICE-CALC. PROC 57 SERVICE = CURR-YY - HIRE-YY 58 IF CURR-MM LT HIRE-MM 59 SERVICE = SERVICE - 1 60 END-IF 61 IF CURR-MM NE HIRE-MM 62 GOTO QUIT-SERV-CALC 63 END-IF 64 IF CURR-DD LT HIRE-DD 65 SERVICE = SERVICE - 1 66 END-IF 67 QUIT-SERV-CALC 68 END-PROC 69 * 70 RAISE-CALC. PROC 72 IF DEPT LT 940 73 RAISE = SALARY * 0.1 74 ELSE 75 RAISE = SALARY * 0.15 76 END-IF 77 END-PROC 78 * 79 BONUS-CALC. PROC 81 IF SALARY GT 29999 82 DISPLAY ERRPRINT, LAST-NAME, +5, + 'INELIGIBLE FOR BONUS' 83 GOTO QUIT-BONUS 84 END-IF 85 IF SERVICE GT 19 86 BONUS = 2000 87 ELSE 88 BONUS = 1000 89 END-IF 90 PRINT BONUSRPT 91 QUIT-BONUS 92 END-PROC 93 * 94 REPORT UPD-RPT PAGESIZE 51 LINESIZE 63 NODATE NOPAGE 95 SEQUENCE DEPT LAST-NAME 96 CONTROL DEPT 97 TITLE 1 'ANNUAL UPDATE REPORT - SALARIED EMPLOYEES' 98 HEADING LAST-NAME 'NAME' 99 HEADING SERVICE 'SERV' 100 LINE DEPT LAST-NAME SERVICE RAISE SALARY 101 * 102 REPORT BONUSRPT LINESIZE 60 NODATE NOPAGE 103 SEQUENCE DEPT LAST-NAME 105 TITLE 1 'ANNUAL BONUS REPORT - SENIOR EMPLOYEES' 106 LINE DEPT LAST-NAME SERVICE BONUS 107 * |
The program illustrated in the above exhibit processes a Personnel Master File named PERSNL that contains the department numbers, names, salaries, and dates of hire of all employees in an imaginary company.
Six working storage fields contain the results of calculations used in the program and printed on the resulting reports.
Using the three procedures, SERVICE-CALC, RAISE-CALC, and BONUS-CALC, each employee's length of service, annual raise, and eligibility for and amount of a bonus is calculated.
Finally, two reports are produced. The first presents a list of all salaried employees, with the new values for length of service, amount of raise, and salary. The second lists only those employees who received a bonus, their length of service, and the amount of the bonus.
This type of file updating and reporting is a typical application. It illustrates many of the statements most commonly used. Portions of this program are referenced throughout this guide as the various statements and operations are described in detail.
The two reports that follow illustrate the reports generated by the sample program. The third exhibit illustrates the printout of the error file ERRPRINT.
ANNUAL UPDATE REPORT - SALARIED EMPLOYEES DEPT NAME SERV RAISE SALARY 901 WALTERS 10 2,204.80 24,252.80 901 2,204.80 24,252.80 903 WIMN 30 1,942.72 23,369.92 903 1,942.72 23,369.92 911 ARNOLD 13 2,316.60 25,482.60 GREEN 12 1,901.12 20,912.32 HAFER 11 634.14 6,975.54 ISAAC 16 1,630.72 18,937.92 KRUSE 21 1,260.48 15,865.28 LARSON 15 1,476.38 17,240.22 YOUNG 11 1,630.72 17,937.92 911 18,187.10 210,058.14 912 LOYAL 28 1,535.04 18,885.44 912 1,535.04 18,885.44 |
ANNUAL BONUS REPORT - SENIOR EMPLOYEES DEPT LAST-NAME SERVICE BONUS 903 WIMN 30 2,000.00 911 ISAAC 16 1,000.00 911 KRUSE 21 2,000.00 911 LARSON 15 1,000.00 911 POWELL 26 2,000.00 911 REYNOLDS 20 2,000.00 911 SMOTH 26 2,000.00 912 LOYAL 28 2,000.00 914 CROCI 17 1,000.00 |
BERG INELIGIBLE FOR BONUS WEST INELIGIBLE FOR BONUS OSMON INELIGIBLE FOR BONUS GRECO INELIGIBLE FOR BONUS JOHNSON INELIGIBLE FOR BONUS JONES INELIGIBLE FOR BONUS JUDAR INELIGIBLE FOR BONUS |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!