Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
1. Introduction
1.1 Capabilities
File access
Field Definition
Logic process
File Output
Report Output
1.2 Environment.
1.2 General Rules.
2 Structure of Easytrieve programs
2.1 Description of various sections.
2.2 Description of statements.
3 Compilation and Running
3.1 Structure of compilation and run
JCL.
Introduction
Easytrieve plus is an information retrieval and data
management system
It is a primitive form of 4GL whose English like
language and simple syntax provide the tools for
easy data retrieval and report generation,
Easytrieve Plus can now produce reports in HTML
format. This feature allows you to create reports that
can be viewed either from a local disk or LAN or
from a World Wide Web server using the Web
browser
Capabilities
File access :
Easytrieve Plus’ file access features all standard retrieval system
capabilities, and also the following :
Accepts upto 890 input or output files.
Synchronises file processing (based on keys) of an unlimited
number of files.
Tests for file availability and current record count.
Provides search of external & instream files.
Provides easy method for using temporary files.
Field Definition:
Easytrieve Plus’ methods of defining all types of record
structures and field formats are consistent and easy to use, including :
Defining all field formats, including binary and unsigned packed
fields.
Providing flexible edit masks.
Establishing initial values of working-storage fields.
Providing default report headings .
Allow multiple use of field definition using COPY keyword,
reducing coding and maintenance.
Logic Process :
Easytrieve Plus provides complete conditional logic, including :
Provides standard programming constructions such as nested IF,
DO WHILE and PERFORM statements.
Supports move for corresponding fields.
Sorts on any number of keys.
File Output :
Routine file maintenance is faster and simpler because of
Easytrieve Plus’ enhanced capabilities, including :
Allowing an unlimited number of input and output files.
Loading and updating files, including VSAM, IMS/DLI, IDMS
and SQL.
Saving report extract work files for subsequent use.
Provides a selective hex dump of a file or specific fields.
Report Output :
Report generation is the most powerful feature of Easytrieve Plus.
The following features make it widely acceptable to users :
Produces unlimited reports from a single pass of the data.
Automatically formats reports.
Provides customizing alternatives to all report formats.
Provides control breaks on any number of keys.
Creates summary reports containing subtotals.
Environment
Easytrieve Plus operates on the IBM 370, 30xx,
43xx and compatible processors in the DOS/VSE,
OS/VS, MVS/ESA and VM/CMS environments.
Under TSO, CMS and ICCF, Easytrieve Plus
can run interactively for data inquiry, analysis and
reporting.
The output can be either returned back to the
screen or routed to a printer.
General Rules
A colon is used to qualify non-unique field name
An asterisk in the first column indicates a
comment. No comments are allowed between
continuations lines
A plus sign indicates that the statement continues
with the first non-blank character in the next
statement area.
Structure of Easytrieve
Program
Easytrieve Programs have three main
sections :
Environment Section
Library Section
characters.
Special characters can be used, but not
delimiters
Start-location
The start location of a filed is the position of
its first character of data relative to the
position of the first character of data in the
record
Defining data structure:
[ELSE]
[Statements executed for false IF]
[END-IF]
ASSIGNEMENT
STATEMENT
The Assignment statement establishes a value in a
filed.
Syntax
field-name [INTEGER] [ROUNDED OR
TRUNCATED] EQ field-name-2 or literal or
arithmetic expression
The are 4 arithmetic operations
*, /, + and -
If INTEGER is used with TRUNCATED then
only the INTEGER function is performed.
INTEGER, ROUNDED and TRUNCATED are
valid only with Numeric fields only
REPORT
The are two parts to every report subactivity
REPORT Statement - which specifies the type
and physical characteristics of the report
Report Definition Statements - which defines
the content of the report
REPORT Statement
Report Statement is first coded in the report
subactivity
Syntax
REPORT report-name +
[PAGE SIZE nn] [LINE SIZE nn] +
[SKIP nn] [SPACE nn] [NO ADJUST] +
[NODATE] [NOPAGE] [NOHEADING] +
[LIMIT nn] [EVERY nn]
PAGESIZE -Lines per page (Default is 58)
LINESIZE -Length of each line (132)
SKIP -Number of blank lines to be
inserted between line groups (0)
SPACE -Number of blank lines inserted
between field columns and between fields and
literals in title and detail lines(3)
NOADJUST -Requests that the title lines and
report be left-justified on the page. The default is
for the report to be centered on the page
NODATE -Inhibits printing the date in
positions one through eight of the first title line
NOPAGE -Inhibits the printing of a page
number.
NOHEADING-Inhibits the printing of column
headings
LIMIT -Limits the number of records printed on
the report
EVERY -Specifies that only every nth line is
printed in the report
Report Definition Statements
This is the second part of a report subactivity and
these statements define the content of the report.
This has to be coded immediately after the
REPORT statement in the following order
– SEQUENCE
– CONTROL
– SUM
– TITLE
– HEADING
– LINE
SEQUENCE
This statement allows to specify the order of the data in
the report
Sequence can be done on any field from input file or any
W working storage field
Sequence fields are stated in major to minor order
Sequence order is ascending. Coding D after a field-
name reverses the order for that field only.
Syntax
SEQUENCE field-name-1 [D] …. +
field-name-n [D]
CONTROL
A CONTROL Statement specifies that a report
should automatically accumulate and print totals.
A control break occurs whenever the value of any
control field changes or end-of-report is reached
A CONTROL field can be any nonquantitative
field from any input file or working storage field
At each control break, the totals are printed for the
quantitative fields specified in the report
Unlimited number of control fields can be
specified.
Fields are coded on the CONTROL statement in
a major to minor order.
Syntax
CONTROL Field-name NEWPAGE NOPRINT
FINAL RENUM
– Final totals are automatically provided. You can alter
the default by coding FINAL NOPRINT
– NOPRINT following any field-name or FINAL
suppresses the printing of totals at that control break.
NEWPAGE following any field or FINAL causes
a new page with page numbers beginning at one
after the printing of the control break totals (in
case of final, before the printing of the final
totals)
RENUM following any field or final causes a
new page with page numbers beginning at one
after the printing of the control break totals (in
case of FINAL before the printing of the final
totals)
SUM
The SUM statement specifies the quantitative
fields to be totaled for a control report
Normally easytrieve Plus totals all quantitative
fields specified on the LINE statement, but the
sum statement overrides this process.
Only the fields specified on the SUM statement
are totalled.
Syntax
SUM quant-field-1 ….. quant-field-n
TITLE STATEMENT
The TITLE statement allows you to define a title for the
report.
Up to 99 titles are permitted.
Syntax
TITLE [nn] +/- nn field-name
COL nn literal
+/-nn is used to alter the normal spacing between
literals or fields on the title lines (nn spaces are added
to or subtracted from the SPACE parameter
COL nn specifies the print column number where
the next title item is to begin.
If this option is specified then NOADJUST
should also be specified on the REPORT
statement
If no TITLEs are coded, the date and page
number are not printed.
HEADING STATEMENT
The HEADING subactivity OVERRIDES a
HEADING parameter coded in the Library
section
Syntax
HEADING field-name (‘literal’ ….)
Eg. HEADING EMP-NO (‘EMPLOYEE’
‘NUMBER’)
LINE STATEMENT
The LINE statement defines the content of a
report line.
LINE 1 is used to designate headings for the
report columns.
Syntax
LINE nn +/-nn field-name
POS nn literal
COL nn
+/- is used to alter the normal spacing between
line items. nn is added to or subtracted from the
SPACE parameter
POS is for aligning fields under the
corresponding column heading positions
indicated on the LINE 1 statement.
COL nn specifies the print column number where
next field is to begin.
TALLY
TALLY is a system defined field for control
reports.
It contains the number of detail records printed
within each control break and can be printed on
the report.
It can only be used in control reports and the
value of TALLY only appears on summary lines.
Relative start-location
– We can define the start-location of a field relative to a
previously defined position in the record.
– Relatively defining a start-location eliminates the need to
identify the actual start-location of a field
– This is most useful when we create output files
Example
EMP# * 5 N
NAME * 16 A
FILLER1 * 10 N
ADDRESS * 39 A
The ADDRESS field would then start in pos 32 in the
record
Relative Redefinition
– You can relatively redefine a field by
designating the original field-name as the
starting location for all subsequent fields in the
redefinition
– Example
DOB W 6 N
MM DOB 2 N
DD DOB +2 2 N
YY DOB +4 2 N
The starting position of the redefined field is designated by
using the original field plus the sum of the lengths of all
previous fields used in the redefinition.
STOP STATEMENT
A STOP statement allows you to terminate an
activity
Syntax
STOP [EXECUTE]
STOP ends the current activity and goes on to the
next activity if additional activities are coded.
STOP EXECUTE immediately terminates all
EASYTRIEVE PLUS execution.
DISPLAY
A DISPLAY statement sends data to a specified
output file or output device.
This is commonly used
– For error messages.
– For highlighting reports.
– For hex display of selected information
Syntax (Format I)
DISPLAY [file-name] NEWPAGE +INTEGER +
SKIP number COL integer
POS integer
literal-1 ….. Literal-n
field-name-1 ….. Field-name-n
If you specify the file-name, EASYTRIEVE
PLUS prints data to the named file. If file
name is not specified the default is
SYSPRINT/SYSLST (EASYTRIEVE PLUS
output files)
NEWPAGE option specifies that a skip to a new
page occurs before the data is printed.
SKIP option specifies that the designated number of
lines are skipped before the data is printed.
Coding integer modifies the horizontal spacing
between display items.
The COL integer option specifies the print column
number where EASYP places the next display item.
The POS integer option on DISPLAY statements
within report procedures causes the next display
item to be positioned under the corresponding
position on LINE 1 statement.
Syntax (Format II)
DISPLAY [file-name] NEWPAGE HEX field-name
SKIP number file name
In this format , EASYTRIEVE PLUS produces a
hexadecimal and character dump of the current
record or the specified field-name
The parameter other than HEX, operate the same
as in Format I
REPORT statement
Syntax
– REPORT report-name [DTLCTL FIRST]
EVERY
NONE
[SUMCTL HIAR DTLCOPY]
NONE
TAG
[SUMMARY]
[SUMFILE file-name]
[PRINTER file-name]
DTLCTL determines when control field values
are printed on detail lines :
FIRST detail line (Default)