Professional Documents
Culture Documents
Eztrieve Presentation
Eztrieve Presentation
TABLE OF CONTENTS
Introduction to Easytrieve
Capabilities
Structure of Easytrieve program
Environment Definition
Data Definition
Processing Activities
Decision and Branching Logic
Input & Output Specification
Report Processing
Table Processing
Synchronized File Processing
INTRODUCTION
Logic Process
Provides standard programming
constructions
Provides powerful calculation capabilities
Performs special tests useful in editing
Supports Move for corresponding fields
Includes special start & finish procedures
Sorts on any number of keys
CAPABILITIES
Report Output
Automatic formatting of reports &
customizing options
Provides Control breaks on any number of
keys
Automatically creates summary file for
subtotals
Processes only fields that are required for
REPORT
Allows explicit positioning of print layout for
MODES OF OPERATION
Easytrieve provides five modes of operation
that facilitate production as well as ad-hoc
programming.
FILE filename
File Type => [IS/ VIRTUAL/ DLI/
VS ([ES] [CREATE [RESET]/ UPDATE]
Device Type => [CARD/PUNCH/PRINTER/DISK/TAPE]
Record Format => [F/V/U/FB/VB/VBS]
DATA / LIBRARY
DEFINITION
DEFINE Statement
Fields are defined in the library using DEFINE statement. Two
categories of data can be defined :
1. File data
2. Working Storage data
Field names must be unique within a file or working storage. The
keyword DEFINE is optional within Library section
DATA / LIBRARY
DEFINITION
Basic syntax of DEFINE statement is as follows :
Procs
Separate modules of program code used
to perform specific tasks
Defined at the end of each activity
Local to the activity after which they are
coded
JOB STATEMENT
JOB statement identifies the files whose records are automatically
provided to the program (automatic input)
JOB [INPUT {file-name KEY(field-name)}…{NULL}]
[START start-proc-name] [FINISH finish-proc-name]
[NAME job-name]
INPUT file-name - Optional parameter identifying automatic input
- provides the name of the file used in automatic input
KEY field-name - identifies fields used in synchronized file
processing
NULL - inhibits automatic input. Normally, a job is implicitly
stopped when the automatic file is exhausted. With NULL, the
program continues until a STOP statement is executed.
JOB STATEMENT
JOB statement identifies the files whose records are automatically
provided to the program (automatic input)
JOB [INPUT {file-name KEY(field-name)}…{NULL}]
[START start-proc-name] [FINISH finish-proc-name]
[NAME job-name]
START - The optional START start-proc-name parameter
identifies a procedure to be executed during the
initiation of the JOB.
FINISH - The optional FINISH finish-proc-name parameter
identifies a procedure to be executed during the normal
termination of the JOB.
NAME job-name - names the JOB activity.Used for documentation
only.
JOB CONTROL FLOW
Reset working storage
Open I/O files
[PERFORM start-proc] Step 1
JOB …retrieve automatic input
IF EOF . . . Logic generated by JOB
reset working storage
closes I/O files
[PERFORM finish-proc]
wrap-up REPORTS
go to the next JOB/SORT activity
END-IF
IF …. Step 2
... Data examination and
END-IF Manipulation statements
SORT STATEMENT
SORT statement orders any file which can be processed sequentially.
DEFINE WS-REPLY W 1 A
SCREEN NAME MAIN-MENU
TITLE 'Employee File Main Menu'
ROW 6 COL 10 'Type an option, then press Enter.'
ROW 8 COL 10 'Option ===>' WS-REPLY VALUE ('V' 'E' 'D' 'X') +
ERROR 'Please type V, E, D, or X'
ROW 10 COL 22 'V View employee'
ROW 11 COL 22 'E Edit employee'
ROW 12 COL 22 'D Delete employee'
ROW 13 COL 22 'X Exit'
KEY F1 NAME 'Help' IMMEDIATE
KEY F3 NAME 'Exit' EXIT
KEY F12 NAME 'Cancel' EXIT IMMEDIATE
|--------------------------------------------------------------------------------------------------
----------------------------------------------|
| Employee File Main Menu |
| Type an option, then press Enter.
|
|
|
| Option ===>
|
| V View employee
|
| E Edit employee
|
| D Delete employee
|
| X Exit
|
| |
| F1=Help F3=Exit F12=Cancel
|
DECISION & BRANCHING
LOGIC
IF condition
statements
ELSE-IF (optional)
statements
ELSE (optional)
statements
END-IF
DO WHILE / DO UNTIL condition
statements
ENDDO
DECISION & BRANCHING
LOGIC
CASE field-name
WHEN condition
statements
OTHERWISE condition
statements
END-CASE
GOTO {label/JOB}
PERFORM proc-name
EXECUTE job-name|sort-name|screen-name
STOP [EXECUTE]
INPUT / OUTPUT
SPECIFICATION
PRINT report-name
PAGESIZE
REPORT BODY
LINESIZE
Label Format - Includes mailing labels, form-letters and
other special-purpose reports.
SIZE DOWN
LINESIZE
REPORT STATEMENT
REPORT report-name +
[SUMMARY]
Parameters + Format Determination
[SUMFILE sum-file-name] +
[LABELS ([ACROSS lit-1] + Label Parameters
[DOWN lit-2] +
[SIZE lit-3] +
[NEWPAGE]] +
[PRINTER file-name] + File Directing Parameters
[PAGESIZE lit-4] + Spacing control Parameters
[LINESIZE lit-5] +
[SPREAD] +
[NOSPREAD] +
[NOADJUST] +
[NODATE] +
[NOPAGE] +
[LIMIT lit-6] + Testing aids Parameters
[EVERY lit-7]
REPORT
STATEMENT
report-name - Names the report
SUMMARY - Inhibits printing of detail data on control reports. Only
quantitative fields are totaled (those defined with decimal
positions)
SUMFILE sum-file-name - SUMFILE is used to generate a summary
file that contains the control and summary field values.
Summary-file-name identifies the file to contain the summary
data.
LABELS - ACROSS specifies the number of labels printed side-by-
side across the page, DOWN specifies the number of print lines
on each label, SIZE specifies the width of each label and
NEWPAGE prints first line of each label at the top of a page.
PRINTER file-name - Identifies a file-name other than the default
print destination
REPORT STATEMENT
PAGESIZE - sets the number of print lines per page
LINESIZE - sets the number of print columns on each report line
SPREAD/NOSPREAD - Adjusts column spacing on the report.
SPREAD maximizes number of spaces between columns.
NOSPREAD, the default, puts three spaces between columns and
centers the report.
NOADJUST - Left justifies the report. Centering is the default.
NODATE - Suppresses printing of date in the leftmost 8 columns of
the report title
NOPAGE - Suppresses printing of characters PAGE and the page
number in the rightmost 11 columns of the report title
LIMIT - Specifies the number of print statements accepted for this
report. Used in Testing
EVERY - Specifies the occurrence value for processing every nth
Print command directed to the report
SEQUENCE
STATEMENT
SEQUENCE field-name-1 [D] [,field-name-2 [D]] ...
Each title line is centered horizontally within the title area of the
report.
Current date is printed in leftmost 8 positions unless NODATE
option is specified on the REPORT statement.
The word PAGE and page number are printed in rightmost 11
positions unless NOPAGE option is specified on the REPORT
statement.
lit-1 - Specifies the position of the title line within the title area.
field-name- Specifies that the contents of the named field will
appear on the title line.
‘lit-2’ - Specifies a character string (enclosed in quotes) for the title
item.
+lit-3 / -lit-3 - Specifies the no. of characters to be added/
subtracted from the normal 3 character space between items.
HEADING
STATEMENT
HEADING field-name (‘literal’...)
Line 2 lists phone number under Social Security number, street address
under name and date-of-hire under Date Of Birth. Line 3 lists the city,
state and zip under Name and street address
o/p : SOUTHWEST 571-40-8057 Florance Smith 11-26-72
785-4815 3250 Big street 08-03-81
Riverside CA 09265
TABLE
PROCESSING
A table is a collection of uniform data records. Tables have two
parts :
1. The argument uniquely identifies a table entry.
2. The description is information directly associated with the
argument.
Tables are defined by FILE statements in the library section.
TABLE option must be coded.
FILE file-name TABLE [INSTREAM / literal]
The only fields defined for TABLE files are ARG (argument) and
DESC (description).
ARG defines the field used to search the table.
DESC defines the field which contains the desired information.
TABLE
PROCESSING
There are two types of TABLEs, instream and external.