Easytrieve Tutorial PDF
Easytrieve Tutorial PDF
1.0 Overview
1.1 Introduction
Página 1
EASYTRIEVE Tutorial
1.2.1 Organization
------------------------------------------------
Name Contents
------------------------------------------------
CA-Easytrieve/Online How to compile, link-edit,
User Guide and execute CA-Easytrieve
programs on the mainframe.
Also, how to compile and
execute interactively using
an editor and how to use
Página 2
EASYTRIEVE Tutorial
CA-Easytrieve/Online screen
and report Painters.
------------------------------------------------
CA-Easytrieve Provides new users with the
Introduction to the information to become
Language Guide productive quickly.
Includes a tutorial
designed to make the
material more interesting
and easy to comprehend.
------------------------------------------------
CA-Easytrieve How to create efficient
Programmer Guide CA-Easytrieve programs and
how to analyze and modify
existing
CA-Easytrieve/Online
programs. How to apply
these programs to various
application tasks.
------------------------------------------------
CA-Easytrieve/Online How to install and maintain
CA-Activator CA-Easytrieve/Online on
Supplement your MVS system, using the
SMP/E software interface
called CA-Activator.
------------------------------------------------
CA-Easytrieve/Online Provides system
Administrator Guide administrators with
information needed to set
up, customize, and
administer a
CA-Easytrieve/Online
system.
------------------------------------------------
CA-Easytrieve/Online Describes the installation
Installation Guide of CA-Easytrieve/Online in
all environments. The most
current step-by-step
installation procedures
for your environment(s) can
be found on the product
tape.
------------------------------------------------
Página 3
EASYTRIEVE Tutorial
The following conventions are used throughout this guide for illustrative
purposes:
------------------------------------------
Notation Meaning
------------------------------------------
{braces} Mandatory choice of one of
these entries.
------------------------------------------
brackets Optional entry or choice of
one of these entries.
------------------------------------------
| (OR bar) Choice of one of these
entries.
------------------------------------------
(parentheses) Multiple parameters must be
enclosed in parentheses.
------------------------------------------
... Ellipses indicate that you
can code the immediately
preceding parameters
multiple times.
------------------------------------------
BOLD Bold text in program code is
used to highlight an example
of the use of a statement.
------------------------------------------
CAPS All capital letters indicate
a CA-Easytrieve keyword, or
within text descriptions,
indicate a name or field
used in a program example.
------------------------------------------
lowercase Lowercase italics represent
italics variable information in
statement syntax.
------------------------------------------
Página 4
EASYTRIEVE Tutorial
* The CLOSE statement now allows controlled file opens and closes.
* Complete control over SQL units of work using the COMMIT statement
and activity options.
Página 5
EASYTRIEVE Tutorial
* Complete control over SQL and CA-IDMS units of work using the
COMMIT statement and activity options.
* Subscripting of arrays.
Página 6
EASYTRIEVE Tutorial
binary search.
Windowed Screens
SCREENs can now be any size and have any start location. When a SCREEN
activity executes another SCREEN activity in which the second screen is
smaller than the first, the second screen overlays the first as a "pop-up"
window.
Screens can now have a border built displayed around them, whether they
are full-screen applications or windows.
SET Statement
The SET statement provides an easy method to change screen attributes for
a field or to indicate an erroneous field in your screen procedures.
SCREEN Attributes
The CURSOR attribute has been added to the default set of attributes
applied to fields in error. Existing users may want to add the attribute
in their site options.
The PRIOR parameter on the GET statement allows backwards browses against
VSAM files. In addition, you can load a CA-Easytrieve virtual file and
browse forward and backward through the file.
Página 7
EASYTRIEVE Tutorial
Instream Macros
The compiler now supports including macro definition as part of the source
program. This capability is particularly useful for testing new macros
prior to storing them in the macro library.
TRANSFER NOCLEAR
Report Painter
CASE Statement
Página 8
EASYTRIEVE Tutorial
CA-IDMS Processing
IMS/DL/I Processing
SQL Processing
Extended Reporting
File Exits
You can now use the EXIT parameter of the FILE statement to invoke
subprograms written in other programming languages for input/output
related events.
Label Reports
You can use the EVEN parameter on the DEFINE statement to indicate that a
packed decimal field is to contain an even number of digits.
The MOVE LIKE statement now supports moving contents of fields with
identical names to and from working storage.
Página 9
EASYTRIEVE Tutorial
The CALL parameter is now available on the PARM statement. CALL enables
you to specify how subprograms referenced in CALL statements are linked to
your CA-Easytrieve program.
IF BREAK
CONTROLSKIP
A new Options Table entry has been added called LONGDTE. This specifies
the default date for reports.
The MOVE LIKE statement now supports moving contents of fields with
identical names to and from working storage.
OS/2 Support
Página 10
EASYTRIEVE Tutorial
Distributable Applications
CA-Ingres Processing
Oracle Processing
C-ISAM Processing
A new Options Table entry has been added called LONGDTE. This specifies
the default date for reports.
DB2 Processing
The CA-Easytrieve SQL Interface now supports DB2 in the UNIX environment.
Extended Reporting
Página 11
EASYTRIEVE Tutorial
7 7 8
1....6 7......................................2 3......0
001000 PRGMNAME
Both EBCDIC and DBCS data processing are applicable to China (Hanzi
characters), Japan (Kanji, Hiragana, and Katakana characters), and Korea
(Haja and Hangual characters). CA-Easytrieve supports both character sets
based upon the following assumptions and rules:
Página 12
EASYTRIEVE Tutorial
PICTURE 4
The statement area normally contains a single statement. However, you can
enter multiple statements on a single record. The character string '. '
(period followed by a space) indicates the end of a statement. Another
CA-Easytrieve statement begins at the next available position of the
statement area (after the space). For example, the following two
CA-Easytrieve statements are on one record:
Página 13
EASYTRIEVE Tutorial
1.7.4 Comments
To place a comment on the same line as a statement, code a period (.), one
or more spaces, an asterisk (*), and then the comment.
1.7.5 Continuations
FIELD-NAME W 6 A +
VALUE 'ABC-
DEF'
----------------------------
FIELD-NAME W 6 A -
VALUE 'ABC+
DEF'
DBCS Data
To continue a statement defining DBCS data, you must delimit the DBCS
data. This means a shift-in code must precede the continuation character
and a shift-out code must precede the continuing DBCS data on the next
record. The following example illustrates continuing a DBCS literal:
FIELD-NAME W 10 K +
VALUE 'DBDBDB +
DBDB'
Página 14
EASYTRIEVE Tutorial
-----------------------------------------
Delimiter Description
-----------------------------------------
space The basic delimiter within
each statement.
-----------------------------------------
' single quote Encloses literals which
are alphanumeric.
-----------------------------------------
. period Terminates a statement.
followed
by a space
-----------------------------------------
, comma Used optionally for
readability.
-----------------------------------------
() parentheses Encloses multiple
parameters and portions of
arithmetic expressions
(the left parenthesis acts
as a basic delimiter).
-----------------------------------------
: colon Used as a delimiter for
file, record, and field
qualifications.
-----------------------------------------
At least one space must follow all delimiters except for the '(' (left
parenthesis) and ':' (colon). The word RECORD-COUNT is shown below with
various delimiters:
RECORD-COUNT
FILEONE:RECORD-COUNT
(RECORD-COUNT)
'RECORD-COUNT'
RECORD-COUNT,
RECORD-COUNT.
1.7.7 Keywords
Página 15
EASYTRIEVE Tutorial
Field names are composed of a combination of not more than 128 characters
chosen from the following:
All working storage field names must be unique, as well as all field names
within a single file. If you use the same field name in more than one
file, or in a file and in working storage, you must qualify the field name
with the file name or the word WORK. A qualified field name consists of
the qualifying word followed by a colon and the field name. You can use
any number of spaces, or no spaces, to separate the colon from either the
qualifying word or the field name. Field names can contain DBCS
characters.
Assume FLD1 occurs in both working storage and the file FILEA. FLD1 can
be qualified in the following ways:
FILEA: FLD1
FILEA:FLD1
FILEA : FLD1
WORK:FLD1
1.7.10 Labels
1.7.11 Identifiers
Identifiers are words which name things (field names, statement labels,
etc.) in CA-Easytrieve. Identifiers cannot contain these delimiters:
, comma
' single quote
( left parenthesis
) right parenthesis
: colon
Página 16
EASYTRIEVE Tutorial
* multiplication
/ division
+ addition
- subtraction
123
+123
-123.4321
Alphanumeric literals are words enclosed within single quotes, and can be
254 characters long. See Literal and Data Formatting Rules, in the
"Coding a CA-Eastrieve Program" chapter of the CA-Easytrieve Programmer
Guide, for complete information on literals.
Font numbers are used by extended report processing to identify which font
is used to display the field name or literal. A font number must begin
with a pound sign (#) and contain only numeric digits. Font numbers can
be specified on the following statements:
* DEFINE
* DISPLAY
* HEADING
* LINE
* TITLE.
Página 17
EASYTRIEVE Tutorial
--------------------------------------------------
Statement Usage
--------------------------------------------------
% Invoke a macro
--------------------------------------------------
* Document comments in a program
--------------------------------------------------
ACCESS Access a macro secured against
unauthorized access in
CA-PANVALET or VSAM
--------------------------------------------------
AFTER-BREAK A REPORT procedure invoked
following the printing of
summary lines for a control
break
--------------------------------------------------
AFTER-LINE A REPORT procedure invoked after
printing a detail line on a
report
--------------------------------------------------
AFTER-SCREEN A SCREEN procedure performed
after a SCREEN activity receives
data from the terminal
--------------------------------------------------
Assignment Establish a value in a field
--------------------------------------------------
BEFORE-BREAK A REPORT procedure invoked
before printing the summary
lines for a control break
--------------------------------------------------
BEFORE-LINE A REPORT procedure invoked
before printing a detail line on
a report
--------------------------------------------------
BEFORE-SCREEN A SCREEN procedure invoked
before a SCREEN activity sends
data to the terminal
--------------------------------------------------
CALL Invoke subprograms written in
other programming languages
Página 18
EASYTRIEVE Tutorial
--------------------------------------------------
CASE Conditionally execute one of
several alternative groups of
statements based on the value of
a specific field
--------------------------------------------------
CLOSE Close a file
--------------------------------------------------
COMMIT Commit a logical unit of
recoverable work
--------------------------------------------------
CONTROL Identify control fields used in
a control report
--------------------------------------------------
COPY Duplicate field definitions of a
named file
--------------------------------------------------
CURSOR Set the initial position of the
screen cursor
--------------------------------------------------
DECLARE Name a set of screen attributes
or an input edit pattern, or
whether a program is statically
or dynamically linked
--------------------------------------------------
DEFAULT Override system-defined screen
attributes and message locations
--------------------------------------------------
DEFINE Specify a data field within a
file or within working storage
--------------------------------------------------
DELETE Delete a row from a
CA-Easytrieve SQL file
--------------------------------------------------
DISPLAY Format and transfer data to the
system output device or to a
named file
--------------------------------------------------
DLI Perform IMS/DLI functions
against an IMS/DLI database.
--------------------------------------------------
DO UNTIL Control repetitive program logic
by evaluating the condition at
the bottom of a group of
statements
--------------------------------------------------
DO WHILE Control repetitive program logic
by evaluating the condition at
the top of a group of statements
--------------------------------------------------
DRAW Produce graphic output by
initiating a GRAPH subactivity
--------------------------------------------------
ELEMENT-RECORD Identify the element records
that comprise the logical record
--------------------------------------------------
ELSE Identify statements to be
executed when IF conditions are
false. See IF.
Página 19
EASYTRIEVE Tutorial
--------------------------------------------------
ELSE-IF Identify a conditional
expression to be tested when the
previous IF or ELSE-IF
conditional expression is false.
See IF.
--------------------------------------------------
END-CASE Terminate the body of a CASE
statement. See CASE.
--------------------------------------------------
END-DO Terminate the body of a loop
associated with a DO UNTIL or DO
WHILE statement. See DO UNTIL
and DO WHILE.
--------------------------------------------------
END-IF Terminate the logic associated
with the previous IF statement.
See IF.
--------------------------------------------------
ENDPAGE A REPORT procedure used to
produce page footing information
--------------------------------------------------
END-PROC Delimit the statements in a
procedure. See PROC.
--------------------------------------------------
END-REPEAT Terminate the body of a REPEAT
statement. See REPEAT.
--------------------------------------------------
ENDTABLE Delimit instream data used to
create small tables
--------------------------------------------------
EXECUTE Invoke a JOB, SORT, or SCREEN
activity from a PROGRAM or
SCREEN activity
--------------------------------------------------
EXIT Terminate a SCREEN activity
--------------------------------------------------
FETCH Retrieve a row from a
CA-Easytrieve SQL file
--------------------------------------------------
FILE Describe a file and database
references
--------------------------------------------------
GET Place the next sequential record
of the named file into the
file's record buffer
--------------------------------------------------
GOTO Modify the top to bottom logic
flow of statement execution
--------------------------------------------------
GOTO JOB Branch to the top of the current
JOB activity
--------------------------------------------------
GOTO SCREEN Branch to the top of the current
SCREEN activity
--------------------------------------------------
GRAPH Define the style and
characteristics of a graph
Página 20
EASYTRIEVE Tutorial
--------------------------------------------------
HEADING Define an alternate heading for
a field on a report or graph
--------------------------------------------------
IDD FILE Identify a non-CA-IDMS file in
the IDD and build the file and
field definition
--------------------------------------------------
IDD NAME Establish the dictionary entity
retrieval environment
--------------------------------------------------
IDD RECORD Identify and define CA-IDMS and
non-CA-IDMS records
--------------------------------------------------
IDD SUBSCHEMA Identify the subschema and build
the file, record, logical
record, element record, and
field definitions
--------------------------------------------------
IDD VERSION Set a global override of the
Options Table VERFILE, VERREC,
and VERSCHM defaults
--------------------------------------------------
IDMS ACCEPT Transfer database keys to
DBKEY program storage
--------------------------------------------------
IDMS ACCEPT Return information from the
PROCEDURE Application Program Information
Block (APIB) associated with a
database procedure to the
program
--------------------------------------------------
IDMS ACCEPT Retrieve the system statistics
STATISTICS
--------------------------------------------------
IDMS BIND Sign on the activity with the
database management system
--------------------------------------------------
IDMS BIND FILE Give the database management
system access to the record in
program storage
--------------------------------------------------
IDMS BIND Establish communications between
PROCEDURE a program and a DBA-written
database procedure
--------------------------------------------------
IDMS COMMIT Request the creation of a
checkpoint
--------------------------------------------------
IDMS CONNECT Establish a record as a member
of a set occurrence
--------------------------------------------------
IDMS DISCONNECT Cancel the relationship between
a record and a set occurrence
--------------------------------------------------
IDMS ERASE Make a record or logical record
unavailable for further
processing and remove it from
all set occurrences in which it
participates as a member
Página 21
EASYTRIEVE Tutorial
--------------------------------------------------
IDMS FIND Locate a record
--------------------------------------------------
IDMS FINISH Sign off the database management
system
--------------------------------------------------
IDMS GET Retrieve current data records
--------------------------------------------------
IDMS IF Test the status of a set
--------------------------------------------------
IDMS KEEP Place a shared or exclusive lock
on a record
--------------------------------------------------
IDMS MODIFY Update a record or logical
record within the database
--------------------------------------------------
IDMS OBTAIN Locate and then retrieve a
record. For database records,
see IDMS FIND/OBTAIN. For
logical records, see IDMS
OBTAIN.
--------------------------------------------------
IDMS READY Establish area availability with
the database manager
--------------------------------------------------
IDMS RETURN Retrieve the database key for an
indexed record without
retrieving the record
--------------------------------------------------
IDMS ROLLBACK Request recovery
--------------------------------------------------
IDMS STORE Place a new record or logical
record occurrence into a
database
--------------------------------------------------
IF Control the execution of
associated statements by testing
conditional expressions
--------------------------------------------------
INITIATION A SCREEN procedure invoked
during the start of a SCREEN
activity
--------------------------------------------------
INSERT Insert a row into a
CA-Easytrieve SQL file
--------------------------------------------------
JOB Define and initiate processing
activities
--------------------------------------------------
JOB INPUT Identify automatic input to the
activity
--------------------------------------------------
JOB INPUT NULL Inhibit automatic input
--------------------------------------------------
JOB INPUT SQL Allow CA-Easytrieve to
automatically manage the SQL
cursor without a file
Página 22
EASYTRIEVE Tutorial
--------------------------------------------------
KEY Define valid terminal keys for a
screen, specify descriptive
text, and assign functions to
terminal keys
--------------------------------------------------
LINE Define the content of a report
line
--------------------------------------------------
LINK Transfer control from current
program to another named program
and return to current program
--------------------------------------------------
LIST Regulate the printing or
suppression of all statements in
the printed output of a program
--------------------------------------------------
LOGICAL-RECORD Identify the logical records
available for automatic or
controlled processing of CA-IDMS
databases
--------------------------------------------------
MACRO Define the parameters of a macro
--------------------------------------------------
MEND Terminate a macro
--------------------------------------------------
MESSAGE Define message type and text for
messages in a SCREEN activity
--------------------------------------------------
MOVE Transfer character strings from
one storage location to another
--------------------------------------------------
MOVE LIKE Move contents of fields with
identical names from one file or
record to another
--------------------------------------------------
MSTART Begin an instream macro
--------------------------------------------------
NEWPAGE Eject the printer to the top of
the next page before printing
the next line of source program
on a statement listing
--------------------------------------------------
PARM Override selected general
standards for a program that are
set in the Site Options Table
--------------------------------------------------
PERFORM Transfer control to a procedure
and return control to next
executable statement in current
program
--------------------------------------------------
POINT Establish a position within an
INDEXED or RELATIVE file from
which subsequent data is
sequentially retrieved
--------------------------------------------------
POP Restore the previous listing
control indicators
--------------------------------------------------
PRINT Produce report output
Página 23
EASYTRIEVE Tutorial
--------------------------------------------------
PROC Initiate a CA-Easytrieve
procedure
--------------------------------------------------
PROGRAM Identify and initiate a
processing activity that can
optionally initiate JOB, SORT,
and SCREEN activities
--------------------------------------------------
PUSH Save the current listing control
indicators
--------------------------------------------------
--------------------------------------------------
PUT Perform sequential file output
--------------------------------------------------
READ Provide random access to INDEXED
and RELATIVE files
--------------------------------------------------
RECORD Identify the CA-IDMS database
records available for automatic
or controlled processing
--------------------------------------------------
REFRESH Restore the initial screen image
by rebuilding it with the
current values of program fields
--------------------------------------------------
RELEASE Manually release the hold on any
record in an INDEXED or RELATIVE
file
--------------------------------------------------
REPEAT Display arrays on a screen
--------------------------------------------------
REPORT Define the type and
characteristics of a report
--------------------------------------------------
REPORT-INPUT A REPORT procedure that selects
or modifies report input data
--------------------------------------------------
RESHOW Re-display a screen image
without rebuilding the screen
using the current values of
program fields
--------------------------------------------------
RETRIEVE Identify the CA-IDMS or IMS/DLI
database records that are input
to the JOB activity
--------------------------------------------------
ROLLBACK Roll back all recoverable work
since the last commit-point
--------------------------------------------------
ROW Specify items to be displayed
and received on a row of a
screen
--------------------------------------------------
SCREEN Define and initiate a SCREEN
activity
--------------------------------------------------
SEARCH Provide access to table data
Página 24
EASYTRIEVE Tutorial
--------------------------------------------------
SELECT Cause a cursor to be declared
(File-based SQL) and opened for a CA-Easytrieve
file
--------------------------------------------------
SELECT Specify automatic input of
(CA-IDMS) logical records from CA-IDMS
databases
--------------------------------------------------
SELECT Identify the rows and columns to
(Non-file SQL) be input to a JOB activity when
a CA-Easytrieve file is not used
--------------------------------------------------
SELECT Select report input data
(Report
Selection)
--------------------------------------------------
SELECT Select sort input data
(Sort Selection)
--------------------------------------------------
SEQUENCE Specify the order of a report or
graph based on the content of
one or more fields
--------------------------------------------------
SET Dynamically change screen
attributes and control the
display of screen errors
--------------------------------------------------
SKIP Space the printer a designated
number of lines before printing
the next line of a statement
listing
--------------------------------------------------
SORT Sequence an input file in
alphabetical or numerical order
based on fields specified as
keys
--------------------------------------------------
SQL Indicate a valid SQL statement
for any of the supported SQL
database management systems
--------------------------------------------------
SQL INCLUDE Indicate SQL table information
is used to generate
CA-Easytrieve field definitions
--------------------------------------------------
STOP Terminate activities
--------------------------------------------------
SUM Specify the quantitative fields
which are totaled for a control
report
--------------------------------------------------
TERMINATION A REPORT procedure invoked at
(Reports) the end of a report, commonly
used to print report footing
information
Página 25
EASYTRIEVE Tutorial
--------------------------------------------------
TERMINATION A SCREEN procedure invoked once
(Screens) during the end of a SCREEN
activity, used to perform
actions that are executed once
at the end of the activity
--------------------------------------------------
TITLE (Graphs) Specify a title to be displayed
on a graph
--------------------------------------------------
TITLE (Reports) Define an optional report title
and its position on a title line
--------------------------------------------------
TITLE (Screens) Define and center title items on
a screen
--------------------------------------------------
TRANSFER Transfer execution to a program
without returning to the
invoking program
--------------------------------------------------
UPDATE Update a row from a
CA-Easytrieve SQL file
--------------------------------------------------
VALUE Specify fields used to draw a
graph
--------------------------------------------------
WRITE Update and delete existing
records or add new records to
INDEXED and RELATIVE files
--------------------------------------------------
* Library Definition
* File Management
* Screen Processing
* Report Processing
* Graph Processing
* Generalized Programming
* Inter-program Execution
* Listing Control
* Macro Processing
* Native SQL
Página 26
EASYTRIEVE Tutorial
Under each category is a list of the statements that belong to each. Also
given is a brief overview of the usage of each statement.
-------------------------------------------------
Statement Usage
-------------------------------------------------
COPY Duplicate field definitions of a
named file
-------------------------------------------------
DECLARE Name a set of screen attributes or
an input edit pattern, or whether
a program is statically or
dynamically linked
-------------------------------------------------
DEFINE Specify a data field within a file
or within working storage
-------------------------------------------------
FILE Describe a file and database
references
-------------------------------------------------
SQL INCLUDE Indicate SQL table information is
used to generate CA-Easytrieve
field definitions
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
CLOSE Close a file
-------------------------------------------------
COMMIT Commit a logical unit of
recoverable work
-------------------------------------------------
DELETE Delete a row from a CA-Easytrieve
SQL file
-------------------------------------------------
DISPLAY Format and transfer data to the
system output device or to a named
file
-------------------------------------------------
ENDTABLE Delimit instream data used to
create small tables
-------------------------------------------------
FETCH Retrieve a row from a
CA-Easytrieve SQL file
Página 27
EASYTRIEVE Tutorial
-------------------------------------------------
GET Place the next sequential record
of the named file into the file's
record buffer
-------------------------------------------------
INSERT Insert a row into a CA-Easytrieve
SQL file
-------------------------------------------------
JOB Define and initiate processing
activities
-------------------------------------------------
JOB INPUT NULL Inhibit automatic input
-------------------------------------------------
JOB INPUT SQL Allow CA-Easytrieve to
automatically manage the SQL
cursor without a file
-------------------------------------------------
POINT Establish a position within an
INDEXED or RELATIVE file from
which subsequent data is
sequentially received
-------------------------------------------------
PUT Perform sequential file output
-------------------------------------------------
READ Provide random access to INDEXED
and RELATIVE files
-------------------------------------------------
RELEASE Manually release the hold on any
record in an INDEXED or RELATIVE
file
-------------------------------------------------
ROLLBACK Roll back all recoverable work
since the last commit-point
-------------------------------------------------
SELECT Cause a cursor to be declared and
(File-based opened for a CA-Easytrieve file
SQL)
-------------------------------------------------
SELECT Identify the rows and columns to
(Non-file SQL) be input to a JOB activity when a
CA-Easytrieve file is not used
-------------------------------------------------
SELECT Select sort input data
(Sort
Selection)
-------------------------------------------------
SORT Sequence an input file in
alphabetical or numerical order
based on fields specified as keys
-------------------------------------------------
UPDATE Update a row from a CA-Easytrieve
SQL file
-------------------------------------------------
WRITE Update and delete existing records
or add new records to INDEXED and
RELATIVE files
-------------------------------------------------
Página 28
EASYTRIEVE Tutorial
-------------------------------------------------
Statement Usage
-------------------------------------------------
AFTER-SCREEN A SCREEN procedure performed after
a SCREEN activity receives data
from the terminal
-------------------------------------------------
BEFORE-SCREEN A SCREEN procedure invoked before
a SCREEN activity sends data to
the terminal
-------------------------------------------------
CURSOR Set the initial position of the
screen cursor
-------------------------------------------------
DEFAULT Override system-defined screen
attributes and message locations
-------------------------------------------------
EXIT Terminate a SCREEN activity
-------------------------------------------------
INITIATION A SCREEN procedure invoked once
during the start of a SCREEN
activity
-------------------------------------------------
KEY Define valid terminal keys for a
screen, specify descriptive text,
and assign functions to terminal
keys
-------------------------------------------------
MESSAGE Define message type and text for
messages in a SCREEN activity
-------------------------------------------------
REFRESH Restore the initial screen image
by rebuilding it with the current
values of program fields
-------------------------------------------------
REPEAT Display arrays on a screen
-------------------------------------------------
RESHOW Re-display a screen image without
rebuilding the screen using the
current values of program fields
-------------------------------------------------
ROW Specify items to be displayed and
received on a row of a screen
-------------------------------------------------
SCREEN Define and initiate a SCREEN
activity
-------------------------------------------------
SET Dynamically change screen
attributes and control the display
of screen errors
-------------------------------------------------
TERMINATION A SCREEN procedure invoked once
during the end of a SCREEN
activity, used to perform actions
that are executed once at the end
of the activity
Página 29
EASYTRIEVE Tutorial
-------------------------------------------------
TITLE Define and center title items on a
screen
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
AFTER-BREAK A REPORT procedure invoked
following the printing of summary
lines for a control break
-------------------------------------------------
AFTER-LINE A REPORT procedure invoked after
printing a detail line on a report
-------------------------------------------------
BEFORE-BREAK A REPORT procedure invoked before
printing the summary lines for a
control break
-------------------------------------------------
BEFORE-LINE A REPORT procedure invoked before
printing a detail line on a report
-------------------------------------------------
CONTROL Identify control fields used in a
control report
-------------------------------------------------
ENDPAGE A REPORT procedure used to produce
page footing information
-------------------------------------------------
HEADING Define an alternate heading for a
field on a report
-------------------------------------------------
LINE Define the content of a report
line
-------------------------------------------------
PRINT Produce report output
-------------------------------------------------
REPORT Define the type and
characteristics of a report
-------------------------------------------------
REPORT-INPUT A REPORT procedure that selects
and/or modifies report input data
-------------------------------------------------
SELECT Select report input data
-------------------------------------------------
SEQUENCE Specify the order of a report
based on the content of one or
more fields
-------------------------------------------------
SUM Specify the quantitative fields
which are totaled for a control
report
-------------------------------------------------
TERMINATION A REPORT procedure invoked at the
end of a report, commonly used to
print report footing information
Página 30
EASYTRIEVE Tutorial
-------------------------------------------------
TITLE Define an optional report title
and its position on a title line
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
DRAW Produce graphic output by
initiating a GRAPH subactivity
-------------------------------------------------
GRAPH Define the style and
characteristics of a graph
-------------------------------------------------
HEADING Define an alternate heading for a
field on a graph
-------------------------------------------------
SEQUENCE Specify the order of a graph based
on the content of one or more
fields
-------------------------------------------------
TITLE Specify a title to be displayed on
a graph
-------------------------------------------------
VALUE Specify fields used to draw a
graph
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
PARM Override selected general
standards for a program that are
set in the Site Options Table
-------------------------------------------------
PROGRAM Identify and initiate a processing
activity that can optionally
initiate JOB, SORT, and SCREEN
activities
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
CALL Invoke subprograms written in
other programming languages
Página 31
EASYTRIEVE Tutorial
-------------------------------------------------
LINK Transfer control from current
program to another named program
and return to current program
-------------------------------------------------
TRANSFER Transfer execution to a program
without returning to the invoking
program
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
CASE Conditionally execute one of
several alternative groups of
statements based on the value of a
specific field
-------------------------------------------------
DO UNTIL Control repetitive program logic
by evaluating the condition at the
bottom of a group of statements
-------------------------------------------------
DO WHILE Control repetitive program logic
by evaluating the condition at the
top of a group of statements
-------------------------------------------------
ELSE Identify statements to be executed
when IF conditions are false. See
IF.
-------------------------------------------------
ELSE-IF Identify a conditional expression
to be tested when the previous IF
or ELSE-IF conditional expression
is false. See IF.
-------------------------------------------------
END-DO Terminate the body of a loop
associated with a DO UNTIL or DO
WHILE statement. See DO UNTIL and
DO WHILE.
-------------------------------------------------
END-IF Terminate the logic associated
with the previous IF statement.
See IF.
-------------------------------------------------
EXECUTE Invoke a JOB, SORT, or SCREEN
activity from a PROGRAM or SCREEN
activity
-------------------------------------------------
GOTO Modify the top to bottom logic
flow of statement execution
-------------------------------------------------
GOTO JOB Branch to the top of the current
JOB activity
-------------------------------------------------
GOTO SCREEN Branch to the top of the current
SCREEN activity
Página 32
EASYTRIEVE Tutorial
-------------------------------------------------
IF Control the execution of
associated statements by testing
conditional expressions
-------------------------------------------------
PERFORM Transfer control to a procedure
and return control to next
executable statement in current
program
-------------------------------------------------
STOP Terminate activities
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
* Document comments in a program
-------------------------------------------------
LIST Regulate the printing or
suppression of all statements in
the printed output of a program
-------------------------------------------------
NEWPAGE Eject the printer to the top of
the next page before printing the
next line of source program on a
statement listing
-------------------------------------------------
POP Restore the previous listing
control indicators
-------------------------------------------------
PUSH Save the current listing control
indicators
-------------------------------------------------
SKIP Space the printer a designated
number of lines before printing
the next line of a statement
listing
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
Assignment Establish a value in a field
-------------------------------------------------
MOVE Transfer character strings from
one storage location to another
-------------------------------------------------
MOVE LIKE Move contents of fields with
identical names from one file to
another
-------------------------------------------------
Página 33
EASYTRIEVE Tutorial
-------------------------------------------------
Statement Usage
-------------------------------------------------
% Invoke a macro
-------------------------------------------------
ACCESS Access a macro secured against
unauthorized access in CA-PANVALET
or VSAM
-------------------------------------------------
MACRO Define the parameters of a macro
-------------------------------------------------
MEND Terminate a macro
-------------------------------------------------
MSTART Begin an instream macro
-------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
SQL Indicate a valid SQL statement for
any of the supported SQL database
management systems
-------------------------------------------------
--------------------------------------------------
Statement Usage
--------------------------------------------------
ELEMENT-RECORD Identify the element records that
comprise the logical record
--------------------------------------------------
IDD FILE Identify a non-CA-IDMS file in
the IDD and build the file and
field definition
--------------------------------------------------
IDD NAME Establish the dictionary entity
retrieval environment
--------------------------------------------------
IDD RECORD Identify and define CA-IDMS and
non-CA-IDMS records
--------------------------------------------------
IDD SUBSCHEMA Identify the subschema and build
the file, record, logical record,
element record, and field
definitions
--------------------------------------------------
IDD VERSION Set a global override of the
Options Table VERFILE, VERREC,
and VERSCHM defaults
Página 34
EASYTRIEVE Tutorial
--------------------------------------------------
IDMS ACCEPT Transfer database keys to program
DBKEY storage
--------------------------------------------------
IDMS ACCEPT Return information from the
PROCEDURE Application Program Information
Block (APIB) associated with a
database procedure to the program
--------------------------------------------------
IDMS ACCEPT Retrieve the system statistics
STATISTICS
--------------------------------------------------
IDMS BIND Sign on the activity with the
database management system
--------------------------------------------------
IDMS BIND FILE Give the database management
system access to the record in
program storage
--------------------------------------------------
IDMS BIND Establish communications between
PROCEDURE a program and a DBA-written
database procedure
--------------------------------------------------
IDMS COMMIT Request the creation of a
checkpoint
--------------------------------------------------
IDMS CONNECT Establish a record as a member of
a set occurrence
--------------------------------------------------
IDMS DISCONNECT Cancel the relationship between a
record and a set occurrence
--------------------------------------------------
IDMS ERASE Make a record or logical record
unavailable for further
processing and remove it from all
set occurrences in which it
participates as a member
--------------------------------------------------
IDMS FIND Locate a record
--------------------------------------------------
IDMS FINISH Sign off the database management
system
--------------------------------------------------
IDMS GET Retrieve current data records
--------------------------------------------------
IDMS IF Test the status of a set
--------------------------------------------------
IDMS KEEP Place a shared or exclusive lock
on a record
--------------------------------------------------
IDMS MODIFY Update a record or logical record
within the database
--------------------------------------------------
IDMS OBTAIN Locate and then retrieve a
record. For database records,
see IDMS FIND/OBTAIN. For
logical records, see IDMS OBTAIN.
--------------------------------------------------
IDMS READY Establish area availability with
the database manager
Página 35
EASYTRIEVE Tutorial
--------------------------------------------------
IDMS RETURN Retrieve the database key for an
indexed record without retrieving
the record
--------------------------------------------------
IDMS ROLLBACK Request recovery
--------------------------------------------------
IDMS STORE Place a new record or logical
record occurrence into the
database
--------------------------------------------------
LOGICAL-RECORD Identify the logical records
available for automatic or
controlled processing of CA-IDMS
databases
--------------------------------------------------
RECORD Identify the CA-IDMS database
records available for automatic
or controlled processing
--------------------------------------------------
RETRIEVE Identify the CA-IDMS database
records that are input to the JOB
activity
--------------------------------------------------
SELECT (CA-IDMS) Specify automatic input of
logical records from CA-IDMS
databases
--------------------------------------------------
-------------------------------------------------
Statement Usage
-------------------------------------------------
DLI Perform IMS/DL/I functions against
an IMS/DL/I database
-------------------------------------------------
Página 36
EASYTRIEVE Tutorial
3.0 Statements A - C
3.1 % (Macro Invocation) Statement
3.1.1 Syntax
%macro-name positional-parameters...keyword-parameters
Parameters
3.2.1 Syntax
* comment-text
You can use comment statements any place within a program, except within a
continued statement. A statement containing all blanks is treated as a
comment.
Página 37
EASYTRIEVE Tutorial
3.3.1 Syntax
CA-Panvalet
VSAM
For both CA-Panvalet and VSAM macro storage access methods, the ACCESS
record can appear anywhere in the CA-Easytrieve program prior to the
retrieval of the macro, and remains in effect until the next ACCESS record
is encountered. The ACCESS record must be on a record by itself.
CA-Easytrieve does not print the ACCESS record.
3.4.1 Syntax
AFTER-BREAK. PROC
Página 38
EASYTRIEVE Tutorial
The AFTER-BREAK procedure is invoked once for each level of break. For
example, assume two control fields are specified. When the minor field
causes a control break, the AFTER-BREAK procedure is invoked only once.
When the major field causes a control break, AFTER-BREAK is invoked twice.
3.4.3 Example
In the following example, the total line for the control field STATE
receives special annotation.
Statements:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
AFTER-BREAK. PROC
IF LEVEL EQ 2
DISPLAY 'TOTALS FOR THE STATE OF ' STATE
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Página 39
EASYTRIEVE Tutorial
Results:
3.5.1 Syntax
AFTER-LINE. PROC
Note that when using an AFTER-LINE procedure, the detail line for the
report has already been built. You cannot modify the contents of the
detail line with an AFTER-LINE procedure. (To modify the contents of a
detail line on a report, use a REPORT-INPUT or BEFORE-LINE procedure.)
3.5.3 Example
Statements:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
Página 40
EASYTRIEVE Tutorial
*
REPORT REPORT1 LINESIZE 65 +
DTLCTL EVERY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
AFTER-LINE. PROC
IF PAY-NET GE 500
DISPLAY '* EMPLOYEE ' LAST-NAME ' +
EXCEEDED WEEKLY SALARY GOAL *'
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 1444.32
TX 777.77
2222.09
Página 41
EASYTRIEVE Tutorial
3.6.1 Syntax
AFTER-SCREEN. PROC
All branch actions (REFRESH, RESHOW, EXIT, GOTO SCREEN) are valid in the
AFTER-SCREEN procedure and any procedure performed by the AFTER-SCREEN
procedure. The AFTER-SCREEN procedure is not executed if the key pressed
is assigned to execute a branch action with a KEY statement. You
typically use an AFTER-SCREEN procedure to perform complex editing and to
perform I/O after data entry.
3.6.3 Example
3.7.1 Syntax
ROUNDED {= } {send-field-name }
receive-field-name INTEGER { } {send-literal }
TRUNCATED {EQ} {arithmetic-expression}
{= } {AND} {bit-mask-field-name}
receive-field-name { } send-field-name {OR } { }
{EQ} {XOR} {bit-mask-literal }
Página 42
EASYTRIEVE Tutorial
Parameters
ROUNDED
TRUNCATED
Note: INTEGER, ROUNDED, and TRUNCATED are valid only with numeric fields.
{= }
{ }
{EQ}
{send-field-name }
{send-literal }
{arithmetic-expression}
Página 43
EASYTRIEVE Tutorial
{= }
{ }
{EQ}
{AND}
{OR }
{XOR}
{bit-mask-field-name}
{ }
{bit-mask-literal }
Página 44
EASYTRIEVE Tutorial
3.7.3 Examples
DEFINE F1A W 4 A
DEFINE F2A1 W 1 A VALUE 'A'
DEFINE F2A2 W 6 A VALUE 'ABCDEF'
DEFINE F2N1 W 2 N VALUE 12
DEFINE F2N2 W 3 P 1 VALUE 1234.5
...
Resulting Value
Note: For an example using varying length alphanumeric fields, see Field
Definition in the CA-Easytrieve Programmer Guide.
Statements:
DEFINE F1N W 4 N 1
DEFINE F2N1 W 4 N 1 VALUE 1
DEFINE F2N2 W 4 N 1 VALUE 2
DEFINE F2N3 W 4 N 1 VALUE 3
JOB INPUT NULL NAME MYPROG
F1N = F2N1 + F2N2 + F2N3
DISPLAY SKIP 2 +
'F1N = F2N1 + F2N2 + F2N3 = ' F1N
F1N = F2N1 + F2N2 / F2N3
DISPLAY SKIP 2 +
'F1N = F2N1 + F2N2 / F2N3 = ' F1N
F1N = (F2N1 + F2N2) / F2N3
DISPLAY SKIP 2 +
'F1N = (F2N1 + F2N2) / F2N3 = ' F1N
F1N = ((F2N1 / F2N2) * 100) + .5
Página 45
EASYTRIEVE Tutorial
DISPLAY SKIP 2 +
'F1N = ((F2N1 / F2N2) * 100) + .5 = ' F1N
STOP
Results:
Resulting
Value
The following example illustrates the use of the INTEGER, ROUNDED, and
TRUNCATED parameters.
If:
SENDFLD W 5 N 2 VALUE(10.75)
RCVFLD W 5 N 1
Then:
----------------------------------------
Assignment Statement RCVFLD
Result
----------------------------------------
RCVFLD INTEGER ROUNDED = SENDFLD 11.0
----------------------------------------
RCVFLD INTEGER TRUNCATED = 10.0
SENDFLD
----------------------------------------
RCVFLD INTEGER = SENDFLD 10.0
----------------------------------------
RCVFLD ROUNDED = SENDFLD 10.8
----------------------------------------
RCVFLD TRUNCATED = SENDFLD 10.7
----------------------------------------
RCVFLD = SENDFLD 10.7
----------------------------------------
Statements:
Página 46
EASYTRIEVE Tutorial
Results:
Resulting
Value
* DECLARE
* DEFAULT
* ROW
* TITLE
When used in these statements the ATTR parameter completely overrides any
site or screen default attributes. See the DEFAULT Statement to set
default screen attributes that override site attributes
3.8.1 Syntax
ATTR attribute-name
(attribute-list)
attribute-list
SENDONLY +
CURSOR +
ASKIP +
PROTECT
Página 47
EASYTRIEVE Tutorial
NUMERIC +
INTENSE +
INVISIBLE
GREEN
RED
BLUE
TURQ|TURQUOISE +
PINK
YELLOW
BLACK
WHITE
MUSTFILL +
MUSTENTER +
TRIGGER +
BLINK
REVERSE +
UNDERLINE
ALARM +
BOX
LEFT
RIGHT
UNDER
OVER
Parameters
CURSOR Specify CURSOR to place the cursor on this field when displayed
on the terminal. If more than one field contains the CURSOR attribute,
the cursor is placed on the first field that contains CURSOR.
Note: The cursor cannot be moved into a field that also contains the
ASKIP, PROTECT, or SENDONLY attributes.
ASKIP
PROTECT
Página 48
EASYTRIEVE Tutorial
NUMERIC NUMERIC specifies that only numeric data can be entered in this
screen field. Use NUMERIC for permitting only numeric data in
alphanumeric fields. NUMERIC is implied for all numeric data types, and
ignored for literals.
INTENSE
INVISIBLE
GREEN _
RED _
BLUE _
TURQ|TURQUOISE_
PINK _
YELLOW _
BLACK _
WHITE _
The value specified is the color of the field or literal when displayed on
a screen. If no color is specified, hardware defaults apply.
BLINK
REVERSE
UNDERLINE
BLINK displays the item blinking. REVERSE displays the item in reverse
video. UNDERLINE displays the item underlined.
BOX
LEFT
RIGHT
UNDER
OVER
Página 49
EASYTRIEVE Tutorial
BOX specifies that field outlining displays a box surrounding the field.
LEFT specifies that field outlining displays a vertical line to the left
of a field.
RIGHT specifies that field outlining displays a vertical line to the right
of a field.
Note: BOX, LEFT, RIGHT, UNDER, and OVER are ignored on terminals that do
not support outlining attributes.
3.9.1 Syntax
BEFORE-BREAK. PROC
The BEFORE-BREAK procedure is invoked once for each level of break. For
example, assume two control fields are specified. When the minor field
causes a control break, the BEFORE-BREAK procedure is invoked only once.
When the major field causes a control break, BEFORE-BREAK is invoked
twice.
Página 50
EASYTRIEVE Tutorial
3.9.3 Example
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
2222.09 100.00
Página 51
EASYTRIEVE Tutorial
The BEFORE-BREAK procedure computes the percentage for each control break
by multiplying the sum of PAY-NET by 100 and then dividing by TOTAL-NET.
Note: TOTAL-NET is a static (S) working storage field summed in the JOB
activity processing.
3.10.1 Syntax
BEFORE-LINE. PROC
3.11.1 Syntax
BEFORE-SCREEN. PROC
Página 52
EASYTRIEVE Tutorial
3.11.3 Example
3.12.1 Syntax
{field-name}
CALL program-name USING ( { } ...) RETURNS return-field
{'literal' }
Parameters
{field-name}
USING ( { } ...)
{'literal' }
Página 53
EASYTRIEVE Tutorial
3.12.3 Examples
The first example shows a CALL statement without parms, the second show on
with parms:
CALL ASMPGM
The CASE and END-CASE statements are used to conditionally execute one of
several alternative groups of statements based on the value of a specific
field.
Página 54
EASYTRIEVE Tutorial
3.13.1 Syntax
CASE field-name
OTHERWISE
statement-n+1
END-CASE
PICTURE 5
Parameters
WHEN You can specify as many WHEN conditions as necessary. At least one
WHEN condition is required. You cannot code statements between CASE and
the first WHEN condition. You must supply a unique set of values to be
compared with field-name in each WHEN condition.
The set of literal values specified for a given WHEN, including the
unspecified values implied by a range, must be unique as compared to the
literal values of any other WHEN for the same CASE.
statement-1
statement-n
Página 55
EASYTRIEVE Tutorial
3.13.3 Example
The following example uses CASE to analyze the data to select employees'
years of service that fall into a range (identified by the WHEN statement)
and, as a result, display 'ONE WEEK VACATION' or 'TWO WEEKS VACATION', or
for all other cases, display 'THREE WEEKS VACATION'.
FILE EMPLOYEE
EMPYRS 5 2 N
...
CASE EMPYRS
WHEN 0 THRU 4
DISPLAY 'ONE WEEK VACATION'
WHEN 5 THRU 10
DISPLAY 'TWO WEEKS VACATION'
OTHERWISE
DISPLAY 'THREE WEEKS VACATION'
END-CASE
...
3.14.1 Syntax
CLOSE file-name
Parameters
Página 56
EASYTRIEVE Tutorial
You can also close an SQL file with the CLOSE statement so that a new
cursor can be created. See SQL Database Processing in the CA-Easytrieve
Programmer Guide for more information.
Note: You cannot use the CLOSE statement to close a printer file or to
close an automatic input or output file. Virtual files without RETAIN are
deleted when closed. CLOSE has no effect on IDMS files.
3.14.3 Example
CLOSE FILEA
3.15.1 Syntax
COMMIT
The COMMIT statement establishes the end of the current logical unit of
work and the beginning of the next.
COMMIT terminates any active holds on files. All open SQL cursors are
closed and all updates to databases are committed.
Note: Cursors defined with the HOLD option (DB2 only) are not closed.
Página 57
EASYTRIEVE Tutorial
Example
3.16.1 Syntax
{IF } {AND}
{DO WHILE } condition { } condition...
{DO UNTIL } {OR }
3.16.3 Examples
Página 58
EASYTRIEVE Tutorial
3.17.1 Syntax
Relational
Subject Operator Object
{IF } {EQ|= }
{ELSE-IF } {NE|^=|NQ } {field-name-2 }
{ } field-name-1 {LT|< |LS } {literal }
{DO WHILE} {LE|<=|LQ|^>} {arithmetic-expression }
{DO UNTIL} {GT|> |GR }
{GE|>=|GQ|^<}
Parameters
Página 59
EASYTRIEVE Tutorial
2. Comparison is arithmetic.
1. CA-Easytrieve only supports equal (EQ =) and not equal (NE ^= NQ)
conditions. If you use any of the other conditional operators, an
error occurs.
Página 60
EASYTRIEVE Tutorial
When the condition subject is a DBCS field, the following evaluation rules
apply:
1. CA-Easytrieve only supports equal (EQ =) and not equal (NE ^= NQ)
conditions. If you use any of the other conditional operators, an
error occurs.
3.17.6 Example
Página 61
EASYTRIEVE Tutorial
END-IF
IF PAY-NET LT (PAY-GROSS / 2)
TOTAL-PAY = TOTAL-PAY + 1
END-IF
IF NAME-FIRST EQ 'LINDA'
TOTAL-FIRST-NAME = TOTAL-FIRST-NAME + 1
END-IF
*
FINISH-PROC. PROC
DISPLAY TOTAL-EMP#
DISPLAY TOTAL-SEX
DISPLAY TOTAL-PAY
DISPLAY TOTAL-FIRST-NAME
END-PROC
3.18.1 Syntax
Relational
Subject Operator
{IF }
{ELSE-IF } {EQ | = }
{ } field-name-1 { } +
{DO WHILE } {NE | ^= | NQ}
{DO UNTIL }
Object
{field-name-2 {field-name-3 } }
{ THRU { } ...}
{literal-1 {literal-2 } }
Parameters
Relational Operator Equal and not equal are the only valid relational
operators for field series conditions.
Página 62
EASYTRIEVE Tutorial
3.18.3 Example
Página 63
EASYTRIEVE Tutorial
3.19.1 Syntax
Subject Object
{ALPHABETIC }
{BREAK }
{CURSOR }
{HIGHEST-BREAK}
{IF } {MODIFIED }
{DO UNTIL } field-name NOT {NULL }
{DO WHILE } {NUMERIC }
{SPACE }
{SPACES }
{ZERO }
{ZEROS }
{ZEROES }
Parameters
{BREAK} (Mainframe and UNIX only) BREAK tests whether this field is
currently being processed as a CONTROL break field on a report. The BREAK
test is an alternative to testing the field-name LEVEL for a specific
numeric value. Field-name must be defined on a CONTROL statement or it
must be the reserved word FINAL.
{CURSOR} CURSOR tests whether the cursor is in the specified field on the
screen. CURSOR can only be used in screen activity procedures.
Página 64
EASYTRIEVE Tutorial
* Two screen fields redefine the same storage area and one of the
fields is used in an IF test.
* The test is performed after the user presses CLEAR, PA1, PA2, or
PA3.
{MODIFIED} MODIFIED tests whether the terminal operator changed the data
in the field. The field is considered MODIFIED only if the contents of
the field upon receipt of the screen do not equal the contents of the
screen at the time the screen is displayed.
* Two screen fields redefine the same storage area and one of the
fields is used in an IF test.
* The test is performed after the user presses CLEAR, PA1, PA2, or
PA3.
{NUMERIC} NUMERIC tests for the digits 0 through 9 (in the correct format
for the field's data type), and for a possible algebraic sign in the
low-order position of type P fields or in the high-order position of type
N fields.
{SPACE} SPACE and SPACES test for the character space in each byte of
EBCDIC.
{ZERO} ZERO, ZEROS, and ZEROES test for the digit 0 (in the correct
format for the field's data type), and for a possible algebraic sign in
the low-order position of type P fields or in the high-order position of
type N fields.
Página 65
EASYTRIEVE Tutorial
3.19.2 Example
The field bits condition compares selected bits of a field for on (1) or
off (0) conditions.
3.20.1 Syntax
Relational
Subject Operator Object
Parameters
Relational Operator The relational operators ON and OFF test for bit
values of one or zero respectively.
Página 66
EASYTRIEVE Tutorial
If the subject is a VARYING field, the object must be equal to the length
of the data portion of the subject. The test is performed based on the
actual length of the subject. The object cannot be a VARYING field.
3.20.2 Example
3.21.1 Syntax
Subject
{IF }
{DO WHILE} NOT EOF {file-name}
{DO UNTIL}
Parameters
Página 67
EASYTRIEVE Tutorial
The object of the test is simply the availability of the record for
processing. The file is available if the last GET or READ operation was
successful and there is a record that can be accessed.
The optional EOF parameter causes the test to be true when the subject is
at end-of-file. This test can never be true for automatic input files.
3.21.3 Examples
The first example illustrates the use of the file presence condition:
The next example illustrates the use of the file presence condition in
synchronized file processing:
Página 68
EASYTRIEVE Tutorial
The file relational condition determines file presence and record matching
for more than one file in JOBs with synchronized file input.
3.22.1 Syntax
Subject
file-name
IF NOT MATCHED PRIMARY ...
SECONDARY
Parameters
3.22.2 Example
Página 69
EASYTRIEVE Tutorial
*
SORT PERSNL TO SORT1 USING (ADDR-STATE) NAME MYSORT1
SORT INVENT TO SORT2 USING (LOCATION-STATE) NAME MYSORT2
*
JOB INPUT (SORT1 KEY (ADDR-STATE), +
SORT2 KEY (LOCATION-STATE)) +
NAME MYPROG FINISH FINISH-PROC
IF MATCHED
COUNT-1 = COUNT-1 + 1
END-IF
*
FINISH-PROC. PROC
DISPLAY COUNT-1
END-PROC
3.23.1 Syntax
Subject
{DUPLICATE} {file-name}
IF NOT {FIRST-DUP} {PRIMARY }
{LAST-DUP } {SECONDARY}
Parameters
{DUPLICATE} DUPLICATE is true when the previous or next record has the
same key as the current record.
{FIRST-DUP} FIRST-DUP is true for the first of two or more records with
the same key.
{LAST-DUP} LAST-DUP is true for the last of two or more records with the
same key.
Página 70
EASYTRIEVE Tutorial
3.23.2 Example
The CONTROL statement identifies control fields used for a control report.
A control break occurs whenever the value of any control field changes or
end-of-report occurs. The control break at end-of-report is equivalent to
the final break. A break level is also assigned to each control field.
Comparison of control fields is a logical compare.
3.24.1 Syntax
field-name NEWPAGE
CONTROL NOPRINT ...
FINAL RENUM
Parameters
field-name
FINAL
Prior to the first field-name, you can code FINAL to specify options for
the control break at end-of-report. Field-name specifies any
Página 71
EASYTRIEVE Tutorial
RENUM RENUM performs the same function as NEWPAGE, and also resets the
page number to 1 on the page following the control break.
NOPRINT NOPRINT suppresses printing the summary line group for the
specified control break. All other control break processing for the
specified control break is performed as usual.
You can specify one or more control breaks. If you do not specify any
control breaks, a FINAL break is implied.
3.24.3 Example
Página 72
EASYTRIEVE Tutorial
3.25.1 Syntax
{file-name }
COPY { }
{database-file-name:record-name}
Parameters
You can code an unlimited number of COPY statements for any one file.
CA-Easytrieve duplicates the fields as if they were coded at the place
CA-Easytrieve encounters the COPY statement.
The same rules of field definition apply when using the COPY statement
(that is, field names must be unique in a given file).
3.25.3 Examples
Página 73
EASYTRIEVE Tutorial
RECORD SALES 28
SLS-CUST-NO 1 10 A
FILE DDBASE FB(28 280)
COPY SALES (fields from RECORD SALES copied)
JOB INPUT (DNASE) NAME MYPROG
RETRIEVE DBASE +
SELECT (CUSTOMER AREA 'CUSTOMER-REGION' +
SALES ID 'SA' SET 'CUSTOMER-SALES')
IF PATH-ID EQ 'SA'
MOVE LIKE SALES TO DDBASE
PUT DDBASE
ELSE
GO TO JOB
END-IF
The CURSOR statement is used within a screen procedure to set the initial
position of the cursor in a field for the next display of the screen.
3.26.1 Syntax
CURSOR AT field-name
Parameters
You can use the CURSOR statement only within screen procedures
(AFTER-SCREEN, BEFORE-SCREEN, INITIATION, TERMINATION), or within any
procedure performed from a screen procedure.
The CURSOR statement must refer to a field on a ROW statement within the
screen declaration.
* Two screen fields redefine the same storage area and one is used
in the CURSOR statement.
Página 74
EASYTRIEVE Tutorial
attribute.
3.26.3 Example
Página 75
EASYTRIEVE Tutorial
4.0 Statements D - F
4.1 DECLARE Statement
The DECLARE statement enables you to declare named screen attributes and
input edit patterns, and to specify how a subprogram is to be linked. Use
of declared attributes provides the ability to dynamically change screen
attributes during program execution. Use of declared attributes and edit
patterns saves you coding time when the set of attributes or edit patterns
are used many times.
4.1.1 Syntax
{ATTR (attribute-list) }
DECLARE name {PATTERN 'pattern' }
{PROGRAM {STATIC|DYNAMIC}}
Parameters
name Specify a name up to 128 characters for the set of declared screen
attributes or set of declared pattern characters.
The valid pattern characters and their meanings are listed below.
------------------------------------------
Character Meaning
------------------------------------------
A Represents a lowercase or an
uppercase letter
------------------------------------------
B Represents a single blank
------------------------------------------
D Represents a digit
------------------------------------------
E Represents an empty string
------------------------------------------
L Represents a lowercase
letter
------------------------------------------
N Represents an uppercase
letter or a national
character
Página 76
EASYTRIEVE Tutorial
------------------------------------------
U Represents an uppercase
letter
------------------------------------------
X Represents any character
------------------------------------------
"x" Double quotes surrounding a
character or a sequence of
characters literally
represent the character or
sequence of characters
contained within. The x
represents any character.
To literally represent
single or double quotes, use
two sets of quotes within
the surrounding set of
double quotes ('""""' or
'"x""x"', '"''"' or
'"x''x"').
------------------------------------------
blank Blanks (unless contained in
double quotes) serve as
delimiters but are otherwise
ignored. They can be
inserted into the pattern to
increase readability.
------------------------------------------
( ) Represents grouping to
control the precedence of
operators.
------------------------------------------
or | or , Represents a choice (or
alternation operator).
------------------------------------------
(m) or (m..n) Represents the repetition of
or (m..*) or the preceding pattern
(*) or * expression. The m and n
represent numbers and m must
be less than n. A single
number with parentheses
indicates the exact number
of repetitions. (m..n)
represents a range of
repetitions, minimum to
maximum. An asterisk in a
range, (m..*), represents an
infinite maximum. An
asterisk by itself, (*) or
*, represents a range from 0
to infinity.
Página 77
EASYTRIEVE Tutorial
------------------------------------------
# or /-/ Represents the remove (or
toss) operation. This
operation applies only to a
single character set at a
time and must immediately
follow that character set in
the pattern. This operation
removes the character that
matched the character set
from the data.
------------------------------------------
+ Represents character set
addition to form another
character set.
------------------------------------------
- Represents character set
difference to form another
character set.
------------------------------------------
concatenation Concatenation is implied by
proximity. For example,
DDDU means 3 digits followed
by an uppercase letter.
------------------------------------------
The edit pattern is evaluated from left to right, (the data from the
screen is processed from left to right). Patterns examine only one
character at a time. They do not look ahead and they do not back track.
See the CA-Easytrieve Programmer Guide for more information.
Other than the assignment, DECLAREd screen attributes can only be used on
DEFAULT, TITLE, and ROW statements.
Página 78
EASYTRIEVE Tutorial
4.1.3 Example
4.2.1 Syntax
Format 1
{TITLE }
{FIELD {attribute-name } }
DEFAULT { ERROR ATTR { } }
{LITERAL {(attribute-list)} }
{KEY }
Format 2
{ {attribute-name } }
INFORMATION {ATTR { } }
DEFAULT MESSAGE ( WARNING ...) { {(attribute-list)} } ...
ACTION { }
{ROW row-number }
Parameters
TITLE Use TITLE to override attributes for all screen titles (fields and
literals) in a screen activity.
Note: You can also override attributes at a title item level. See the
TITLE Statement.
Note: You can also override attributes at a screen item level. See the
ROW Statement.
FIELD ERROR Use FIELD to override attributes for all row fields in a
screen activity. Optionally, specify ERROR to override attributes for
fields flagged in error by the automatic edit process.
Note: You can also override attributes at a screen item level. See the
ROW Statement.
KEY Use KEY to override attributes for a function key display area in a
screen activity.
Página 79
EASYTRIEVE Tutorial
{attribute-name }
ATTR { }
{(attribute-list)}
MESSAGE Use MESSAGE to override attributes for any or all message levels
(INFORMATION, WARNING, ACTION).
ROW row-number Use ROW to override the placement of the message level
(INFORMATION, WARNING, ACTION). Row-number must be an unsigned integer
that does not exceed the maximum screen size (SCREEN ROWCOUNT) and
specifies the row number on which the message is displayed.
If ROW is not specified, all messages are displayed one line above the key
display area, if used. See the KEY Statement.
You cannot code overlapping overrides. For example, the following code is
in error because the attribute for INFORMATION level messages is coded
twice:
The following attributes are ignored for TITLE, LITERAL, and KEY:
* CURSOR
* NUMERIC
* INVISIBLE
* MUSTFILL
* MUSTENTER
* TRIGGER
* ALARM
Página 80
EASYTRIEVE Tutorial
4.2.3 Examples
You can use MESSAGE to display INFORMATION level messages in yellow and
all other levels of messages in red:
You can override the placement of messages on a screen using the ROW
parameter:
The DEFINE statement specifies data fields within a file or within working
storage.
4.3.1 Syntax
DEFINE +
{start-location } }
{* +offset-value } }
{W } + }
Location
{S } }
{file-qualifier: overlay-field-name +offset-value} }
UPDATE + }
}
HEADING (#font-number 'heading-literal' ...) + }
}
INDEX (index-field-name) + }
}
Character-
MASK ({mask-identifierBWZ'mask-literal'|HEX}) + } istics
}
OCCURS maximum-occurrences + }
}
VALUE initial-value + }
}
RESET }
Página 81
EASYTRIEVE Tutorial
Parameters
DEFINE You can omit the DEFINE keyword for fields defined after the
associated FILE statement or for working storage fields defined after any
FILE statement. For definitions outside the library, the DEFINE keyword
must precede each field definition.
Location
The optional +offset-value allows you to offset the field from the
beginning of overlay-field-name.
Attributes
Página 82
EASYTRIEVE Tutorial
For each field-name you define, you must specify the following attributes:
* Data format
Página 83
EASYTRIEVE Tutorial
The table below shows the length equivalent and maximum possible
values for signed binary fields:
-----------------------------------------------
Field Digits Maximum Value Minimum Value
Length in
Bytes
-----------------------------------------------
1 3 127 128-
-----------------------------------------------
2 5 32,767 32,768-
-----------------------------------------------
3 7 8,388,607 8,388,608-
-----------------------------------------------
4 10 2,147,483,647 2,147,483,648-
-----------------------------------------------
The next table shows the length equivalent and maximum possible
values for unsigned binary fields:
----------------------------------------
Field Digits Maximum
Length in Unsigned Value
Bytes
----------------------------------------
1 3 255
----------------------------------------
2 5 65,535
----------------------------------------
3 8 16,777,215
----------------------------------------
4 10 2,147,483,648
----------------------------------------
-----------------------------------------
Field Maximum Value Minimum Value
Length in
Bytes
-----------------------------------------
2 32,767 -32,768
-----------------------------------------
4 2,147,483,647 -2,147,483,648
-----------------------------------------
Página 84
EASYTRIEVE Tutorial
--------------------------------------------------------
Field Maximum Value Minimum Value
Length
in
Bytes
--------------------------------------------------------
1 9 0
--------------------------------------------------------
2 99 -9
--------------------------------------------------------
19 999,999,999,999,999,999 -999,999,999,999,999,999
--------------------------------------------------------
-----------------------------------------
Field Maximum Value Minimum Value
Length in
Bytes
-----------------------------------------
4 9,999,999 -9,999,999
-----------------------------------------
----------------------------------------------------
Field Maximum Value Minimum Value
Página 85
EASYTRIEVE Tutorial
Length in
Bytes
----------------------------------------------------
4 999,999,999,999,999 -999,999,999,999,999
----------------------------------------------------
Note: See the table below under Usage Notes for maximum lengths and
number of decimal positions for data types.
EVEN Use EVEN to indicate that a packed decimal field (P) is to contain
an even number of digits. The high order digit is zero. For example, a
two-byte packed even field can only contain two digits, such as X'012F'.
You can specify VARYING on type A fields. When VARYING is specified, the
length attribute (field-length) is the total number of bytes the varying
length field can occupy (two-byte length plus maximum size of data).
You can specify VARYING for file fields or working storage fields. For
file fields the starting position (start-location) points to the two-byte
indicator. For both file fields and working storage fields,overlay
redefinition begins with the two-byte length indicator.
Página 86
EASYTRIEVE Tutorial
When a VARYING field is displayed in your output, the data window is based
on the maximum length of the field (field-length minus two). The length
indicator does not display in output unless DISPLAY HEX is specified.
Characteristics
UPDATE Specify UPDATE for each SQL field to be modified. You can
specify UPDATE only for fields defined in a CA-Easytrieve SQL file. Only
SQL fields specified as UPDATE can be modified by the UPDATE statement.
Note: You must have UPDATE authorization for the column in the SQL table
that this file references.
You can use a unique font number for each 'heading-literal' by coding the
# sign and a value for font-number before 'heading-literal'. Any
'heading-literal' that does not have a font assigned uses the default font
identified in the printer set definition module. See your system
Página 87
EASYTRIEVE Tutorial
The BWZ (blank when zero) option suppresses the display of field-name when
it contains all zeros. BWZ can be used by itself or with other options on
the MASK parameter.
Note: HEX edit masks are not allowed for VARYING fields.
Initial-value can be any valid literal whose type matches the field-name
type. If initial-value is non-numeric, it must be enclosed in single
quotes. The maximum length for initial-value is 254 bytes.
Página 88
EASYTRIEVE Tutorial
RESET Use RESET only for W working storage fields. When you code RESET
on the field definition for a W field, RESET returns the field to its
initial value whenever a JOB, SCREEN, or SORT is executed. You can use
RESET with OCCURS for array fields but not for redefined fields (fields
having overlay redefinition). When you use RESET on multiple fields, the
fields are reset in the order of the field definitions.
See the CA-Easytrieve Programmer Guide for complete rules for working with
signed (quantitative) and unsigned (non-quantitative) fields.
4.3.3 Examples
The DEFINE statement specifies data fields within a file or within working
storage. You usually specify file fields and work fields in your
CA-Easytrieve library section, but you can also define them within an
activity as the following examples illustrate. The first example shows
fields defined in the library:
Página 89
EASYTRIEVE Tutorial
When fields are defined in an activity, each field definition must start
with the DEFINE keyword and physically be defined before the field is
referenced. In the library section, the use of the DEFINE keyword is
optional.
Note: The DEFINE keyword is not needed when the field definitions
immediately follow the FILE statement.
PICTURE 6
Method 1
FILE PERSNL FB(150 1800)
REGION * 1 N
BRANCH * 2 N
SSN * 5 P
EMP# * 5 N
JOB INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1
LINE EMP# REGION BRANCH
Method 2
FILE PERSNL FB(150 1800)
REGION 1 1 N
BRANCH 2 2 N
SSN 4 5 P
Página 90
EASYTRIEVE Tutorial
EMP# 9 5 N
JOB INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1
LINE EMP# REGION BRANCH
Add the RESET parameter to reinitialize the field each time a JOB, SORT,
or SCREEN activity is executed.
Because VARYING is used, this W type work field has two parts that are
internally defined as follows:
The default report heading for a field is the field name. You can
override this default by using the HEADING parameter, as shown in the
following example:
Página 91
EASYTRIEVE Tutorial
4.3.9 Arrays
DEFINE ARRAY W 20 A
DEFINE ELEMENT ARRAY 2 N 0 OCCURS 10
4.4.1 Syntax
Parameters
4.4.3 Example
The following example selects a specific row from the table, then deletes
it.
Página 92
EASYTRIEVE Tutorial
IF EOF PERSNL
DISPLAY 'EMPLOYEE NOT FOUND'
ELSE
DELETE FROM PERSNL
END-IF
The DISPLAY statement formats and transfers data to the system output
device or to a named file. You can code DISPLAY to transfer printed data
to the system output device, or you can optionally code a file name after
DISPLAY to cause data to be printed to the named file. The DISPLAY
statement has three formats; Format 3 can only be used when the file is
associated with an extended reporting printer.
4.5.1 Syntax
Format 1
display-file-name {TITLE|NOTITLE}
DISPLAY SKIP skip-integer +
SYSPRINT CONTROL 'carriage-control-character'
field-name
#font-number
'literal'
+offset ...
-offset
COL column-number
POS position-number
Format 2
display-file-name {TITLE|NOTITLE}
DISPLAY SKIP skip-integer +
SYSPRINT CONTROL 'carriage-control-character'
{file-name }
HEX {field-name }
{record-name}
Format 3
display-file-name
DISPLAY CONTROL 'control-literal'
SYSPRINT
Parameters
Format 1
display-file-name
SYSPRINT
Página 93
EASYTRIEVE Tutorial
field-name
'literal'
Code field-name or 'literal' in the order you want them to appear on the
printed line.
+offset
-offset
Note: ÅOffset does not extend space beyond the left and right margin set
points.
Página 94
EASYTRIEVE Tutorial
Format 2
{file-name }
HEX {field-name }
{record-name}
You can only use this format of the DISPLAY statement when
display-file-name is associated with an extended reporting printer. A
syntax error occurs if display-file-name is not an extended reporting
printer. See the CA-PSI Subsystems Reporting Environment Guide, or the
CA-Easytrieve for UNIX User Guide for more information about extended
reporting.
Unless you specify relative or absolute positioning, the first data entry
of each DISPLAY statement begins in column 1 of the print line. Each data
entry that follows is printed next to the preceding entry. For HEX
displays, the output is printed five lines per 100 bytes of the record or
field.
Página 95
EASYTRIEVE Tutorial
4.5.3 Examples
Format 1
Format 2
Página 96
EASYTRIEVE Tutorial
4.6.1 Syntax
Format 1
{io-record-name} {'function-literal' }
DLI file-name { } { } +
{io-field-name } {function-field-name}
{'search-value-literal' }
SSANO ssa-number SSA { } ...
{search-value-field-name}
Format 2
{CHKP} {'seg-len-literal' }
DLI { } { } id-field-name +
{XRST} {seg-len-field-name}
{'checkpoint-len-literal' }
{ } checkpoint-field-name ...
{checkpoint-len-field-name}
Format 3
Format 4
Format 5
{'psb-name-literal' }
DLI PCB { }
{psb-name-field-name}
Format 6
DLI TERM
Parameters
Format 1
{io-record-name}
{ }
{io-field-name }
Página 97
EASYTRIEVE Tutorial
{'function-literal' }
{ }
{function-field-name}
You can specify any IMS/DL/I function code whose parameter requirements
conform to Format 1. The function code can be specified as either an
EBCDIC alphabetic literal ('function-literal') or an alphanumeric
function-field-name that contains a four-byte alphabetic code. Valid
function codes (for example, GNP) are described in IBM's IMS/DL/I
Application Programming publications.
{'search-value-literal' }
SSANO ssa-number SSA { }
{search-value-field-name}
Code the optional SSANO and SSA parameters when the database activity to
be performed cannot be satisfied without using segment search arguments.
SSANO identifies a function-field-name that represents a four-byte binary
field. Function-field-name can be set dynamically to control the number of
SSAs used in database system calls. This value overrides the assumed
number which is equal to the count of SSA parameter entries. The SSA
parameter supplies segment search argument values. You can code the SSA
values as search-value-field-name or an alphabetic literal
('search-value-literal'). The SSA value must contain the segment search
argument in the exact form required by IMS/DL/I. If
search-value-field-name contains DBCS data, the DBCS code system of
search-value-field-name must equal the DBCS code system of file-name.
Format 2
{CHKP}
{ }
{XRST}
{'seg-len-literal' }
{ }
{seg-len-field-name}
Página 98
EASYTRIEVE Tutorial
restart JCL.
{'checkpoint-len-literal' }
{ }
{checkpoint-len-field-name}
Format 3
Use Format 3 of the DLI statement to perform a basic checkpoint. For IMS,
you must specify the compatibility option (COMPAT=YES) for the PSB being
processed; this option generates a dummy PCB that acts as an I/O PCB
during checkpoint processing. Test CHKP-STATUS to determine the results
of the call. For more information of CHKP-STATUS, see the "File
Processing" chapter in the CA-Easytrieve Programmer Guide. For additional
information on basic checkpoint, see IBM's IMS/DL/I Application
Programming publications.
Format 4
Use Format 4 of the DLI statement when you are calling a subprogram (such
as a COBOL program) which accesses DL/I records. Coding this statement
before referencing DLI fields causes the fields to become available for
processing.
Format 5
Use Format 5 to schedule a PSB. Format 5 is used for CICS execution only.
In other environments, it is ignored. Any program that executes under
CICS must schedule the PSB before accessing any PSB, including programs
that are accessing DL/I with the RETRIEVE statement. For activities that
use the RETRIEVE statement, the PSB must be scheduled in a JOB START proc,
or in a previously-executed activity. When a PSB is scheduled, it stays
scheduled until one of the following occurs:
* Task termination
* Syncpoint
Página 99
EASYTRIEVE Tutorial
{'psb-name-literal' }
{ }
{psb-name-field-name}
Format 6
The loop control statements DO and END-DO control and delimit repetitive
program logic.
4.7.1 Syntax
{WHILE}
DO { } conditional-expression
{UNTIL}
statement-1
...
statement-n
END-DO
PICTURE 7
Parameters
{WHILE}
{ }
{UNTIL}
Página 100
EASYTRIEVE Tutorial
END-DO END-DO terminates the body of the loop associated with the DO
statement. An END-DO statement must be specified after each DO statement
and its associated statements.
DO WHILE
DO UNTIL
4.7.3 Examples
FILE FILEA
ELEMENT 1 10 A OCCURS 10
CTR W 2 N
JOB INPUT FILEA
CTR = 1
DO UNTIL CTR > 10
DISPLAY ELEMENT (CTR)
CTR = CTR + 1
END-DO
Página 101
EASYTRIEVE Tutorial
END-DO
END-DO
STOP
4.8.1 Syntax
DRAW graph-name
Parameters
4.9.1 Syntax
ELEMENT-RECORD record-name
Parameters
Página 102
EASYTRIEVE Tutorial
The name of each field must be unique within the element record. However,
it is not necessary for the field to be unique within the logical record
that contains the element record being defined. If a field defined in
another element record has the same name as a field in the named element
record, then all references to either field must be qualified with the
name of the field's containing element record. See the "CA-IDMS Database
Processing" chapter in the CA-Easytrieve Programmer Guide for more
information.
4.10.1 Syntax
ENDPAGE. PROC
4.10.3 Example
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
ENDPAGE. PROC
DISPLAY SKIP 2 '* CONFIDENTIAL - FOR INTERNAL USE ONLY *'
END-PROC
*
Página 103
EASYTRIEVE Tutorial
4.11.1 Syntax
END-PROC
4.12.1 Syntax
ENDTABLE
All data required to create an instream table file must be coded between
the definition statements and the ENDTABLE statement.
If the table data is to be stored in a macro, you must store the entire
table definition from the FILE statement through the ENDTABLE statement.
4.12.3 Example
Página 104
EASYTRIEVE Tutorial
The EXECUTE statement invokes a JOB, SORT, or SCREEN activity from either
a PROGRAM or SCREEN activity.
4.13.1 Syntax
EXECUTE {job-name|sort-name|screen-name}
Parameters
You can use the EXECUTE statement to invoke multiple stacked windows from
a SCREEN activity. When each stacked window terminates with an EXIT, the
full screen image is restored to the screen image that existed before the
EXECUTE. An EXIT from the primary screen does not restore the screen.
4.13.3 Example
PARM-FIELD W 5 A
PROGRAM NAME SAMPLE-PROGRAM USING PARM-FIELD
IF PARM-FIELD = 'DAILY'
EXECUTE DAILY-JOB
ELSE
EXECUTE WEEKLY-JOB
END-IF
JOB NAME DAILY-JOB
. . .
JOB NAME WEEKLY-JOB
Página 105
EASYTRIEVE Tutorial
4.14.1 Syntax
EXIT
When an EXIT statement is encountered and the SCREEN activity was invoked
from a PROGRAM or SCREEN activity, control is returned to the statement
following the EXECUTE statement.
4.14.3 Example
4.15.1 Syntax
Parameters
Página 106
EASYTRIEVE Tutorial
The FETCH statement retrieves rows from the open cursor and places the
data in the file's data area. If the file does not have an open cursor
associated with it, the cursor previously SELECTed is reopened. If no
cursor was previously selected, the default cursor (SELECT all defined
fields FROM table) is opened.
The FETCH statement cannot reference an automatic input file in the same
JOB activity. You can FETCH from a file other than the automatic input
file.
4.15.3 Example
The above PROGRAM activity simply fetches each row of the table and
displays the fields. The DO loop repeats the process until end-of-file.
FILE statements must describe all files that your program references. You
can also access SQL, CA-IDMS, and IMS/DL/I databases using CA-Easytrieve
files. Code FILE statements at the beginning of a program after the PARM
statement, if one is used. Not all parameters are necessary (or valid)
for describing any one file. A review of all parameters will quickly
indicate those required for any particular file.
Página 107
EASYTRIEVE Tutorial
4.16.1 Syntax
FILE file-name +
{'password-literal' }
PASSWORD { } +
{password-field-name}
NOVERIFY +
{parm-literal }
EXIT (program-name USING ( { } ...) MODIFY) +
{parm-field-name}
CARD }
PUNCH }
Device
PRINTER (PAGESIZE (line-page-size display-page-size) + } Type
LINESIZE line-length) }
F record-length }
}
V record-length }
}
block-length }
U FULLTRK }
}
FB (record-length block-length ) + }
Record
FULLTRK }
Format
}
VB (record-length block-length ) }
FULLTRK }
}
VBS (record-length block-length ) }
FULLTRK }
WORKAREA area-length +
INSTREAM
TABLE +
max-table-entries
BUFNO buffers +
DEFER +
ASA +
Página 108
EASYTRIEVE Tutorial
EXTENDED xrpt-printer +
CODE {EBCDIC|ASCII|dbcs-code-name} +
KEY key-field-name +
SYSTEM (system-id PATH path-specification +
ACCESS {BTRIEVE }
{DBASE }
{DELIMITED }
{HOST } +
{SUPERCALC }
{LOTUS }
{RRDS }
INDEX index-file-specification + +
ACCESS-PATH access-path-number +
CREATE-PATH (access-path-number +
KEY (key-start-pos key-length key-type) + +
DUPLICATE MODIFIABLE ) ...
OWNER 'owner-id' +
CREATE-MODE create-mode-literal +
PAGESIZE page-size-literal )
{'file-identifier' } }
SYSNAME { } }
{file-identifier-field-name} }
}
MEMORY }
VIRTUAL (RETAIN DISK ) }
}
{'terminal-id-literal' } }
TERMINAL (ID { } + }
{terminal-id-field-name} }
}
NOFORMFEED + }
}
BEFORE } Data
NEWPAGE AFTER ... ) } Set
}
Type
{'spool-class-literal' } }
SPOOL ( CLASS { } + }
{spool-class-field-name} }
}
{'destination-literal' } }
NODE { } + }
{destination-field-name} }
}
{'user-id-literal' } }
USERID { } ) }
{user-id-field-name} }
Página 109
EASYTRIEVE Tutorial
Parameters
See the SYSNAME parameter for the relationship between a FILE statement
and an external data set.
File Types
Note: Only UPDATE, DEFER, and CODE are valid FILE statement parameters
for an SQL file.
Página 110
EASYTRIEVE Tutorial
When you specify SQL, the file can be used as the subject of either
automatic input or controlled processing using the SELECT, FETCH, CLOSE,
INSERT, UPDATE, and DELETE statements. These statements support full
read-write access to the tables but you do not have to declare, open, and
close cursors to manage the tables. Multiple tables for a single file are
joined for inquiry only.
The optional RESET subparameter requests that all records under control of
RETRIEVE be reset to binary zero immediately prior to retrieving each root
record.
{relative-position }
DLI ({ } RESET)
{dbd-namerelative-occurrence}
The optional RESET subparameter requests that all records under control of
RETRIEVE be reset to binary zero immediately prior to retrieving each root
record.
Página 111
EASYTRIEVE Tutorial
For SQL, code UPDATE to specify that all columns defined for the file can
be updated. If you do not specify UPDATE for an SQL file, only those
columns defined with the UPDATE parameter can be updated. UPDATE is
required to DELETE from or INSERT to an SQL file.
Note: You must have UPDATE, INSERT, or DELETE authorization for the SQL
table that this file references.
{'password-literal' }
PASSWORD { }
{password-field-name}
'Password-literal' is the optional password for the file. You can specify
the password as an alphabetic literal or a hexadecimal quoted literal.
{parm-literal }
USING ( { } ...)
{parm-field-name}
Device Types
The optional parameters CARD, PUNCH, and PRINTER specify the device type
for SEQUENTIAL files. For MVS, if you do not specify one of these
parameters, the device type is determined by your JCL.
CARD (TSO and CMS only) The CARD option retrieves the file data from
the system input stream (SYSIN). Only one file in a CA-Easytrieve
execution can use the CARD option. Files using this option must be
80-character unblocked records.
Note: In TSO and CMS, you cannot use a CARD file if you want to execute
Página 112
EASYTRIEVE Tutorial
(Workstation only) The CARD option indicates the file is a variable length
file (carriage-return, line-feed delimited) using an 80-character record
buffer.
(UNIX only) The CARD option indicates the file is "stdin." It is treated
as a variable length file (new-line delimited) with a maximum record
length of 256.
PUNCH (TSO and CMS only) The PUNCH option indicates punched card
output. Files created with this option are 80-character unblocked
records.
PRINTER PRINTER indicates that the file receives printed output routed
to either a file, online printer, terminal, or to a subsystem (JES/POWER)
data set. Although normal input/output statements (GET, PUT, READ, WRITE)
cannot reference PRINTER files, the DISPLAY statement and the PRINTER
parameter of the REPORT statement can reference PRINTER files.
Line-length must be at least one less than the length of the data portion
of the file's logical record. If the FILE definition does not provide the
file's format and logical record length, then no compile time verification
of the line-length is done.
Line-length provides the default value for any REPORT specifying this file
as its PRINTER file.
The default value of LINESIZE is calculated as one less than the data
portion of the logical record if the file format and record length are
known at compile time. Otherwise, the default is taken from the LINESIZE
site option.
Record Format
You can optionally code the record format of non-VSAM files for MVS
programs. If you do not code a record format in MVS, CA-Easytrieve
obtains it from the operating system when the file is opened. For input
files, CA-Easytrieve always obtains the record format from MVS. The
record format and length are required for VSE and workstation FILE
statements.
F record-length
V record-length
Página 113
EASYTRIEVE Tutorial
U block-length
FULLTRK
FB (record-length block-length )
FULLTRK
VB (record-length block-length )
FULLTRK
CA-Easytrieve supports fixed (F), variable (V), and undefined (U) formats.
Fixed and variable length records can be blocked (FB,VB).
VBS (MVS only) MVS systems can process Variable Block Spanned (VBS)
records using BFTEK=A processing.
For mainframe variable format files, allow four bytes of the record length
for the Record Description Word (RDW) and, if the file is blocked, four
bytes of the block size for the Block Description Word (BDW).
* Include the DSORG, LRECL and RECFM parameters in the original JCL
or TSO dynamic allocation. This forces SMS to establish the block
size before CA-Easytrieve gets control in OPEN processing. This
is only applicable for disk data sets.
OR
* Define a value of zero for the block length value. If you want
CA-Easytrieve to pick up the logical record length from your JCL,
code a zero for record-length. You must also code a BLKSIZE=0 in
your JCL or code no BLKSIZE parameter at all.
Examples:
This tells CA-Easytrieve to pick up the LRECL from the JCL and to
utilize the block size set by SMS.
Página 114
EASYTRIEVE Tutorial
WORKAREA allows you to reference the fields in a file prior to the normal
allocation of a files's data buffer. See the "File Processing" chapter in
the CA-Easytrieve Programmer Guide for more information.
TABLE The TABLE option declares the file as the source for a SEARCH
statement to access a table.
INSTREAM
max-table-entries
The INSTREAM option indicates that the table file immediately follows the
file description. The size of an INSTREAM table is limited only by the
amount of available memory. Max-table-entries specifies the maximum
number of entries in an external table. If INSTREAM or max-table-entries
is not specified, the file is an external table whose maximum number of
entries is limited by the site option TBLMAX.
BUFNO buffers BUFNO establishes the number of buffers allocated for the
file. Buffers can be 1 through 255 for MVS programs. The default value
is obtained from the Site Options Table. BUFNO is ignored on the
workstation.
ASA (MVS only) The optional ASA parameter sets the DCB A option for
RECFM. ASA is ignored on the workstation.
Página 115
EASYTRIEVE Tutorial
If not specified, the default is taken from the program's CODE parameter
on the PARM statement. If not specified on the PARM statement, the
default is taken from the CA-Easytrieve/Workstation Site Options.
(Mainframe only) Use CODE dbcs-code-name to define the DBCS code system to
be used for all K and M fields for this file. If not specified, the
default is taken from the CODE parameter on the PARM statement for this
program. If not specified on the PARM statement, then the default is
taken from the processing code system as defined in the CA-PSI Subsystems
DBCS Options table.
KEY key-field-name Use the KEY parameter to specify the key field for
your UNIX ISAM file. CA-Easytrieve uses this parameter only when the file
is created. After the file is created, this parameter is ignored and key
information is obtained from the access method. If KEY is not specified
during creation, the first field defined in the file is used as the key
field.
ACCESS {BTRIEVE }
{DBASE }
{DELIMITED }
{HOST }
{SUPERCALC }
{LOTUS }
{RRDS }
Code the ACCESS parameter to specify the access mode of file type to be
associated with this file.
Note: The BTRIEVE Manager must be loaded before you can run a program
that accesses a BTRIEVE file.
{DBASE} Specify DBASE if the file is a dBASE III, IV, or 5.0 (.DBF) file.
DBASE is valid only if the file type is SEQUENTIAL or unspecified and the
record format is fixed.
Página 116
EASYTRIEVE Tutorial
Note: CA-Easytrieve reads only dBase data files. dBase indexed files
cannot be accessed.
{HOST} Specify HOST if the file is to be accessed using the IBM High
Level Applications Program Interface (HLLAPI). HOST is valid only if the
file type is SEQUENTIAL or unspecified.
* Specify the HOST transfer operating system (CMS or TSO) and the
correct emulator type in the options table. Ensure that you have
compiled your program with the desired options in effect.
* OS/2 only - define the .DEF file for the program accessing the
HOST.
{LOTUS} Specify LOTUS if the file is a Lotus 123 (.WKS or .WK1) file.
The default access mode for a Lotus file is .WKS format. To override the
default, include the extension of the file to be accessed in the PATH
parameter if the file is a .WK1 file.
LOTUS is valid only if the file type is SEQUENTIAL or unspecified and the
record format is fixed.
{RRDS} Specify RRDS if you coded VS as the file type and you want the
workstation file to function as a VSAM RRDS file. A VSAM RRDS file is
then emulated instead of a KSDS file. Use this parameter to maintain
portability between the workstation and the mainframe. See Usage Notes
for more information.
KEY can only be coded once for each indexed (workstation ISAM) file, and
is ignored if the file is not an indexed file.
Página 117
EASYTRIEVE Tutorial
Note: Workstation ISAM file keys are always stored in character format
and the key length cannot exceed 100 bytes in length. Only alphanumeric
and zoned numeric data should be used for the key on the workstation.
INDEX can only be coded once for each indexed (workstation ISAM) file, and
is ignored if the file is not an indexed file.
ACCESS-PATH can only be coded once for each BTRIEVE file and is ignored if
the file is not a BTRIEVE file. See your BTRIEVE Reference Manual for
more information.
CREATE-PATH (access-path-number +
KEY (key-start-pos key-length key type) +
DUPLICATE MODIFIABLE) ...
Use the KEY parameter to specify the start position, length, and type of
key to be created in a BTRIEVE file. Key-start-pos and key-length must be
integers. Key-length cannot exceed 255 bytes. Key-type can be any valid
CA-Easytrieve data type. CA-Easytrieve data types are mapped to BTRIEVE
key types as follows:
------------------------------------------
CA-Easytrieve data BTRIEVE key type
type
------------------------------------------
A STRING
------------------------------------------
N STRING
------------------------------------------
P DECIMAL
------------------------------------------
B STRING
Página 118
EASYTRIEVE Tutorial
------------------------------------------
U STRING
------------------------------------------
I INTEGER
------------------------------------------
F STRING
------------------------------------------
S FLOAT
------------------------------------------
D FLOAT
------------------------------------------
Use DUPLICATE if you want to permit duplicate keys for this access path.
Use MODIFIABLE if the contents of the key can be changed during a WRITE
UPDATE operation.
-------------------------------------------
create-mode-literal Description
-------------------------------------------
0 Requires an owner ID
for any file access (no
data encryption)
-------------------------------------------
1 Permits read-only
access without an owner
ID (no data encryption)
-------------------------------------------
2 Requires an owner ID
for any file access
(with data encryption)
-------------------------------------------
3 Permits read-only
access without an owner
ID (with data
encryption)
-------------------------------------------
Note: If the CREATE-MODE parameter is not coded and the OWNER parameter
is coded, the file is created with CREATE-MODE 0.
The value you select for page-size-literal can have performance and disk
space implications. See your BTRIEVE Reference Manual for more
Página 119
EASYTRIEVE Tutorial
information.
SYSNAME {'file-identifier' }
{ }
{file-identifier-field-name}
Note: If SYSNAME is not specified, then the file-name specified after the
FILE keyword is used. The length of file-name must conform to operating
system standards.
CICS:
* For file types SEQUENTIAL, INDEXED, and RELATIVE, this is the FCT
name of the associated VSAM data set. The requirements for the
format of the file-identifier character string are the same as the
requirements for the FCT name. If fewer than eight characters are
provided, the value is padded with blanks on the right to obtain a
string of eight characters. File-identifier-field-name must be an
eight-byte sequential alphanumeric field of any format. Only
uppercase alphabetic and numeric digits are allowed. The first
character must not be a digit.
TSO:
* For file types SEQUENTIAL, INDEXED and RELATIVE, and device type
PRINTER, this is the DDname of the associated data set. The
requirements for the format of the file-identifier character
string are the same as the requirements for the DDname. If fewer
than eight characters are provided, the value is padded with
blanks on the right to obtain a string of eight characters.
File-identifier-field-name must be an eight-byte alphanumeric
field of any format. Only uppercase alphabetic and numeric digits
are allowed. The first character must not be a digit.
CMS:
* For file types SEQUENTIAL, INDEXED and RELATIVE, and device type
PRINTER, this is the FILEDEF or DLBL name of the associated data
set. The requirements for the format of the file-identifier
character string are the same as the requirements for the FILEDEF
or DLBL name. If fewer than eight characters are provided, the
value is padded with blanks on the right to obtain a string of
eight characters. File-identifier-field-name must be an
eight-byte alphanumeric field of any format. Only uppercase
alphabetic and numeric digits are allowed. The first character
Página 120
EASYTRIEVE Tutorial
Workstation:
* For file types SEQUENTIAL, INDEXED and RELATIVE, and device type
PRINTER, this is the 64-character fully-qualified file
specification of the physical file. See the FILE SYSTEM parameter
and the CA-Easytrieve/Workstation User Guide for more information.
* For file type INDEXED, if the physical data file is defined with
an extension, then the indexed file associated with that data file
must be explicitly defined on the FILE statement.
UNIX:
* For SEQUENTIAL, INDEXED, and RELATIVE file types and the PRINTER
device type, SYSNAME is either a file description string or an
environment variable specifying the file description string. If
the value of SYSNAME contains a path separator (/), it is treated
as a file description string. If it does not contain a path
separator, CA-Easytrieve searches for an environment variable with
the same name. If found, the value of the variable is used as the
file description string. If the variable is not found, the
SYSNAME value is used as the path.
MEMORY
DISK
MEMORY and DISK indicate the type of CICS temporary storage that
CA-Easytrieve is to use for storing this file. MEMORY indicates a main
storage resident temporary storage queue in CICS. DISK indicates an
auxiliary storage resident temporary storage queue. DISK is the default.
TERMINAL Code the TERMINAL parameter to route the output for this
printer file to an online terminal. The TERMINAL parameter is mutually
exclusive with the SPOOL, VIRTUAL, and SYSNAME parameters.
{'terminal-id-literal' }
ID { }
{terminal-id-field-name}
Página 121
EASYTRIEVE Tutorial
NEWPAGE BEFORE
AFTER
Code NEWPAGE to eject the page each time the file is opened and each time
it is closed. Specify NEWPAGE BEFORE to eject the page each time the file
is opened. Specify NEWPAGE AFTER to eject the page each time the file is
closed.
SPOOL Code the SPOOL parameter to route the output for this printer
file to the operating system spooling subsystem. The SPOOL parameter is
mutually exclusive with the VIRTUAL, TERMINAL and SYSNAME parameters. In
CMS, the printer device must be spooled to RSCS. SPOOL is ignored on the
workstation.
CLASS {'spool-class-literal' }
{ }
{spool-class-field-name}
Code CLASS to specify the spool class for the file. CLASS can be
specified as a literal or as a field name. Any valid class is accepted.
NODE {'destination-literal' }
{ }
{destination-field-name}
Code NODE to specify the destination for the file. This destination is
usually a local or remote printer device name or a network node name, but
can be anything meaningful to the operating system spooling subsystem.
Note: If NODE is not specified, the destination for the file is not
passed to the operating system spooling subsystem.
{'user-id-literal' }
USERID { }
{user-id-field-name}
Página 122
EASYTRIEVE Tutorial
Code USERID to specify the user of the printed output. The NODE
subparameter must also be specified and must contain a network node name.
See the "File Processing" chapter and the "SQL Database Processing"
chapter in the CA-Easytrieve Programmer Guide for more information about
using the FILE statement.
4.16.3 Examples
FILE SEQFILE
Página 123
EASYTRIEVE Tutorial
5.0 Statements G - M
5.1 GET Statement
GET places the next or previous sequential record of the named file into
the file's record buffer.
5.1.1 Syntax
HOLD
GET file-name PRIOR STATUS
NOHOLD
Parameters
Note: The access method of the operating system must support retrieval of
previous records or an execution error occurs.
HOLD
NOHOLD
Note: You cannot browse (GET) a file in CICS if you specify HOLD. An
execution error occurs. When you want to update a record, use the READ
statement.
Página 124
EASYTRIEVE Tutorial
If you do not code STATUS and the operating system returns a non-zero
status, CA-Easytrieve issues an appropriate diagnostic message.
You must test for end-of-file (EOF) or file presence (IF file-name) when
using the GET statement to ensure record availability. If you specified
GET PRIOR, an EOF means you have reached the beginning of the file.
When you reverse the direction of a GET statement by using GET PRIOR, the
record returned is the record immediately preceding the record previously
placed in the file's record buffer. When you reverse the direction of a
GET PRIOR statement by using only GET, the record returned is the record
immediately following the record previously placed in the field's record
buffer.
You cannot use GET for a file designated as automatic input. To inhibit
automatic input, specify INPUT NULL on the JOB statement:
You can use GET to access a secondary file while automatically accessing a
primary file.
5.1.3 Examples
The following code illustrates testing for EOF when using the GET
statement.
FILE MASTER
...
GET MASTER
IF EOF MASTER
STOP
END-IF
...
Página 125
EASYTRIEVE Tutorial
The GOTO statement allows you to modify the natural top to bottom logic
flow of statement execution.
5.2.1 Syntax
{GOTO } {label }
{ } {JOB }
{GO TO} {SCREEN}
Parameters
A label can:
Assignment MESSAGE
CALL MOVE
CASE MOVELIKE
CLOSE PERFORM
COMMIT POINT
CURSOR PRINT
DELETE PUT
DISPLAY READ
DLI REFRESH
DO RELEASE
END-DO RESHOW
END-IF ROLLBACK
END-PROC SEARCH
EXECUTE SELECT (except non-file SQL)
EXIT SET
FETCH SQL
GET Statement label
GOTO STOP
IDMS TRANSFER
IF UPDATE
INSERT WRITE
{JOB} GOTO JOB causes an immediate branch to the top of the current JOB
activity. It does not include execution of the START procedure. When
used in a START procedure, GOTO JOB terminates the START procedure. When
used in a FINISH procedure, GOTO JOB terminates the FINISH procedure.
Página 126
EASYTRIEVE Tutorial
5.2.2 Example
PICTURE 8
5.3.1 Syntax
{'LOW' }
GRAPH graph-name SUMMARY MODE {'HIGH' } +
{mode-field-name}
{'PIE' }
{'VBAR' }
{'SVBAR' }
{'HBAR' }
STYLE {'SHBAR' } NOHEADING
{'LINE' }
{'XY' }
{'SCATTER' }
{style-field-name}
Parameters
At least one graph-name must be coded for each DRAW graph-name statement.
For unnamed graphs, you can code the DRAW statement without the graph-name
parameter.
Página 127
EASYTRIEVE Tutorial
{'LOW' }
MODE{'HIGH' }
{mode-field-name}
{'PIE' }
{'VBAR' }
{'SVBAR' }
{'HBAR' }
STYLE {'SHBAR' }
{'LINE' }
{'XY' }
{'SCATTER' }
{style-field-name}
Specify 'PIE' to display a pie chart. 'PIE' is the default if the graph
style is not coded. The y-value for this graph determines the size of the
pie slice. The x-value for this graph determines the category for the
y-value. If you code SUMMARY, all y-values for each identical x-value are
summed producing a slice that is the size of the sum of all of the
y-values for this category.
Specify 'LINE' to display a line graph. The y-value determines the height
of the data point on the graph. The x-value determines the category for
the y-value. If you code SUMMARY, all y-values for each identical x-value
Página 128
EASYTRIEVE Tutorial
are summed producing a data point that is the sum of all of the y-values
for this category.
'Style-field-name' is a field you can define that contains the graph type
(one of the style literals described above).
5.3.2 Example
The following program code produces a vertical bar graph in low resolution
mode that displays the sum of the gross pay for each region without axis
headings.
Página 129
EASYTRIEVE Tutorial
5.4.1 Syntax
Parameters
For graphs, specify the text for the heading to be displayed for the field
on the VALUE statement. Multiple literals, each enclosed within single
quotes ('') and separated by one or more blanks within the parentheses,
are displayed on a single line with a space between each literal.
5.4.3 Examples
Statements:
Página 130
EASYTRIEVE Tutorial
NAME-LAST EMPNAME 8 A
NAME-FIRST EMPNAME +8 12 A
PAY-NET 90 4 P 2
JOB INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65
HEADING PAY-NET ('NET', 'PAY')
LINE EMPNAME SSN '* NO OVERTIME *' PAY-NET
Results:
SOCIAL
SECURITY NET
EMPNAME NUMBER PAY
The next example produces a vertical bar graph that displays the sum of
the gross pay for each region with user-specified headings:
The IDD FILE statement identifies a non-CA-IDMS file in the IDD and builds
file and field definitions.
5.5.1 Syntax
{HIGHEST}
IDD FILE file-name VERSION {LOWEST } +
{nnnn }
SELECT (record-name...) +
FILENAME new-file-name
Parameters
{HIGHEST}
VERSION {LOWEST }
{nnnn }
Página 131
EASYTRIEVE Tutorial
5.6.1 Syntax
Parameters
Página 132
EASYTRIEVE Tutorial
IDD entities are retrieved from the designated dictionary/node until the
environment is altered by issuing another IDD NAME statement. You can use
the IDD NAME statement as many times as required and before any other IDD
statement. However, the PROGRAM-NAME parameter can be used only once.
The IDD RECORD statement identifies and defines CA-IDMS and non-CA-IDMS
records. The record-name can be qualified by the record's version. The
elements defined within the record are used to generate field definitions
at the location specified.
5.7.1 Syntax
{HIGHEST}
IDD RECORD record-name VERSION {LOWEST } +
{nnnn }
{start-position}
{* +offset }
LOCATION { }
{W }
{S }
Parameters
{HIGHEST}
VERSION {LOWEST }
{nnnn }
Página 133
EASYTRIEVE Tutorial
The IDD SUBSCHEMA statement identifies the subschema and builds the file,
record, logical record, element record, and field definitions for a
subschema. The subschema can be qualified by the schema and schema's
version.
5.8.1 Syntax
Parameters
{HIGHEST}
SCHEMA schema-name VERSION {LOWEST }
{nnnn }
RESET The optional RESET parameter requests that all element records
under control of RETRIEVE be reset to binary zero immediately prior to
retrieving each root record.
Página 134
EASYTRIEVE Tutorial
You can use the optional SELECT parameter to request that only specific
records be defined. If the SELECT parameter is omitted, the definitions
of logical records are not generated. Only database records can be
defined in this way. The SELECT parameter must be used to generate
logical record definitions.
Use the IDD VERSION statement to set a global override of the Site Options
Table VERFILE, VERREC, and VERSCHM defaults.
5.9.1 Syntax
{HIGHEST}
IDD VERSION SCHEMA {LOWEST } +
{nnnn }
{HIGHEST}
FILE {LOWEST } +
{nnnn }
{HIGHEST}
RECORD {LOWEST }
{nnnn }
Parameters
{HIGHEST}
SCHEMA {LOWEST }
{nnnn }
{HIGHEST}
FILE {LOWEST }
{nnnn }
{HIGHEST}
RECORD {LOWEST }
{nnnn }
Página 135
EASYTRIEVE Tutorial
Other IDD statements appearing after the IDD VERSION statement, that have
VERSION parameters as part of their syntax but no VERSION parameter coded,
default to the version specified in the IDD VERSION statement. IDD
statements that have a VERSION parameter coded override the VERSION
statement. The defaults specified by the IDD VERSION statement remain in
effect until another IDD VERSION statement is issued.
You can code as many IDD VERSION statements as you require. If the IDD
VERSION statement is not used, the default versions are retrieved from the
Site Options Table.
5.10.1 Syntax
Format 1
{RECORD} {currency-field-name}
IDMS ACCEPT DBKEY receive-field-name {AREA } { }
{SET } {'currency-literal' }
Format 2
{NEXT } {set-field-name}
IDMS ACCEPT DBKEY receive-field-name {PRIOR} { }
{OWNER} {'set-literal' }
Parameters
Format 1
{RECORD}
{AREA }
{SET }
{currency-field-name}
{ }
{'currency-literal' }
Página 136
EASYTRIEVE Tutorial
Format 2
{NEXT }
{PRIOR}
{OWNER}
{set-field-name}
{ }
{'set-literal' }
5.11.1 Syntax
{proc-field-name}
IDMS ACCEPT PROCEDURE { } TO apib-field-name
{'proc-literal' }
Parameters
{proc-field-name}
{ }
{'proc-literal' }
Página 137
EASYTRIEVE Tutorial
5.12.1 Syntax
Parameters
See your CA-IDMS documentation for more information about the statistics
produced.
The IDMS BIND statement signs on the activity with the database management
system.
5.13.1 Syntax
{subschema-name }
IDMS BIND { } +
{'subschema-literal'}
{program-name }
PROGRAM-NAME { } +
{'program-literal'}
{db-name-table-name }
DBNAME { } +
{'db-name-table-literal'}
{node-name }
NODE { } +
{'node-literal'}
{dictionary-name }
DICTNAME { } +
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { }
{'dictionary-node-literal'}
Página 138
EASYTRIEVE Tutorial
Parameters
{subschema-name }
{ }
{'subschema-literal'}
{program-name }
PROGRAM-NAME { }
{'program-literal'}
{db-name-table-name }
DBNAME { }
{'db-name-table-literal'}
{node-name }
NODE { }
{'node-literal'}
{dictionary-name }
DICTNAME { }
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { }
{'dictionary-node-literal'}
Página 139
EASYTRIEVE Tutorial
The IDMS BIND FILE statement gives the database management system access
to the record in program storage.
5.14.1 Syntax
Parameters
5.15.1 Syntax
{proc-field-name}
IDMS BIND PROCEDURE { } TO receive-field-name
{'proc-literal' }
Parameters
{proc-field-name}
{ }
{'proc-literal' }
Página 140
EASYTRIEVE Tutorial
5.16.1 Syntax
Parameters
ALL This optional parameter controls which locks are released. The
default is ALL EXCEPT THOSE HELD.
5.17.1 Syntax
{record-field-name} {set-field-name}
IDMS CONNECT RECORD { } SET { }
{'record-literal' } {'set-literal' }
Parameters
{record-field-name}
{ }
{'record-literal' }
{set-field-name}
{ }
{'set-literal' }
Página 141
EASYTRIEVE Tutorial
5.18.1 Syntax
{record-field-name} {set-field-name}
IDMS DISCONNECT RECORD { } SET { }
{'record-literal' } {'set-literal' }
Parameters
{record-field-name}
RECORD { }
{'record-literal' }
{set-field-name}
SET { }
{'set-literal' }
5.19.1 Syntax
Format 1
MEMBERS
{record-field-name} PERMANENT
IDMS ERASE RECORD { }
{'record-literal' } SELECTIVE
ALL
Format 2
Parameters
Format 1
{record-field-name}
RECORD { }
{'record-literal' }
Página 142
EASYTRIEVE Tutorial
MEMBERS
PERMANENT
SELECTIVE
ALL
Format 2
The IDMS FIND and IDMS OBTAIN statements are described together because
their formats are the same. The IDMS FIND statement only locates
(positions to) a record; the IDMS OBTAIN statement locates and then
retrieves a record. These statements have six formats:
Página 143
EASYTRIEVE Tutorial
5.20.1 Syntax
Format 1
Format 2
Format 3
Format 4
Format 5
Format 6
{control-field-name} SHARE|SHR
USING ({ }...)
{'control-literal' } EXCLUSIVE|EXC
Parameters
Format 1
{key-field-name}
DBKEY { }
{'key-literal' }
Página 144
EASYTRIEVE Tutorial
{record-field-name}
RECORD{ }
{'record-literal' }
SHARE|SHR
EXCLUSIVE|EXC
Format 2
{RECORD} {field-name}
{SET } { }
{AREA } {'literal' }
SHARE|SHR
EXCLUSIVE|EXC
Format 3
{NEXT }
{PRIOR }
{FIRST }
{LAST }
{ {nth-field-name} }
{NTH { } }
{ {nth-literal } }
{record-field-name}
RECORD { }
{'record-literal' }
Página 145
EASYTRIEVE Tutorial
{SET }{search-field-name}
{ }{ }
{AREA}{'search-literal' }
SHARE|SHR
EXCLUSIVE|EXC
Format 4
{set-field-name}
OWNER SET { }
{'set-literal' }
SHARE|SHR
EXCLUSIVE|EXC
{CALC }
{ }
{DUPLICATE}
{record-field-name}
RECORD { }
{'record-literal' }
SHARE|SHR
EXCLUSIVE|EXC
Página 146
EASYTRIEVE Tutorial
Format 6
CURRENT This optional parameter controls the start of the search. The
default begins with the owner of the current record within the set.
{record-field-name}
RECORD { }
{'record-literal' }
{set-field-name}
SET { }
{'set-literal' }
{control-field-name}
USING ({ } ...)
{'control-literal' }
SHARE|SHR
EXCLUSIVE|EXC
The IDMS FINISH statement signs off the database management system.
5.21.1 Syntax
IDMS FINISH
Página 147
EASYTRIEVE Tutorial
5.22.1 Syntax
{record-field-name}
IDMS GET RECORD { }
{'record-literal' }
Parameters
{record-field-name}
RECORD { }
{'record-literal' }
5.23.1 Syntax
{MEMBER }
{set-field-name} {NOMEMBER}
IDMS IF SET { } { }
{'set-literal' } {EMPTY }
{NOEMPTY }
Parameters
{set-field-name}
SET { }
{'set-literal' }
{MEMBER }
{NOMEMBER}
{ }
{EMPTY }
{NOEMPTY }
Página 148
EASYTRIEVE Tutorial
5.24.1 Syntax
{RECORD} {field-name}
IDMS KEEP {SET } { } EXCLUSIVE
{AREA } {'literal' }
Parameters
{RECORD} {field-name}
{SET } { }
{AREA } {'literal' }
EXCLUSIVE This optional parameter controls the lock for the record.
The default is SHARED LOCK.
5.25.1 Syntax
Format 1
{record-field-name}
IDMS MODIFY RECORD { }
{'record-literal' }
Format 2
Página 149
EASYTRIEVE Tutorial
Parameters
Format 1
{record-field-name}
RECORD { }
{'record-literal' }
Format 2
5.26.1 Syntax
{FIRST}
IDMS OBTAIN { } RECORD logical-record-name WHERE(boolean-expression)
{NEXT }
Parameters
{FIRST}
{ }
{NEXT }
Página 150
EASYTRIEVE Tutorial
The IDMS READY statement establishes area availability with the database
manager.
5.27.1 Syntax
Parameters
{area-field-name}
AREA { }
{'area-literal' }
{RETRIEVAL} PROTECTED
{ }
{UPDATE } EXCLUSIVE
The IDMS RETURN statement retrieves the database key for an indexed record
without retrieving the record itself.
5.28.1 Syntax
{set-field-name}
IDMS RETURN DBKEY receive-field-name FROM { } +
{'set-literal' }
KEY symbolic-key +
{ }
{CURRENCY }
{FIRST CURRENCY }
{LAST CURRENCY }
{NEXT CURRENCY }
{PRIOR CURRENCY }
{ }
{ {key-field-name} }
{USING ({ } ...)}
{ {'key-literal' } }
Página 151
EASYTRIEVE Tutorial
Parameters
{set-field-name}
FROM { }
{'set-literal' }
{ }
{CURRENCY }
{FIRST CURRENCY }
{LAST CURRENCY }
{NEXT CURRENCY }
{PRIOR CURRENCY }
{ }
{ {key-field-name} }
{USING ({ } ...)}
{ {'key-literal' } }
These parameters determine the record for which the database key is
returned:
* USING - the first index entry whose symbolic key matches the
key-field-name or 'key-literal'. If no such entry exists, a
status code of 1726 (INDEX ENTRY NOT FOUND) is returned. The
attributes of key-field-name or 'key-literal' must match the
symbolic key of the index.
Página 152
EASYTRIEVE Tutorial
5.29.1 Syntax
Parameters
CONTINUE This optional parameter specifies the action taken after the
recovery. The default is to terminate the run-unit.
Format 1 of the IDMS STORE statement places a new record occurrence into
the database. Format 2 places a new logical record occurrence into the
database.
5.30.1 Syntax
Format 1
{record-field-name}
IDMS STORE RECORD { }
{'record-literal' }
Format 2
Parameters
Format 1
{record-field-name}
RECORD { }
{'record-literal' }
Format 2
Página 153
EASYTRIEVE Tutorial
5.31.1 Syntax
IF conditional-expression-1
statement-1
ELSE-IF conditional-expression-2 . . .
statement-2
ELSE
statement-3
END-IF
The following diagram illustrates IF, ELSE-IF, ELSE, and END-IF logic:
PICTURE 9
Parameters
Página 154
EASYTRIEVE Tutorial
5.31.3 Examples
Página 155
EASYTRIEVE Tutorial
Página 156
EASYTRIEVE Tutorial
5.32.1 Syntax
INITIATION. PROC
You use INITIATION to perform actions that are to be executed only once.
Typically you use INITIATION to initialize a field or position a file at a
specific starting position.
5.32.3 Example
INITIATION. PROC
MESSAGE 'Enter an employee number.' LEVEL INFORMATION
MOVE ZERO TO EMP-NO
MOVE SPACES TO EMPNAME
END-PROC
5.33.1 Syntax
Parameters
Página 157
EASYTRIEVE Tutorial
INSERT does not require an open cursor. If a cursor for the file is not
open, one is not opened automatically. If a cursor is open, the inserted
record does not appear in the cursor's result set until the cursor is
closed and re-opened with a new SELECT statement.
5.33.3 Example
5.34.1 Syntax
JOB +
{(file-name KEY field-name-1...)...)}
INPUT {NULL } +
{SQL }
START start-proc-name +
FINISH finish-proc-name +
NAME job-name +
ACTIVITY TERMINAL
COMMIT ( )
NOACTIVITY NOTERMINAL
Parameters
Página 158
EASYTRIEVE Tutorial
Note: Except in CICS, CA-Easytrieve issues a GET HOLD for a VSAM file
with the UPDATE parameter as automatic input. This allows you to update
an automatic input file in all environments except CICS.
Note: Synchronized file processing is not allowed for CA-IDMS and IMS/DLI
database files.
Página 159
EASYTRIEVE Tutorial
NAME job-name The NAME parameter names the JOB activity. Job-name can:
ACTIVITY TERMINAL
COMMIT ( )
NOACTIVITY NOTERMINAL
Specify the COMMIT parameter to control the logical unit of work. COMMIT
indicates when the activity commits recoverable work. Each commit point
posts all updates, additions and deletions, terminates holds, and closes
SQL cursors.
Specify TERMINAL to commit all recoverable work during any terminal I/O
operation. In CICS, this results in terminal I/O being performed in a
pseudo-conversational mode. Specify NOTERMINAL to tell CA-Easytrieve not
to commit during a terminal I/O. TERMINAL is the default.
Note: You can also issue your own COMMIT and ROLLBACK statements to
commit or recover work on a controlled basis.
The JOB statement can also identify the name of an automatic input file
(which can be any file or database that is processed sequentially).
Página 160
EASYTRIEVE Tutorial
Environment
...
Library
...
Activities {JOB...
... {...
JOB, SCREEN <------------- { job procedures
and/or { ...
SORT { ...
... { reports
... { ...
5.34.3 Examples
5.35.1 Syntax
EXIT
KEY key-name THRU key-name...NAME 'literal' IMMEDIATE
REFRESH
Parameters
Página 161
EASYTRIEVE Tutorial
---------------------------------------
Terminal Key Symbolic Constant
Name Value
---------------------------------------
Enter ENTER 1
---------------------------------------
Clear CLEAR 11
---------------------------------------
PA1 thru PA3 PA1 thru 12 thru 14
PA3
---------------------------------------
PF1 thru PF24 F1 thru F24 21 thru 44
---------------------------------------
F1 thru F12 F1 thru F12 21 thru 32
---------------------------------------
Note: Only terminal keys with a KEY-PRESSED symbolic name can be used on
a KEY statement. If other terminal keys (such as test request) are
required, you must test KEY-PRESSED using the constant value of the
terminal key in your program code. If you test for terminal keys without
a symbolic name, you cannot code KEY statements in your program.
the PA1, PA2, and PA3 keys are also valid. The constant values of the PA
keys (12, 13, 14) fall between the value for CLEAR (11) and F12 (32).
key-name=literal
For example:
To display only the key-name on a screen, code NAME 'literal' with a blank
space between single quotes (' ').
Página 162
EASYTRIEVE Tutorial
EXIT
REFRESH
Optionally, you can code EXIT or REFRESH to specify the branch action
taken when a user presses key-name. If EXIT or REFRESH is specified, the
action is automatically executed by CA-Easytrieve and the AFTER-SCREEN
procedure (if any) is not executed.
Specify EXIT to terminate the screen activity after editing and extracting
data from screen fields into program fields.
If an action is not specified for key-name, you can test for key-name in
your SCREEN activity procedures with the system-defined field,
KEY-PRESSED.
If no KEY statements are coded, all keys are valid and you must provide
code for all keys in your SCREEN activity procedures.
The function key area is built depending on the sequence of keys specified
in KEY statements. You must specify keys in the order you want them
displayed.
The key display area is built on the bottom line of a screen. If the key
display area requires additional lines because of the number of keys and
the length of the descriptive text, additional lines at the bottom of the
screen are used.
REFRESH can also be invoked by using the REFRESH statement. See the
REFRESH Statement for more information.
Note: If you specify that one or more message areas use the same screen
row as the function key area, messages might overlap the function key
Página 163
EASYTRIEVE Tutorial
area. The default for the message area is the row immediately preceding
the key display area.
Note: The CLEAR, PA1, PA2, and PA3 keys do not transmit data from the
screen to the program. Also, cursor positioning cannot be ascertained
when these keys are pressed.
5.35.3 Examples
------------------------------------------------------
Code Meaning
------------------------------------------------------
KEY F1 F1 is valid, but nothing is
displayed on the screen. You must
provide code.
------------------------------------------------------
KEY F1 THRU F24 F1 through F24 are valid keys, but
nothing is displayed on the screen.
You must provide code for all keys.
------------------------------------------------------
KEY F1 NAME 'Help' F1 is valid. F1=Help is displayed
on the screen. You must provide
code.
------------------------------------------------------
KEY F1 F4 F1 and F4 are valid keys, but
nothing is displayed on the screen.
You must provide code.
------------------------------------------------------
KEY F1 THRU F4, F8 F1, F2, F3, F4, and F8 are valid
keys, but nothing is displayed on
the screen. You must provide code
for all keys.
------------------------------------------------------
KEY F12 EXIT NAME F12 terminates the screen activity
+ without moving data from screen
'CANCEL' IMMEDIATE fields into program fields. The
AFTER-SCREEN procedure (if any) is
not executed. F12=CANCEL is
displayed on the screen.
------------------------------------------------------
KEY F3 IMMEDIATE The AFTER-SCREEN procedure (if any)
is executed without editing or
moving data in screen fields to
program fields. Nothing is
displayed on the screen. You must
provide code for F3.
------------------------------------------------------
KEY F3 EXIT F3 terminates the activity after
editing and moving data from the
screen.
------------------------------------------------------
KEY F5 IMMEDIATE + F5 ignores the data on the screen
REFRESH NAME + and rebuilds the screen with the
'Refresh' values currently in memory.
F5=Refresh is displayed on the
screen.
------------------------------------------------------
Página 164
EASYTRIEVE Tutorial
The LINE statement defines the contents of a report line. One or more
field values or literals can be contained on a report line; each one is a
line item. The data format of the field or literal remains unchanged.
5.36.1 Syntax
{ field-name }
{#font-number }
{ 'literal' }
LINE line-number {+offset } ...
{-offset }
{COL column-number }
{POS position-number }
Parameters
{+offset}
{ }
{-offset}
Página 165
EASYTRIEVE Tutorial
{COL column-number} COL specifies the column number where the next line
item is placed. The value of column-number has a valid range of 1 to
'nnn,' where 'nnn' cannot be so large that the following line item extends
beyond the end of the line defined by LINESIZE.
Note: You must specify the NOADJUST parameter on the REPORT statement to
use the COL parameter.
5.36.3 Example
The LINK statement is used to transfer control from the current program
(parent program) to another named program (child program). When the child
program terminates, execution is then returned to the statement following
the LINK statement in the parent program.
5.37.1 Syntax
{program-field-name}
LINK { } +
{'program-name' }
{field-name}
USING { } +
{'literal' }
GIVING field-name +
HOST +
WAIT wait-time +
NOENTER
Página 166
EASYTRIEVE Tutorial
Parameters
{program-field-name}
{ }
{'program-name' }
Program-field-name is the name of the field that contains the name of the
program to which you want to LINK.
{field-name}
USING { }
{'literal' }
Note: If the child program returns a value, but the GIVING parameter is
not specified, the value is ignored. Not all operating systems allow the
child program to return data to the parent program.
LINK can be used to invoke any program written in any language that is
supported by the operating system in which the program is executing,
including CA-Easytrieve. Similarly, the program can issue any command
supported by the operating system.
A program invoked using the LINK statement can issue terminal I/O or
display reports, but only in fully-conversational mode. See the
CA-Easytrieve Programmer Guide for more information.
Página 167
EASYTRIEVE Tutorial
Note: If you code the USING or GIVING parameter on the LINK statement,
you must code a PROGRAM statement to handle the parameters in the child
program when it is written in CA-Easytrieve.
5.37.3 Example
5.38.1 Syntax
ON MACROS
LIST
OFF NOMACROS
Parameters
ON
OFF
MACROS
NOMACROS
LIST OFF
PARM LIST(NOPARM)
Página 168
EASYTRIEVE Tutorial
5.39.1 Syntax
LOGICAL-RECORD record-name
Parameters
5.40.1 Syntax
MACRO positional-count +
positional-parameters ... keyword-parameters ...
Parameters
Página 169
EASYTRIEVE Tutorial
Keyword-parameters have two parts: the keyword name and the default value.
5.40.2 Examples
MACRO
...
...
Macros with both positional and keyword-parameters require that you supply
positional-parameters first, and also supply a positional-count.
Página 170
EASYTRIEVE Tutorial
The optional MASK parameter establishes a pattern (edit mask) for a field
name. The MASK parameter can be coded in the syntax of the following
CA-Easytrieve statements:
* DEFINE
* ROW
5.41.1 Syntax
MASK ({mask-identifierBWZ'mask-literal'|HEX })
BWZ The BWZ (blank when zero) option suppresses the display of
field-name when it contains all zeros. BWZ can be used by itself or with
other options on the MASK parameter.
Note: HEX edit masks are not allowed for VARYING fields.
* The MASK parameter of the DEFINE and ROW statements specifies the
edit mask pattern.
Symbol Meaning
9 Prints a digit.
Z Prints a digit, except for leading zeros.
* Prints asterisks instead of leading zeros.
- Prints a minus sign prior to the first non-zero
digit of a negative number.
Página 171
EASYTRIEVE Tutorial
Decimal Digits
Alphanumeric Fields
Currency Symbols
Insertion Symbols
All other symbols before the last digit position are treated as
insertion symbols, including Z, $, -, and *. The symbols ,
(comma) and . (period) can also be used as insertion symbols.
For example, in the mask 'ZZZ,999.99,' the comma always prints. In the
mask 'ZZZ,Z99,99,' the comma prints only if the digit prior to the comma
is non-zero.
Página 172
EASYTRIEVE Tutorial
Fill Characters
Negative Indicators
Number of
Decimals Mask
none ZZZZZZZZZZZZZZZZZZ *
0 ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ-
1 ZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.9-
2 Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.99-
3 ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.999-
4 ZZ,ZZZ,ZZZ,ZZZ,ZZZ.9999-
5 Z,ZZZ,ZZZ,ZZZ,ZZZ.99999-
6 ZZZ,ZZZ,ZZZ,ZZZ.999999-
7 ZZ,ZZZ,ZZZ,ZZZ.9999999-
8 Z,ZZZ,ZZZ,ZZZ.99999999-
9 ZZZ,ZZZ,ZZZ.999999999-
10 ZZ,ZZZ,ZZZ.9999999999-
11 Z,ZZZ,ZZZ.99999999999-
12 ZZZ,ZZZ.999999999999-
13 ZZ,ZZZ.9999999999999-
14 Z,ZZZ.99999999999999-
15 ZZZ.999999999999999-
16 ZZ.9999999999999999-
17 Z.99999999999999999-
18 .999999999999999999-
* For zoned decimal fields with no decimals, the default mask
is '999999999999999999'.
Your system administrator can define additional edit masks in the Site
Options Table when CA-Easytrieve is installed.
Página 173
EASYTRIEVE Tutorial
Displaying
When leading zeros are an important part of the number (such as social
security numbers and part numbers) an edit mask that displays these zeroes
is essential. Following are examples of edit masks that display leading
zeros:
--------------------------------------------
Mask Field Contents Displayed
Results
--------------------------------------------
999-99-9999 053707163 053-70-7163
--------------------------------------------
(99)-9999 006421 (00)-6421
--------------------------------------------
Suppressing
------------------------------------------
Mask Field Contents Displayed
Results
------------------------------------------
$$,$$9 01234 $1,234
------------------------------------------
$$,$$9 00008 $8
------------------------------------------
$$,$$9.99 0123456 $1,234.56
------------------------------------------
ZZZ,ZZ9 000123 123
------------------------------------------
---,--9 +001234 1,234
------------------------------------------
---,--9 -001234 -1,234
------------------------------------------
Replacing
-------------------------------------------
Mask Field Contents Displayed
Results
-------------------------------------------
**9 001 **1
-------------------------------------------
**,**9 01234 *1,234
-------------------------------------------
**,**9.99 0123456 *1,234.56
-------------------------------------------
Página 174
EASYTRIEVE Tutorial
------------------------------------------
Mask Field Contents Displayed
Results
------------------------------------------
ZZZ- -123 123-
------------------------------------------
ZZZ- +123 123
------------------------------------------
ZZZ CR -123 123 CR
------------------------------------------
ZZZ CR +123 123
------------------------------------------
ZZZ IS MINUS -123 123 IS
MINUS
------------------------------------------
5.41.6 Examples
PICTURE 10
5.42.1 Syntax
MEND
Página 175
EASYTRIEVE Tutorial
The MESSAGE statement allows you to issue your own specific messages for a
screen activity. You define the message type and specify the message text
using the MESSAGE statement.
5.43.1 Syntax
MESSAGE {'literal' }
{ } ... +
{field-name}
{INFORMATION}
LEVEL {WARNING }
{ACTION }
Parameters
{'literal' }
{ }
{field-name}
Use 'literal' to define the text you want displayed in the message. Use
field-name to specify a field whose contents you want displayed as part of
the message. A message can consist of a combination of literals and
field-names.
{INFORMATION}
LEVEL {WARNING }
{ACTION }
ACTION messages are the most severe. They tell a user that an error has
occurred and an action is required to correct the error before he can
continue. ACTION is the default message level if no level is specified.
Página 176
EASYTRIEVE Tutorial
(The default message area is one line above the function key display area
at the bottom of the screen.) You can also use the DEFAULT statement to
override default message attributes.
If different levels of messages are displayed on the same line (by default
or override), then the message displayed is controlled by message
precedence. If two messages are sent to the same line on the screen, the
message with the highest severity is displayed. The severity precedence
from highest to lowest is:
* ACTION
* WARNING
* INFORMATION
5.43.3 Example
MOVE transfers character strings from one storage location to another. The
MOVE statement is especially useful for moving data without conversion and
for moving variable length data strings.
5.44.1 Syntax
Format 1
{send-file-name }
{send-record-name} send-length-field
MOVE { } +
{send-field-name } send-length-literal
{send-literal }
{receive-file-name } receive-length-field
TO {receive-record-name} FILL fill-character
{receive-field-name } receive-length-literal
Format 2
{NULL }
{SPACE }
{SPACES}
MOVE { } TO receive-field-name ...
{ZERO }
{ZEROS }
{ZEROES}
Página 177
EASYTRIEVE Tutorial
Parameters
Format 1
{send-file-name }
{send-record-name}
{ }
{send-field-name }
{send-literal }
send-length-field
send-length-literal
You can override the length of the sending field with the current value of
send-length-field or send-length-literal.
{receive-file-name }
{receive-record-name}
{receive-field-name }
receive-length-field
receive-length-literal
You can override the length of the receiving field with the current value
of receive-length-field or receive-length-literal.
Format 2
{NULL }
{SPACE }
{SPACES}
{ }
{ZERO }
{ZEROS }
{ZEROES}
Página 178
EASYTRIEVE Tutorial
The first parameter after the MOVE keyword (NULL, SPACE, SPACES, ZERO,
ZEROS, or ZEROES) identifies the sending data area. The default length of
the field is the defined length of receive-field-name. Moving spaces or
zeros to a field fills the entire field with the selected character.
Moving nulls sets a nullable field to NULL. Moving spaces or zeros sets a
nullable field to NOT NULL.
When you specify Format 1 parameters, data moves from left to right as if
both areas were alphanumeric. The data moved is unconverted.
Send-file-name and receive-file-name can be any file in which data is
currently available. See Assignment and Moves in the "Coding a
CA-Easytrieve Program" chapter of the CA-Easytrieve Programmer Guide for
MOVE statement specification rules.
5.44.3 Examples
Statements:
Página 179
EASYTRIEVE Tutorial
Results:
0000000099 66
0000000000 00
==========
**********
The MOVE LIKE statement moves the contents of fields with identical names
from one file, record, or working storage to another. Data movement and
conversion follow the rules of the Assignment statement.
5.45.1 Syntax
{send-file-name } {receive-file-name }
MOVE LIKE { } TO { }
{send-record-name} {receive-record-name}
Parameters
{send-file-name }
{ }
{send-record-name}
{receive-file-name }
{ }
{receive-record-name}
Note: The order in which fields are processed differs from previous
versions of CA-Easytrieve. In previous versions, the moves occurred
starting with the last identically-named field in receive-file-name or
receive-record-name and ended with the first identically-named field in
the file.
Página 180
EASYTRIEVE Tutorial
In IDD processing, MOVE LIKE assigns a new value to the receiving field if
all of the following conditions are met:
The differences between the MOVE LIKE statement and the MOVE statement are
as follows:
5.45.5 Example
Página 181
EASYTRIEVE Tutorial
MYFILE:NAME-FIRST = PERSNL:NAME-FIRST
MYFILE:NAME-LAST = PERSNL:NAME-LAST
MYFILE:NAME = PERSNL:NAME
MYFILE:BRANCH = PERSNL:BRANCH
MYFILE:REGION = PERSNL:REGION
Whatever values were in the fields of the file PERSNL are now found in the
fields of the file MYFILE.
5.46.1 Syntax
MSTART macro-name
Parameters
macro-name Specify the name of the macro. Macro-name must be from one to
eight characters in length. The first character must be alphabetic.
Página 182
EASYTRIEVE Tutorial
6.0 Statements N - R
6.1 NEWPAGE Statement
NEWPAGE is a listing control statement that ejects the printer to the top
of the next page before printing the next line of the source program on
the statement listing.
6.1.1 Syntax
NEWPAGE
The PARM statement allows you to override selected general standards for a
program that are set in the Site Options Table. Alteration of the
environment with the PARM statement lasts for only as long as the program
is running.
6.2.1 Syntax
PARM +
{SNAP }
ABEXIT {NOSNAP} +
{NO }
{DYNAMIC }
BIND {STATIC-ONLY} +
{ANY }
{STATIC }
CALL { } +
{DYNAMIC}
{EBCDIC }
CODE PROCESS {ASCII } +
{dbcs-code-name}
COMPILE +
Página 183
EASYTRIEVE Tutorial
STATE XREF
{LONG }
FLOWSIZ number-of-table-entries { } ) +
NOSTATE NOXREF {SHORT}
LINK (program-name R) +
{PARM }
LIST { } +
{NOPARM}
PLANOPTS 'plan-options-module' +
SORT +
{NO }
(ALTSEQ { } +
{(YES alt-sort-table)}
DEVICE device-type +
{storage-amount }
MEMORY { } +
{(MAX -storage-released)}
{ALL CONSOLE }
{ PRINTER }
{ }
MSG ( {CRITICAL CONSOLE } ) +
{ PRINTER }
{DEFAULT }
{NO }
RELEASE core-storage-amount +
WORK number-of-work-data-sets) +
SQLID 'auth-id' +
{FULL }
SQLSYNTAX {PARTIAL} +
{NONE }
SSID 'ssid' +
SYNTAX +
TRANSID 'transid' +
{DISK }
VFM (buffer-core-storage DEVICE { } ) +
{MEMORY}
{YES}
Página 184
EASYTRIEVE Tutorial
WORKFILE ( { } BLOCKMAX )
{NO }
Parameters
{SNAP }
ABEXIT {NOSNAP}
{NO }
{DYNAMIC }
BIND {STATIC-ONLY}
{ANY }
BIND is an SQL-related parameter that identifies the type of SQL bind that
you want for the execution of your application program. BIND is currently
only used by the DB2 SQL interface. It is ignored in other environments.
BIND STATIC-ONLY or BIND ANY requires a value for the PLAN and LINK
parameters. PLAN specifies the name of the "static-command-program" and
its DB2 PLAN name. LINK identifies the load module name of your
link-edited CA-Easytrieve program. Your CA-Easytrieve application program
must run as a link-edited program for static SQL processing.
Note: Regardless of the option you specify for the BIND parameter, your
program is dynamically processed when being processed by the interpreter,
that is, whenever the CHECK or RUN commands are executed.
Página 185
EASYTRIEVE Tutorial
-------------|---------------------------------------------------|
| |
BIND | Value Specified in the Options Table |
Parameter | |
|---------------------------------------------------|
|
Value | blank A S D
Specified |
-------------|---------------------------------------------------
{STATIC }
CALL { }
{DYNAMIC}
{EBCDIC }
CODE PROCESS {ASCII }
{dbcs-code-name}
(Mainframe DBCS) Use CODE dbcs-code-name to define the DBCS code system to
be used for all K and M fields for this file. If not specified here, the
default is taken from the processing code system as defined in the CA-PSI
Subsystems DBCS Options Table.
Página 186
EASYTRIEVE Tutorial
CLIST
NOCLIST
PMAP
NOPMAP
DMAP
NODMAP
DMAP creates a listing of the data map for each file and its associated
fields. NODMAP inhibits this operation.
FLDCHK
NOFLDCHK
FLOW
NOFLOW
FLOWSIZ number-of-table-entries
FLOWSIZ establishes the number of entries in the trace table for the flow
option. Number-of-table-entries is a numeric value from 1 to 4096.
FLOWSIZ is ignored on the workstation.
STATE
NOSTATE
XREF {LONG }
{ }
NOXREF {SHORT}
Página 187
EASYTRIEVE Tutorial
XREF causes the creation of a cross reference listing of each field name,
file name, procedure name, screen name, report name, and statement label.
LONG implies that entries are listed even though they are not referenced.
SHORT causes only referenced entries to be listed. NOXREF inhibits this
operation. XREF and NOXREF are ignored on the workstation.
LINK (program-name R)
LINK terminates execution after the completion of syntax check and compile
operations. On the mainframe, program-name is used to create the link
edit control statement that names the program. In MVS systems, the
optional subparameter R specifies that the program replaces an existing
program with the same name. On the workstation, program-name names the
file containing the object module (.OBJ).
{PARM }
LIST { }
{NOPARM}
The value specified for planname must be the name of the DB2 PLAN that
identifies the DBRM of the given "static-command-program." See the "SQL
Database Processing" chapter in the CA-Easytrieve Programmer Guide for
information about how to generate the "static-command-program."
Use PLANOPTS to specify the name of the plan options module that is to
override the default CA-Pan/SQL plan options module, DQSMPLN@. See the
CA-Pan/SQL SQL Interface Installation Guide for more information about
generating a plan options module.
Página 188
EASYTRIEVE Tutorial
For the SQL/DS SQL interface, the PREPNAME parameter enables you to
specify the name of the access module or "package" that is to be
associated with the SQL statements for this application program.
For the CA-Datacom SQL interface, PREPNAME enables you to specify the
access plan.
For either database, The PREPNAME parameter also enables you to specify an
owner ID ('access-userid') for the access module or access plan. See your
specific database documentation for information about obtaining an
authorization ID.
Note: You should specify a unique value for the SQL-access-module for
each CA-Easytrieve program. If you use the same name for either parameter
value, database catalog contention can occur, or an existing access module
could be replaced with another one. See your database administrator for
information about establishing naming conventions.
SORT SORT overrides the default parameters used to interface with your
installation's sort program. See the installation procedures on your
product tape for details of these SORT parameters.
{NO }
ALTSEQ { }
{(YES alt-sort-table)}
ALTSEQ identifies the collating sequence table for the sort process. NO
indicates usage of the standard table. YES identifies an alternate table.
Alt-sort-table specifies the name of the table that you provide. When you
omit alt-sort-table, the default name is EZTPAQTT.
DEVICE device-type
DEVICE specifies the device type for dynamically allocated sort work data
sets. Device-type can be any valid unit name or generic device type.
DEVICE is ignored on the workstation.
{storage-amount }
MEMORY { }
{(MAX -storage-released)}
MEMORY specifies the maximum amount of core storage used by the sort
program. Storage-amount is the amount of storage made available for the
sort and must be a value from 16 to 4096. MAX allows the sort program to
obtain maximum storage available. Storage-released is the amount of
storage released (for system use) after the MAX amount has been reserved.
A minus sign must immediately precede storage-released. Storage-amount
and storage-released values represent 1024-byte units of storage. MEMORY
is ignored on the workstation.
Página 189
EASYTRIEVE Tutorial
{ALL CONSOLE }
{ PRINTER }
{ }
MSG ( {CRITICAL CONSOLE } )
{ PRINTER }
{DEFAULT }
{NO }
ALL outputs all messages. CRITICAL outputs only critical level messages.
DEFAULT outputs messages at the level specified when the sort program was
installed. NO outputs no messages.
For ALL or CRITICAL messages, specify the location at which messages are
received: PRINTER or CONSOLE.
Página 190
EASYTRIEVE Tutorial
{FULL }
SQLSYNTAX {PARTIAL}
{NONE }
Specify NONE with a BIND STATIC-ONLY parameter if you want syntax checking
to be performed by the DB2 preprocessor in a batch environment. NONE
causes partial syntax checking, as described above. If no compile errors
are found, your program executes, unless CA-Easytrieve errors are found.
No connection is made to the DBMS catalog unless you have coded the SQL
INCLUDE statement. If you coded an SQL INCLUDE statement, your DBMS
catalog must be available to CA-Easytrieve.
You can use SSID to specify the DB2 subsystem ID. If you specify this
value, it is used at both compile and runtime. If you do not specify the
DB2 subsystem ID, the subsystem ID from the Site Options Table is used.
You can use SSID to specify the name of the database to which this session
will connect. If you do not specify the subsystem ID, the subsystem ID
from the Site Options Table is used.
Página 191
EASYTRIEVE Tutorial
check operation.
For SQL/DS:
You can use USERID to specify a valid userid and password for an explicit
CONNECT.
For CA-IDMS:
You can use 'connect-userid' to specify the CA-IDMS dictionary name for an
explicit CONNECT. If you do not specify USERID, an implicit connection
occurs according to the rules of the given database system.
You can use 'connect-userid' to specify the user identifier under which
this session will run. If you do not specify USERID, an explicit
connection occurs without an 'identified-by' clause. 'Password' is
ignored.
{DISK }
VFM (buffer-core-storage DEVICE { } )
{MEMORY}
VFM establishes the work area parameters used by the CA-Easytrieve Virtual
File Manager access method.
DEVICE DISK reverts to disk device usage when the site option default is
DEVICE MEMORY. DEVICE MEMORY inhibits the use of an overflow device.
{YES}
WORKFILE ( { } BLOCKMAX )
{NO }
Use WORKFILE YES instead of VFM if you have multiple large reports in your
program. NO is the default. In MVS systems that take advantage of the
system-defined blocksize feature, use BLOCKMAX to automatically set the
blocksize in your JCL to the largest possible blocksize for the track.
See PRINT Statement Processing in the "Report Processing" chapter in the
CA-Easytrieve Programmer Guide for more information.
Página 192
EASYTRIEVE Tutorial
Code PARM statement parameters and their subparameters in any order. You
must code multiple subparameters within parentheses.
6.2.3 Examples
Página 193
EASYTRIEVE Tutorial
PERFORM transfers control to a procedure and, after the procedure has been
executed, returns control to the next executable statement after the
PERFORM statement.
6.3.1 Syntax
PERFORM proc-name
Parameters
6.3.3 Example
Página 194
EASYTRIEVE Tutorial
6.4.1 Syntax
{= }
{EQ} {field-name}
POINT file-name PRIOR {GE} { } STATUS
{GQ} {literal }
{>=}
Parameters
PRIOR Specify PRIOR if you want to use PRIOR on the GET statement. See
the GET Statement for more information.
{= }
{EQ}
{GE}
{GQ}
{>=}
{field-name}
{ }
{literal }
STATUS Specify the STATUS parameter whenever the possibility exists for
an unsatisfactory completion of the input/output request..
Página 195
EASYTRIEVE Tutorial
If you do not code STATUS and the operating system returns a non-zero
status, CA-Easytrieve issues an appropriate diagnostic message.
You cannot use a file presence test (IF file-name) to test the success of
a POINT.
GE is not supported for POINT PRIOR when the underlying access method does
not support it.
6.4.3 Example
Página 196
EASYTRIEVE Tutorial
6.5.1 Syntax
POP
You can place POP statements anywhere in the CA-Easytrieve source code.
POP must be on a record by itself. POP does not appear in the printed
output.
The PRINT statement produces report output. Issue the PRINT statement to
initiate a printed line.
6.6.1 Syntax
PRINT report-name
Parameters
Página 197
EASYTRIEVE Tutorial
6.6.3 Example
6.7.1 Syntax
Format 1
proc-name. PROC
statement-1
...
statement-n
END-PROC
Format 2
proc-name
PROC
statement-1
...
statement-n
END-PROC
Parameters
Página 198
EASYTRIEVE Tutorial
In most cases, you can code any statement in a procedure. However, you
cannot code certain input/output statements (such as GET, PUT) in
procedures invoked during SORT or REPORT processing.
--------------------------------------
Screen Procedures Report Procedures
--------------------------------------
AFTER-SCREEN AFTER-BREAK
--------------------------------------
BEFORE-SCREEN AFTER-LINE
--------------------------------------
INITIATION BEFORE-BREAK
--------------------------------------
TERMINATION BEFORE-LINE
--------------------------------------
ENDPAGE
--------------------------------------
REPORT-INPUT
--------------------------------------
TERMINATION
--------------------------------------
Página 199
EASYTRIEVE Tutorial
6.8.1 Syntax
ACTIVITY TERMINAL
PROGRAM NAME program-name COMMIT ( ) +
NOACTIVITY NOTERMINAL
Parameters
ACTIVITY TERMINAL
COMMIT ( )
NOACTIVITY NOTERMINAL
Specify the COMMIT parameter to control the logical unit of work. COMMIT
indicates when the activity commits recoverable work. Each commit point
posts all updates, additions and deletions, terminates holds, and closes
SQL cursors.
Specify TERMINAL to commit all recoverable work during any terminal I/O
operation. In CICS, this results in terminal I/O being performed in a
pseudo-conversational mode. Specify NOTERMINAL to tell CA-Easytrieve not
to commit during a terminal I/O. TERMINAL is the default.
Note: You can also issue your own COMMIT and ROLLBACK statements to
commit or recover work on a controlled basis.
See the CA-Easytrieve Programmer Guide for more information about commit
processing.
Página 200
EASYTRIEVE Tutorial
6.8.3 Example
FILE ...
...
PROGRAM NAME EXAMPLE1
EXECUTE JOB1
EXECUTE PANEL1
JOB NAME JOB1
...
SCREEN NAME PANEL1
...
is equivalent to:
FILE ...
...
JOB NAME JOB1
...
SCREEN NAME PANEL1
...
PUSH is a listing control statement that saves the current listing control
indicators.
6.9.1 Syntax
PUSH
Página 201
EASYTRIEVE Tutorial
You can code a PUSH statement anywhere in CA-Easytrieve source code. PUSH
must be on a record by itself. PUSH does not appear in the printed
output.
The PUT statement performs sequential file output. PUT outputs records to
SEQUENTIAL files and also adds consecutive records (mass sequential
insertion) to an INDEXED or RELATIVE file.
6.10.1 Syntax
{input-file-name }
PUT output-file-name FROM { }STATUS
{input-record-name}
Parameters
{input-file-name }
FROM { }
{input-record-name}
FROM identifies the file or record from which the current record is
copied.
STATUS Specify the STATUS parameter whenever the possibility exists for
an unsatisfactory completion of the input/output request.
Página 202
EASYTRIEVE Tutorial
If you do not code STATUS and the operating system returns a non-zero
status, CA-Easytrieve issues an appropriate diagnostic message.
If you use the PUT statement, you must include the UPDATE parameter on the
FILE statement for RELATIVE or INDEXED files. You must specify CREATE for
SEQUENTIAL files. UPDATE informs CA-Easytrieve that all input records can
potentially be updated or deleted.
6.10.3 Example
6.11.1 Syntax
{key-field-name} HOLD
READ file-name KEY { } STATUS
{'key-literal' } NOHOLD
Parameters
{key-field-name}
KEY { }
{'key-literal' }
Página 203
EASYTRIEVE Tutorial
You must provide the key to the desired record. CA-Easytrieve uses the
contents of key-field-name or 'key-literal' in a search for a
corresponding record in the file. Alphanumeric literals must be enclosed
within single quotes. CA-Easytrieve does not change the data format of
key-field-name or 'key-literal.' The access method can require that the
search value have the same length as the file's key. Key-field-name
cannot be nullable.
HOLD
NOHOLD
Specify HOLD to hold a record for update. This is the default when UPDATE
is specified for the file. HOLD is invalid if UPDATE is not specified on
the FILE statement. HOLD does not mean you are required to perform the
update. It holds the position of the file and can also lock the record
(CICS and workstation LANs). Records are automatically released when the
update operation completes or a commit point is taken. You can also
manually release the hold on any record with the RELEASE statement.
STATUS Specify the STATUS parameter whenever the possibility exists for
an unsatisfactory completion of the input/output request.
If you do not code STATUS and the operating system returns a non-zero
status, CA-Easytrieve issues an appropriate diagnostic message.
You can use a file presence test (IF file-name) to determine the success
of the READ. The test is true when the last GET or READ was successful.
6.11.3 Example
Página 204
EASYTRIEVE Tutorial
6.12.1 Syntax
Format 1 (CA-IDMS)
Format 2 (IMS/DLI)
Parameters
Format 1 (CA-IDMS)
Página 205
EASYTRIEVE Tutorial
Format 2 (IMS/DLI)
KEY The optional KEY parameter identifies the sequence field for the
segment.
The KEY parameter is not necessary for the RECORD statement that defines
the lowest segment in a path. The KEY parameter is required for the root
segment when using the tickler file.
CA-IDMS
All fields defined following the RECORD statement are part of this record.
The name of each field must be unique within the record. However, the
field does not have to be unique within the file that contains the record
being defined. If a field defined in another record has the same name as a
field defined in this record, then all references to either field must be
qualified with the name of the field's containing record.
IMS/DLI
RECORD allocates a work space which contains the segment data during
execution. Field definition statements, coded immediately following a
RECORD statement, relate to data fields within that segment. One RECORD
statement must be coded for each segment of the database to be processed.
They must be coded in the same order as in the PSB which defines the
database. All segments of a database need not be defined, but the parent
segment of each RECORD must be coded because incomplete paths are not
supported.
Página 206
EASYTRIEVE Tutorial
6.13.1 Syntax
REFRESH
6.13.3 Example
The following example illustrates the REFRESH statement being invoked when
F6 is pressed. Because F6 is not an IMMEDIATE key, the current values of
QTY and PRICE are used to compute the extended price. F5 is used to clear
erroneous data from the screen.
DEFINE EXT-PRICE W 4 P 2
DEFINE QTY W 4 P 0
DEFINE PRICE W 4 P 2
SCREEN NAME TEST-REFRESH
KEY F2 NAME 'Reset to zero'
KEY F3 EXIT NAME 'Exit'
KEY F5 IMMEDIATE REFRESH NAME 'Refresh screen'
KEY F6 NAME 'Compute Ext Price'
TITLE 'TEST REFRESH'
ROW 3 'Quantity . .' QTY
ROW 5 'Price . . .' PRICE
ROW 7 'Ext Price .' EXT-PRICE
BEFORE SCREEN. PROC
MOVE ZERO TO QTY, PRICE, EXT-PRICE
END-PROC
AFTER-SCREEN. PROC
IF KEY-PRESSED = F6
EXT-PRICE = QTY * PRICE
REFRESH
END-IF
END-PROC
Página 207
EASYTRIEVE Tutorial
6.14.1 Syntax
RELEASE file-name
Parameters
CA-Easytrieve automatically issues a hold request for GETs and READs when
UPDATE is specified on the FILE statement. Records are automatically
released when the update operation completes or a commit point is taken.
Alternatively, you can use the RELEASE statement to manually release the
hold on a record. If HOLD is not specified, RELEASE is ignored.
6.14.3 Example
6.15.1 Syntax
{start-field-name}
REPEAT number TIMES VARYING subscript FROM { } +
{start-integer }
ROW row-number
ROW statements
END-REPEAT
Página 208
EASYTRIEVE Tutorial
Parameters
number Number is the number of times the group of ROW statements in the
REPEAT construct is repeated.
{start-field-name}
FROM { }
{start-integer }
FROM is an optional parameter that defines the initial value for the
REPEAT subscript. Subscript is automatically incremented by 1 from either
start-field-name or start-integer for each iteration of the group of ROW
statements. If FROM is omitted, the subscript starts at 1.
6.15.3 Example
Página 209
EASYTRIEVE Tutorial
This code:
...
WS-EMPLOYEE W 33 A OCCURS 30 . * 2-DIMENSIONAL TABLE OF
WS-NAME WS-EMPLOYEE 30 A . * 30 EMPLOYEES CONTAINING:
WS-STATUSES WS-EMPLOYEE +30 3 A . * EMPLOYEE NAME AND
WS-STAT WS-STATUSES 1 A OCCURS 3. * 3 STATUSES
...
SCREEN NAME EMPLOYEE-LIST
TITLE 'List of Employees'
ROW 3 'Name' COL 30 'Statuses'
REPEAT 15 TIMES VARYING USER-SUB
ROW WS-NAME (USER-SUB) +
WS-STAT (USER-SUB, 1) WS-STAT (USER-SUB, 2) WS-STAT (USER-SUB,
3)
END-REPEAT
Produces:
List of Employees
Name Statuses
WIMN, GLORIA F G O
BERG, NANCY C
CORNING, GEORGE I T
...
The REPORT statement allows you to define the type and characteristics of
a report. Although you can specify a large number of REPORT statement
parameters, you will probably produce most reports using default parameter
values specified in the Site Options Table.
6.16.1 Syntax
REPORT report-name +
SUMMARY + }
SUMFILE summary-file-name + }
SUMSPACE sumfield-addition + }
TALLYSIZE tally-print-size + }
}
{EVERY} }
DTLCTL {FIRST} + } Format
Página 210
EASYTRIEVE Tutorial
{NONE } } Determination
} Parameters
{ ALL } }
SUMCTL { ( HIAR DTLCOPY ) } + }
{ NONE DTLCOPYALL } }
{ TAG } }
}
ACROSS number-of-labels }
LABELS ( DOWN number-of-lines ) + } Label
SIZE label-length } Parameters
NEWPAGE }
}
FILE work-file-name + } File Directing
PRINTER receive-file-name + } Parameters
}
LIMIT number-of-records + } Testing Aid
EVERY n-number-of-lines } Parameters
Report-name can:
Página 211
EASYTRIEVE Tutorial
TALLYSIZE tally-print-size Use TALLYSIZE to set the print size for the
field TALLY. Valid values for tally-print-size are 1 through 18. The
number of digits used for TALLY on a summary line are the sum of the
values of TALLYSIZE and SUMSPACE.
{EVERY}
DTLCTL {FIRST}
{NONE }
Specify EVERY to print the value of all control fields on every detail
line.
Specify FIRST to print the value of all control fields on the first detail
line of a page and on the first detail line after each control break.
Control field values are not printed on all other detail lines.
{ ALL }
SUMCTL { ( HIAR DTLCOPY ) } +
{ NONE DTLCOPYALL }
{ TAG }
Página 212
EASYTRIEVE Tutorial
Label Parameters
ACROSS number-of-labels
LABELS ( DOWN number-of-lines ) +
SIZE label-length
NEWPAGE
Note: The NOHEADING and NOADJUST options are automatically activated when
you specify LABELS; therefore, you cannot specify TITLE and HEADING
statements. You cannot use LABELS with SUMMARY.
Specify SIZE to set the length of each label. The value of label-length
is the number of print positions on a label. Label-length has a value
range from 1 to 'nnn,' where 'nnn' is the length of the label.
NEWPAGE controls the printing of the first line (LINE 01) of each label.
When coded, NEWPAGE associates a printer top-of-form request with the
first line of each label.
Note: You should not use the FILE parameter in CICS. An execution error
occurs when work-file-name is not a virtual file.
Note: Instead of coding the FILE parameter for each report in your
program, you can use the WORKFILE YES parameter on the PARM statement.
See PARM Statement earlier in this chapter, and PRINT Statement Processing
in the "Report Processing" chapter in the CA-Easytrieve Programmer Guide
for more information.
Página 213
EASYTRIEVE Tutorial
In other words, at least one line group must fit on a report page.
Página 214
EASYTRIEVE Tutorial
When the report is directed to an extended reporting printer that does not
support a Forms Control Block (FCB), then CA-Easytrieve multiplies
line-page-size by the default height of the assigned extended reporting
printer. This enables CA-Easytrieve to compare PAGESIZE with the heights
of fonts used on the report as they are both in the same base unit (the
H-unit). The value of line-page-size multiplied by the default height of
the assigned extended reporting printer cannot exceed the maximum page
length of that extended reporting printer.
Line-length must be at least one less than the length of the data portion
of the file's logical record. If the FILE definition does not provide the
file's format and logical record length, then no compile time verification
of the line-length is done.
The default value of LINESIZE is calculated as one less than the data
portion of the logical record if the file format and record length are
known at compile time. Otherwise, the default is taken from the LINESIZE
site option.
The first character in a PRINTER file contains the ASA carriage control
information.
Line-length overrides the value defined in the Site Options Table. If the
report is directed to an extended reporting printer, CA-Easytrieve
multiplies line-length by the default width of the assigned extended
reporting printer. This value defines the width of the print line in
terms of the extended reporting printer's W-unit.
When the report is directed to an extended reporting printer that does not
support a Forms Control Block (FCB), the default height of the assigned
extended reporting printer defines the height of each line.
Página 215
EASYTRIEVE Tutorial
When the report is directed to an extended reporting printer that does not
support a Forms Control Block (FCB), the height of each line is defined by
the default height of the assigned extended reporting printer. This
operation converts number-of-lines into the H-units applicable to the
printer.
SPREAD
NOSPREAD
Specify SPREAD to insert the maximum number of spaces between each column
of a report. NOSPREAD deactivates SPREAD when it is the default specified
in the Site Options Table. SPREAD and NOADJUST are mutually exclusive.
See Report Processing in the CA-Easytrieve Programmer Guide for more
information and examples of this parameter.
NODATE
LONGDATE
SHORTDATE
Specify NODATE to inhibit the printing of the date value on the first
title line (TITLE 01).
Página 216
EASYTRIEVE Tutorial
LIMIT and EVERY are used as testing aids for report development. These
parameters control the amount of data output on a report.
The data window for fields with VARYING specified on the DEFINE statement
is based on the maximum length of the field. The window is padded to the
right with blanks for VARYING fields less than the maximum.
6.17.1 Syntax
REPORT-INPUT. PROC
Although you can code the logic to select records in the JOB activity
itself, you can occasionally place the logic in a REPORT-INPUT procedure.
When the report data has been spooled (because the report had been
SEQUENCEd or the printer file was in use), the REPORT-INPUT procedure is
invoked as each spooled record is read to produce this report. This means
that all records PRINTed are spooled and sorted (if SEQUENCE is
specified). The REPORT-INPUT procedure is then invoked. For performance
reasons, you should select the records in a JOB activity, if possible.
Página 217
EASYTRIEVE Tutorial
6.17.3 Example
Statements:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
HOLD-ZIP S 5 N VALUE 00000
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
REPORT-INPUT. PROC
IF ZIP NE HOLD-ZIP
HOLD-ZIP = ZIP
SELECT
END-IF
END-PROC
*
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
333.43
Página 218
EASYTRIEVE Tutorial
6.18.1 Syntax
RESHOW
Upon receiving the screen, CA-Easytrieve saves a copy of the screen image.
The RESHOW statement restores the saved image.
6.18.3 Example
...
SCREEN NAME MENU UPPERCASE
KEY ENTER
KEY F1 NAME 'Help' IMMEDIATE
KEY F3 NAME 'Exit' EXIT
TITLE...
ROW...
AFTER-SCREEN. PROC
IF KEY-PRESSED = F1
EXECUTE MENU-HELP
RESHOW
END-IF
CASE OPTION
...
END-PROC
SCREEN NAME MENU-HELP
KEY F3 NAME 'Exit' EXIT
TITLE...
ROW...
Página 219
EASYTRIEVE Tutorial
6.19.1 Syntax
Format 1 (CA-IDMS)
RETRIEVE file-name +
{program-name }
PROGRAM-NAME { } +
{'program-literal'}
{db-name-table-name }
DBNAME { } +
{'db-name-table-literal'}
{node-name }
NODE { } +
{'node-literal'}
{dictionary-name }
DICTNAME { } +
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { } +
{'dictionary-node-literal'}
KEYFILE tickler-file-name +
KEYVALUE (calc-key-field-name EQ calc-value-field-name ...) +
+
DUPS
NODUPS
SELECT (record-name +
AREA 'area-literal' +
SET 'set-literal' + +
INDEX 'index-set-literal' USING ('index-key-literal' ...)
ID 'path-literal' +
LIMIT numer-of-records +
WHILE (condition) +
...)
Format 2 (IMS/DLI)
RETRIEVE file-name +
KEYFILE tickler-file-name KEYVALUE key-field-name +
SELECT (record-name +
ID 'path-literal' +
LIMIT number-of-records +
SSA 'segment-literal' +
WHILE (condition) +
...)
Parameters
Format 1 (CA-IDMS)
file-name File-name is the same as the name coded in the FILE file-name
IDMS and JOB INPUT (file-name) statements.
{program-name }
PROGRAM-NAME { }
{'program-literal'}
Página 220
EASYTRIEVE Tutorial
{db-name-table-name }
DBNAME { }
{'db-name-table-literal'}
{node-name }
NODE { }
{'node-literal'}
{dictionary-name }
DICTNAME { }
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { }
{'dictionary-node-literal' }
KEYFILE tickler-file-name +
KEYVALUE (calc-key-field-name EQ calc-value-field-name ...) +
DUPS
NODUPS
The optional tickler file is designated by coding the KEYFILE and KEYVALUE
parameters. Tickler-file-name is the name of a file that is sequentially
processed to obtain the keys of the root records to be retrieved. The DBCS
code system of tickler-file-name must equal the DBCS code system of
file-name.
Página 221
EASYTRIEVE Tutorial
You must code one calc-value-field-name for each key field defined in the
KEY parameter of the RECORD statement for the root record.
The key values are used in the CALC retrieval of root records. Therefore,
only CALC records can be root records when the tickler file is used. The
optional keywords, DUPS and NODUPS, are used to specify whether CALC
records with duplicate keys are also retrieved. The OPTIONS table
parameter CALCDUP has the default value. The JOB activity is terminated
at end-of-file for tickler-file-name.
The KEY parameter for the root record retrieved by the tickler file option
must be specified on the RECORD statement.
SET 'set-literal' The SET subparameter specifies the name of the set
used for retrieving the named record (record-name). This subparameter is
not allowed if record-name is the root record or if record-name is a node.
SET is required for all other records. 'Set-literal' must be alphanumeric
(non-DBCS), and is padded to the right (if necessary) to create a 16-byte
value.
Note: The INDEX subparameter cannot be used with the tickler file.
Página 222
EASYTRIEVE Tutorial
Format 2 (IMS/DLI)
The DBCS code system assigned to tickler-file-name must match the DBCS
code system of file-name.
Página 223
EASYTRIEVE Tutorial
SSA 'segment-literal' You can code the optional Segment Search Argument
(SSA) parameter for the root segment. 'Segment-literal' is used in the
creation of the SSA to qualify segment retrieval. This parameter is not
valid when you use a tickler file. The value supplied with SSA is
enclosed within parentheses and concatenated with the segment-name to
produce the root segment's SSA. 'Segment-literal' cannot contain any DBCS
data.
6.20.1 Syntax
ROLLBACK
See the CA-Easytrieve Programmer Guide for more information about types of
work that are recoverable. Use the COMMIT statement to commit any pending
changes.
Página 224
EASYTRIEVE Tutorial
6.20.3 Example
6.21.1 Syntax
ROW row-number +
+offset-value {field-name }
{ } +
COL column-number {'row-literal'}
{attribute-name }
ATTR { } +
{(attribute-list)}
{RIGHT}
JUSTIFY { } +
{LEFT }
FILL {'fill-character'|NULL} +
{pattern-name}
PATTERN { } +
{'pattern' }
UPPERCASE +
{attribute-name }
ERROR ( ATTR { } +
{(attribute-list)}
...
{'literal' }
{ ... } )
{field-name }
Página 225
EASYTRIEVE Tutorial
Parameters
A ROW without any fields or literals displays a blank line on the screen
at the corresponding row-number.
Row-number cannot exceed the default ROWCOUNT value set in the site
options or the value of the ROWCOUNT parameter specified on the SCREEN
statement, if coded.
+offset-value {field-name }
{ }
COL column-number {'row-literal'}
The sum of the length of all screen items (fields and literals) plus
offset-values and column-numbers (if used) cannot exceed the value of the
default LINESIZE set in the site options, or the value of the LINESIZE
parameter on the SCREEN statement, if coded.
{attribute-name }
ATTR { }
{(attribute-list)}
* CURSOR
* NUMERIC
* INVISIBLE
* MUSTFILL
* MUSTENTER
Página 226
EASYTRIEVE Tutorial
* TRIGGER
* ALARM
SENDONLY and ASKIP are assumed for literals and system-defined read-only
fields.
{RIGHT}
JUSTIFY { }
{LEFT }
Use the JUSTIFY parameter to specify whether the data in the field is left
or right justified when displayed at the terminal.
You can use the FILL parameter to fill a field with underscores to
illustrate the total length of the field. You can fill a field with NULL
on a 3270 display to allow insertion of characters.
Varying length fields with FILL NULL do not have trailing nulls translated
to spaces. The first trailing null terminates the varying length field,
and then sets its length.
The optional MASK parameter is used to format the field for display.
If MASK is not coded, the MASK coded on the field's definition is used.
Use NOMASK to specify that the field's default MASK is to be used instead
of the field's definition MASK.
The BWZ (blank when zero) option suppresses the display of field-name when
it contains all zeros. BWZ can be used by itself or with other options on
the MASK parameter.
When fields are received from the terminal, the mask is used as an editing
template also. Special characters in the MASK are stripped from the data
Página 227
EASYTRIEVE Tutorial
before it is moved into the field data area. See the CA-Easytrieve
Programmer Guide for more information.
Note: HEX edit masks are not allowed for VARYING fields.
{pattern-name}
PATTERN { }
{'pattern' }
PATTERN allows you to specify a pattern against which each input character
is edited. The pattern can be specified as a literal or as the name of a
DECLAREd pattern. See the DECLARE Statement.
The valid pattern characters and their meanings are shown in the following
table.
---------------------------------------------
Character Meaning
---------------------------------------------
A Represents a lower-case or an
upper-case letter
---------------------------------------------
B Represents a single blank
---------------------------------------------
D Represents a digit
---------------------------------------------
E Represents an empty string
---------------------------------------------
L Represents a lower-case letter
---------------------------------------------
N Represents an upper-case letter
or a national character
---------------------------------------------
U Represents an upper-case letter
---------------------------------------------
X Represents any character
---------------------------------------------
"x" Double quotes surrounding a
character or a sequence of
characters literally represent
the character or sequence of
characters contained within.
The x represents any character.
To literally represent single
or double quotes, use two sets
of quotes within the
surrounding set of double
quotes ('""""' or '"x""x"',
'"''"', or '"x''x"').
---------------------------------------------
blank Blanks (unless contained in
double quotes) serve as
delimiters but are otherwise
ignored. They can be inserted
into the pattern to increase
readability.
---------------------------------------------
( ) Represents grouping to control
the precedence of operators.
Página 228
EASYTRIEVE Tutorial
---------------------------------------------
or | or , Represents a choice (or
alternation operator).
---------------------------------------------
(m) or (m..n) Represents the repetition of
or (m..*) the preceding pattern
or (*) expression. The m and n
or * represent numbers and m must be
less than n. A single number
with parentheses indicates the
exact number of repetitions.
(m..n) represents a range of
repetitions, minimum to
maximum. An asterisk in a
range, (m..*), represents an
infinite maximum. An asterisk
by itself, (*) or *, represents
a range from 0 to infinity.
---------------------------------------------
# or /-/ Represents the remove (or toss)
operation. This operation
applies only to a single
character set at a time and
must immediately follow that
character set in the pattern.
This operation removes the
character that matched the
character set from the data.
---------------------------------------------
+ Represents character set
addition to form another
character set.
---------------------------------------------
- Represents character set
difference to form another
character set.
---------------------------------------------
concatenation Concatenation is implied by
proximity. For example, DDDU
means 3 digits followed by an
upper-case letter.
---------------------------------------------
The edit pattern is evaluated from left to right (the data from the screen
is processed from left to right). Patterns examine only one character at
a time. They do not look ahead and they do not back track. See the
CA-Easytrieve Programmer Guide for more information.
Página 229
EASYTRIEVE Tutorial
{attribute-name }
ERROR ( ATTR { } +
{(attribute-list)}
{'literal' }
{ ... } )
{field-name }
6.21.3 Example
Página 230
EASYTRIEVE Tutorial
7.0 Statements S - Z
7.1 SCREEN Statement
7.1.1 Syntax
ACTIVITY TERMINAL
SCREEN NAME screen-name COMMIT ( ) +
NOACTIVITY NOTERMINAL
{attribute-name }
BACKGROUND ATTR { } +
{(attribute-list)}
{SINGLE }
{DOUBLE } {attribute-name }
BORDER ({ } ATTR { } +
{WIDE } {(attribute-list)}
{'border literal'}
SHADOW
Parameters
ACTIVITY TERMINAL
COMMIT ( )
NOACTIVITY NOTERMINAL
Página 231
EASYTRIEVE Tutorial
Specify the COMMIT parameter to control the logical unit of work. COMMIT
indicates when the activity commits recoverable work. Each commit point
posts all updates, additions and deletions, terminates holds, and closes
SQL cursors.
Specify TERMINAL to commit all recoverable work during any terminal I/O
operation. In CICS, this results in terminal I/O being performed in a
pseudo-conversational mode. Specify NOTERMINAL to tell CA-Easytrieve not
to commit during a terminal I/O. TERMINAL is the default.
Note: You can also issue your own COMMIT and ROLLBACK statements to
commit or recover on a controlled basis.
ROWCOUNT rows ROWCOUNT rows allows you to override the default number
of terminal rows for the screen display. The default is set in the Site
Options Table. See LINESIZE columns, below, for valid ROWCOUNT-LINESIZE
combinations.
On the mainframe, ROWCOUNT can be any value from 1 to 255. LINESIZE can
be any value from 1 to 255. If the dimensions of the screen exceed the
screen size available on the display terminal, only a portion of the
screen is displayed.
On the workstation, ROWCOUNT can be any value from 1 to 25. LINESIZE can
be any value from 1 to 80. A ROWCOUNT of 25 is flagged as an error if the
portability compiler switch (/P) is specified. See the "Compiling From
the Command Line" chapter in the CA-Easytrieve/Workstation User Guide for
more information.
{attribute-name }
BACKGROUND ATTR { }
{(attribute-list)}
Página 232
EASYTRIEVE Tutorial
{SINGLE }
{DOUBLE } {attribute-name }
BORDER ({ } ATTR { }
{WIDE } {(attribute-list)}
{'border literal'}
PICTURE 11
PICTURE 12
'Border literal' specifies the character to be used for the screen border.
This value must be a single character enclosed in single quotes.
* CURSOR
* NUMERIC
* INVISIBLE
* MUSTFILL
* MUSTENTER
* TRIGGER
* ALARM
See the ATTR Parameter for a list of attribute keywords. See the DECLARE
Statement for more information on DECLAREd screen attributes.
PICTURE 13
SCREEN statement
Screen declaration statements:
DEFAULTs (first in declaration section)
KEYs, TITLEs, ROWs (in any order)
Screen procedures (both special-named and user-defined, in any order)
Página 233
EASYTRIEVE Tutorial
If the LINESIZE and ROWCOUNT for a screen are less than the line size and
number of rows on the terminal, the screen is displayed as a pop-up
window. Any fields from previous screens that are still displayed are
given the ASKIP attribute to prevent data entry on those screens.
When executing in TSO and CMS, if the terminal supports two presentation
sizes, CA-Easytrieve selects the presentation size based on the size of
the screen. When a pop-up window is displayed, the presentation space is
based on the larger of the previous display size or the size of the pop-up
window.
7.1.3 Example
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 COL 22 'E Edit employee'
ROW COL 22 'D Delete employee'
ROW COL 22 'X Exit'
KEY F1 NAME 'Help' IMMEDIATE
KEY F3 NAME 'Exit' EXIT
KEY F12 NAME 'Cancel' EXIT IMMEDIATE
The following illustrates the screen created from the example screen
declaration:
Option ===> _
V View employee
E Edit employee
D Delete employee
X Exit
Página 234
EASYTRIEVE Tutorial
7.2.1 Syntax
Parameters
file-name File-name is the name of the file that describes the table and
its source. The file must have the TABLE parameter on its FILE statement
and must be a fixed length.
The length and field type of search-field must match the length and field
type of the ARG field defined for file-name. Search-field cannot be a
varying length field or a nullable field.
The length and field type of result-field must match the length and field
type of the DESC field defined for file-name. Result-field cannot be a
varying length field or a nullable field.
You can code SEARCH statements any place in a PROGRAM, SCREEN, or JOB
activity, and issue any number of SEARCHes against any number of tables.
The file must be in ARG sequence and cannot contain any duplicates. The
compare between the WITH field and the ARG field in the table is a logical
compare, that is, the compare ignores the data type and treats both fields
as if they have a data type of A.
When the table file is also an INDEXED file and the ARG field is the key,
CA-Easytrieve performs a keyed read of the file. Otherwise, the entire
file is read into memory and a binary search is performed. See the
CA-Easytrieve Programmer Guide for more information on table processing.
Página 235
EASYTRIEVE Tutorial
7.2.3 Example
Statements:
DEFINE CODE W 4 A
DEFINE DESCRIPTION W 40 A
FILE CLASSES TABLE INSTREAM
ARG 1 4 A
DESC 10 40 A
1011 ENGLISH I
1012 ENGLISH II
1013 ENGLISH III
1014 ENGLISH IV
ENDTABLE
PROGRAM NAME MYPROG
MOVE '1012' TO CODE
SEARCH CLASSES WITH CODE, GIVING DESCRIPTION
IF CLASSES
DISPLAY DESCRIPTION
ELSE
DISPLAY 'CLASS NOT FOUND'
END-IF
Results:
ENGLISH II
7.3.1 Syntax
Página 236
EASYTRIEVE Tutorial
Parameters
{column-name} ASC
ORDER BY { }
{integer } DESC
ORDER BY returns the rows of the result table in the order of the values
of the specified column-names. Integer references a column by its
position in the result table rather than by a column-name. ASC returns
the rows in ascending order and is the default. DESC returns the rows in
descending order.
FOR UPDATE Specify FOR UPDATE to allow updates of the updatable fields
defined in file-name. If used, FOR UPDATE must be the last parameter
specified on the SELECT statement. If FOR UPDATE is not coded and you
attempt to update file-name, you receive an error at execution.
Página 237
EASYTRIEVE Tutorial
7.3.3 Examples
The next example shows a file-based SQL SELECT statement with DEFER:
7.4.1 Syntax
SELECT logical-record-name +
WHERE (boolean-expression) +
LIMIT record-literal +
{program-name }
PROGRAM-NAME { } +
{'program-literal'}
{db-name-table-name }
DBNAME { } +
{'db-name-table-literal'}
Página 238
EASYTRIEVE Tutorial
{node-name }
NODE { } +
{'node-literal'}
{dictionary-name }
DICTNAME { } +
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { }
{'dictionary-node-literal'}
Parameters
{program-name }
PROGRAM-NAME { }
{'program-literal'}
{db-name-table-name }
DBNAME { }
{'db-name-table-literal'}
{node-name }
NODE { }
{'node-literal'}
{dictionary-name }
DICTNAME { }
Página 239
EASYTRIEVE Tutorial
{'dictionary-literal'}
{dictionary-node-name }
DICTNODE { }
{'dictionary-node-literal'}
7.4.2 Example
*
IDD SUBSCHEMA DEMOSSLR SCHEMA DEMOSCHM +
SELECT (CUST-SALES-LR)
*
JOB INPUT DEMOSSLR
SELECT CUST-SALES-LR
*
DISPLAY CUST-NAME +2 SLS-CUST-NO +2 PROD-DESC
The SELECT statement identifies the rows and columns that are to be input
to the JOB activity. Only one SELECT statement can be coded in each JOB
activity, and it must be coded as the first statement in the JOB activity.
7.5.1 Syntax
{ {* }
DISTINCT { {expression }
SELECT { { } +
ALL { {table-name.* }
{ {correlation-name.*}
}
{expression } }
, {table-name.* } ... } +
{correlation-name.*} }
}
Página 240
EASYTRIEVE Tutorial
WHERE search-condition +
GROUP BY column-name + +
, column-name ...
HAVING search-condition +
{ {* }
DISTINCT { {expression }
UNION SELECT { { } +
ALL { {table-name.* }
{ {correlation-name.*}
}
{expression } }
, {table-name.* } ... } +
{correlation-name.*} }
}
WHERE search-condition +
GROUP BY column-name + +
, column-name ...
HAVING search-condition
{column-name} ASC
ORDER BY { } +
{integer } DESC
{column-name} ASC
, { } ... +
{integer } DESC
Parameters
DISTINCT
ALL
{* }
{expression }
{ }
{table-name.* }
{correlation-name.*}
The above parameters are used to identify the columns to be retrieved from
the specified table.
Página 241
EASYTRIEVE Tutorial
UNION... The UNION clause is used to include rows from another table.
{column-name} ASC
ORDER BY { }
{integer } DESC
ORDER BY returns the rows of the result table in the order of the values
of the specified column-names. Integer references a column by its
position in the result table rather than by a column-name. ASC returns
the rows in ascending order and is the default. DESC returns the rows in
descending order.
Code the SELECT statement immediately following the JOB INPUT SQL
statement.
Página 242
EASYTRIEVE Tutorial
7.5.3 Example
* IF SQL/DS
SQL CONNECT :user-id IDENTIFIED BY :password
* END-IF
SQL DECLARE cursor CURSOR FOR select clause
SQL OPEN cursor
DO WHILE SQLCODE NE 100
SQL FETCH cursor INTO :host-variable-1 +
, :host-variable-2...
process CA-Easytrieve code
END-DO
SQL CLOSE cursor
7.6.1 Syntax
SELECT
7.6.3 Example
REPORT-INPUT. PROC
IF ZIP NE HOLD-ZIP
HOLD-ZIP = ZIP
SELECT
END-IF
END-PROC
Página 243
EASYTRIEVE Tutorial
7.7.1 Syntax
SELECT
7.7.3 Example
7.8.1 Syntax
Parameters
Página 244
EASYTRIEVE Tutorial
7.8.3 Examples
REPORT PERSNL-REPORT
SEQUENCE REGION BRANCH PAY-NET D
CONTROL REGION BRANCH
TITLE 'PERSONNEL REPORT'
LINE REGION BRANCH EMPNAME PAY-NET
The above graph declaration produces a pie graph that displays the sum of
the gross pay for each branch sequenced by branch.
The SET statement allows you to dynamically change screen attributes and
to control the display of screen errors.
Página 245
EASYTRIEVE Tutorial
7.9.1 Syntax
Format 1
{attribute-name } {'literal' }
ATTR { } { ... }
{(attribute-list)} {field-name }
Format 2
{attribute-name }
SET field-name ATTR { }
{(attribute-list)}
Parameters
ERROR Use ERROR to indicate that you want to flag field-name as being in
error and to specify attributes or messages for field-name.
When you specify ERROR, the attributes or messages for field-name are
determined by the hierarchy in the following table. The priority is from
highest to lowest.
-------------------------------------------
Statement/ Attributes Message
Area
-------------------------------------------
1. SET ATTR literal or
statement parameter field-name
parameter(s)
-------------------------------------------
2.ROW ERROR ATTR ERROR 'literal'
statement parameter or field-name
parameter(s)
-------------------------------------------
3. DEFAULT FIELD ERROR Default system
statement ATTR message:
parameter Value entered is
not allowed.
Type an
acceptable value.
-------------------------------------------
4. Site FIELD ERROR Default system
Options ATTR message: Value
Table parameter entered is not
allowed. Type an
acceptable value.
-------------------------------------------
Página 246
EASYTRIEVE Tutorial
{attribute-name }
ATTR { }
{(attribute-list)}
CURSOR MUSTENTER
NUMERIC TRIGGER
INVISIBLE ALARM
MUSTFILL
SENDONLY and ASKIP are assumed for literals and system-defined read-only
fields.
{'literal' }
{ }
{field-name}
Use 'literal' to define the text you want displayed in the message. Use
field-name to specify a field whose contents you want displayed as part of
the message. A message can consist of a combination of literals and
field-names.
You can code the SET statement in a screen procedure or in any procedure
PERFORMed from a screen procedure, except for SCREEN TERMINATION. If
coded in a SCREEN TERMINATION procedure or if coded in a procedure called
from a SCREEN TERMINATION procedure, the SET statement is ignored at
execution time.
The SET statement can be executed any number of times before displaying
the screen. The last SET statement for field-name determines the
attributes or messages for that field.
When multiple SET statements are coded for multiple field-names before the
next display of a screen, the field-name that is physically displayed
first on the screen has its message displayed on the screen. All other
field-names only have their attributes displayed.
Página 247
EASYTRIEVE Tutorial
The SET statement overrides any ACTION messages defined in the MESSAGE
statement, even if the MESSAGE statement is executed after all SET
statements.
The attributes and messages specified on the SET statement are evaluated
when the statement is executed. If the attributes or messages are
variable, the value is saved and bound to the field-name when the SET
statement is executed. If the variables are later modified, the
attributes or messages are not changed when the screen is re-displayed.
If you code SET field-name ERROR without any other parameters, the
attributes and messages for field-name are determined by the ROW
statement. If the attributes and messages on the ROW statement are
variable, the values displayed for the SET statement are the same as the
values determined when the ROW statement is evaluated.
When you execute a RESHOW, REFRESH, or GOTO SCREEN statement after a SET
statement, the attributes or messages specified in the SET statement are
not affected.
7.9.3 Examples
In the following example, when the department number is not found in the
table, the field is flagged in error.
In the next example, when a user types a value greater than 50,000 into
PAY-GROSS, PAY-GROSS is displayed in yellow, otherwise PAY-GROSS is
displayed in turquoise.
ROW PAY-GROSS
...
AFTER-SCREEN. PROC
IF PAY-GROSS > 50,000
SET PAY-GROSS ATTR (YELLOW)
ELSE
SET PAY-GROSS ATTR (TURQ)
END-IF
END-PROC
In the last example, five rows are displayed when the screen is displayed.
Row 1 is displayed in BLUE and the cursor is positioned in AFIELD. Rows
2-5 are displayed in YELLOW.
Página 248
EASYTRIEVE Tutorial
7.10.1 Syntax
SKIP skip-amount
Parameters
You can code a SKIP statement anywhere in CA-Easytrieve source code. SKIP
must be on a record by itself. SKIP does not appear in the printed
output. However, the requested blank line appears.
The SORT statement defines and initiates an activity that sorts any file
that can be processed sequentially. SORT sequences an input file in
alphabetical or numerical order based on fields specified as keys.
7.11.1 Syntax
ACTIVITY TERMINAL
COMMIT ( ) +
NOACTIVITY NOTERMINAL
SIZE record-count +
WORK number-of-work-data-sets +
BEFORE proc-name +
NAME sort-name
Parameters
Página 249
EASYTRIEVE Tutorial
You can code any number of fields up to the input limit of your
installation's sort program. Up to 10 key fields can be used on the
workstation. Sort-key-field-name can be any field less than 256 bytes
long in the sort input file. (The only exceptions are variable length
fields, which cannot be used as keys.) Sort-key-field-name cannot be a
nullable field.
ACTIVITY TERMINAL
COMMIT ( )
NOACTIVITY NOTERMINAL
Specify the COMMIT parameter to control the logical unit of work. COMMIT
indicates when the activity commits recoverable work. Each commit point
posts all updates, additions and deletions, and terminates holds. SQL
cursors may or may not be closed, depending on the underlying database and
the cursor definition.
Specify TERMINAL to commit all recoverable work during any terminal I/O
operation. In CICS, this results in terminal I/O being performed in a
pseudo-conversational mode. Specify NOTERMINAL to tell CA-Easytrieve not
to commit during a terminal I/O. TERMINAL is the default.
Página 250
EASYTRIEVE Tutorial
This parameter overrides the number of work data sets set in the Site
Options Table. WORK is ignored on the workstation.
* You must execute a SELECT statement for each record that you want
returned to the output file.
* A SELECTed record is written only once, even if SELECTed more than
once in the procedure.
* Any record not SELECTed does not get written to the sorted file.
* If the file being sorted is a variable length record file, the
output file is generated with a record length equal to the maximum
record length that is specified in the FILE statement.
7.11.3 Example
In the following example, the output file contains all of the records of
the input file sorted into ascending sequence by the values of fields
REGION and BRANCH.
Página 251
EASYTRIEVE Tutorial
The SQL statement supports the SQL statements of the following database
management systems:
* DB2
* SQL/DS
* CA-Datacom/DB SQL
* CA-IDMS SQL
* CA-Ingres
* Oracle
7.12.1 Syntax
SQL native-sql-statement
ALTER
CLOSE cursor-name
COMMENT ON
COMMIT {work}
CONNECT
CREATE
DECLARE cursor-name {with hold}
DELETE {where current of cursor-name}
DROP
EXPLAIN
FETCH cursor-name
GRANT
INSERT
LABEL
LOCK
OPEN cursor-name
RELEASE
REVOKE
ROLLBACK {work}
SELECT INTO *(for static-only processing)
SET CONNECTION
Página 252
EASYTRIEVE Tutorial
ACQUIRE
ALTER
CLOSE cursor-name
COMMENT
COMMIT {work}
CONNECT userid
CONNECT TO database
CREATE
DECLARE CURSOR-NAME
DELETE {where current of cursor-name}
DROP
EXPLAIN
FETCH cursor-name
GRANT
INSERT
LABEL
LOCK
OPEN cursor-name
PUT
REVOKE
ROLLBACK {work}
UPDATE {where current of cursor-name}
ALTER
CLOSE cursor-name
COMMENT
COMMIT {work}
CREATE
DECLARE cursor-name
DELETE {where current of cursor-name}
DROP
FETCH cursor-name
GRANT
INSERT
LOCK
OPEN cursor-name
REVOKE
ROLLBACK {work}
SELECT INTO
UPDATE {where current of cursor-name}
ALTER
CLOSE cursor-name
COMMIT {work} {continue} {release}
CONNECT TO dictionary-name
CREATE
DECLARE cursor-name
Página 253
EASYTRIEVE Tutorial
DELETE*
DROP
EXPLAIN
FETCH cursor-name
GRANT
INSERT
OPEN cursor-name
RELEASE
RESUME
REVOKE
ROLLBACK {work}
SUSPEND
UPDATE*
CLOSE cursor-name
COMMIT {work}
CONNECT
CREATE
DECLARE cursor-name
DELETE
DISCONNECT
DROP
FETCH cursor-name
INSERT
OPEN cursor-name
ROLLBACK {work}
UPDATE
CLOSE cursor-name
COMMIT {work}
CONNECT
CREATE
DECLARE cursor-name
DELETE
DISCONNECT
DROP
FETCH cursor-name
INSERT
OPEN cursor-name
ROLLBACK {work}
UPDATE
Página 254
EASYTRIEVE Tutorial
7.13.1 Syntax
SQL INCLUDE +
(column ...) +
{starting-position}
{* +offset }
LOCATION { } +
{W }
{S }
HEADING +
UPDATE +
NULLABLE +
Parameters
(column ...) Specify a list of one or more column names for which field
definitions are to be generated. The column name(s) must be enclosed
within parentheses. If no column names are specified, all columns from
the table are used.
{starting-position}
{* +offset }
LOCATION { }
{W }
{S }
Use this optional parameter to specify the location at which the field
definitions are to be generated.
The * (asterisk) indicates that the field begins in the next available
starting position (highest position assigned so far, plus 1). The
optional +offset is an offset you want added to the * value. There must
be at least one blank between the * and the optional +offset.
When a CA-Easytrieve SQL file does not contain the UPDATE parameter, only
the specific columns defined with UPDATE can be modified with an UPDATE
statement. If UPDATE is coded on the FILE statement, all columns in the
file can be modified.
Página 255
EASYTRIEVE Tutorial
Note: You can only use UPDATE when the field definitions are generated
for a CA-Easytrieve file.
The indicator variable precedes the data portion of the field in storage.
This field cannot be directly referenced. To check this indicator
variable, you must use the IF NULL statement.
When used, the SQL INCLUDE statement(s) must precede any other SQL or
SELECT statements and must be coded in the library definition section of
your CA-Easytrieve program.
The generated CA-Easytrieve field names are the same as the SQL column
names. If a name matches a reserved word, the field definition is
allowed, but all references to it must be qualified using any applicable
qualification.
Fields with SQL data types that do not have equivalent CA-Easytrieve data
types are defined as shown in the following table. Fields of DATE2/4/98 ,
TIME11:08 am , TIMESTAMP, and BINARY cannot be used in arithmetic
operations. Fields of FLOAT, DOUBLEPRECISION, REAL, and LONGINTEGER are
defined as packed decimal fields. Non-zero FILE-STATUS and SQLCODE values
are returned if the data is truncated.
-----------------------------------------------
SQL Data Type CA-Easytrieve Length Decimals
Data Type
-----------------------------------------------
DATE Alphanumeric 10
-----------------------------------------------
TIME Alphanumeric 8
-----------------------------------------------
TIMESTAMP Alphanumeric 26
-----------------------------------------------
Página 256
EASYTRIEVE Tutorial
BINARY Alphanumeric
Length
of SQL
field
-----------------------------------------------
FLOAT Packed 10 3
Numeric
-----------------------------------------------
DOUBLEPRECISION Packed 10 3
Numeric
-----------------------------------------------
REAL Packed 10 3
Numeric
-----------------------------------------------
LONGINTEGER Packed 10 0
Numeric
-----------------------------------------------
The DBMS system catalog must be referenced each time the program is
compiled or interpreted. Therefore, to reduce catalog contention and to
improve performance, you should always create link-edited programs.
Field Reference
One of the advantages of using the SQL INCLUDE interface is the ability to
reference host-variables (CA-Easytrieve fields) using the group level
TABLE definition.
When specifying the INTO clause on a native SQL FETCH or non-file SQL
SELECT statement or the VALUES clause of the native SQL INSERT statement,
the host variable TABLE definition can be substituted in place of coding
all host-variables in the table.
If you require access to an indicator variable other than its use for NULL
checking, you must define your own variable and reference it with its
host-variable. For some DBMSs, the indicator variable is examined to
detect truncation.
Página 257
EASYTRIEVE Tutorial
7.14.1 Syntax
STOP EXECUTE
Parameters
When used in a JOB activity, STOP completes all reports and executes a
FINISH procedure, if coded. If you code STOP EXECUTE, all CA-Easytrieve
activity procedures are immediately terminated. If STOP is coded in the
START or FINISH procedure, the procedure is terminated.
7.14.3 Examples
Página 258
EASYTRIEVE Tutorial
7.15.1 Syntax
Parameters
Página 259
EASYTRIEVE Tutorial
7.16.1 Syntax
TERMINATION. PROC
7.16.3 Example
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
TOTAL-NET S 8 N 2
JOB INPUT FILE1 NAME MYPROG
TOTAL-NET = TOTAL-NET + PAY-NET
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
TERMINATION. PROC
DISPLAY TITLE
DISPLAY SKIP 5 TOTAL-NET 'IS THE Y-T-D COMPANY NET PAY'
DISPLAY SKIP 5 'PLEASE ROUTE THIS REPORT TO CORPORATE OFFICERS'
END-PROC
Página 260
EASYTRIEVE Tutorial
7.17.1 Syntax
TERMINATION. PROC
7.18.1 Syntax
Parameters
COL column-number
+offset
Title items are separated by one space. Use +offset to add additional
spaces between title items.
{'title-literal' }
{ }
{title-field-name}
Página 261
EASYTRIEVE Tutorial
7.18.2 Example
The following program code produces a horizontal bar graph that displays
the sum of the gross pay for each region with the title GROSS PAY BY
REGION.
One or more TITLE statements define an optional report title. The TITLE
statement defines the title items and their position on the title line.
7.19.1 Syntax
{ field-name}
{#font-number }
TITLE title-number { 'literal' } ...
{+offset }
{-offset }
{COL column-number }
Parameters
By default, each title line is formatted as a list of title items that are
separated by the number of spaces defined by the SPACE parameter of the
Página 262
EASYTRIEVE Tutorial
Note: You must code at least one title item, specified by field-name or
'literal', on each TITLE statement.
{+offset}
{ }
{-offset}
{COL column-number} The COL parameter specifies the print column number
where the next title item is placed. The value of column-number has a
valid range of 1 to 'nnn,' where 'nnn' cannot force the following title
item beyond the end of the title line LINESIZE.
Each title line is centered within the title area of the report unless you
specify NOADJUST.
7.20.1 Syntax
{attribute-name }
ATTR { } ...
{(attribute-list)}
Parameters
Página 263
EASYTRIEVE Tutorial
COL column-number
+offset
Note: A syntax error occurs when a TITLE overlays another screen item.
{field-name}
{ }
{'literal' }
{attribute-name }
ATTR { }
{(attribute-list)}
CURSOR
NUMERIC
INVISIBLE
MUSTFILL
MUSTENTER
TRIGGER
ALARM
TITLE items that are not located at a specific column (COL) are centered
in the row based on the LINESIZE parameter of the SCREEN statement.
7.20.3 Example
Página 264
EASYTRIEVE Tutorial
produces:
7.21.1 Syntax
{field-name } {field-name}
TRANSFER { } USING { } NOCLEAR
{'program-name'} {'literal' }
Parameters
{field-name }
{ }
{'program-name'}
Specify the field-name that contains the name of the target program, or
specify the name of the target program as a 'literal' within single
quotes. Field-name cannot be nullable.
{field-name}
USING { }
{'literal' }
Specify the name of a field that contains the value to pass to the target
program, or specify a 'literal' to pass to the target program. Field-name
cannot be nullable.
NOCLEAR Use NOCLEAR to specify that you do not want to clear the
terminal screen when exiting a CA-Easytrieve program in CICS or on the
workstation.
Página 265
EASYTRIEVE Tutorial
TRANSFER can be used to invoke any program written in any language that is
supported by the operating system in which the program is executing;
similarly, the program can issue any command supported by the operating
system.
When the target program is another CA-Easytrieve program and you want to
pass a parameter, you must specify the USING parameter on the target
program's PROGRAM statement.
7.21.3 Example
CASE OPTION
WHEN 'V'
NEXT-PGM = 'VIEWCUST'
WHEN 'E'
NEXT-PGM = 'EDIT-CUST
WHEN 'D'
NEXT-PGM - 'DEL-CUST'
WHEN 'A'
NEXT-PGM = 'ADD-CUST'
END-CASE
TRANSFER NEXT-PGM USING EMP#
7.22.1 Syntax
UPDATE file-name
Parameters
Página 266
EASYTRIEVE Tutorial
When the file is defined with the UPDATE parameter, all defined columns
are updated. Otherwise, only the columns that contain the UPDATE
parameter are updated. See the SQL INCLUDE Statement or the DEFINE
Statement.
7.22.3 Example
7.23.1 Syntax
Parameters
x-value X-value specifies the field or literal to be used for drawing the
horizontal axis of the graph. X-value must be a numeric field or literal
if you are drawing an XY or SCATTER graph.
Página 267
EASYTRIEVE Tutorial
You can use a literal value to count occurrences. For example, the
statement VALUE DEPT 1 counts the number of records within each
department.
All graphs are automatically scaled; any data that is too long to be
displayed is truncated.
The y-value for a PIE graph determines the size of the pie slice. The
x-value for a PIE graph determines the category for the y-value. If
SUMMARY is coded on the GRAPH statement, all y-values for each identical
x-value are summed producing a slice that is the size of the sum of all of
the y-values for this category.
For VBAR (vertical bar) and HBAR (horizontal bar) graphs, the x-value
determines the category for the y-value. If SUMMARY is coded on the GRAPH
statement, all y-values for each identical x-value are summed producing a
vertical or horizontal bar that is the sum of all of the y-values for this
category.
For LINE graphs, the x-value determines the category for the y-value. If
SUMMARY is coded on the GRAPH statement, all y-values for each identical
x-value are summed producing a data point that is the sum of all of the
y-values for this category.
For XY and SCATTER graphs, the y-value determines position of the data
point on the y-axis. The x-value determines the position of the data
point on the x-axis. If SUMMARY is coded on the GRAPH statement, all
y-values for each identical x-value are summed producing a data point that
is the sum of all of the y-values for this x-value.
7.23.3 Example
The following code produces a stacked vertical bar graph that displays the
sum of the gross pay and net pay for each region.
Página 268
EASYTRIEVE Tutorial
7.24.1 Syntax
Format 1
UPDATE {input-file-name }
WRITE output-file-name FROM { }STATUS
ADD {input-record-name}
Format 2
Parameters
UPDATE
ADD
DELETE
For SEQUENTIAL files, only UPDATE is allowed. For RELATIVE files, only
UPDATE and DELETE are allowed.
{input-file-name }
FROM { }
{input-record-name}
STATUS Specify the STATUS parameter whenever the possibility exists for
an unsatisfactory completion of the input/output request.
Página 269
EASYTRIEVE Tutorial
If you do not code STATUS and the operating system returns a non-zero
status, CA-Easytrieve issues an appropriate diagnostic message.
Format 1
Format 2
Format 2 of the WRITE statement deletes the current active record for the
file.
7.24.3 Example
Página 270
EASYTRIEVE Tutorial
* General
* File-related
* Report-related
* Screen-related.
SYSDATE
SYSDATE-LONG
SYSTIME
SYSUSERID
In CICS, you must first log onto CICS because this field is updated from
the EIB.
Página 271
EASYTRIEVE Tutorial
RETURN-CODE
UIBFCTR
UIBDLTR
UIB-ADDRESS
RECORD-LENGTH
For SQL files, RECORD-LENGTH contains the sum of the maximum lengths of
all fields in the file. For CA-IDMS and IMS/DLI files, RECORD-LENGTH
contains the sum of the maximum lengths of all records in the file.
RECORD-COUNT
Página 272
EASYTRIEVE Tutorial
FILE-STATUS
Cause: This condition occurs following a GET statement when the current
record is the last record in the file. It can occur for SEQUENTIAL,
INDEXED, and RELATIVE files.
Following a GET PRIOR statement, this condition could also indicate the
beginning of a file.
Cause: This condition can occur following a GET or READ statement for an
INDEXED file that does not have unique keys.
Following a GET statement, this condition indicates that at least one more
record with a matching key is waiting to be processed.
In CICS/VS, MVS (batch and TSO), and CMS/OS, an INDEXED file can have
non-unique keys if the associated data set is a VSAM PATH and the
auxiliary index data set was defined with non-unique keys.
Página 273
EASYTRIEVE Tutorial
Cause: This condition can occur following a PUT or WRITE ADD statement
for an INDEXED file, or a PUT statement for a RELATIVE file.
For an INDEXED file, it indicates that the key of the record matches the
key of a record already present in the file. For a RELATIVE file, it
indicates that the slot designated by the relative record number already
contains a record (the slot is not empty).
This condition can also occur following a WRITE UPDATE statement for a
SEQUENTIAL or INDEXED file. It indicates that:
* The alternate index was defined with the unique key and the
upgrade option.
Cause: This condition can occur following a READ or POINT statement for
an INDEXED or RELATIVE file. For an INDEXED file, it indicates that no
record in the file matches the key specified by the statement. For a
RELATIVE file, this condition indicates that the slot designated by the
relative record number is empty.
PATH-ID
For CA-IDMS and IMS/DLI files, PATH-ID is a field that contains the ID
value of the lowest record retrieved in a path using the RETRIEVE
statement. See the CA-Easytrieve Programmer Guide for more information.
IDMSCOM
Página 274
EASYTRIEVE Tutorial
SLC
SQLCA
SQLCA contains a set of fields defined for the SQL Communications Block.
See the CA-Easytrieve Programmer Guide for more information.
LINE-COUNT
LINE-NUMBER
LINE-NUMBER is a field that contains the number of the line being printed
within the line group.
PAGE-COUNT
PAGE-NUMBER
PAGE-NUMBER is a field that contains the number of the page being printed.
TALLY
LEVEL
LEVEL is a field that indicates the control break level. See the CONTROL
Statement.
BREAK-LEVEL
Página 275
EASYTRIEVE Tutorial
KEY-PRESSED
---------------------------------------
Terminal Key Symbolic Constant
Name Value
---------------------------------------
Unknown 0
---------------------------------------
Enter ENTER 1
---------------------------------------
Clear CLEAR 11
---------------------------------------
PA1 thru PA3 PA1 thru 12 thru 14
PA3
---------------------------------------
PF1 thru PF24 F1 thru 21 thru 44
F24
---------------------------------------
F1 thru F12 F1 thru 21 thru 32
F12
---------------------------------------
Test Request 220
---------------------------------------
Op ID card 222
Reader
---------------------------------------
Magnetic Slot 223
Reader
---------------------------------------
Trigger Action 224
---------------------------------------
Structured 230
Field
---------------------------------------
Clear Partition 231
---------------------------------------
Read Partition 232
---------------------------------------
No Aid 255
Generated
---------------------------------------
TERM-COLUMNS
Página 276
EASYTRIEVE Tutorial
TERM-ROWS
TERM-NAME
Página 277
EASYTRIEVE Tutorial
Página 278
EASYTRIEVE Tutorial
-----------------------------------------
** R Reserved for future use
-----------------------------------------
/ Assignment
-----------------------------------------
' Syntax delimiter (single
quote)
-----------------------------------------
% Macro invocation
-----------------------------------------
> Conditional expression
-----------------------------------------
>= Conditional expression
POINT
-----------------------------------------
, Syntax delimiter (comma)
-----------------------------------------
= Assignment
Conditional expression
POINT
-----------------------------------------
@ R Reserved for future use
-----------------------------------------
Página 279
EASYTRIEVE Tutorial
Página 280
EASYTRIEVE Tutorial
This appendix also contains a table that helps you easily identify
differences in CA-Easytrieve for different environments (mainframe, PC,
and UNIX). These differences will be resolved in future versions of the
CA-Easytrieve language. See Environmental Differences at the end of this
appendix.
BEFORE-LINE Procedure
Bounds Checking
CA-Easytrieve now checks to ensure that your indexes and subscripts do not
refer past the end of the field.
Conditional Expressions
Página 281
EASYTRIEVE Tutorial
DBCS Support
DEFINE Statement
If you define the same field more than once with different attributes, an
error occurs during compilation.
Fields whose storage location exceeds the file length are now flagged in
error.
When you redefine a field that contains an OCCURS value, the field
inherits the OCCURS value. This allows the field to be subscripted. If
the field's length exceeds the redefined field's length, a warning message
results when you define the field and subscripting is not allowed at
reference. If a multi-dimensional array is defined, all occurrences of
secondary dimensions must fit into a single occurrence of the
corresponding primary dimension. A warning message results when you
define the field and subscripting of secondary dimensions is not allowed
at reference.
You cannot use the VALUE parameter for a varying length alphanumeric field
unless the VARYING keyword precedes the VALUE parameter.
Extended Reporting
FILE Statement
Página 282
EASYTRIEVE Tutorial
Names
PARM Statement
REPORTs
The DISPLAY statement now ensures that printed output remains within the
physical page size you specify.
Items on the title are now always refreshed with the current value of
fields when produced. Older versions only refreshed title fields when
printing titles as the result of a detail line.
Special-named break procedures now refer to the last detail record of the
control group having the break. Older versions referred to the first
record of the new control group.
The algorithm used to center ADJUSTed reports does not use the sum control
tag literal. The report items are used to center the report, then the tag
literal is placed on the report.
You can use the COL parameter on the TITLE statement without specifying
the ADJUST parameter on the REPORT statement.
Reserved Words
SYSDATE/SYSTIME
The SYSDATE and SYSTIME fields no longer use a space in place of a leading
zero for month.
Página 283
EASYTRIEVE Tutorial
CALL Statement
DISPLAY Statement
The DISPLAY NEWPAGE function has been replaced by the DISPLAY TITLE and
DISPLAY NOTITLE functions. The reason for this change is that previous
versions of DISPLAY NEWPAGE did not consistently produce report titles and
headings. For source compatibility, DISPLAY NEWPAGE is accepted and
functions the same as DISPLAY TITLE.
END Statement
FILE Statement
The SQL SELECT parameter is replaced with the more powerful SQL file type.
SQL SELECT is still supported.
PARM Statement
LIST FILE³NOFILE
DEVICE
VFM DEVICE (except DISK³MEMORY)
SORT DIAG³NODIAG
SORT ERASE³NOERASE
SORT SYS
SORT TP³NOTP
SORT VIRTUAL³REAL
SORT WORK DA
PRESIZE
EXITSTR
Página 284
EASYTRIEVE Tutorial
DBCS Support
Multiple code systems and DBCS extended reporting are not supported.
END Statement
FILE Statement
JOB Statement
Macros
PARM Statement
The ENVIRONMENT and RESTARTABLE parameters of the PARM statement are not
supported.
--------------------------------------------------------
Feature Mainframe PC/DOS UNIX
--------------------------------------------------------
Screen Processing X X
--------------------------------------------------------
DECLARE Statement:
PROGRAM Parameter X X
--------------------------------------------------------
Graph Processing X
--------------------------------------------------------
FILE Statement:
CODE parameter X X
SYSTEM parameter X
KEY parameter X
--------------------------------------------------------
LINK Statement:
HOST parameter X
WAIT parameter X
NOENTER parameter X
Página 285
EASYTRIEVE Tutorial
--------------------------------------------------------
PARM Statement:
CODE parameter X
CALL parameter X X
--------------------------------------------------------
Report Processing:
CONTROLSKIP X X
parameter
--------------------------------------------------------
Double Byte
Character Set X
(DBCS) Support
--------------------------------------------------------
CALL Statement:
DYNAMIC execution X X
--------------------------------------------------------
Conditional
Expressions:
Field Class X X
Condition: X X
BREAK parameter
HIGHEST-BREAK
parameter
--------------------------------------------------------
Página 286
EASYTRIEVE Tutorial
11.0 Glossary
activity section
A required section of a CA-Easytrieve program in which the executable
statements (procedural or declarative) that process your data are coded.
alphanumeric literal
A word enclosed in single quotes, up to 254 characters long, consisting of
alphabetic characters A through Z, and numeric characters 0 through 9.
arithmetic expression
An expression that enables two or more numeric quantities to be combined
to produce a single value.
array
A series of consecutive memory locations in one or more dimensions.
assignment
Establishing the value of a field as a result of simple data movements, an
arithmetic expression, or logical bit manipulation.
bounds checking
A process that automatically checks that indexes and subscripts do not
reference data outside the storage boundary of the field being referenced.
commit point
A point at which updates are committed to the operating system.
commit processing
A process that issues commands to the operating environment signifying the
end of one unit of work and the start of the next.
conditional expression
Program logic using a statement that offers an alternative to the normal
top-to-bottom execution of a program.
control report
A report that automatically accumulates and prints totals of quantitative
report information.
conversational program
In a CICS environment, a program in which CA-Easytrieve does not issue a
commit point during each terminal I/O. See SCREEN COMMIT Parameter in the
"Screen Processing" chapter for more information.
decision/branching logic
Controlling the execution of a program by coding statements that govern
the flow of a program depending on the truth value of a conditional
expression.
Página 287
EASYTRIEVE Tutorial
environment section
An optional section of a CA-Easytrieve program that enables you to
customize the operating environment for the duration of a program's
compilation and execution by overriding selected general standards. See
the PARM Statement.
external table
Table data that is located in a file external to the program. An external
table is established just before use.
graph format
The display format of a CA-Easytrieve graph, consisting of a title area,
work area, and function key area.
GRAPH subactivity
An area in a JOB activity where graphs are described.
hexadecimal literal
A word used to code a value that contains characters not available on
standard data entry keyboards. A hexadecimal literal must be prefixed
with X', and terminated with a single quote, and can contain digits 0
through 9, and letters A through F.
indexing
A data reference that results from CA-Easytrieve deriving a displacement
value to correspond to a particular occurrence in a field name defined
with OCCURS. See Array Processing for more information.
instream macro
Macro statements that are included in the source program input to
CA-Easytrieve.
instream table
Table data within the program immediately following the argument (ARG) and
description (DESC) fields for the file. An instream table is established
at the time the program is compiled.
JOB activity
An activity in a CA-Easytrieve program that reads information from files,
examines and manipulates data, writes information to files, and initiates
reports and graphs.
library section
An optional section of a CA-Easytrieve program that describes the data to
be processed by the program. A library section is optional only if a
program is not doing any input or output of files.
Página 288
EASYTRIEVE Tutorial
macro
One or more often-repeated CA-Easytrieve source statements that you can
save to use in more than one program or multiple times within a program.
mask
A user-supplied sequence of characters against which CA-Easytrieve edits
data input into a numeric field.
pattern
A user-supplied sequence of characters that describes the format of data
in a field. Used to edit complex combinations of data types and character
sequences.
PROGRAM activity
An activity in a CA-Easytrieve program that is a simple top-down sequence
of instructions.
pseudo-conversational program
In a CICS environment, a program in which CA-Easytrieve issues a commit
point during each terminal I/O. See SCREEN COMMIT Parameter in the
"Screen Processing" chapter for more information.
report procedures
Routines provided in CA-Easytrieve that perform special data manipulation
for a report.
REPORT subactivity
An area in a JOB activity where reports are described.
rollback
A process that recovers the updates made since the last commit point.
screen attributes
Information that controls the display of screen items, such as color and
brightness.
Página 289
EASYTRIEVE Tutorial
screen format
The layout of a CA-Easytrieve screen that consists of a title area, work
area, message area, function key area, and border. The size of the screen
defaults to the values specifies in the Site Options Table.
screen item
A field or literal that you want to display to or receive from the
terminal user.
screen procedures
Routines provided in CA-Easytrieve that perform customized actions
specific to your screen application.
SCREEN activity
An activity in a CA-Easytrieve program that defines a screen-oriented
transaction.
segmented data
A common data structure in which each record contains a fixed portion of
data and multiple occurrences of data segments.
sequenced report
A report in which data items used in the report are sorted.
SORT activity
An activity in a CA-Easytrieve program that creates sequenced or ordered
files.
state tables
Examine each character in a string to determine if the string is
acceptable or not. Each character examined causes a transition from one
state to the next. Most compilers use state tables for recognizing
tokens, such as labels or identifiers.
subscript
An integer (or a field containing an integer) that represents the
occurrence number of the element within the array to be referenced.
Página 290
EASYTRIEVE Tutorial
SYSPRINT
The default CA-Easytrieve system output printer, whose actual destination
is set in the Site Options Table.
system-defined fields
Special read-only data fields provided by CA-Easytrieve that are stored as
part of working storage.
table
A collection of uniform data records. The argument uniquely identifies a
table entry; the description is the remainder of the table entry.
~*~
Página 291