Ca Easytrieve Report Generator 11 6
Ca Easytrieve Report Generator 11 6
Copyright © 2005-2019 Broadcom. All Rights Reserved. The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries.
Contents
Release Notes............................................................................................................................................. 15
New Features.................................................................................................................................... 15
New Features Since Release 6.4......................................................................................................17
Differences Between Releases......................................................................................................... 22
Release Comparison......................................................................................................................... 35
Migration Guidelines........................................................................................................................36
CA SMP/E Internet Service Retrieval............................................................................................. 37
Portfolio Simplification.................................................................................................................... 37
Simplified Design System................................................................................................................39
Documentation Changes...................................................................................................................39
Installing..................................................................................................................................................... 40
Installation Best Practices................................................................................................................ 41
Install CA Easytrieve for Windows.................................................................................................41
Install CA Easytrieve for UNIX and Linux for zSeries.................................................................. 43
Install CA Easytrieve for Linux PC................................................................................................ 45
Install CA Easytrieve for z/OS........................................................................................................ 50
How the Installation Process Works......................................................................................52
Preparing for Installation........................................................................................................53
Install Your Product Using CA CSM....................................................................................53
Installing Your Product Using Pax ESD or DVD................................................................. 90
SAMPJCL and CBAAJCL Contents................................................................................... 104
Upgrade CA Easytrieve for z/OS.................................................................................................. 107
Install CA Easytrieve Packaged with CCS....................................................................................107
Install CA Easytrieve SDS.............................................................................................................108
Install the License Key.................................................................................................................. 108
Maintain Your Product...................................................................................................................109
Configuring............................................................................................................................................... 110
Configuration Best Practices..........................................................................................................110
Configure Your Product................................................................................................................. 111
Configure With CA CSM.................................................................................................... 112
Configure Without CA CSM............................................................................................... 112
Configure Your System..................................................................................................................119
Setting Environment Variables............................................................................................ 120
Updating the Table...............................................................................................................122
Getting Started..........................................................................................................................................160
Programming Lessons.................................................................................................................... 164
Lesson 1 - Library Section, FILE and DEFINE Statements................................................164
Lesson 2 - Activity Section, JOB and IF Statements.......................................................... 167
Lesson 3 - Activity Section, Report Output with PRINT Statement................................... 171
Lesson 4 - Activity Section, REPORT Statement and Report Definition Statements..........175
Library Section - Describe and Define Data................................................................................. 181
Describe Files and Fields..................................................................................................... 184
Activity Section - Processing and Logic....................................................................................... 196
JOB Activities...................................................................................................................... 196
SORT Activities................................................................................................................... 214
PROGRAM Activities..........................................................................................................217
Activity Section - Input and Output.............................................................................................. 218
Activity Section - Reporting.......................................................................................................... 229
Processing of Reports...........................................................................................................234
Label Report......................................................................................................................... 241
Testing Aid Parameters........................................................................................................ 244
Format Determination Parameters........................................................................................244
Multiple Reports................................................................................................................... 246
Report Procedures (PROCs).................................................................................................249
System-Defined Fields................................................................................................................... 260
General Purpose Fields........................................................................................................ 260
File Processing Fields.......................................................................................................... 261
Report Processing Fields......................................................................................................262
Using......................................................................................................................................................... 263
Using Best Practices.......................................................................................................................263
Create and Format a Report...........................................................................................................265
Compile and Link Your Program.................................................................................................. 271
Controlling Compilation.......................................................................................................271
Results of the Compilation...................................................................................................272
Program Compilation and Link-Editing Using JCL............................................................ 275
Submitting Your Program for Non-Mainframe Compilation.............................................. 288
Link-Editing Non-Mainframe Programs.............................................................................. 291
Execute a Program......................................................................................................................... 297
Execute a Program in UNIX and Linux for zSeries............................................................298
Execute a Program in Windows.......................................................................................... 298
Execute a Program in z/OS..................................................................................................299
File Description String (Non-Mainframe Only).................................................................. 300
Execute a Windows Indexed File Program......................................................................... 302
Execute a Btrieve Program.................................................................................................. 303
Execute a C-ISAM Program................................................................................................ 304
Report Display Facility (z/OS Only)................................................................................... 305
Error Analysis Report.......................................................................................................... 309
Execute a Program on a Web Server...................................................................................311
Alternate Collating Sequence Table.............................................................................................. 317
Extended Reporting........................................................................................................................ 320
Printing Concepts................................................................................................................. 322
Printer Characteristics...........................................................................................................336
Font Characteristics.............................................................................................................. 350
Set Up Source Control Supports....................................................................................................357
Workbench...................................................................................................................................... 359
Main Window....................................................................................................................... 360
Opening Windows................................................................................................................ 363
Manage Files and Applications............................................................................................363
Edit Source or Text Files.....................................................................................................368
Build and Run Programs......................................................................................................371
Debug Programs................................................................................................................... 373
Set Preferences..................................................................................................................... 381
Configuration Manager.........................................................................................................383
Workbench Tools and Utilities............................................................................................ 396
Creating Toolkit and Writing Scripts...................................................................................410
Workbench Help...................................................................................................................425
CA Easytrieve/Earl Usage..............................................................................................................425
CA Easytrieve SDS........................................................................................................................ 427
Create a JCL/Submit Prolog Source File.............................................................................427
Create a Project and Host Profile........................................................................................ 428
Import File and Field Definitions........................................................................................ 429
Design and Run a Report.....................................................................................................429
Programming.............................................................................................................................................430
Text Conventions and Field Rules.................................................................................................430
Code Programs............................................................................................................................... 432
Structured Programming.......................................................................................................432
Program Sections..................................................................................................................433
Define Files and Fields........................................................................................................ 434
8-Byte Binary Fields............................................................................................................ 438
Declarations.......................................................................................................................... 440
Literal and Data Formatting Rules...................................................................................... 441
Control Program Flow..........................................................................................................445
Assignments and Moves.......................................................................................................451
Table Processing...................................................................................................................461
Array Processing...................................................................................................................463
Inter-Program Linkage......................................................................................................... 472
Code Efficient Programs...................................................................................................... 488
Code CICS Programs........................................................................................................... 489
Multiple Platform Considerations........................................................................................ 489
SQL Database Processing.............................................................................................................. 490
Programming Methods......................................................................................................... 490
CA Easytrieve SQL Statement Rules.................................................................................. 491
Program Environment...........................................................................................................491
Library Section Definition................................................................................................... 494
CA Easytrieve SQL Files.....................................................................................................501
Automatic Retrieval Without a File.....................................................................................507
Native SQL Processing........................................................................................................ 509
ODBC Data Sources............................................................................................................ 514
CA IDMS Database Processing..................................................................................................... 516
CA IDMS Interface.............................................................................................................. 517
IDD Interface........................................................................................................................531
Sample Database and Logical Record................................................................................. 533
IMS/DLI Database Processing....................................................................................................... 538
Test Database........................................................................................................................539
PCB and PSB Processing.....................................................................................................540
Automatic Input....................................................................................................................541
Controlled Processing Using DLI Statements..................................................................... 547
IMS Fast Path DEDB Processing........................................................................................ 553
CA Datacom/DB Database Processing.......................................................................................... 553
Access the Database............................................................................................................. 554
Access Macros......................................................................................................................554
File Processing................................................................................................................................568
File Processing Modes......................................................................................................... 570
Sequential Files.................................................................................................................... 571
Virtual File Manager............................................................................................................ 574
Indexed Files........................................................................................................................ 575
Relative Files........................................................................................................................ 578
Sorting Files..........................................................................................................................582
Synchronized File Processing.............................................................................................. 584
PRINTER Files.....................................................................................................................589
Non-Mainframe Files........................................................................................................... 590
Report Processing........................................................................................................................... 591
PRINT Statement (Report Processing)................................................................................ 592
Report Formats..................................................................................................................... 594
Report Generation.................................................................................................................596
Standard Reports.................................................................................................................. 597
Label Reports........................................................................................................................604
XML Reports........................................................................................................................607
Sequenced Reports............................................................................................................... 609
CONTROL Reports..............................................................................................................609
Report Procedures.................................................................................................................629
Routing Printer Output......................................................................................................... 641
Use Extended Reporting.......................................................................................................643
Extended Reporting Concepts.............................................................................................. 644
Report Layout Processing.................................................................................................... 656
Screen Processing........................................................................................................................... 663
Screen Format.......................................................................................................................664
Use the SCREEN Statement................................................................................................ 666
Screen Title Area..................................................................................................................668
Screen Work Area................................................................................................................ 669
Format an Item for Display................................................................................................. 671
Screen Message Area........................................................................................................... 685
Screen Function Key Area................................................................................................... 685
Screen Key Processing......................................................................................................... 685
Screen Procedures.................................................................................................................686
Commit Processing...............................................................................................................693
Sample Screen Applications.................................................................................................697
Macro Facility................................................................................................................................ 706
Invoke a Macro.................................................................................................................... 708
Define Macros...................................................................................................................... 709
Process Macros..................................................................................................................... 711
In-stream Macros..................................................................................................................712
SUPRA Interface Option................................................................................................................714
SUPRA Interface Operation.................................................................................................715
TOTAL Interface Option............................................................................................................... 726
%ADDM - Add Master (TOTAL).......................................................................................728
%ADDV - Add Variable (TOTAL).....................................................................................729
%CBLCNVRT...................................................................................................................... 730
%CLOSX - Close TOTAL File........................................................................................... 730
%CONCAT...........................................................................................................................730
%CONVAE...........................................................................................................................731
%CONVEA...........................................................................................................................731
%DATECALC...................................................................................................................... 732
%DATECONV..................................................................................................................... 733
%DATEVAL........................................................................................................................ 734
%DELM................................................................................................................................ 735
%DELVD..............................................................................................................................736
%DFNTOTF......................................................................................................................... 737
%EZSSID..............................................................................................................................737
%EZTINI.............................................................................................................................. 737
%FINDX............................................................................................................................... 738
%GETCALEN...................................................................................................................... 739
%GETJULI........................................................................................................................... 739
%RDNXT............................................................................................................................. 739
%OPENX.............................................................................................................................. 740
%READD............................................................................................................................. 740
%READM.............................................................................................................................741
%READR..............................................................................................................................742
%READV............................................................................................................................. 743
%RGHTJUST....................................................................................................................... 744
%SINOF................................................................................................................................744
%SINON............................................................................................................................... 744
%VERNUMP........................................................................................................................745
%WRITM............................................................................................................................. 745
%WRITV.............................................................................................................................. 746
Example - Retrieve Records Using a Tickler File...............................................................747
CA EZ/Key............................................................................................................................................... 984
Additional Resources................................................................................................................................985
Product Names..........................................................................................................................................986
2 Release Notes
New features, release comparison, and migration guidelines.
Welcome to the CA Easytrieve® Report Generator Release Notes for Release 11.6. This section includes the following
articles:
New Features
This article describes the new features, enhancements, and changes for Release 11.6:
This article describes the following new features, enhancements, and changes in CA Easytrieve Report Generator for Release
11.6:
REGION=OM
Continuous Delivery
CA Easytrieve uses the continuous delivery (CD) release model for the delivery of new features. In the CD release model:
• Enhancements are delivered in the maintenance service stream as feature PTFs. New product features and fixes are no
longer bundled together.
• Enhancements are delivered disabled to give you more control over when and how the features are implemented. With new
features disabled, you control when to make the new features available for use in your environment. An explicit action is
required to enable the feature.
• Individual product fixes are provided when needed, separate from product features. You can apply product fixes without
enabling new features, which limits exposure to additional features being applied in a production environment. These
changes can limit SMP/E dependencies that were forced previously by bundling features and fixes together.
CA Easytrieve® Report Generator 11.6
After full integration and regression testing with other CA Technologies products, the enhancement and product fixes are
added into the CA Recommended Service for z/OS (CA RS), ensuring product quality and the integrity of your environment.
CA RS is an important part of a good preventive maintenance philosophy that lets you develop and implement a proactive
maintenance strategy in which you apply preventive maintenance on a regular schedule.
Important: We recommend that you use the CA SMP/E Internet Service Retrieval to acquire product maintenance. This
service uses the IBM SMP/E RECEIVE ORDER command and can reduce hours of maintenance time to just minutes. You can
acquire maintenance on demand or can schedule an SMP/E job to run regularly, which eliminates time consuming fix searches
and the need to select maintenance manually through the Broadcom Support Portal.
WARNCC {F|S|Z}
• F
Returns a condition code of 4 for warnings. This is the default.
• S
Returns a condition code of 16 for warnings.
• Z
Returns a condition code of 0 for warnings.
Enhancements for Release 11 SP3
Enhancements for Release 11 SP3 include:
• Support for multiple SSIDs with CA PAN/SQL feature
• Determine data set block size
• New Function mode
Support for Multiple SSIDs with CA Pan/SQL Feature
This feature allows a CA Easytrieve Report Generator program to invoke a specific DB2 PAN/SQL installation from among
multiple installations based on the value specified for PARM SSID in the program. With this feature, if you have multiple
versions of DB2 installed, you can have multiple CA PAN/SQL installations for each DB2 within a single library, and select
the DB2 you want to access by way of the PARM SSID value in the program. This is done by building the Easytrieve SSID
Table which is a cross-reference table that assigns a specific PAN/SQL installation with a DB2 SSID. The SAMPJCL member
CA Easytrieve® Report Generator 11.6
SSIDTBL is used to build the table. Information about how to create multiple PAN/SQL for DB2 installations in the same load
library is provided with PAN/SQL.
Note:
In Release 11.6, member SSIDTBL is in hlq.CBAAJCL.
Determine Data Set Blocksize
The new BLOCK0 option specifies whether a system-determined block size is used for files that do not have the logical length
and block size coded. This option passes a zero value to the operating system, which in turn determines the optimum block
size.
Use this option only if your operating system supports IBM system determined block size.
Note: You can override this option through Block-length of the FILE statement. There is no PARM statement override.
This option has the following format:
BLOCK0 {N|D|P|A}
• N
Indicates that the system does not determine the block size for data sets. Specify the block size through JCL or the FILE
statement. This is the default.
• D
Indicates that the system determines the block size for data sets that are stored in a tape or a disk.
• P
Indicates that the system determines the block size for data sets stored in a PRINTER.
• A
Indicates that the system determines the block size for data sets stored in a tape, disk or a PRINTER.
Note:
This option was available in Release 6.4 but was not in Release 11 prior to SP3.
New Function Mode
NEWFUNC is a new option in the Options Table. The NEWFUNC option specifies whether to use the standard Release 11.x
compiler or the compatibility mode compiler to compile your CA Easytrieve Report Generator programs. This option does not
have any impact on link-edited CA Easytrieve Report Generator application programs. NEWFUNC applies only to z/OS.
The NEWFUNC option has the following format:
NEWFUNC {Y|N}
• Y
Compiles and runs programs using the latest product release. This option incorporates all new functionality. This is the
default.
• N
Compiles and runs programs using the compatibility mode of CA Easytrieve Plus Report Generator. This option gives you
more control when moving your applications to CA Easytrieve Report Generator Release 11.x.
Note:
• You cannot override this option in the PARM statement.
• For more information about the standard and compatibility mode compilers, see Migration Guidelines.
• For information about running programs in New Function mode, see Configuration Best Practices.
Enhancements for Release 11 SP2
Enhancements for Release11 SP2 include:
• New options
• Modified options
CA Easytrieve® Report Generator 11.6
• Unsupported options
New Options
New options for Release 11 SP2 include:
• AMODE31 {Y|N}
Specifies the location of where memory is to be allocated during the execution of the CA Easytrieve Report
Generator application program. (execution time, z/OS only)
• Setting AMODE31 to Y allows all possible memory allocations to be made above the 16meg line.
• Setting AMODE31 to N causes all possible memory allocations to be made below the 16meg line.
• Storage allocation below the 16meg line is required if the Easytrieve application program calls, (or uses as a FILE
EXIT), a 24-bit subprogram. The default is Y.
• You can override this value through PARM CALL(AMODE31|AMODE24)
When the subprogram being called is link-edited as AMODE(24) and if any parameters are being passed to that program,
those parameters must reside in memory that is located below the 16meg line. Memory location can be controlled at the
following installation level as well as at the program level:
• Installation level
To force all storage below the 16meg line for all CA Easytrieve Report Generator programs, set the AMODE31
Installation Option to N. For more information see Configuration Best Practices and Updating the Table.
• Program level
To force storage below the 16meg line for a specific CA Easytrieve Report Generator program, you must specify the
CALL(AMODE24) parameter in the PARM statement in the program.
• MTVSERR (Y|N)
Determines how an empty input VSAM file is to be handled. Setting MTVSERR to Y will cause the CA Easytrieve Report
Generator I/O system to treat an empty VSAM input file as an I/O error condition. This will cause the immediate abnormal
termination of the program. Setting MTVSERR to N will cause an empty VSAM input file to be handled as though it is at
End-Of-File. The default is N.
• SPRTXIT modname
Specifies the name of a user-supplied SYSPRINT exit routine. The modname must be a valid program name. For more
information on the SYSPRINT exit capability, see Unit Record Exits. This is an execution time option for z/OS only. The
default is no exit name (blanks).
Modified Options
The following options have been renamed or modified:
The LIST(FILE) option setting default is now changed to LIST(NOFILE). In past releases the generation of end-of-job File
Statistics was the default operation. With this release, the default is changed to generate no File Statistics by default.
Unsupported Options
CA Easytrieve® Report Generator 11.6
The following options are no longer supported in Release 11.x. Determine if any of these options are used at your site to
understand how your programs could be affected.
• DATEMLC
The DATEMLC option that was available in Release 6.X is no longer an option in Release 11. Instead, the DATEMLC
processing is now always equivalent to setting DATEMLC to Z (leading zero on single digit months). When the first part
of a date field, (month or day), is a one-digit value, that value will be prefixed with a leading zero. There is no built-in
option to replace that leading zero with a blank.
If programs compiled and linked under Release 6.4 0311 are now getting a blank instead of the leading zero when run
under CA Easytrieve Report Generator Release 11.x and you wish to simulate 6.4 0311 DATEMLC=B, you can copy the
6.4 EZTPOPT load module to the r11 CAILIB.
• CMSVFM
Specifies the file mode of the CMS minidisk used for the VFM work file when operating under VM/CMS.
New Features for r11 SP0
The following features are new for CA Easytrieve Report Generator r11 SP0 if you are upgrading from CA Easytrieve Report
Generator for UNIX or Windows 1.4:
• C-ISAM Processing (UNIX only)
• File Statistics
• New environments
• ODBC processing
• Program level date override
• XML report output
• Windows indexed files
• Windows-based Compiler and runtime environment
• Windows-based Interactive Development Environment (IDE)
• GUI printer set definition and option table generator
C-ISAM Processing (UNIX only)
Variable-length and relative record format C-ISAM files are supported with CA Easytrieve Release 11.x.
File Statistics
You can now optionally output file statistics containing activity I/O record counts.
Note: CA Easytrieve Release 11.x does not open output files that are not used in an activity. Therefore, the output files
remain undefined. This is a known difference between CA Easytrieve Release 6.4 and Release 11.x. CA Easytrieve Release 6.4
opened all output files whether or not they are used which allowed files to be created with DCB information.
New Environments
CA Easytrieve Report Generator Release 11.x operates in new environments, including Solaris UNIX, Linux, and Windows.
ODBC Processing
The SQL Interface to CA Easytrieve Report Generator now supports ODBC environments.
In the Windows and UNIX environments, this allows access to any data source defined within the ODBC data source
administrator. Within CA Easytrieve Report Generator, the following statements are all that is required to define and access an
ODBC data source named PERSNL:
an XML file. Each field that appears on a CONTROL statement becomes a group or parent element and each field on the LINE
statement will be “wrapped” within that group.
For an XML report, note the following:
• No printed output is generated.
• Control and summary totals are not generated.
• Spacing statements used on the REPORT statement will be ignored.
Windows Indexed Files
An internal Indexed Sequential Access Method (ISAM) is included with the Windows version. This will provide emulation
services for developing mainframe VSAM programs.
Windows-Based Compiler and Runtime Environment
In addition to the UNIX environment, the Compiler now runs in Windows as well as z/OS. This results in a single compiler
working on all supported platforms and automatic availability of new features on any other platform.
Windows-Based Interactive Development Environment (IDE)
This release includes the Workbench, a Graphical User Interface (GUI) for the development and testing of CA Easytrieve
Report Generator programs. The Workbench provides color-coded program displays based upon CA Easytrieve Report
Generator syntax.
Compiler error messages that highlight the error within the source code are also provided. Once all errors are resolved and
depending upon where the output is directed, the results of the program are displayed in a new window. This Workbench
provides a seamless testing and execution environment for most types of CA Easytrieve Report Generator programs.
When the data for the program is not available from within the Windows environment, you can syntax-check the program
within the GUI and then upload it to the platform where the data exists. You can then compile and execute the program
using the CA Easytrieve Report Generator product for that platform. In most cases, this can occur without any changes to the
program.
Workbench features are as follows:
• You can group macros and called programs into an application that lets you easily open, view, and edit all components of a
program at the same time.
• An interface to Microsoft SourceSafe and CA Pan/LCM is provided to allow managed source control for your programs.
• You can debug a program in the Workbench environment. Once a program is successfully compiled, it can be executed in a
step-by-step mode to allow a programmer to view and follow the program flow. At any point during execution, any defined
variable can be displayed within the Data Director and those values can be monitored during the execution of the program.
You can also set unconditional or conditional breakpoints on any executable line within the program to compare the value
of a variable.
GUI Printer Set Definition and Option Table Generator
CA Easytrieve Report Generator Release 11.x offers menu options from the Workbench to create printer set definitions and
maintain the options table. The Configuration Manager enables options and multiple printer definitions to be defined and
maintained. It enables the generation of a binary output file that is compatible with CA Easytrieve Report Generator in the z/
OS, UNIX, and Windows environments. You can subsequently move this file to the appropriate platform where it can be used
directly by the product.
Enhancements from CA Easytrieve Plus Report Generator
The product supports the following enhancements from CA Easytrieve Plus Report Generator:
• Environment-independent FILE statements help ensure portability between environments and access methods.
• The CLOSE statement now allows controlled file opens and closes.
• A dynamic file name provides the ability to determine the file name at execution time.
• Simple read/write access to SQL files provides automated cursor management with full application capabilities.
• File-based SQL has been greatly enhanced to automate the SELECT statement. This new method automates the work of
coding the selected columns and the INTO list of host variables. SQL files previously required a SELECT statement on the
FILE statement and a complete INTO list for the columns. (The old style is supported though no longer documented.)
• Complete control over SQL units of work is provided using the COMMIT statement and activity options.
• 128-character entity names for ANSI standard support.
• Descriptive logical file names longer than eight characters can now be used.
• Boundary checking of subscripts and indexes during execution protects environment and makes debugging easier.
CA Easytrieve® Report Generator 11.6
• The PROGRAM super activity can execute other activities as logic dictates.
• The PROGRAM statement provides direct access to execution parameters.
• You can LINK and TRANSFER to other CA Easytrieve programs.
• SEARCH of INDEXED table file results in keyed read rather than binary search.
• You can specify column locations for title items in automatically adjusted reports.
• Warning messages are issued during compilation to provide helpful direction.
• The compilation listing has been enhanced.
• Storage of intermediate reporting data can now be automatically directed to report work files (temporary sequential disk
files) instead of to virtual (VFM) files. This option provides a large performance improvement for large reports.
• Effective in Release 11.x, you can use the COL parameter on the TITLE statement without specifying the ADJUST
parameter on the REPORT statement.
• You can use the BEFORE-LINE report procedure to modify detail line information.
• You can control and enable 24-bit processing at the installation and program level using a CALL (AMODE24) parameter
on the PARM statement. The default is 31-bit processing.
• You can specify a block size of zero as a parameter of the FILE statement or within the DCB parameter of your JCL. This
block size allows complete control of file allocations.
• CA Easytrieve uses the Large Block Interface (LBI) for TAPE files, which lets you use the maximum block size for that
tape device.
• You can execute multiple JOB activities under the same LE Run Unit. Specify ENVIRONMENT (COBOL) on the
PROGRAM statement and specify the EXECUTE statement within the PROGRAM activity to invoke the JOB activities.
Example:
Prior Release
An error was detected only when a subscript or INDEX causes an 0C1 or 0C4 abend. The programmer had only the abend
dump to identify the problem.
Release 11.x
If a subscript or INDEX is out of bounds, an informative error is always forced. This error message helps the programmer
identify the exact problem area.
In the following example, Release 6.4 would silently overwrite FLD3 with data from the assignment to FLD2(SUB) because
SUB starts with a value of 0. However, Release 11 would issue message EZABX009 to indicate that an index or subscript is
out of range.
Release 11.x
CA Easytrieve Report Generator honors the END statement but does not support it. CARD input data that was used within
the program source must use a DD statement to point to the input data. For compile-and-go execution, remove the CARD
keyword and specify the file name in the DD statement on the FILE statement. For link-edited execution, you can use the
CARD keyword and specify SYSIN in the DD statement.
See the following example:
Prior Release
The SYSIN exit could be invoked during execution of a program in compile-and-go mode.
Release 11.x
The SYSIN exit (SINXIT) is called only during the compilation phase and not during the execution phase. The parameter list
for the SYSIN exit is the same in r11 as it was in 6.x.
Conditional Expressions Changes
Prior Release
CA Easytrieve® Report Generator 11.6
Comparisons involving a VARYING alphanumeric field as the subject or object used the current length of the subject field as
the length of the comparison.
Note: For complete details about the special VARYING alphanumeric field type, see DEFINE Statement and Define Files
and Fields.
Release 11.x
Comparisons involving a VARYING alphanumeric field as the subject or object use the longer of the subject or object for the
comparison. The shorter subject or object is padded with spaces.
Example:
TRUEFALSE
FALSEFALSE
The Release 6.x and Release 11.x DEFINE statements have the following differences:
• If you define the same field more than once with different attributes as shown in the following example, a warning is issued
during compilation.
• When you redefine a field that contains an OCCURS value, the field inherits the OCCURS value. The inherited value
lets the field be subscripted. If the field length exceeds the redefined length, a warning message is issued when the field
is defined and subscripting at reference is not permitted. To implement bounds checking, the product now provides this
protection. When you intend to determine the starting location of a dynamically, use an INDEX rather than a subscript.
Subscripting carries the length of an item length with its references. Use of a smaller storage area combined with
subscripting can result in overlaid storage and protection exceptions in older versions. If a multidimensional array is
defined, all occurrences of secondary dimensions must fit into a single occurrence of the corresponding primary dimension.
A warning message results when the field is defined and subscripting of secondary dimensions is not allowed at reference.
The following example illustrates the Release 11.x warning message given because FLDP-R redefines the shorter FLDP
field but inherits its OCCURS attribute. Release 6.4 gave no warning and either addressed bad storage or abended.
• Fields referenced in activities in which no file I/O is specified now receive warning messages because open files can
now be inherited. In Release 6.4, they could not be inherited and therefore error messages were issued. This difference,
therefore, does not affect working Release 6.4 programs.
The following example shows 6.4 functionality:
• Varying length alphanumeric fields are now modeled correctly. If you use a varying length alphanumeric field as a model,
the VARYING keyword is included in the length and type of the new field. See the following example:
The following example shows the 6.4 results, in which FLDV2 is not VARYING:
The following example, shows r11 results with FLDV2 correctly modeled after FLDV1:
The following example processes two records, with the second record shorter than the first. The example writes the records to
a file, then reads them and displays a field that is defined beyond the length of the record:
The Release 6.4 results display data outside of the first record and also a portion of the second record in the system buffer. The
Release 11.x results display the program storage buffer, but the second record still contains the ‘BC’ characters from the first
record. Only refer to data that is constrained by RECORD-LENGTH. The buffer is not initialized between input operations.
The following example reads the file and correctly displays the variable portion of the record (VFLD2):
If you write records from a variable-length input file to a variable-length output file, you must set the RECORD-LENGTH
field for each output record. The RECORD-LENGTH field of the output file must be set to the RECORD-LENGTH value of
the input file before the PUT to the output file. See the following example:
SQL files without the DEFER keyword were SQL files behave like other file types. The cursor is opened
opened before executing the user-defined START procedure, before the user-defined START procedure, unless DEFER
if a procedure was coded. This behavior contradicted the is coded. With DEFER, the cursor is opened after the user-
documented behavior and did not conform to the behavior for specified START procedure. This way, host variables can be
other file types. properly set before the cursor is opened.
The access method for the VS parameter was determined at The VS parameter is replaced with SEQUENTIAL,
execution time. INDEXED, and RELATIVE to provide better portability.
The underlying access method is still determined at execution
time. However, VS is still valid syntax, and INDEXED
(KSDS) is assumed when VS is coded. See the example that
follows.
Example: VS parameter
The following example shows 6.4 syntax:
WORKFILE {Y|N}
CA Easytrieve® Report Generator 11.6
The WORKFILE option is used to activate the Automatic Report Workfiles feature.
WORKFSPA nnn
The WORKFSPA option indicates the number of cylinders that should be allocated for each of the dynamically-allocated
Report Workfiles.
Printer Profiles are also new in Release 11.x. The profiles specify the physical data set attributes for logical printers including
SYSPRINT. If you increase the LINESIZ value, you should also review the settings of the SYSPRINT profile.
Note:
For more information about these options, see Updating the Table.
Options Table
Prior Release
With Release 6.x, the Options Table existed as a load module.
Release 11.x
Starting with Release 11.x on the z/OS platform, the Options Table exists as a file that may optionally be identified by the
EZOPTBL DD statement in the Compilation JCL and in the Execution JCL. If the DD is omitted from the Compilation JCL
and EZTINI was not created using JOB6EOP, default Option Table values are generated by the Compiler. If EZTINI does not
exist and the DD is omitted from the Execution JCL, an error occurs and the program cannot run.
A utility is supplied to convert your 6.x options table to the new format. The following 6.x options are not supported in the new
options table:
Note:
• Several Release 6.x options are still supported in Release 11.x, but with a new name. The conversion utility will handle
these options properly. For a list of former and current option names, see Modified Options in New Features Since Release
6.4.
• The following 6.x options are supported in the new options table, but are ignored and reserved for future use:
• TBLMAX
• UPDTIDD
• While comments describing each option were given in the Release 6.x OPTTBL option table macro, in Release 11.x,
comments can only be written as a separate line, starting with an asterisk and describing the particular option and meaning
of possible values.
• Options can be started at any position, if the options name is the first non-blank entry on that line. They must not end
beyond column 80.
• Options can also be specified in lower case. If an option value is one of a set of valid values, it is converted to upper case.
Other option values remain in lower case. Those specifying a load module name, a device or a DDNAME must be specified
in upper case or they will cause a problem during compile or execution time.
Reports
The following enhancements have been made to reports in Release 11.x.
Title fields were refreshed only when printing titles as the Items on the title line are now always refreshed with the
result of a detail line. current value of fields when produced.
Reports that included a control break had one extra blank line The extra blank line at the end of the report is now omitted.
at the end of the report. This is only at the end of the report, not at the end of every
page.
A single, nonsequenced (nonspooled) report was treated All reports work consistently in their handling of W fields.
differently than other reports. As a result, W (working This change can cause older, miscoded programs to behave
storage) fields were sometimes used instead of S (static) differently due to misuse of W fields.
fields. When that report became spooled (by adding
sequencing or inserting a prior report) the W field logic
sometimes caused report misbehavior.
Special named break procedures referred to the first record of Special named break procedures refer to the last detail record
the new control group. As a result, detail references did not of the control group so that detail references match control
always match associated control and sum fields. and sum information. This change has no adverse effect when
standard programming practices were observed while saving
detail information manually. See the following example.
Reserved Words
The list of new reserved words follows. Programs that have field names with these values will cause errors.
• BREAK-LEVEL
• DRAW
• ELEMENT-RECORD
• END-REPEAT
• EXECUTE
• GRAPH
• HIGH-VALUES
• INITIATION
• LOGICAL-RECORD
CA Easytrieve® Report Generator 11.6
• LOW-VALUES
• NOTITLE
• SET
• SUMMARY-INDEX
• SYSUSERID
SEQUENCE Statement Changes
Prior Release
Duplicate field names were allowed.
Release 11.x
Duplicate field names result in a compiler error. See the following example:
5/10/1105/10/11
The following example shows the error that is issued when the UPDATE parameter is omitted:
2
FILE VSINP VS 3 INREC 1 150 A 4
* 5 JOB INPUT VSINP 6 PUT VSINPEZTC0252E >>>
$ must be CREATE or UPDATE file
Prior Release
A READ or POINT statement could override the FILE statement VSAM type (ES).
Release 11.x
If the FILE statement specifies sequential processing (by specifying the VS(ES) or SEQUENTIAL parameter), then direct-
access statements (READ, POINT, WRITE) are flagged as syntax errors. Files targeted by direct-access statements must
specify INDEXED or RELATIVE on the FILE statement. However, a file specifying INDEXED can be accessed using the
sequential-access statements (GET, PUT).
In the following example of 6.4 code, the READ overrides the FILE statement ES parameter:
In the following release 11.x code example, the READ statement shows a syntax error because VS(ES) has not been changed
to INDEXED:
Prior Release
The attributes specified on the FILE statement were ignored. The access method for the VS parameter was determined at
execution time.
Release 11.x
The attributes specified on the FILE statement are not ignored. The attributes must match the organization of the actual VSAM
file.
For example, if the file that is being processed is a KSDS (keyed) VSAM file, but the FILE statement explicitly specifies the
ESDS type (sequential), processing is as follows: Release 6.4 compiles the program and executes without problems. Release
11.x compiles without problems but, at execution time, recognizes that the file organization does not match what was explicitly
specified on the FILE statement.
CA Easytrieve® Report Generator 11.6
The following errors occur when the code is executed in Release 11.x:
1 NAGLE 554.40
SEQ=01
2 POST 292.00
SEQ=02
2 PETRIK
220.80
SEQ=03
2 POST
292.00
SEQ=01
2 PETRIK 220.80
SEQ=01
In the Release 6.4 results, the sequence numbers are 01, 02, and 03 because the W field was treated like an S field. In the
Release 11.x results, the sequence numbers are all 01 because r11 treats the W field properly. Because W fields are copied to
the spool record when PRINT executes, the WFLD is not added until AFTER-LINE executes during despooling and printing.
As a result, the WFLD copy for every spool record contains the zero that WFLD contained at the time of the PRINT statement.
Release 6.4 incorrectly treated W fields like S fields when the first report was not sequenced. If you sequence this single report
or add a report before it, 6.4 properly spools the W field and shows the sequence numbers as "01". This inconsistent treatment
of the W fields causes inconsistent results.
Note: Both Release 6.4 and Release 11.x treat WFLDs coded as S fields properly, regardless of whether the report is
sequenced or is the first report. Future maintenance to the program will not jeopardize the working code.
CA Easytrieve® Report Generator 11.6
Release Comparison
This article lists the key features added since Release 6.4. Click the link for more information about a
feature.
This article lists the key features added after Release 6.4. Click the link for more information about a feature.
Migration Guidelines
It is important to have a solid migration strategy to ensure a smooth and successful migration to release
11.x from a prior release. The release 11.x release is unlike prior releases because its architecture resulted
in a new version of both the language compiler and the runtime system. Read this chapter before starting
your migration.
It is important to have a solid migration strategy to ensure a smooth and successful migration to CA Easytrieve® Report
Generator release 11.x from a prior release. The release 11.x release is unlike prior releases because its architecture resulted in
a new version of both the language compiler and the runtime system. Read this chapter before starting your migration.
Compatibility Mode
When you are ready to migrate to release 11.6, we recommend that you start by running any recompiled programs in
compatibility mode. This recommendation includes programs that use 'compile and go' mode for on-demand reporting.
Compatibility mode is available in Service Pack 3 and higher and is enabled by setting the NEWFUNC option to N. In
compatibility mode, programs are compiled and executed as under the release 6.4 compiler and you can delay testing and using
new release 11.x functionality. The only additional migration task you must perform is to copy your release 6.4 options table
load module EZTPOPT to release 11.x. This is done by copying the EZTPOPT load module from the release 6.4 CAILIB to
CBAALOAD for r11.6 and higher (or CAILIB for r11.0/r11.5).
After you successfully run your programs in compatibility mode, you can enable new function mode by doing the following:
1. Create another options table that is set to enable new functionality (with NEWFUNC Y specified).
2. Use the new EZOPTBL DD in your JCL to point to the new options table. If you link your programs, the load modules
created and linked under the earlier release continue to run under release 11.x with no changes in compatibility mode.
Warning: the same values for the option table parameters which you used with release 6.4.
If you link your programs, the load modules that are created and linked under the earlier release continue to run under release
11.6 with no changes in compatibility mode.
Note: Compatibility mode may not be supported in future releases. Plan to migrate your programs to new function mode.
Mode Detection
During migration, your environment can have some programs running in new function mode and some in compatibility mode.
You can determine how many programs are running in compatibility mode by using a monitoring tool to see which runtime
CA Easytrieve® Report Generator 11.6
module your programs load. A program running in compatibility mode loads the module EZTPD01. A program running in new
function mode loads ETRSM.
Additionally, the CA Easytrieve Report Generator report header indicates the release and mode. Examples are as follows:
• CA Easytrieve 11.6 SP0 indicates new function mode (NEWFUNC is set to Y).
• CA Easytrieve Plus 11.6-C SP0 indicates compatibility mode (NEWFUNC is set to N).
Portfolio Simplification
This article includes the portfolio simplification updates for .
This article includes the portfolio simplification updates for CA Easytrieve® Report Generator.
Runtime Report Generator for TSO Provides the ability to run CA Easytrieve applications
developed on another system without requiring the full
development environment.
Report Generator for TSO/XA DB2 Performs reporting online and enables creation of complete
online systems that can browse or update files and tables
using TSO.
Runtime Report Generator for CICS Performs reporting online and enables creation of complete
online systems that can browse or update files and tables in
IBM® CICS®.
Report Generator for CICS/SP DB2 Performs reporting online and enables creation of complete
online systems that can browse or update files and tables in
IBM DB2®.
Report Generator for CICS/XA DB2 Performs reporting online and enables creation of complete
online systems that can browse or update files and tables in
DB2.
Report Generator CA Datacom Option for SQL and Non- Enables CA Easytrieve to access data stored in CA Datacom
SQL databases using CA Datacom access commands or by coding
SQL statements to access the data.
Report Generator CA Datacom SQL Enables CA Easytrieve to access data stored in CA Datacom
databases by coding SQL statements to access the data.
Report Generator CA IDMS Option for SQL Enables CA Easytrieve to access data stored in CA IDMS
databases by coding SQL statements to access the data.
Report Generator CA IDMS Option for SQL and NON SQL Enables CA Easytrieve to access data stored in CA IDMS
databases using CA IDMS access commands or by coding
SQL statements to access the data.
Next Steps
To use these options, go to your usual download facility (for example, Download Management on Broadcom Support and
download the additional component features from the drop-down list. If one of the downloads requires an LMP key, follow
your usual process to acquire the key.
Documentation Changes
The following update has been made since the last release of this documentation:
Release Information
CA Easytrieve® Report Generator 11.6
The following update has been made since the last release of this documentation:
• Linux PC Installation Support—Added this section.
• CA Easytrieve Simplified Design System—Moved the text from Configuration Best Practices to this article.
Installing
The following update has been made since the last release of this documentation:
• Install CA Easytrieve for Linux PC—Revised the Install the License Key section, added the Install CA Licensing Files
section.
• Install CA Easytrieve SDS—Added this article.
• Install the License Key—Added this article.
• Maintain Your Product—Added this article.
Configuring
The following update has been made since the last release of this documentation:
• DDIVRND - Round or Truncate Division Result—Added to Compiler Options.
• Updating the Table—Moved the various option category sections to individual pages.
Using
The following updates have been made to the second edition of this documentation:
• Additional Compiler Options—Added WARNCC0 option description and removed RUNSYM option description.
• Alphabetical Listing of Options—Deleted RUNSYM option description and added WARNCC0 option description.
• Link-Editing Previously-Compiled Programs in UNIX, Linux for zSeries, or Linux PC—Explained how and when to force
the assembler to create a 32-bit .o file.
• Link-Editing with Other Systems—Noted link-editing restrictions for the Linux PC environment.
The following updates have been made since the last release of this documentation:
• Program Compilation and Link-Editing Using JCL—Updated CAILIB to CBAALOAD.
• Using CA Easytrieve Simplified Design System—This article has been added
Programming
• Standard Reports
• Report Headings—Updated the statement syntax.
• Line Item Positioning in Reports—Updated the report example.
• Report Procedures
• Static Working Storage—Updated the statement syntax.
Language Reference
The following update has been made since the last release of this documentation:
• ASSIGNMENT Statement—This article has been added.
• PROGRAM Statement—Added note for the USING parameter.
3 Installing
Install, upgrade, and maintain the product.
This article describes the installation prerequisites and the CCS version of the product. This section includes the following
articles:
Installation Prerequisites
This section describes the software and knowledge prerequisites that you need to install the product.
Software
You must install CA Common Services (CCS) Release 14.1 or higher.
CA Easytrieve® Report Generator 11.6
Note:
For more information about CCS, see the CA Common Services for z/OS documentation.
Knowledge
Depending on the platform, the installer should have the following knowledge or privileges:
Windows
• Familiarity with standard Windows installation using InstallShield
UNIX/Linux zSeries
• System Administrator privileges
• Familiarity with tar and other UNIX commands
z/OS
Knowledge of:
• JCL
• TSO/ISPF
• The z/OS environment and installing software in this environment
• Your organization's IT environment, enterprise structure, and region structure
• If maintenance is available for for VSAM data sets, you must use the Install Utility to update those data sets for each region
that you have set up.
• For more information about CA CSM, see Install Your Product Using CA CSM.
Release Notes
The Release Notes section in this documentation describes the syntax enhancements that are made to several statements. These
changes affect the way your program compiles and executes. Not reading this section can delay your upgrade.
Configuration
After you install CA Easytrieve, see the Configuring section for setup information.
• /cdrom/ezt
Identifies the location of the installation tar file.
For other environments:
Insert and mount the CD-ROM and issue the tar command:
• /cdrom/ezt
Identifies the location of the installation tar file.
4. When the tar command completes, change to the bin directory and issue the ./setup command to install product licensing.
You must have root authority to complete the setup operation.
CA Easytrieve® Report Generator 11.6
10. Install the license key as described in Install the License Key.
Verify the Installation
After you install CA Easytrieve, you must verify that the installation was successful.
You can verify the installation as follows:
• Verify the basic functionality.
• Verify the installation with Ingres, Oracle, and DB2.
Verify Basic Functionality
You can verify that the software is installed correctly by compiling and executing the testezt.ezt program. This program is
installed in the directory where you installed CA Easytrieve.
You can compile and execute from the directory where you installed the software. You can also copy testezt.ezt to the home
directory of your user ID. This procedure assumes that you did not rename testezt.ezt.
Follow these steps:
1. Compile testezt.ezt with the following command:
ezt testezt.ezt
a.out
If the previous message does not appear, review the steps in the installation procedure and repeat the verify procedure. If
the message still does not display, contact CA Support.
Verify the Installation with Ingres, Oracle, and DB2
You can verify that the software installed correctly and can communicate with Ingres, Oracle, or DB2 by compiling and
executing the program for your database. The programs are found in the directory where you installed the software. You can
CA Easytrieve® Report Generator 11.6
compile and execute the program from the directory where you installed the software. You can also copy the program to the
home directory of your user ID. This procedure assumes that you did not rename the program.
Note: The mode version of the libraries you link with must match the mode of your OS (32-bit or 64-bit).
Follow these steps:
1. Edit the program for your database as follows:
• testingr.ezt
(Optional) Identifies the Ingres application program. Change the USERID parameter of the PARM statement to a valid
Ingres user ID and password.
• testora.ezt
(Optional) Identifies the Oracle application program. Change the USERID parameter of the PARM statement to a valid
Oracle user ID and password.
• testdb2.ezt
(Optional) Identifies the DB2 application program. Change the USERID parameter of the PARM statement to a valid
DB2 user ID and password. Also change the SSID parameter to a valid database name.
The program is edited and ready for compile.
2. Compile the program with the EZT command as follows:
ezt program
• program
Identifies the program for your database.
Limits: testingr.ezt (for Ingres), testora.ezt (for Oracle), testdb2.ezt (for DB2)
The program compiles and is ready for execution.
3. Execute the program with the following command:
a.out
If the message does not display, review the steps in the installation procedure and repeat the verify procedure. If the
message still does not display, contact CA Support.
• Root authority is not required to install CA Easytrieve. However, you must have root authority to install CA Technologies
licensing and the unixODBC driver.
• GNU C Library (glibc) version 2.3.4 or above is required.
• New Curses Library (ncurses) is required.
• Determine whether you have a 32-bit or 64-bit system. If you are running a 64-bit OS, verify that the 32-bit compatibility
packages listed below are installed.
• Verify the available disk space before beginning. This product requires 115 MB of disk space.
32-Bit Compatibility Packages
If you are running a 64-bit OS, the following 32-bit packages must be installed:
• ncurses-libs
• glibc-devel
• glibc
• libgcc
For example, when running a Pentium Pro or later processor, install the following packages:
• ncurses-libs.i686
• glibc-devel.i686
• glibc.i686
• libgcc.i686
Install in the Linux Environment
This section describes how to install CA Easytrieve in the Linux PC environment.
Note: If CA Easytrieve is already installed on the PC, remove it before following these instructions. Navigate to the uninstall
subdirectory (in the installed directory), type ./ezt_uninstall at the command prompt, and follow the prompts.
Follow these steps:
1. Log into your Linux PC.
Note: We recommend logging in as a user with root access. Although CA Easytrieve installation does not require this
level of access, it is required to install CA Technologies licensing and the unixODBC driver.
2. Download the ezt_install file to a directory and make it the current directory.
3. Type ./ezt_install at the command prompt and press Enter.
4. Follow the prompts to install the software. During the interview phase:
• When you are prompted for the installation path, press Enter to accept the default path /opt/CA/ezt. Otherwise, type a
preferred path.
• When you are prompted to install CA Licensing, press Enter to accept the default Yes.
• A unixODBC message appears. If you plan to use CA Easytrieve with a non-native database such as Db2, you must
install the unixODBC driver separately. For more information, see Install the unixODBC Driver.
The installation proceeds. Upon completion, a successful installation message appears. A second message instructs you to
add four lines to your login profile.
5. Press Enter to exit the installer. Next, perform the Post-installation Tasks in the next section.
Post-installation Tasks
This section contains tasks that you must perform after you install CA Easytrieve on a Linux PC:
Note: The first line specifies the path that was specified during CA Easytrieve installation. The default path is /opt/CA/ezt.
CA Easytrieve® Report Generator 11.6
export USR_PATH=/usr/bin:/usr/lib:/usr/lib32:/usr/local/libexport
EZTPATH=$EZT/bin:$EZT/eztpgms:$USR_PATHexport PATH=$PATH:
$EZTPATHexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EZTPATHexport
EZTOPTS="-W a,--32 -I $EZT/macros"
Note:
The first line is an example. Your EZTPATH path may be different.
Install CA Licensing
CA Licensing must be installed before you install the license key.
If you did not install CA licensing during product installation, check for the existence of the following directory:
/opt/CA/SharedComponents/ca_lic
If the directory does not exist, you must perform this procedure.
Note:
If you installed CA Licensing during product installation, you do not need to perform this procedure. Instead, follow the steps
in Install the License Key.
Follow these steps:
1. Run the following command:
uname -a
2. If the result is x86_64, locate the lic98_Linux_AMD.tar file in the installation directory. Otherwise, locate
the lic98_linuxIntel.tar file.
3. Run the following command, specifying your .tar file:
tar -xvf tar_file.tar
The files are extracted.
4. Run the following command:
./install
When the command completes, the licensing files are in the following directory:
/opt/CA/SharedComponents
5. Follow the steps in Install the License Key.
Install the License Key
After installing CA Easytrieve on a Linux PC, you must install the ALP license key that was sent to you when the product was
purchased.
Before you install the license, verify that the ca_lic directory exists, as described in the CA Licensing section above.
For information about installing the license key, see Install the License Key.
Create the Options Table
After installing the product, you must create the options table. The option table contains options such as compiler and
execution options.
To create an options table, type the following commands:
cd $EZT/binetopload -b -l >ezoptbl.def</dev/null
Note:
For more information about the options table, see Updating the Table.
CA Easytrieve® Report Generator 11.6
odbcinst -j
Note:
If the numbers for SQLULEN size and SQLLEN size are 8, contact Broadcom Support.
Verify the Installation
After you install CA Easytrieve, verify that the installation was successful.
Warning: Update the profiles before verifying your installation.
Note: The mode version of the libraries you link with must match the mode of your OS (32-bit or 64-bit).
Follow these steps:
1. Edit the program for your database as follows:
• testingr.ezt
(Optional) Identifies the Ingres application program. Change the USERID parameter of the PARM statement to a valid
Ingres user ID and password.
• testora.ezt
(Optional) Identifies the Oracle application program. Change the USERID parameter of the PARM statement to a valid
Oracle user ID and password.
• testdb2.ezt
(Optional) Identifies the DB2 application program. Change the USERID parameter of the PARM statement to a valid
DB2 user ID and password. Also change the SSID parameter to a valid database name.
The program is edited and ready for compile.
2. Compile the program with the EZT command as follows:
ezt program
• program
Identifies the program for your database.
Limits: testingr.ezt (for Ingres), testora.ezt (for Oracle), testdb2.ezt (for DB2)
The program compiles and is ready for execution.
3. Execute the program with the following command:
a.out
If the message does not display, review the steps in the installation procedure and repeat the verify procedure. If the
message still does not display, contact Broadcom Support.
Apply Maintenance
After you install the product, you must apply the latest maintenance (also called published solution or PTF).
Follow these steps:
1. Download the latest published solution from Broadcom Support.
Note:
For more information about downloading published solutions, see Maintain You Product.
2. Go to the root directory and type the following command:
./ezt_patch-release-and-date -i console
All installation information is written to a log. If you experience problems during installation, this log can help CA Support
troubleshoot the cause.
The log can be found in the directory where CA Easytrieve was installed, and is named
CA_Easytrieve_Report_Generator_Install_date_time.log.
More Information:
For more information about CA Easytrieve, see the following articles:
• Customizing the options table
• Creating and maintaining an alternate collating sequence table
• Defining environment variables
• How to compile and execute your CA Easytrieve program
CA Easytrieve provides a language to develop reports against existing data and the ability to manipulate information from
different sources to create data. CA Easytrieve lets programs execute in linkedited mode, which results in a load module.
Warning: To support programs compiled and linked on a prior release of CA Easytrieve, a compatible runtime
system is shipped with this product. To take advantage of the new features and functionality of this, and future
releases, a program must be recompiled.
A "toolkit" option is offered to package commonly used functionality. You can also access various optional database products
as described in the following sections.
Toolkit Option
The Toolkit option provides easy-to-use pre-written routines. These routines enable users to further enhance the capabilities of
CA Easytrieve with minimal effort.
SQL Options
CA Easytrieve offers options that provide SQL access to DB2, Oracle, CA Datacom/DB, and CA IDMS. These programs are
interpretive and access is always dynamic. For DB2, you can also program this access using static SQL.
You can run existing programs that were written using SQL with this release.
Operating Environment
In your z/OS operating system, CA Easytrieve link-edited application programs execute in as little as 640 KB of main storage.
CA Easytrieve compilations and compile-and-go applications require a 2 MB to 4 MB region size. The size depends on
the number of dynamically acquired storage areas, such as I/O buffers and operating system control blocks. The maximum
amount of storage that is required depends on the size of the program to be compiled or executed, and the options that are
implemented.
Migration Considerations
CA Easytrieve is upwardly compatible. This means that older CA Easytrieve programs execute using the new CA
Easytrieve runtime; however, programs that are compiled using the new release of the product will not execute properly using
the older runtime libraries. This should be a consideration during migration. If you compile new application programs in
development at the current release, they will not run in production until that system is also upgraded. For more information
about migrating to the current release of CA Easytrieve from prior releases, see Release Notes.
JCL Notation
Many examples of JCL are in this section. Because sites vary in their conventions for naming data sets, volumes, and other
computer-related resources, you must adjust the JCL.
CA Common Services
The CA Common Services (CCS) are a group of system services that help you manage your data center more efficiently.
CA Easytrieve requires the CAIRIM service (CA Resource Initialization Manager), which acts as a common driver for
CA Easytrieve® Report Generator 11.6
dynamic initialization routines. For more information about CAIRIM and how to install it, see Installing in the CA Common
Services documentation.
Pre-Installation Considerations
Before you install CA Easytrieve, consider:
• The product component structure
• The required disk space
Product Component Structure
CA Easytrieve consists of several components. The term component refers to the base product component and its options or
interfaces. The components are provided in several files on the media. You can unload the components from the media by
specifying the correct CA LMP keyword in the installation jobs.
The SMP/E installation process installs all components into a single target and distribution library. The installation process
always creates the target and distribution libraries.
This release has the following SYSMODs:
• CBAAB60
Contains the runtime component for release 11.6.
• CCL2B60
Contains the 6.4 compatibility component.
• CA03B60
Contains the compiler component for release 11.6.
Disk Space
Before you install the product, review the following table for adequate space availability:
Note: If you are upgrading from a previous r11 release, you might need to increase the size of the SMPPTS data set. Allocate
the replacement with SPACE=(CYL,(10,1,20)).
z/OS Installation Process
The following steps describe the z/OS installation process:
1. Prepare for the installation by confirming that your site meets all installation requirements.
CA Easytrieve® Report Generator 11.6
4. (For CA CSM Release 5.1 and earlier only) Deploy the target libraries.
Note: This step is optional for CA CSM Version 6.0. For more information, see the Configuring Products scenario that is
available in the CA CSM documentation.
5. Configure your product using CA CSM or manually.
6. (For staging system configurations in CA CSM Version 6.0 only) Deploy configured run-time libraries, and activate your
product.
Note: Configuration is considered part of starting your product.
CA Chorus™ Software Manager (CA CSM) is an application that simplifies and unifies the management of your CA
Technologies mainframe products on z/OS systems. As products adopt the CA CSM services, you can install your products in
a common way according to industry best practices.
If you do not have CA CSM installed, download it from Download Management on the Broadcom
Support website. Click here to access the CA CSM product documentation.
Use the following scenarios to guide you through the product installation process using CA CSM:
• Acquire Products Using CA CSM
• Install Products Using CA CSM
• Maintain Products Using CA CSM
• Configure Products Using CA CSM
Note:
For additional information about how to use CA CSM, use the CA CSM online help.
Figure 1: Acquiring_Products_CIG
1. Configure CA CSM.
2. If you can download the product package from Broadcom Support:
1.1 Update the product list.
2.1 Download product packages.
3. If you cannot download the product package from Broadcom Support:
1.1 Add external product installation packages.
2.1 Add external product maintenance packages.
After you complete this process, the product packages are ready for installation with CA CSM.
Note: For more information about acquiring products, see the CA CSM online help.
Configure CA CSM
Before you start acquiring product packages, configure a Broadcom Support online account, a CA CSM account, and the
required download settings. If you have previously configured these settings, update the product list.
Follow these steps:
1. Start your Web browser, and enter the CA CSM access URL, which you can get from your system administrator.
Note: If the Notice and Consent Banner appears, read and confirm the provided information.
2. Enter your z/OS login user name and password, and log in.
The initial page appears. You are prompted to perform configuration.
CA Easytrieve® Report Generator 11.6
•To download packages only for specific releases, select one or more releases in the Releases table on the right and
select the Update Product Releases link.
5. To view the downloaded packages, you have the following options:
6. • To display the downloaded maintenance packages, select the product release icon in the product list.
• To display the downloaded base installation packages, select the product gen level icon below the product release in
the product list.
The product packages are downloaded and ready for installation.
Add External Product Installation Packages
Sometimes you have product installation packages that you downloaded outside of CA CSM. For example, you do not have an
HTTP or an FTP access in your mainframe environment, or the required packages are not available from Broadcom Support.
You can use CA CSM to install these external packages according to your organization policy. If you are using this installation
option, first add the external packages to the CA CSM software catalog.
Follow these steps:
1. Log in to CA CSM using your credentials.
2. Select the Products tab.
3. Select the Add Product link in the Actions section.
4. Specify the name, release, and gen level of the product, and select OK.
The product is added to the product list.
5. Select the gen level of the product that you want to download on the product tree.
The Base Install Packages section appears on the right.
6. Select the Add External Package button.
7. Specify one of the following package types and package details, and select OK.
• UNIX File
Adds an installation package that is located in a USS directory in binary mode.
• FTP File
Adds a product package that is not published on Broadcom Support, for example, a beta version of a product.
•FTP Host
Specifies the FTP server where the installation package is located. Select a server from the list, or provide your FTP
server host.
• FTP Port
Specifies the FTP port number for the FTP server.
• FTP Path
Defines the FTP path where the installation package is located. Start the path with a forward slash (/). Enter only a
forward slash to specify the root directory.
Example: /outgoing/
• Package Name
Defines the package name.
Example: 0111.pax.Z
Note: You can use an asterisk (*) for the package name.
• User Name
Defines a valid user name to access the FTP location.
• Password
Defines a valid password to access the FTP location.
8. Refresh the page to see the added product package.
The product installation package is now listed in the product list and is available for installation with CA CSM.
Add External Product Maintenance Packages
Sometimes you have maintenance packages, for example, unpublished maintenance or a program temporary fix (PTF),
that you downloaded outside of CA CSM. You can use CA CSM to install these external maintenance packages per your
organization policy. For this installation option, first add the packages to the CA CSM software catalog.
Usually, the maintenance is placed as a single package. However, some CA products have older aggregated maintenance
packages that were released before December 31, 2013. An aggregated package is a file that comprises several single
maintenance packages (nested packages). When you add an aggregated package, CA CSM inserts all the nested packages and
the aggregated package itself. In the list of maintenance packages, the aggregated package is marked with the CUMULATIVE
type.
CA Easytrieve® Report Generator 11.6
Figure 2: Installing_Products
1. (Optional) Configure base installation settings.
2. (Optional) Configure a working set of SMP/E environments.
3. Initiate product installation and review product information.
4. Select an installation type.
5. Review installation prerequisites if any are presented.
6. Take one of the following steps to select an SMP/E environment:
CA Easytrieve® Report Generator 11.6
If you plan to install a product in an existing SMP/E environment, add this SMP/E environment to your working set. A
working set is a selected group of SMP/E environments with which you want to work. Although you can have only one
working set, you can have as many SMP/E environments in it as you need.
Note: CA CSM does not have a default working set.
If you do not have the SMP/E environment in your working set, you can only create a new SMP/E environment during product
installation. In this case, exit the installation wizard, configure your working set and then restart the wizard.
Follow these steps:
1. Select the SMP/E Environments tab, and select the SMP/E environments that you want to include in a working set.
An information text area under the list of SMP/E environments displays the number of environments you selected.
2. Select Use as Working Set.
3. Select OK.
The working set is configured.
The new working set replaces a previously defined working set.
You can display only those SMP/E environments that are in your working set by selecting Show Working Set Only.
Initiate Product Installation
You can install a downloaded product from the Products tab. The process starts a wizard that guides you through the
installation. At the end of the wizard, a task dynamically invokes the SMP/E and other utilities that are required to install the
product.
Follow these steps:
1. Select the Products tab.
2. Perform one of the following steps:
• If the package was acquired using CA CSM:
From the product list on the left side, select the required product gen level (the innermost level in the product list under
the release level of a product; for example, SP0 or 0110). Locate the product package that you want to install, select
Actions to the right of the package, and select Install.
• If the package was acquired outside of CA CSM:
In the Actions section in the left pane, select the Install External Package link. Enter the location of the package. Select
OK.
The Introduction step of the wizard appears.
Review Product Information
Review the information about the product that you are installing.
Follow these steps:
1. On the Introduction step, review the information about the installation.
Note: If the product license agreement appears, review it. If you agree, accept it. If you do not accept the license
agreement, you cannot proceed with the installation.
2. Select Next.
You are prompted to select the type of installation.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
Select an Installation Type
When you install a product, you select an installation type. There can be one or more installation types, according to the
product.
When you select the custom installation type, you are prompted to select the features that you want to install. If your selected
features require installation of other features, the installation wizard includes the required features to the installation process.
If your selected features are mutually exclusive, the installation wizard excludes any features conflicting with the features you
selected last from the installation process. For example, you select feature 1 and then select feature 2 that is mutually exclusive
with feature 1. The wizard then automatically excludes feature 1.
Follow these steps:
1. On the Features step, select the type of installation, and select Next.
CA Easytrieve® Report Generator 11.6
2. (Optional) If you select the custom installation type, select the features to install, and select Next.
A summary of the features to install appears, with prerequisites.
Review Installation Prerequisites
Some products require an installation of other products first.
Review the summary of installation prerequisites to verify that all prerequisites are satisfied on the Prerequisites step.
• If no prerequisites exist, select Next.
You are prompted to select an SMP/E environment for the installation.
• If all prerequisites exist and are satisfied, you are prompted to locate the installed prerequisites.
Install the product to the same SMP/E environment and the target zone where the product prerequisites are installed.
1. From the SMP/E environment drop-down list, select an SMP/E environment with the installed prerequisites. This
drop-down list represents all CA CSM-managed SMP/E environments where the prerequisites are installed.
A list of target zones for the selected SMP/E environment where the prerequisites are installed is populated.
2. From the target zone drop-down list, select a target zone within the selected SMP/E environment where the
prerequisites are installed.
3. Select Next.
You are prompted to confirm the selected SMP/E environment for the installation.
• If prerequisites are not satisfied, perform one of the following actions:
• Select Cancel to exit the wizard. Install the prerequisites or migrate an SMP/E environment to CA CSM where the
prerequisites are installed. Restart the installation.
• Open CA CSM in another browser window and install the prerequisites, or migrate an SMP/E environment to CA
CSM where the prerequisites are installed. After you complete, select Refresh on the Prerequisites step of the wizard.
Then, select the SMP/E environment and a target zone where the prerequisites are installed. Select Next to continue the
product installation.
You are prompted to confirm the selected SMP/E environment for the installation.
Select an SMP/E Environment
You select the SMP/E environment where you want to install your product in. You can create an SMP/E environment, or
you can select an existing SMP/E environment from your working set. You can configure your working set from the SMP/E
Environments tab.
While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform any action
against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10 minutes, the
lock releases.
If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You are
prevented from performing any actions on the SMP/E environment. You can wait until the notification message disappears and
the SMP/E environment becomes available or can select Cancel to select another SMP/E environment.
Follow these steps:
1. On the SMP/E Environment step, substep 1, take one of the following steps:
• Select Create a New SMP/E Environment to create an SMP/E environment.
• Select an existing SMP/E environment from your working set.
• If no existing SMP/E environment appears, exit the wizard, configure your working set, and restart the wizard.
• If your product has the installed prerequisites, the SMP/E environment with the installed prerequisites that
you selected at the Prerequisites step of the wizard is preselected for you. You cannot select another SMP/E
environment. You cannot create a new SMP/E environment.
Note: When you install a product in an existing SMP/E environment where HOLDDATA is received, the product
installation may fail. For more information, see the online help.
2. Select Next.
You are prompted to set up the SMP/E environment.
Create an SMP/E Environment
You can create an SMP/E environment while you are installing a product. During the process, you are asked to specify the
following information:
• The SMP/E environment name and the prefix of the CSI data set in CA CSM
• Data set allocation parameters
CA Easytrieve® Report Generator 11.6
You can specify data set allocation parameters collectively for all SMP/E data sets, target libraries, and distribution libraries
that are allocated during product installation. You allocate data sets using one of the following methods:
• Allocate data sets using SMS parameters.
• Allocate cataloged data sets using UNIT and optionally VOLSER.
• Allocate uncataloged data sets using UNIT and VOLSER.
If you allocate uncataloged data sets, specify a VOLSER. Based on the value that you enter, CA CSM performs the following
validations to ensure integrity of the installation:
• The value of VOLSER must specify a mounted volume.
• You must have ALTER permissions for the data sets with the entered high-level qualifier (HLQ) on the volume that
VOLSER defines.
• To test allocation, CA CSM temporarily allocates one of the uncataloged data sets that are allocated during the installation.
1. The data set is allocated with one track for both primary and secondary space.
2. CA CSM verifies that the data set has been allocated on the specified volume.
3. The data set is deleted.
If the data set allocation fails or the data set cannot be found on the specified volume, you cannot proceed with the product
installation wizard.
Follow these steps:
1. On the SMP/E Environment step, substep 2, review and specify the following parameters as applicable:
• SMP/E Environment Name
Defines the SMP/E environment name.
• Data Set Name Prefix
Defines the prefix for the name of the CSI VSAM data set.
• Catalog
Defines the name of the SMP/E CSI catalog.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• High-Level Qualifier
Specifies the high-level qualifier (HLQ) for all SMP/E data sets that are allocated during installation. Product packaging
defines the low-level qualifiers (LLQ). The low-level qualifiers cannot be changed.
• DSN Type
Specifies the DSN type for allocating SMP/E data sets.
• SMS Parameters / Data Set Parameters
Specifies if this SMP/E environment is using SMS or data set parameters.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for SMP/E data sets.
• Management Class (SMS Parameters only)
Defines the management class for SMP/E data sets.
• Data Class (SMS Parameters only)
Defines the data class for SMP/E data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for allocating
the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
CA Easytrieve® Report Generator 11.6
2. Select Next.
Work DDDEF allocation parameters and a list of the data sets to be created for the SMP/E environment appear.
Review Parameters of an Existing SMP/E Environment
When you use an existing SMP/E environment to install your product, you review the SMP/E environment parameters. If
applicable, you also specify parameters for any new data sets to be allocated while installing a product. During the process, you
are asked to review allocation parameters for new data sets, which you can customize for each data set. The existing data sets
remain intact.
The Software Installation Service (SIS) determines which data sets exist and which must be allocated for the installation using
an existing SMP/E environment. If the SIS determines that new data sets must be allocated, you are prompted to specify the
data set allocation parameters. The data set allocation parameters are prepopulated with the values from the existing data set
that was found first.
Follow these steps:
1. On the SMP/E Environment step, substep 2, review the current SMP/E environment parameters and allocation parameters
for data sets that must be added to the SMP/E environment. Update the information as applicable:
Note: You cannot change the current SMP/E environment parameters.
• SMP/E Environment Name
Identifies the SMP/E environment name.
• Data Set Name Prefix
Identifies the prefix for the name of the CSI VSAM data set.
• Catalog
Identifies the name of the SMP/E CSI catalog.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
• High-Level Qualifier
Specifies the high-level qualifier (HLQ) for all SMP/E data sets that are allocated during installation. Product packaging
defines the low-level qualifiers (LLQ). The low-level qualifiers cannot be changed.
• DSN Type
Specifies the DSN type for allocating SMP/E data sets.
• SMS Parameters / Data Set Parameters
Specifies if this SMP/E environment is using SMS or data set parameters.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for SMP/E data sets.
• Management Class (SMS Parameters only)
Defines the management class for SMP/E data sets.
• Data Class (SMS Parameters only)
Defines the data class for SMP/E data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for allocating
the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
2. Select Next.
Work DDDEF allocation parameters and a list of the data sets to be created for the SMP/E environment, if any, appear.
Set Up SMP/E Environment Parameters
When creating an SMP/E environment for your product installation, you specify SMP/E environment parameters. When using
an existing SMP/E environment for installing your product, you review and, if necessary, update its SMP/E environment
parameters.
CA Easytrieve® Report Generator 11.6
You can assign different prefixes to each newly allocated data set during the installation process.
Follow these steps:
1. On the SMP/E Environment step, substep 3, specify whether to use SMS or Unit parameters for allocating work DDDEFs
for the SMP/E environment. Complete the appropriate fields. The following fields are available depending on your
selection:
• Storage Class (SMS only)
Defines the SMS storage class for work DDDEFs.
• Management Class (SMS only)
Defines the management class for work DDDEFs.
• Data Class (SMS only)
Defines the data class for work DDDEFs.
• Unit (Unit only)
Defines the type of the DASD on which to place work DDDEFs.
The allocation parameters that you specify for work DDDEFs are applied only to new work DDDEFs that are created
during the installation. The existing work DDDEFs, if any, remain intact.
Note: The settings for allocating work DDDEFs are globally defined on the System Settings, Software Installation tab.
You must have the appropriate access rights to be able to modify these settings.
2. Review the data set names if any appear. Select the Override link to change the high-level qualifier of the data set name and
the allocation parameters. Select OK.
3. (Optional) If any additional parameters appear, review the parameters that already have the default values assigned. Edit
the parameters if necessary and specify any missing parameters.
4. Select Next.
You are prompted to select a target zone to use.
Select a Target Zone
You select a target zone in the SMP/E environment where you want to install your product. You create a target zone or select
an existing target zone in the SMP/E environment (if you use an existing SMP/E environment).
Follow these steps:
1. On the Target Zone step, substep 1, perform one of the following actions:
• Select Create a New Target Zone to create a target zone.
• Select an existing target zone in the SMP/E environment.
This option is available only if you selected to use an existing SMP/E environment.
Warning:
• If you install a product or its components into an existing target or distribution zone, older versions are deleted
from the zone and associated data sets. We recommend that you use new target and distribution zones for this
installation so that you can apply maintenance to your current version, if necessary.
• If your product has the installed prerequisites, the target zone of the SMP/E environment with the installed
prerequisites that you selected at the Prerequisites step of the wizard is preselected for you. You cannot select
another target zone. You cannot create a new target zone.
2. Select Next.
You are prompted to set up the target zone.
Create a Target Zone
You can create a target zone in a new or an existing SMP/E environment where you install your product. The target zone
parameters are prepopulated with the values that are entered for the SMP/E environment. You can change data set allocation
parameters.
You can specify a different SMP/E environment data set to be used for a new target zone.
Follow these steps:
1. On the Target Zone step, substep 2, review and specify the following parameters as applicable:
• Target Zone Name
Defines the name for the target zone.
• Create New CSI Data Set
Specifies that a new CSI data set will be created for the target zone.
• Data Set Name Prefix
CA Easytrieve® Report Generator 11.6
Defines the prefix for the name of the target zone data set.
Note: This field is only enabled when you have the Create New CSI Data Set check box selected.
• Catalog
Defines the name of the SMP/E target zone catalog.
Note: This field is only enabled when you have the Create New CSI Data Set check box selected.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• High-Level Qualifier
Specifies the high-level qualifier (HLQ) for all target zone data sets that are allocated during installation. Product
packaging defines the low-level qualifiers (LLQ) and they cannot be changed.
• DSN Type
Specifies the DSN type for allocating target zone data sets.
• SMS Parameters / Data Set Parameters
Specifies if this target zone uses SMS or data set parameters.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for target zone data sets.
• Management Class (SMS Parameters only)
Defines the management class for target zone data sets.
• Data Class (SMS Parameters only)
Defines the data class for target zone data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for allocating
the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
2. Select Next.
A list of the data sets to be created for the target zone appears.
Use an Existing Target Zone
When using an existing target zone for installing your product, you review and, if necessary, update its parameters.
Follow these steps:
1. On the Target Zone step, substep 2, review the current target zone parameters and allocation parameters for data sets that
must be added. Update as applicable:
Note: You cannot change the current SMP/E environment parameters.
1.1 • Target Zone Name
Identifies the name for the target zone.
• Data Set Name Prefix
Identifies the prefix for the name of the target zone data set.
• Catalog
Identifies the name of the SMP/E target zone catalog.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
• High-Level Qualifier
CA Easytrieve® Report Generator 11.6
Specifies the high-level qualifier (HLQ) for all target zone data sets that are allocated during installation. Product
packaging defines the low-level qualifiers (LLQ) and they cannot be changed.
• DSN Type
Specifies the DSN type for allocating target zone data sets.
• SMS Parameters / Data Set Parameters
Specifies if this target zone uses SMS or data set parameters.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for target zone data sets.
• Management Class (SMS Parameters only)
Defines the management class for target zone data sets.
• Data Class (SMS Parameters only)
Defines the data class for target zone data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for
allocating the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps
you progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area
identifies the error.
2. Select Next.
If there are any data sets to be created for the target zone, a list of data sets appears. If the list is empty, no new data sets are
going to be allocated.
Set Up Target Zone Parameters
When creating a target zone in the SMP/E environment for your product installation, specify target zone parameters.
Follow these steps:
1. On the Target Zone step, substep 3, review the data set names if any appear. Select the Override link to change the high-
level qualifier of the data set name and the allocation parameters. Select OK.
2. (Optional) If more parameters appear, review the parameters that have the default values assigned. Edit the parameters if
necessary and specify any missing parameters.
3. Select Next.
You are prompted to confirm the distribution zone.
Confirm a Distribution Zone
You must confirm a distribution zone of the SMP/E environment where you want to install your product. Depending on
whether you created a target zone or you selected an existing target zone, create a distribution zone or select an existing
distribution zone in the SMP/E environment.
Follow these steps:
1. On the Distribution Zone step, substep 1, review the selected option for the distribution zone.
• If you are using an existing target zone, the related distribution zone is automatically selected. You cannot select other
distribution zones or cannot create a new one.
Note: If you install a product or its components into an existing target or distribution zone, older versions are
deleted from the zone and associated data sets. We recommend that you use new target and distribution zones for this
installation so that you can apply maintenance to your current version, if necessary.
• If you are creating a target zone, you can create a distribution zone or you can select an existing distribution zone.
Note: Using an existing distribution zone with a new target zone relates the existing distribution zone to the new target
zone. This action breaks the relationship from the previous target zone that was related to this distribution zone. You
cannot accept maintenance packages from the previous target zone to this distribution zone using CA CSM.
2. Select Next.
You are prompted to set up the distribution zone.
Create a Distribution Zone
CA Easytrieve® Report Generator 11.6
You can create a distribution zone that is related to the newly created target zone. The distribution zone parameters are
prepopulated with the values that are entered for the SMP/E environment. You can change data set allocation parameters.
You can specify a different SMP/E environment data set to be used for the new distribution zone.
You can also specify the same SMP/E environment data set as the one that you specified for the target zone. In that case, the
target and distribution zones share the SMP/E environment data set. The SMP/E environment data set will be allocated using
the parameters that you have defined when specifying the target zone.
Follow these steps:
1. On the Distribution Zone step, substep 2, review and specify the following parameters as applicable:
• Distribution Zone Name
Defines the name for the distribution zone.
• Create New CSI Data Set
Specifies that a new CSI data set will be created for the distribution zone.
• Data Set Name Prefix
Defines the prefix for the name of the distribution zone data set.
Note: This field is only enabled when you have the Create New CSI Data Set check box selected.
• Catalog
Defines the name of the SMP/E distribution zone catalog.
Note: This field is only enabled when you have the Create New CSI Data Set check box selected.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
Note: This parameter is set to its default value, and you cannot edit it.
• High-Level Qualifier
Specifies the high-level qualifier (HLQ) for all distribution zone data sets that are allocated during installation. Product
packaging defines the low-level qualifiers (LLQ) that cannot be changed.
• DSN Type
Specifies the DSN type for allocating distribution zone data sets.
• SMS Parameters / Data Set Parameters
Specify if this distribution zone is to use SMS or data set parameters. Complete the applicable fields.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for distribution zone data sets.
• Management Class (SMS Parameters only)
Defines the management class for distribution zone data sets.
• Data Class (SMS Parameters only)
Defines the data class for distribution zone data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for allocating
the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
2. Select Next.
A list of the data sets to be created for the distribution zone appears.
Use an Existing Distribution Zone
You can use an existing distribution zone that is related to the existing target zone you selected, or with a new target zone. The
distribution zone parameters are prepopulated with the values that are entered for the SMP/E environment. You can change
data set allocation parameters.
CA Easytrieve® Report Generator 11.6
Note: Using an existing distribution zone with a new target zone relates the existing distribution zone to the new target zone.
This action breaks the relationship from the previous target zone that was related to this distribution zone. You cannot accept
maintenance packages from the previous target zone to this distribution zone using CA CSM.
Follow these steps:
1. On the Distribution Zone step, substep 2, review the current distribution zone parameters and allocation parameters for
data sets that you want to add. Update as applicable:
Note: You cannot change the current SMP/E environment parameters.
• Distribution Zone Name
Identifies the name for the distribution zone.
• Data Set Name Prefix
Identifies the prefix for the name of the distribution zone data set.
• Catalog
Identifies the name of the SMP/E distribution zone catalog.
• Cross-Region
Identifies the cross-region sharing option for SMP/E data sets.
• Cross-System
Identifies the cross-system sharing option for SMP/E data sets.
• High-Level Qualifier
Specifies the high-level qualifier (HLQ) for all distribution zone data sets that are allocated during installation. Product
packaging defines the low-level qualifiers (LLQ) that cannot be changed.
• DSN Type
Specifies the DSN type for allocating distribution zone data sets.
• SMS Parameters / Data Set Parameters
Specify if this distribution zone is to use SMS or data set parameters. Complete the applicable fields.
• Storage Class (SMS Parameters only)
Defines the SMS storage class for distribution zone data sets.
• Management Class (SMS Parameters only)
Defines the management class for distribution zone data sets.
• Data Class (SMS Parameters only)
Defines the data class for distribution zone data sets.
• VOLSER (Data Set Parameters only)
Defines the volume serial number on which to place data sets. The volume must have enough space for allocating
the data sets.
Note: This field is mandatory if you set Catalog to No.
• Unit (Data Set Parameters only)
Defines the type of the DASD on which to place data sets.
• Catalog (Data Set Parameters only)
Specifies if you want SMP/E data set to be cataloged.
Note: An information text area can appear at the bottom of the wizard. The area provides information that helps you
progress through the wizard. For example, if a field is highlighted (indicating an error), the information text area identifies
the error.
2. Select Next.
If there are any data sets to be created for the distribution zone, a list of data sets appears. If the list is empty, no new data
sets are going to be allocated.
Set Up Distribution Zone Parameters
When creating a distribution zone in the SMP/E environment where you want to install your product, specify distribution zone
parameters.
Follow these steps:
1. On the Distribution Zone step, substep 3, review the data set names if any appear. Select the Override link to change the
high-level qualifier of the data set name and the allocation parameters. Select OK.
2. (Optional) If any additional parameters appear, review the parameters that already have the default values assigned. Edit
the parameters if necessary and specify any missing parameters.
3. Select Next.
You see a summary of the installation task.
CA Easytrieve® Report Generator 11.6
You can configure CA CSM to download automatically the available HOLDDATA that it uses for each maintenance
installation. You then have current information about what maintenance packages are marked as PE (PTF in Error).
Follow these steps:
1. Select the Settings tab, and select the Software Catalog link under System Settings in the Settings section on the left side.
2. In the HOLDDATA Settings section, select the Enable Automatic Updates checkbox.
3. Set up values for the following fields, and select Apply:
• Owner of Update Task
Specifies the TSO user ID under which the update task is run.
• Recurrence
Specifies how often the task recurs.
• Update Software Catalog Every number of Days
or
• Update Software Catalog On day of week Every number of Weeks
Specifies the frequency of downloading HOLDDATA to your software catalog, in days or weeks, depending on the
value of Recurrence.
Note: Imagine you set the recurrence for a specific number of days and you set the time that precedes the current time.
Then the first update occurs in the specified number of days at the specified time. For example, on Monday at 10.30am,
you set the number of days to 3 and time to 07.00. The first update then occurs on the third day, Thursday, at 7.00am.
When you set the time past the current time, the first update occurs on the same day at the time set. For example, on
Monday at 10.30am, you set the number of days to 3 and time to 11.00. The first update then occurs on that Monday at
11.00am.
• System Time
Specifies the system time when an automatic update occurs. The system time reflects your CA CSM application server
time zone. The TZ parameter within Tomcat startup libraries defines the time zone. If the TZ parameter is not defined,
the CA CSM application server time zone defaults to GMT - Greenwich Mean Time.
Note: Local time is calculated based on the system time that you set.
Note: To download available HOLDDATA to the software catalog immediately, select Update Immediately.
The automatic HOLDDATA download is configured.
Configure CA CSM to Reject Unneeded Maintenance from the SMP/E Environment
During the regular, FIXCAT, or CA RS maintenance wizard execution, CA CSM may receive maintenance. Some
maintenance packages may not be directly associated with the maintenance that you want to apply.
You can configure CA CSM to reject the maintenance that was received but not applied during the wizard execution.
• If you exit the wizard before the maintenance installation started, CA CSM rejects the maintenance that has been received
during the wizard execution. The SMP/E environment is restored to the state that it had before you started the wizard.
• If you navigated through the wizard steps, started the maintenance installation task, and the task completed
successfully, CA CSM rejects the received but not applied maintenance that is not directly associated with the maintenance
that you have applied.
This process ensures that your SMP/E environments do not contain unneeded received maintenance.
Follow these steps:
1. Select the Settings tab, and select the Software Installation link under System Settings on the left side.
2. In the Maintenance Installation section, select the Reject Received Maintenance checkbox.
3. Select Apply.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note:
While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later on
the Tasks tab.
CA CSM is configured to reject unneeded maintenance.
Download Product Maintenance Packages
You can download maintenance packages for installed products through the Products tab. You can download:
• All maintenance packages for a product
CA Easytrieve® Report Generator 11.6
• Only maintenance packages that have been released from the time the product release was updated last
Note: The information for HIPERs and new maintenance on the Software Status tab is based on the current information in
your software catalog. We recommend that you update the product list on a daily or weekly basis to keep it current.
Warning:
You can also download maintenance using the CA SMP/E Internet Service Retrieval. This option uses the IBM SMP/
E RECEIVE ORDER command to download CA Mainframe product maintenance over the Internet, by securely
submitting an order for PTFs and HOLDDATA to a remote CA server. This service eliminates the manual steps that
are required to download maintenance from CA Support Online. The orders are fulfilled based on the status of your
SMP/E environments. Based on your order criteria, all PTFs and their requisites are downloaded automatically and
received to your system.
To use this download option, complete the procedures in CA SMP/E Internet Service Retrieval. After you set up this
service, you can use CA CSM to apply and accept your maintenance.
Follow these steps:
1. Verify that your CA CSM login user name is associated with a registered user of CA Support online on the Software
Acquisition Settings page.
CA CSM uses the credentials to access CA Support.
2. Select the name of the product for which you want to download maintenance in the product list on the left side.
Maintenance information about the product appears in the Releases section on the right side.
3. For the product release for which you want to download maintenance, select the Actions drop-down list to the right of the
release. Complete one of the following steps:
• Select Update Product Release to download all maintenance packages for the product release.
• Select Get Latest Maintenance to download only maintenance packages that have been released from the time the
product release was updated last.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
The maintenance packages are downloaded.
Configure CA CSM to Perform Automatic Maintenance Updates
You can configure CA CSM to perform automatic maintenance updates (downloading and receiving maintenance) for products
that are installed in an SMP/E environment.
Note: For more information about automatic maintenance updates, see Configuring CA CSM to Perform Automatic
Maintenance Updates at CA Chorus Software Manager documentation.
Manage Maintenance Downloaded Outside of CA CSM
Sometimes you acquire maintenance packages, such as unpublished maintenance, PTF, APARs, and USERMODs, outside
of CA CSM. For example, you are validating a test PTF released for a product. You can add information about these
maintenance packages to CA CSM from the Products tab.
Adding these maintenance packages to CA CSM provides you with a complete view of all the maintenance for a product
release. After a package is migrated, you can use CA CSM to apply the maintenance.
Usually, the maintenance is placed as a single package. However, some CA Technologies products still have older aggregated
maintenance packages that were released before December 31, 2013. An aggregated package is a file that comprises several
single maintenance packages (nested packages). When you add an aggregated package, CA CSM inserts all the nested
packages and the aggregated package itself. In the list of maintenance packages, the aggregated package is marked with the
CUMULATIVE type.
When you insert an aggregated package, CA CSM assigns a fix number to it. The fix number is unique and contains eight
characters. The first two characters are AM (for Aggregated Maintenance) and a unique six-digit number follows. The number
value increases by 1 with each added aggregated package.
Note: If the aggregated maintenance package has the same fix number as one of its nested packages, only the nested package
is added. The aggregated package itself is not available in the list of maintenance packages.
Follow these steps:
1. Select the Products tab, and select the product release for which the maintenance applies.
CA Easytrieve® Report Generator 11.6
1. Select the SMP/E Environments tab, and select the SMP/E environment where you want to receive maintenance
packages.
2. Select Maintenance.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to receive, and select the Receive link.
The maintenance wizard opens to the Introduction step.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears and
the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Review the information about the receiving, and select Next.
5. Review and adjust the receive list selections as required, and select Next.
6. Review the summary, and select Receive.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
The maintenance packages are received to the SMP/E environment global zone.
Reject Maintenance
You can reject a received maintenance package. Information about the maintenance package is removed from the SMP/E
environment global zone.
Note: While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform
any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10
minutes, the lock releases.
Follow these steps:
1. Select the SMP/E Environments tab, and select the SMP/E environment from which you want to reject maintenance.
2. Select Maintenance.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to reject, and select the Reject link.
Note: You can filter out only received packages.
The maintenance wizard opens to the Introduction step.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears and
the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Review the information about the rejection, and select Next.
5. Review and adjust the rejected list selections as required, and select Next.
6. Review the summary, and select Reject.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
The maintenance packages are rejected. Information about the maintenance packages is removed from the SMP/E environment
global zone.
Apply Maintenance
After maintenance has been downloaded for a product, you can apply the maintenance to products that are installed in an SMP/
E environment.
As an option, CA CSM lets you verify that the maintenance packages can be applied to the selected target zones without
applying the packages.
Note: While you work with an SMP/E environment, the SMP/E environment is locked and other CA CSM users cannot
perform any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more
than 10 minutes, the lock releases.
Follow these steps:
CA Easytrieve® Report Generator 11.6
1. Select the SMP/E Environments tab, and select the SMP/E environment whose products you want to apply maintenance
to.
2. Select Maintenance.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to apply, and select the Apply link.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears and
the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Follow the instructions on the wizard to navigate through the wizard steps.
5. From the Summary step, review the summary, and select Check and Apply.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
CA CSM verifies and applies the maintenance packages to the selected target zones.
If the task fails, navigate to the Tasks tab and review SMPOUT in the task output to identify and correct problems. Rerun the
wizard.
You have completed acquiring and applying maintenance. You can accept the applied maintenance (except USERMODs) from
the SMP/E Environments, Maintenance tab.
USERMODs
A product USERMOD can be provided as a published maintenance package downloaded during the Update Product process.
When CA CSM downloads a package including a ++USERMOD statement, it is loaded under the product with a USERMOD
type. You can install these packages using CA CSM but cannot accept them because they are not intended to be permanent.
You can create a USERMOD manually, or we can provide an unpublished maintenance package as a USERMOD. In this case,
the USERMOD file, which contains the ++USERMOD statement and the body of the USERMOD, must be managed as an
externally downloaded package.
Unresolved HOLDDATA Processing
When you apply maintenance, review and process any unresolved HOLDDATA for the applied maintenance and its
prerequisites. The maintenance wizard displays all unresolved HOLDDATA and lets you review the HOLDDATA and details
about the HELD maintenance. You can then bypass the HOLDDATA or exclude the HELD maintenance. CA CSM determines
unresolved HOLDDATA by running SMP/E APPLY GROUP/GROUPEXTEND CHECK.
In the maintenance wizard, you can perform the following actions:
• Select HOLDDATA (HOLDDATA TYPE, REASON, or maintenance) to bypass it.
• Leave HOLDDATA unselected to exclude it. If you do not select a HOLDDATA entry checkbox, CA CSM excludes the
HELD maintenance from the processing.
If you exclude at least one HELD maintenance package, CA CSM runs an appropriate SMP/E APPLY GROUP/
GROUPEXTEND CHECK command to verify the processing. CA CSM verifies whether other maintenance requires the
excluded maintenance. If so, CA CSM also excludes it from processing.
If the SMP/E APPLY GROUP/GROUPEXTEND CHECK command discovers further unresolved HOLDDATA, you are
notified about all unresolved HOLDDATA again. Select what HOLDDATA to bypass and what HELD maintenance to
exclude.
This iterative process repeats until all HOLDDATA is resolved or bypassed. You can then proceed to the next step.
A list of maintenance packages that are excluded during the processing of unresolved HOLDDATA is displayed in the
Summary step.
Apply CA RS Maintenance
CA CSM lets you track and apply CA Recommended Services (CA RS) maintenance for your products.
CA Recommended Service (CA RS) is a set of maintenance packages that have been tested in a mainframe integrated system
test environment. We recommend that you install CA RS maintenance to keep your products current. CA Technologies
releases CA RS maintenance regularly. The release date determines the CA RS maintenance level.
To learn about new CA RS maintenance available, download the CA RS files that are listed for published CA RS maintenance.
You can configure CA CSM to download CA RS files automatically, or add CARS files manually.
CA Easytrieve® Report Generator 11.6
Based on information in CA RS files, you can filter CA RS maintenance in the SMP/E Environments, Maintenance section.
You can also select the packages that are applicable for within the CA RS level that you want to install.
You can apply particular CA RS maintenance packages. You can update all products in an SMP/E environment.
Note: A CA RS file can list a maintenance package that the HOLDDATA marked as PE (PTF in Error). The CA RS file
can also reflect a corrective maintenance package for this PE that is not listed in this CA RS file. This situation can occur if
a maintenance package is found in error after the CA RS file is published. The CA RS processing continues as expected, and
the maintenance package that is marked as PE is not applied. However, the CA RS level for the product is not updated to the
current level until you apply the corrective maintenance package to the SMP/E environment.
Configure Automatic CA RS File Download
You can configure CA CSM to download available CA RS files automatically. After download, the CA RS files are stored in a
USS directory under the software catalog.
Follow these steps:
1. Select the Settings tab, and select the Software Catalog link under System Settings in the Settings section on the left side.
2. In the CA RS Settings section, select the Enable Automatic Updates checkbox.
3. Set up values for the following fields, and select Apply:
• Owner of Update Task
Specifies the TSO user ID under which the update task is run.
• Recurrence
Specifies how often the task recurs.
• Update Software Catalog Every number of Days
or
• Update Software Catalog On day of week Every number of Weeks
Specifies the frequency of downloading CA RS files to your software catalog, in days or weeks, depending on the value
of Recurrence.
Note: Imagine you set the recurrence for a specific number of days and you set the time that precedes the current time.
Then the first update occurs in the specified number of days at the specified time. For example, on Monday at 10.30am,
you set the number of days to 3 and time to 07.00. The first update then occurs on the third day, Thursday, at 7.00am.
When you set the time past the current time, the first update occurs on the same day at the time set. For example, on
Monday at 10.30am, you set the number of days to 3 and time to 11.00. The first update then occurs on that Monday at
11.00am.
• System Time
Specifies the system time when an automatic update occurs. The system time reflects your CA CSM application server
time zone. The TZ parameter within Tomcat startup libraries defines the time zone. If the TZ parameter is not defined,
the CA CSM application server time zone defaults to GMT - Greenwich Mean Time.
Note: Local time is calculated based on the system time that you set.
Note: To download available CA RS files to the software catalog immediately, select Update Immediately.
The automatic CA RS download is configured.
Add a CA RS File
If you cannot automatically download available CA RS files, add them to the software catalog manually. Use the Add CA RS
File link. The CA RS files added manually are stored in the same USS directory as other CA RS files.
Follow these steps:
1. Download the CA RS file using FTP from the CA Technologies file server directly to your USS directory.
1.1 Connect to the FTP site at the following location:
ftp://ftp.ca.com
CA Easytrieve® Report Generator 11.6
/pub/ASSIGNS
CARyymm.TXT
2. In the CA CSM web-based interface, select the Products tab, and select the Add CA RS File link in the Actions section on
the left side.
3. Specify the USS path to the CA RS file you want to add, and select OK.
Information about the CA RS file is saved in the CA CSM Software Catalog USS database.
FIXCAT data is provided in the same file as error HOLDDATA. Error HOLDDATA contains FIXCAT HOLDDATA
statements that assign a maintenance package to a category. Select a category, and CA CSM determines and applies associated
maintenance packages to the selected products installed in an SMP/E environment.
Masking Maintenance Categories
When you select maintenance categories in the wizard, you can use masking.
Use an asterisk (*), or a percent sign (%), or both to specify naming masks. An asterisk substitutes for any number of symbols.
A percent sign substitutes for one symbol.
For example:
• CA.System.z/OS.*
Selects all the categories whose names start with CA.System.z/OS.
• CA.System.z/OS.%% S
Selects all the categories under CA.System.z/OS whose last segment consists of two symbols.
Apply FIXCAT Maintenance
You can select and apply maintenance for your products based on FIXCAT using CA CSM.
As an option, CA CSM lets you verify that the maintenance packages can be applied to the selected target zones without
applying the packages.
Note: While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform
any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10
minutes, the lock releases.
Follow these steps:
1. Select the SMP/E Environments tab.
2. From the list on the right, locate the SMP/E environment whose products you want to apply FIXCAT
maintenance. Select the Actions drop-down list to the right of the SMP/E environment, and select Update Using Fix
Categories.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears and
the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
3. Follow the instructions on the wizard to navigate through the wizard steps.
4. From the Summary step, review the summary, and select Check and Apply.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
CA CSM verifies and applies the FIXCAT maintenance packages to the selected target zones.
If the task fails, navigate to the Tasks tab and review SMPOUT in the task output to identify and correct problems. Rerun the
wizard.
You can accept the applied maintenance (except USERMODs) from the SMP/E Environments, Maintenance tab.
Restore Maintenance
You can restore (back out) an applied maintenance package (but not an accepted maintenance package).
Note: While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform
any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10
minutes, the lock releases.
Follow these steps:
1. Select the SMP/E Environments tab, and select the SMP/E environment from which you want to restore maintenance.
2. Select Maintenance.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to restore, and select the Restore link.
Note: You can filter out only applied packages.
CA Easytrieve® Report Generator 11.6
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears and
the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Review the information about the restoring, and select Next.
5. Review and adjust the list selections as required. Select Zones to review and adjust the zones where the maintenance is
restored from. You can only perform maintenance actions on zones you select here. Select OK to confirm the selection and
return to the wizard, and select Next.
6. Review the prerequisites if they exist, and select Next. CA CSM restores these prerequisites as part of the maintenance
restoring process.
7. Review the summary, and select Restore.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later
on the Tasks tab.
The maintenance packages are restored.
Accept Maintenance
After maintenance has been applied, you can accept the maintenance for products that are installed in an SMP/E environment.
You cannot accept USERMODs.
Use this procedure to accept the maintenance in GROUP mode.
Warning: Before you start, update the HOLDDATA in your software catalog. To do so, select Update HOLDDATA
in the Actions section on the Software Catalog page. You can also set up the automatic HOLDDATA download as
described previously in this article.
Note: While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform
any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10
minutes, the lock releases.
Follow these steps:
1. Select the SMP/E Environments tab, and select the SMP/E environment whose products you want to accept
maintenance.
2. Select Maintenance.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to accept, and select the Accept link.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears
and the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Review the information about the maintenance, and select Next.
5. Review and adjust the accept list selections as required. Select Zones to review and adjust the zones where the
maintenance is accepted. You can only perform maintenance actions on zones you select here. Select OK to confirm the
selection and return to the wizard, and select Next.
6. Select the installation mode for the selected maintenance, and select Next.
7. Perform one of the following actions to address prerequisites:
• If no prerequisites exist, select Next. A list of HOLDDATA appears.
• If prerequisites exist and are available, review them, and Select Next. A list of HOLDDATA appears. The
prerequisites are accepted as part of the process.
• If a prerequisite is not available, the wizard cannot continue. Select Cancel to exit the wizard. Acquire the prerequisite
and restart the process.
8. Review HOLDDATA entries, if they exist. Select Export Table to open all HOLDDATA information for all selected
maintenance in a separate browser window. Selecting Export Table is similar to running the LIST SYSMODS
HOLDDATA command within your SMP/E environment.
9. Select Next.
SMP/E work DDDEFs of SMPWRKx and SYSUTx, with their allocation parameters, are listed.
Note: For more information about SMPWRKx and SYSUTx data sets, see IBM SMP/E for z/OS Reference.
10. Review the work DDDEF allocation parameters, and edit them, if necessary, to verify that sufficient space is allocated for
them during the maintenance acceptance:
CA Easytrieve® Report Generator 11.6
Note: Changes in the allocation parameters apply to the current maintenance processing only.
1.1 Select Override for a DDDEF to edit its allocation parameters.
A pop-up window opens.
2.1 Make the necessary changes, and select OK to confirm.
The pop-up window closes, and the DDDEF entry is selected in the list indicating that the allocation parameters
have been overridden.
To update allocation parameters for the DDDEFs automatically, select Resolve Overrides. CA CSM provides values for
all DDDEFs based on the total size of the selected maintenance packages being accepted. All DDDEF entries are selected
in the list indicating that the allocation parameters have been overridden.
•
To cancel a parameter update for any DDDEF, clear its checkbox.
•
To edit the allocation parameters for a DDDEF after you automatically updated them using the Resolve
Overrides button, select Override. Make the necessary changes. Select OK to confirm and return to the wizard.
11. (Optional) Select View SMP/E Work DDDEFs to review SMP/E work DDDEF and their allocation parameters for the
selected SMP/E environment zones. Select Close to return to the wizard.
Note: Sometimes, the allocation parameters differ from the allocation parameters that you obtained using the Resolve
Overrides button.
Select Next.
12. Review the summary, and select Accept.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status
later on the Tasks tab.
The maintenance packages are accepted.
Accept Maintenance in GROUPEXTEND Mode
CA CSM lets you invoke the SMP/E utility with the GROUPEXTEND option enabled for accepting maintenance.
Note: For more information about GROUP and GROUPEXTEND modes, see IBM SMP/E for z/OS Commands.
When you accept maintenance in GROUPEXTEND mode, the following installation modes are available:
• Accept Check
Checks if the maintenance can be accepted to the selected SMP/E environment in GROUPEXTEND mode.
• Accept
Accepts the maintenance to the selected SMP/E environment in GROUPEXTEND mode.
• Accept Check and Accept
Checks if the maintenance can be accepted to the selected SMP/E environment in GROUPEXTEND mode. Then accepts it
if possible.
For the GROUPEXTEND option, CA CSM does not automatically receive and display maintenance or HOLDDATA
prerequisites that must be bypassed when accepting the maintenance. Accept check mode lets you check if any prerequisites or
HOLDDATA exist and report them in the task output.
How Maintenance in GROUPEXTEND Mode Works
We recommend that you accept maintenance in GROUPEXTEND mode in the following sequence:
1. Apply all maintenance packages that you want to include by the GROUPEXTEND option.
2. Run the maintenance in Accept check mode.
• If the task fails, review SMPOUT in the task output. Review if there are missing (not applied) maintenance packages or
HOLDDATA that must be resolved or bypassed.
• If the task succeeds, review SMPRPT in the task output. Review what maintenance packages were found and accepted.
3. Run the maintenance in Accept mode. Specify the maintenance packages that you want to exclude and HOLDDATA that
you want to bypass, if any exist.
The followings options are available for bypassing HOLDDATA:
• HOLDSYSTEM
• HOLDCLASS
• HOLDERROR
CA Easytrieve® Report Generator 11.6
• HOLDUSER
Note: For more information about the BYPASS options, see IBM SMP/E for z/OS Commands.
You can run the maintenance in Accept mode in the same CA CSM session after Accept check mode is completed. The values
that you entered for Accept check mode are then prepopulated on the wizard dialogs.
Accept Maintenance in GROUPEXTEND Mode
You can accept maintenance (except USERMODs) with the GROUPEXTEND option enabled.
Note: While you work with an SMP/E environment, the environment is locked and other CA CSM users cannot perform
any action against it. When the task finishes, logging out from CA CSM, or a CA CSM session is inactive for more than 10
minutes, the lock releases.
Follow these steps:
1. Select the SMP/E Environments tab, and select the SMP/E environment holding the maintenance packages that you
want to accept in GROUPEXTEND mode.
2. Select Maintenance.
Maintenance packages available for the products are listed.
Note: If you do not see any maintenance package listed, verify that you have maintenance view criteria defined.
3. Select the maintenance packages that you want to accept in GROUPEXTEND mode, and select the Accept
GROUPEXTEND link.
Note: If you select an SMP/E environment being used in CA CSM by another user, a notification message appears. You
are prevented from performing any actions on the SMP/E environment. Wait until the notification message disappears
and the SMP/E environment becomes available, or select Cancel to select another SMP/E environment.
4. Review the information about the maintenance, and select Next.
The packages that you want to accept are listed.
Note: Select a link in the Status column for a maintenance package, if available, to review a list of zones. The zones
indicate where the maintenance package is already received, applied, or accepted. Select Close to return to the wizard.
5. Review the packages, and select Next.
Warning: For the GROUPEXTEND option, CA CSM does not automatically receive and display maintenance
or HOLDDATA prerequisites that must be bypassed when accepting the maintenance. Accept check mode lets
you review if any prerequisites or HOLDDATA exist and report them in the task output. We recommend that you
run the maintenance in Accept check mode first.
6. Read the information that is displayed on this tab, and select Next.
The installation options appear.
7. Specify installation options as follows, and select Next:
1.1 Select the installation mode for the selected maintenance.
2.1 Review the GROUPEXTEND options and select the ones that you want to apply to the maintenance:
• NOAPARS
Excludes APARs that resolve error reason ID.
• NOUSERMODS
Exclude USERMODs that resolve error reason ID.
3.1 (Optional) Enter maintenance packages that you want to exclude in the Excluded SYSMODs field. You can enter
several packages, separate them by a comma.
The Bypass HOLDDATA step of the wizard appears.
8. (Optional) Enter the BYPASS options for the HOLDDATA that you want to bypass during the maintenance installation.
You can enter several BYPASS options, separate them by a comma.
9. Select Next.
10. Review the summary, and select Accept GROUPEXTEND.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to
close this dialog. The task output browser opens, and you can view the action details.
Note:
While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later on
the Tasks tab.
• If you run the maintenance installation in Accept check mode and the task succeeds, review SMPRPT in the task
output. Review what maintenance packages were found and accepted.
CA Easytrieve® Report Generator 11.6
• If you run the maintenance installation in Accept check mode and the task fails, review SMPOUT in the task output.
Review if there are missing (not accepted) maintenance packages or HOLDDATA that must be resolved or bypassed.
You completed maintaining products with CA CSM.
When a configuration targets a staging system, the configuration wizard provides a set of catalog preference variables as
part of the target settings. You can determine whether the customized run-time data sets that are created in the first phase
should be cataloged in the catalog that is associated with the CA CSM driving system. This setting is default.
If you decide not to catalog the data sets to the CA CSM driving system catalog, you can optionally specify the name of a
user catalog where the customized run-time data sets are to be cataloged. If you do not provide the user catalog name, the
data sets are uncataloged.
Note: The support for creating uncataloged run-time data sets assumes that the following statements are true:
• The volume that is specified for the run-time data sets is not SMS-managed.
• The rules that are established at your site allow the run-time data sets to be created as uncataloged data sets.
When an optional user catalog name is specified, you can specify optional alternate, or indirect, system residence volumes
(SYSRES). By default, no SYSRES preference is specified.
• If no SYSRES preference is specified, the user catalog entries are created with the actual volume serial numbers of the
run-time data sets.
• If a SYSRES preference is specified, the user catalog entries are created with an indirect reference to a system residence
volume (or its logical extensions). Specifying a SYSRES preference lets you change the volume serial numbers of the
system residence volume (or its logical extensions) later without having to recatalog the run-time data sets on those
volumes.
Note: For more information about non-VSAM user catalog entries and indirect volume serial references, see the
description of the DEFINE NONVSAM command in IBM DFSMS Access Method Services for Catalogs (SC26-7394).
2. You make the data sets accessible and activate the configuration.
Systems that do not share DASD with the CA CSM driving system do not have access to the run-time data sets. For
those systems, move the run-time data sets to DASD that is accessible to the remote system. For moving the data sets,
use a method that is appropriate for your site and environment. CA CSM does not endorse a specific technique or
support transmitting the customized run-time data sets that are created when configuring a product to a staging system.
After making the data sets accessible, activate the configuration.
Build the Configuration
You can build a previously saved configuration, or you can rebuild your configuration (for example, if there is a problem with
the build).
You can only build configurations with a status of Under Construction (8) (resume the configuration first), or Build failed.
Follow these steps:
Perform one of the following actions:
• If you are on the Review and Build step of the wizard, select Build.
• If your configuration is saved in a step before the Review and Build step, resume the configuration from
the Configurations tab. Follow the instructions on the wizard to navigate through the wizard steps. From the Review and
Build step, select Build.
• If your configuration is in Build failed status, select the Actions drop-down list to the right of the configuration, and
select Build.
Optionally, you can edit the configuration before you build it again. Navigate to the Review and Build step of the wizard,
and select Build.
A dialog that shows the progress of the task opens. When the task completes, select Show Results on the Progress tab to close
this dialog. The task output browser opens, and you can view the action details.
Note: While a task is in progress, you can perform other work. Select Hide to exit the dialog and view the task status later on
the Tasks tab.
The configuration is built.
Built configurations are ready to be optionally validated or implemented. Before you start implementing a configuration, you
can still edit the configuration.
You can build your configuration again later (for example, if there is a problem with the build).
Validate the Configuration
Before you implement a configuration, you can validate it. Validation verifies access to resources that are going to be utilized
when you implement the configuration.
Note: Although validation is optional, we recommend that you validate the configuration before implementation.
CA Easytrieve® Report Generator 11.6
You can only validate configurations with a status of Build completed, Validated, Validation error, Implementation stopped, or
Implementation error.
While validation of a configuration is in progress, do not use the configuration data sets that are outside of CA CSM. Doing so
helps avoid data set contention between the CA CSM validate processing and data sets being accessed outside of CA CSM.
Follow these steps:
1. Select the Configurations tab and locate the configuration that you want to validate.
2. Select the Actions drop-down list to the right of the configuration, and select Validate.
The validation dialog opens. This dialog contains status information and a table of numbered configuration steps.
The validation process is started and continues until it has successfully completed or fails. The steps in this dialog
automatically update as operation data changes.
3. Review the operation steps. You can perform the following actions:
• Select the link of a step name to display information about the actions that are associated with this step.
• Select the icon in the Text column to see details about the processing that is associated with this step. If this step is
manual, you can use this information to perform the step manually. Select Show Details to open a detailed summary for
all steps in the configuration.
• For the steps with prerequisites, hold the mouse over the icon in the Prereq column to review prerequisites details.
When the validation is completed, a message appears confirming that the validation succeeded or failed.
Note: While a validation is in progress, you can perform other work. Select Hide to exit the dialog without stopping the
validation process. Select the configuration status link to bring back the validation dialog while the validation is still in
progress, or view the status of the validation task later from the Tasks tab.
After the validation finishes and before you start implementing, you can still edit the configuration.
After a validation has finished successfully for a configuration on a staging system, review the activation instructions, if any.
Select Activation Instructions from the validation dialog. Doing so opens the required steps that you will have to complete
after you implement the configuration to activate this configuration.
Edit the Configuration
You can edit configurations that you have previously created and built. You can edit a configuration if the build fails, or when
validation fails because of an errant value.
You can only edit configurations in a status of Build complete, Build failed, Validated, or Validation error.
You can only edit a configuration that has not started implementing yet. After a configuration has started implementing, you
cannot edit it.
You can only edit one configuration at a time.
Follow these steps:
1. Select the Configurations tab and locate the configuration that you want to edit.
Note: Select the Status column to sort by status and identify all configurations that you can edit.
2. Select the Actions drop-down list to the right of the configuration, and select Edit.
3. Change data on this step as needed, and navigate and make edits to the remaining steps in the wizard.
Implement the Configuration
When you start the implementation, CA CSM evaluates the defined steps and determines what steps to execute. The selected
steps are presented as a list. Release them so that they can be eligible to execute after their prerequisite steps have successfully
completed.
Note: Validation and implementation of a configuration may require exclusive access to data sets that the configuration
specifies. Using data sets outside of CA CSM, such as ISPF edit and browse data sets, can introduce data set contention.
Data set contention can result in validation and implementation errors. Therefore, while validation or implementation of a
configuration is in progress, do not use the configuration data sets that are outside of CA CSM.
Implementation completes the configuration process for configurations on a nonstaging system. For configurations on staging
systems, you may be required to perform extra steps to activate your configuration.
Implementation executes on the target system, applying the variables, resources, and operations that are defined in the
configuration.
CA Easytrieve® Report Generator 11.6
You can only implement configurations with a status of Build completed, Validated, Validation error, Implementation stopped,
or Implementation error.
Follow these steps:
1. Select the Configurations tab and locate the configuration that you want to implement.
2. Select the Actions drop-down list to the right of the configuration, and select Implement.
The Implementation dialog opens. This dialog contains status information, and a table of numbered operation steps.
3. Review the operation steps. You can perform the following actions:
• Select the link of a step name to display information about the actions that are associated with this step.
• Select the icon in the Text column to see details about the processing that is associated with this step. If this step is
manual, you can use this information to perform the step manually.
• For the steps that have prerequisites, hold the mouse over the icon in the Prereq column to see details about the
prerequisites.
4. (Optional) Select one or more steps and perform the following actions using the action links:
• Set Automatic
Changes the mode of the selected manual steps so that CA CSM automatically performs them when they are released
and all prerequisites are satisfied.
You cannot change the mode of external steps. CA CSM cannot perform them automatically.
• Set Manual
Changes the mode of the selected automatic steps so that they become manual steps that you must perform outside
of CA CSM.
• Release
Releases the selected steps. The steps become eligible for execution when all prerequisite steps are complete.
• Bypass
Skips the selected steps. These steps are not released when you select Release All. If the bypassed steps are
prerequisites for other steps, the prerequisites are considered satisfied. The dependent steps are executed when they are
released.
5. For manual or external steps, select the Actions drop-down list to the right of a step, and select Confirm.
The step is confirmed as completed successfully. Any prerequisites that other steps within the implementation define are
satisfied.
6. Perform one of the following actions:
• Select Release All to release all steps at once and execute them. However, steps do not execute if they have prerequisite
steps that have not completed. Perform and confirm manual and external steps.
• Select Release Next to release and execute the next step in sequence. However, the step does not execute if it has
prerequisite steps that have not completed. Select Release Next for each subsequent step, and confirm manual and
external steps.
The implementation process is started and continues until it has successfully completed, is stopped manually, or fails. The
steps in this dialog automatically update as operation data changes.
Note: While an implementation is in progress, you can perform other work. Select Hide to exit the dialog without
stopping the implementation process. Select the configuration status link to bring back the implementation dialog while the
implementation is still in progress, or view the status of the implementation task later from the Tasks tab.
You can select Stop to stop the implementation process. Non-executing steps are not started. You can start another run of
the implementation from the Configurations tab by selecting the configuration and selecting Implement.
When the implementation is completed, a message appears confirming that the implementation succeeded or failed.
7. (For successful configurations on staging systems) Select Activation Instructions to open the required steps that you must
complete next to activate this configuration.
Note: If the configuration fails, address implementation failures.
View Step and Action Details
The validation and implementation dialogs contain links that let you drill down for more information about steps and actions
that are associated with each step.
Follow these steps:
1. On the Validate Configuration or Implement Configuration dialog, select the link for the step you want to view details.
An Actions dialog opens. The dialog contains the actions that are associated with this step as links if more information is
available. This dialog contains the following columns:
• Name
CA Easytrieve® Report Generator 11.6
2. Select the Actions drop-down list to the right of the configuration, and select Activation Instructions.
A dialog that shows activation instructions opens. This dialog contains information about steps that you have to perform to
activate the configuration.
3. Review the steps.
4. (Optional) Select Export to print the activation instructions, or export them to a TXT file or a ZIP file.
5. Close the dialog.
6. Perform the steps that are described in the activation instructions.
Your configuration is activated and fully functional.
Address Implementation Failures
Follow these steps:
1. Determine the cause of the failure. Drill down into the step and action details, and analyze the details.
2. If the error is related to a problem in your environment, make the necessary changes to your environment to correct the
issue. Implement this configuration again.
3. If the error is related to the configuration settings in CA CSM, create a new configuration and import values from the failed
configuration:
1.1 When in step 3 (Import Values), select Import from Previous and Delete. Doing so imports the values from the
failed configuration, and deletes the failed configuration. This action prevents duplicate resource problems.
2.1 Modify the values in the new configuration as you need.
3.1 Complete the remaining wizard steps.
4. Build the configuration.
5. Validate the configuration to discover and clean up any data sets that may have been created as part of the failed
implementation attempt.
6. Implement the configuration.
7. (Optional: Staging systems only) Activate the configuration.
2. Create a mount point for the file system. This example shows how to create your USS pax directory named /CA/CAPAX
directory in the existing /u/maint directory. From the TSO OMVS shell, enter the following commands:
cd /u/maint/
mkdir CA
cd CA
mkdir CAPAX
MOUNT FILESYSTEM('your_zFS_data_set_name')
MOUNTPOINT('yourUSSpaxdirectory')
TYPE(ZFS) MODE(RDWR)
PARM(AGGRGROW)
Warning: The FTP procedures vary due to local firewall and other security settings. Consult your local network
administrators to determine the appropriate FTP procedure to use at your site.
After you run the JCL job, the pax file resides in the mainframe USS directory that you supplied.
Example CAtoMainframe.txt, JCL
The following text appears in the CAtoMainframe.txt JCL file:
*//*
*//* This job must be customized as follows:
*//* 1. Supply a valid JOB statement.
*//* 2. The SYSTCPD and SYSFTPD JCL DD statements in this
JCL may be *//* optional at your site. Remove the statements
that are not *//* required. For the required statements,
update the data set *//* names with the correct site-specific
data set names. *//* 3. Replace "Host" based on the type
of download method. *//* 4. Replace "YourEmailAddress" with
your email address. *//* 5. Replace "yourUSSpaxdirectory"
with the name of the USS *//* directory used on your
system for Pax ESD downloads. *//* 6. Replace "FTP
Location" with the complete path *//* and name
of the pax file obtained from the FTP location *//* of
the product download page. *//
*********************************************************************//
GETPAX EXEC PGM=FTP,PARM='(EXIT TIMEOUT 120',REGION=0M//
SYSTCPD DD DSN=yourTCPIP.PROFILE.dataset,DISP=SHR//
SYSFTPD DD DSN=yourFTP.DATA.dataset,DISP=SHR//SYSPRINT
DD SYSOUT=*//OUTPUT DD SYSOUT=*//INPUT DD
*Hostanonymous YourEmailAddresslcd yourUSSpaxdirectorybinaryget FTP_location
*
• mainframe
Specifies the z/OS system IP address or DNS name.
• userid
Specifies your z/OS user ID.
• password
Specifies your z/OS password.
• C:\PC\folder\for\thePAXfile
Specifies the location of the pax file on your PC.
Note: If you specify a location that has blanks or special characters in the path name, enclose that value in double
quotation marks.
• yourUSSpaxdirectory
Specifies the name of the USS directory that you use for Pax ESD downloads.
• paxfile.pax.Z
CA Easytrieve® Report Generator 11.6
Use the following sample JCL to extract the product pax file into a product installation directory.
The UNZIPJCL job completes with a zero return code. Messages GIM69158I and GIM48101I in the output and IKJ56228I
in the JES log are acceptable.
GIMUNZIP creates z/OS data sets with the high-level qualifier that you specified in the UNZIPJCL job. You use these data
sets to perform the product installation. The pax file and product-specific directory are no longer needed.
Note: For more information, see the IBM SMP/E for z/OS Reference (SA22-7772).
• Set the DASD HLQ to the same value specified for yourHLQ within the JCL that is used to unzip the pax file.
• The following steps include instructions to execute the EZTSEDIT macro each time you open a new SAMPJCL
member. To edit all SAMPJCL members simultaneously, read and follow the instructions in the EZTAREAD member.
2. Open the SAMPJCL member EZT1ALL in an edit session and execute the EZTSEDIT macro from the command line.
EZT1ALL is customized.
3. Submit EZT1ALL.
This job produces the following results:
• The target and distribution data sets for your product are created.
• Unique SMPLTS, SMPMTS, SMPSCDS, and SMPSTS data sets for this target zone are created.
4. If your product requires a USS file system or if you want to install a feature of the product that requires a USS file system,
allocate and mount the file system:
Note: You can customize the supplied HFS JCL to zFS, if your site requires it.
5. Open the SAMPJCL member EZT2CSI in an edit session and execute the EZTSEDIT macro from the command line.
EZT2CSI is customized.
6. Submit EZT2CSI.
This job produces the following results:
• The CSI data set is defined.
• The SMPPTS and SMPLOG data sets are allocated.
• The global, target, and distribution zones are initialized.
• The DDDEF entries for your product are created.
• The DDDEFs for the required SMP/E data sets are created.
1. Open the SAMPJCL member EZT3RECD in an edit session, and execute the EZTSEDIT macro from the command line.
EZT3RECD is customized.
2. Submit EZT3RECD to receive SMP/E base functions and error HOLDDATA.
Your product is received and now resides in the global zone.
3. If an FMID was placed in error, download and receive PTFs from Broadcom Support.
4. Open the SAMPJCL member EZT4APP in an edit session, and execute the EZTSEDIT macro from the command line.
EZT4APP is customized.
5. Submit EZT4APP to apply SMP/E base functions with the CHECK option. If you find unresolved hold errors, we
recommend that you note these errors and verify that resolving PTFs are applied before implementing products in
production. Update the JCL to BYPASS the unresolved hold error IDs. After successful completion, rerun APPLY with the
CHECK option removed.
Your product is applied and now resides in the target libraries.
6. Open the SAMPJCL member EZT5ACC in an edit session, and execute the EZTSEDIT macro from the command line.
EZT5ACC is customized.
7. Submit EZT5ACC to accept SMP/E base functions with the CHECK option. After successful completion, rerun ACCEPT
with the CHECK option removed.
Your product is accepted and now resides in the distribution libraries.
rm paxfile
• paxfile
Specifies the name of the CA Technologies pax file that you downloaded.
The pax file is deleted.
3. Delete the product-specific directory by entering the following command:
rm -r product-specific_directory
• product-specific_directory
Specifies the product-specific directory that the pax command created.
The product-specific directory is deleted.
CA Easytrieve® Report Generator 11.6
Note: You can also use TSO ISHELL to navigate to the pax file and product-specific directory, and delete them using the D
line command.
see the CA Common Services for z/OS CAUNZIP Administration documentation. After execution completes, the
ZIPRPT data set contains the summary report. The summary report does the following:
• Summarizes the content of the product order ZIP file.
• Details the content of each data set and the z/OS UNIX files produced.
• Provides a sample job to receive the PTFs in your order.
9. Review the sample job that is provided in the CAUNZIP output ZIPRPT file.
10. Cut and paste the JCL into a data set,
11. Specify your SMP/E CSI on the SMPCSI DD statement.
12. Submit the job to receive the PTFs in your order.
13. Verify that you have the values from the base installation in the EZTSEDIT macro that was customized in the installation
steps.
14. (Optional) Apply CA Recommended Service (CA RS) Maintenance
Apply and Accept Maintenance
Use this procedure to apply and optionally accept CA Technologies corrective maintenance.
Warning: We recommend that you use CA CSM to maintain your CA Technologies z/OS-based products. The
procedure that is discussed in this section is fully automated when you use CA CSM.
ftp.ca.com/pub/ASSIGNS/YEARLY/YEARyyyy.TXT
ftp.ca.com/pub/ASSIGNS/CARyymm.TXT
2.1 Open the SAMPJCL member EZT6CARS in an edit session, update EZT6CARS SAMPJCL to download ASSIGN
statements from Broadcom Support, and execute the EZTSEDIT macro from the command line.
EZT6CARS is customized.
2. Submit EZT6CARS.
The job downloads the CA RS ASSIGN statements.
CA Easytrieve® Report Generator 11.6
3. Open the SAMPJCL member EZT6RECP in an edit session, manually add the data set that contains the ASSIGN
statements to the SMPPTFIN DD, and execute the EZTSEDIT macro from the command line.
EZT6RECP is customized.
4. Submit EZT6RECP.
The job receives the external HOLDDATA file and CA RS ASSIGN statements.
5. Open the SAMPJCL member EZT7APYP in an edit session and execute the EZTSEDIT macro from the command line.
EZT7APYP is customized.
6. Submit EZT7APYP.
The PTFs are applied.
7. (Optional) Open the SAMPJCL member EZT8ACCP in an edit session and execute the EZTSEDIT macro from the
command line.
EZT8ACCP is customized.
8. (Optional) Submit EZT8ACCP.
The PTFs are accepted.
Note: You do not have to submit the job at this time. You can accept the PTFs according to your site policy.
HOLDDATA
When you apply maintenance, you typically encounter SMP/E HOLDDATA. We use HOLDDATA to
notify your SMP/E system of SYSMODs that have errors or special conditions.
When you apply maintenance, you typically encounter SMP/E HOLDDATA. We use HOLDDATA to notify your SMP/E
system of SYSMODs that have errors or special conditions.
HOLDDATA is included in PTFs.
System HOLDDATA
System HOLDDATA indicates data that is an in-stream part of the SYSMOD, informing you of special conditions. The
following reasons are used with SYSTEM HOLDDATA for your product:
• ACTION
Indicates that you must perform special processing before or after you apply this SYSMOD.
• AO
Affects automated operations. It changes either the message identifier or the displacement of a field inside the message.
• DB2BIND
Indicates that DBRMs have changed and packages need to be rebound.
• DDDEF
Indicates that data sets and DDDEFs are being added or modified.
• DELETE
Deletes the SYSMOD load module. You cannot reverse this type of SYSMOD with the SMP/E RESTORE command.
• DEP
Indicates a dependency for this SYSMOD that you must externally verify.
• DOC
Indicates a documentation change with this SYSMOD.
• DOWNLD
Indicates that some or all of the elements that this SYSMOD delivers are to be downloaded to a workstation.
Code a BYPASS(HOLDSYS) operand on your APPLY command to install SYSMODs that have internal holds. Code the
BYPASS(HOLDSYS) operand only after you have performed the required action, or if you are performing the action after
the APPLY, if that is appropriate.
• DYNACT
Describes the steps to dynamically activate this fix without performing an IPL.
• EC
Indicates that this SYSMOD requires a hardware engineering change. An EC hold SYSMOD usually does not affect the
product unless the EC is present on the hardware device.
• ENH
Introduces a small programming enhancement. The hold contains the instructions to implement the enhancement. If no
action is needed to implement the enhancement, give a summary of the enhancement.
• EXIT
Indicates that changes delivered by this SYSMOD require reassembly of user exits.
• EXRF
Indicates that the SYSMOD must be installed in both the Active and Alternate Extended Recovery Facility Systems.
• IPL
CA Easytrieve® Report Generator 11.6
Indicates that an IPL is required for this SYSMOD to take effect. This option is used only when there is no alternative for
dynamic activation.
MSGSKEL
Indicates that the SYSMOD contains internationalized message versions that must be run through the message compiler for
each language.
• MULTSYS
Apply this SYSMOD to multiple systems for either pre-conditioning, coexistence, or exploitation.
• RESTART
Indicates that after applying this SYSMOD, the site must perform a special restart as opposed to a routine restart.
• SQLBIND
Indicates that a bind is required for a database system other than DB2.
Error HOLDDATA
If a SYSMOD has unresolved error HOLDDATA, SMP/E does not install it unless you add a bypass to your APPLY
command. You can bypass error HOLDDATA in situations that are not applicable to you. Error HOLDDATA that is not
applicable to you can include a problem that happens only with a hardware device that you do not have or in a product feature
that you do not use.
When CA Technologies publishes a SYSMOD that resolves the error HOLDDATA, the resolving SYSMOD supersedes the
error HOLDDATA. This action lets you apply the original SYSMOD in conjunction with the fixing SYSMOD.
The only manual task is running a REPORT ERRSYSMODS. This report identifies the following:
• Any held SYSMODs already applied to your system
• Any resolving SYSMODs that are in RECEIVE status
SMP/E identifies the SYSMOD to apply to correct the situation.
FIXCAT HOLDDATA
CA Technologies provides FIXCAT HOLDDATA to help identify maintenance that is required to support a particular
hardware device, software, or function. Fix categories are supplied as SMP/E FIXCAT HOLDDATA statements. Each
FIXCAT HOLDDATA statement associates an APAR and its related fixing PTF to one or more fix categories.
SAMPJCL Contents
The following table shows the installation jobs and related TSO macros that are provided in hlq.SAMPJCL. An index of the
SAMPJCL members is in hlq.SAMPJCL(EZTAREAD).
EZT2CSI Creates and customizes SMP/E CSI. Prepare the SMP/E Environment for a
Pax Installation
EZT3RECT SMP/E receive of base functions from Not used
media.
EZT3RECD SMP/E receive of base functions from Run the Installation Jobs for a Pax
DASD. Installation
EZT4APP SMP/E apply of base functions. Run the Installation Jobs for a Pax
Installation
EZT5ACC SMP/E accept of base functions. Run the Installation Jobs for a Pax
Installation
EZT6RECP SMP/E receive of downloaded PTFs Apply Preventive Maintenance
from DASD.
• Apply CA Recommended Service
(CA RS) Maintenance
CBAAJCL Contents
The CBAAJCL data set contains configuration jobs and utility jobs.
Configuration Jobs
The following table shows the configuration jobs to run after you run the installation jobs. JOB06OP1 is always required. Run
the other jobs only if you use the feature that is associated with that job.
JOB09URT Compiles and links the User Assemble a User Requirements Table
Requirements Table (URT) for the CA for the CA Datacom/DB Option
Datacom/DB option.
JOB10SUP Link edits the SUPRA interface module. Activate the SUPRA Interface Option
JOB11SUA Installs the EZTPSPRA module for the Activate the SUPRA Interface Option
SUPRA interface without SMP/E.
JOB11SUB Installs the EZTPSPRA module for the Activate the SUPRA Interface Option
SUPRA interface through SMP/E.
JOB12TOT Link edits the TOTAL interface module. Activate the TOTAL Interface Option
JOB13DBO Build the DBCS Code System definition Create the DBCS Options Module
module (only necessary if you use the
DBCS feature).
JOB14PSD Builds the Extended Printer Set Printer Set Definition
definition module (only necessary if you
use the Extended Reporting feature). • Create Extended Reporting Printer
Set Definition
JOB15ORA Activates Oracle support by linking the Activate the Oracle Interface Option
Oracle ORASTBL member into the CA
Easytrieve Report Generator compiler.
Utility Jobs
The following table shows the utility jobs and example members that are provided in hlq.CBAAJCL. These members are used
for processing that can be unrelated to product installation.
• If you modify and run JCL members from previous service packs, you can corrupt the installation. For instructions
on implementing CA Easytrieve Report Generator, see Installing.
• As of Release 11.x, the distribution loadlib and the target CBAALOAD are allocated as PDS/Es. If those
libraries are PDS-format data sets, CA Easytrieve Report Generator Release 11.x cannot be installed into existing
distribution load libraries and target CBAALOADs.
Published Fixes
All published fixes are available from Download Management on Broadcom Support. With this release, published fixes are
now supplied as PTFs instead of as APARs, as was done previously. This ensures compliance with CA Technologies current
z/OS packaging standards. Also, CA Easytrieve Report Generator fixes can now be ACCEPTed according to IBM’s SMP/E
standards.
• -n new_olf
Specifies the name of the new OLF file to merge.
CA Easytrieve® Report Generator 11.6
• -c current_olf
Specifies the path and name of the current OLF file to merge.
Default: ca.olf
• -o output_olf
Specifies the path and name of the new OLF file to create.
Default: ca.olf
• -b backup_olf
Specifies the path and name of the backup of the current OLF file.
Default: ca.old
• -d debug_log
Enables debugging and places information in the mergeolf.log file.
The new CA Easytrieve *.olf license file is merged with the existing ca.olf license file and the license key installation is
complete.
Example: Merge New License Into Old License File
The following example merges a new olf file that has been renamed to ca.nol into an existing ca.olf file:
4 Configuring
Configure the product.
This section discusses how to configure CA Easytrieve® Report Generator and includes the following topics:
• Configuration Best Practices
• Configure Your Product
• Configure Your System
These best practices are based on customer feedback to CA support, Development, and Technical Services.
We encourage you to share your best practices. To do so, you can enter a comment in the space provided at the bottom of this
article.
Set the Optimal Storage Amount
The optimal storage amount for your environment can vary from 256 KB to 640 KB, depending on the number of dynamically
acquired storage areas, such as I/O buffers and operating system control blocks. CA Easytrieve Report Generator executes in
as little as 192 KB of main storage in your z/OS. Setting an optimal storage amount for the product helps you save space in
your z/OS.
We recommend that you set the maximum storage amount based on the following two parameters:
• Size of the programs that you compile or execute
• The product options that you want to implement
Execute DB2 Programs as Statically Linked and Bound
The BIND option specifies the default Db2 bind that is used. We recommend that you execute Db2 programs as statically
linked and bound. Although you can use static or dynamic program execution for Db2, production programs are better
executed as statically linked and bound programs. These types of programs provide enhanced performance capabilities, low
overhead, and individual database mapping for each program.
Note:
Some SQL processing types are available for either static or dynamic execution but not for both.
Run Programs in New Function Mode
The NEWFUNC option specifies whether to use the current version of the compiler or the Release 6.4 (Compatibility Mode)
compiler to compile your CA Easytrieve Report Generator programs. Running programs in new function mode ensures
adherence to the documented rules of the CA Easytrieve Report Generator language and lets you take advantage of the new
product features. For example, boundary checking of indexes and subscripts helps ensure data integrity and output validity.
Do the following to run programs in new function mode:
1. Set NEWFUNC to Y in the Options Table. (The default is Y.)
2. Compile and link the program using CA Easytrieve Report Generator Release 11.6.
Note:
• You can view running programs in compatibility mode as a temporary workaround for specific problems by setting
NEWFUNC to N.
• For more information about the Options Table, see Updating the Table.
Set the AMODE31 Option
CA Easytrieve® Report Generator 11.6
The AMODE31 option specifies the location of where memory is to be allocated during the execution of the CA Easytrieve
Report Generator application program. We recommend that you set the AMODE31 option depending on your processing
requirements as follows:
• If the programs are calling 31-bit subprograms, set AMODE31 to Y.
• If the programs are calling 24-bit subprograms, set AMODE31 to N. An override is available on the PARM statement by
using CALL(AMODE24).
• If the programs are calling 24-bit subprograms and ENVIRONMENT(COBOL) is used, set AMODE31 to N and set the LE
runtime options ALL31=(OFF),STACK=(,,BELOW).
Note:
If you do not set AMODE31 correctly, it can result in a S0C4 ABEND or undesired storage allocation below the 16 MB line.
Increase the Number of I/O Buffers
Specifying more buffers for a large sequential file lets your job run faster. We recommend that you specify the number of I/O
buffers for each sequential file using the BUFNO option in the Options Table.
You can override the Options Table value through the BUFNO parameter of the FILE statement. The default BUFNO is 2.
You can specify BUFNO from 0 through 255.
Note:
VFM and VSAM files do not use the BUFNO information.
Set Global Options
We recommend that you set the global options through the Options Table using JOB06OP2 that is provided in hlq.CBAAJCL.
Setting options globally eliminates the need to code the options in their specific area, saves programming time, reduces
required knowledge, and lets you override certain options at run time.
Because the Options File is now a file instead of a load module, you can create files that are specific to program groups and
identified by the //EZOPTBL DD in your JCL.
Note:
• You can also use the local overrides that are available through statements such as PARM and REPORT.
• For more information about setting global options, see Updating the Table.
Create an EZTINI File
Creating an EZTINI file lets you bypass the //EZOPTBL DD requirement. We recommend that you create an EZTINI file
using JOB06OP1 that is provided in hlq.CBAAJCL.
Use Migration Utilities
Migration utilities reduce the time needed for migrating the Options Table and printer set definitions. We recommend that you
use the MOV64OPT and MOV64PSD migration utilities that are provided in hlq.CBAAJCL to migrate to Release 11.x.
The migration utilities perform the following tasks:
• MOV64OPT converts a CA Easytrieve Plus Release 6.4 Options Table to release 11.x option file.
• MOV64PSD converts CA Easytrieve Plus Release 6.4 Extended Reporting Printer Definitions (EZTPXRPT load module)
to CA Easytrieve Report Generator Release 11.x.
If you are migrating from CA Easytrieve® Report Generator release 11 SP03, release 11 SP04, or release 11.5 to CA
Easytrieve® Report Generator release 11.6, you can optionally migrate your existing options table settings to the current
release.
Follow these steps:
1. Execute the JOB06OP1 job to create a release 11.6 EZOPTBL.
2. Copy the release 11 SP03, release 11 SP04, or release 11.5 EZOPTBL into the new one (via TSO).
Your existing option file settings are migrated to the current release.
EZOPTBL Options Table Settings
If you have set NEWFUNC to N (no) in your CA Easytrieve® Report Generator release 11 EZOPTBL Options Table, you
should copy your CA Easytrieve® Report Generator release 6.4 Options Table module EZTPOPT into your release 11.6
CBAALOAD in order to keep your 6.4 options.
To accomplish this, we recommend a TSO copy or run this job.
//jobcard
//STEP1 EXEC PGM=IEBCOPY
//CAILIB DD DISP=SHR,
// DSN=your.ezt64.CAILIB
//ABAALOAD DD DISP=SHR,
// DSN=your.r116.CBAALOAD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=CAILIB,OUTDD=CBAALOAD
SELECT MEMBER=((EZTPOPT,,R))
//*
The JOB15ORA job link edits the ORASTBL module (from the Oracle SQLLIB) into the CA Easytrieve® Report
Generator Compiler module (EZTCOM) and activates the Oracle interface.
[
{ YES } ] %EZTPSPRA SCHEMA sche
name [ OVERRIDE { } ] + [ { N
[ { YES } ] [ FIELDS maxfields ] [ OPEN
[ SCAN start-column THRU end-column ]
• SCHEMA schema-name
Specifies the default name of the schema where the directory entries for the views to be accessed are located.
You can override the default schema-name at execution time by using a PARM on the job EXEC statement. This is helpful
when multiple schemas are used.
There is no default schema-name. For a SUPRA JCL example, see the SUPRA Interface Option section.
• OVERRIDE {YES|NO}
• YES
Overrides the schema-name when you execute the preprocessor.
• NO
Ignores attempts to override the schema name. This is the default.
• FIELDS maxfields
Specifies the maximum number of fields that can exist in a view included by the preprocessor.
If the number of fields in the view exceeds maxfields, an error message is printed and execution stops.
The specified value has an effect on the memory requirement when executing the preprocessor. Each field requires
approximately 110 bytes of storage. Decreasing the value conserves memory. Increasing the value causes more memory to
be used by the preprocessor.
Limits: 1 - 32767
Default: 250
• OPEN {YES|NO}
CA Easytrieve® Report Generator 11.6
• YES
Specifies that the preprocessor is to issue open and close functions for the directory files. This is the default.
• NO
Indicates that the open function has been performed by a system task and the preprocessor is not to open and close the
directory files.
• SCAN start-column THRU end-column
• start-column
Specifies the column number where the preprocessor starts to scan for input.
Limits: 1 - 80; must be less than end-column
Default: 1
• end-column
Specifies the column number where the preprocessor stops scanning for input.
Limits: 1 - 80; must be greater than start-column
Default: 72
These values also control the columns used during code generation. Set these values in accordance with the SCANCOL
option.
Note: To compile the SUPRA preprocessor, you must define the Options Table with SCAN=(1,72). If your option
differs, rerun JOB11SUA or JOB11SUB as described previously, or assemble a temporary copy of the options table to be
used for the compile of the SUPRA preprocessor.
The LINKURT step completes with a return code of 4 and the following message:
TRAP=(OFF,NOSPIE),ABTERMENC=(RETCODE),TERMTHDACT(UAIMM)
Macro Libraries
The section provides additional information and the steps that must be executed for some of the macro
interfaces.
The section provides additional information and the steps that must be executed for some of the macro interfaces.
Macro Library Storage
Macro statements are stored and maintained in a macro library. The MACTYPE entry in the CA Easytrieve® Report
Generator options table (see the Option Tables in Language Reference) specifies the macro library storage access method.
The types of access methods are listed below, (the letter under the macro library type is the corresponding value to be used for
the MACTYPE option):
Type Description
Panvalet(P) Macros are stored in a CA Panvalet library and maintained
through CA Panvalet utilities.
PDS (OS/390 and z/OS only)(D) Macros are stored in a Partitioned Data Set (PDS) and
maintained through the operating system utilities and TSO.
When creating the PDS macro library, specify the following
data set attributes:
DCB=(RECFM=FB,LRECL=80,BLKSIZE=nnnn
Where nnnn is any multiple of 80.
Security
CA Easytrieve® Report Generator 11.6
z/OS provides the capability, through program products such as CA ACF2 and CA Top Secret to secure the entire macro
library against unauthorized access.
* EODAD=ENTRY3,LRECL=80,RECFM=FB ...
END
SYSPRINT Exit
The SYSPRINT exit routine receives a pointer to the data to be printed in parameter one. The second parameter has a pointer
to a one-word code, which always has the value of binary 4, except at end-of-file, when the exit is called with a code value of
binary 8.
Parameter three points to a two-word area. The first word is binary 0 during compilation and binary 4 during execution. The
second word is binary 0 on the first call to the exit and can be used by the exit to determine first time entry. The contents of the
second word are not modified, thus providing the exit with an anchor for reentrant coding. Parameter four points to a one-word
area that contains the binary length of the print line as defined for the Line Size option in the Printer Profile Definition +1.
Sample SYSPRINT Exit Routine
The following is a sample SYSPRINT exit routine:
EZTPATH=path_name
export EZTPATH
For C shell, place EZTPATH in the .login for the users who need access to CA Easytrieve® Report Generator. For example:
The path_name should contain a list of directory names, separated by colons. For example, if CA Easytrieve® Report
Generator is installed in /ezt/bin and you want to use the options table or alternate collating sequence table in the group
directory /admin/ezt for Bourne and KORN shell users, enter the following:
EZTPATH=/admin/ezt:/ezt/bin
export EZTPATH
To link a program that uses Ingres, C-ISAM, or other databases in UNIX and Linux for zSeries, you can add the directories
that contain their shared or archived libraries to EZTPATH. For more information about each DBMS, see Compiling and
Linking Your Program. In Windows, programs are not linked so this step is not required.
Warning: CA Easytrieve® Report Generator always searches for the options table and alternate collating sequence
tables in the current directory.
Note: If you place the options table or the alternate collating sequence table in the directory where you installed CA
Easytrieve® Report Generator, the options table and alternate collating sequence table are deleted the next time you install CA
Easytrieve® Report Generator into the same directory.
EZTSQL (UNIX and Linux for zSeries Only)
The EZTSQL environment variable defines which SQL interface to use during a compile or link operation for a program using
SQL facilities. Valid values are:
ingres
openingresoracledb2odbc
EZTLIBS="-llib1 -llib2"
export EZTLIBS
For C shell, place EZTLIBS in the .login for the users who need access to CA Easytrieve® Report Generator. For example:
[ pre-options ] [ | post-options ]
The values of pre-options are the command line parameters that ezt processes before the parameters specified on the command
line. The values of post-options are options that are processed after the command line parameters. A vertical bar separates the
two sets of parameters.
For example, using the C shell notation for setting environment variables, the following commands:
By placing the macro search directory /usr/usr1/macros after the vertical bar in EZTOPTS, you ensure that any macro
directories specified on the command line are searched first. By placing the macro search directory before the vertical bar, CA
Easytrieve® Report Generator searches /usr/usr1/macros before any macro directories specified on the command line.
For Windows, the recommended approach is to include this macro only within the Environment Manager. For more
information, see Workbench Tools and Utilities
EZTDLLS (Windows Only)
You can use an EZTDLLS environment variable to name a list of dynamic load libraries (DLLs) to be loaded when CA
Easytrieve® Report Generator tries to locate dynamically-loaded user-written subroutines.
Setting this value as an environment variable establishes a global value. During application development, we recommend that
you use the Environment Manager to control the location of dynamic libraries. See the following sections and Workbench
Tools and Utilities for information.
Operating System-Specific Variables in UNIX or Linux for zSeries
Your operating system can use an environment variable to define the path list the loader uses to locate shared objects when
an executable links with shared objects. This variable is typically named SHLIB_PATH (HP-UX), LIBPATH (AIX),
LD_LIBRARY_PATH (Solaris or Linux for zSeries). For more information, see your operating system documentation.
During compilation, this variable must be set to the location of the CA Easytrieve® Report Generator compiler shared library:
libeztcom.sl or libeztcom.so. During execution of a CA Easytrieve® Report Generator program, the variable must contain both
the location of the CA Easytrieve® Report Generator runtime shared libraries and any other shared libraries that contain called
programs.
Dynamic Control of the Windows Environment
Use the Environment Manager function to dynamically control environment variables. For more information, see Workbench
Tools and Utilities.
To update the options table, type site option keywords and their corresponding values. For each site option you want to update,
you must supply a separate line with the keyword and its value. You can leave blank lines between input lines. A double slash
(//) begins a comment. Comments terminate at the end of the line.
Following the processing of the last input record, etopload writes all of the current options both to a listing and to an output
file. The output file can be used later to rebuild your site options after installing a new version of CA Easytrieve Report
Generator or if they happen to be destroyed.
Printer Profiles
To add or update a Printer Profile, use the following syntax examples.
Note:
For information about printer profile options, see Printer Profile Definition.
For System Printers
Example:
Example:
Example:
etopload -b -l >ezoptbl.def</dev/null
For Windows:
etopload -b -l >ezoptbl.def<nul
This command invokes the etopload utility that builds a default options table that is named EZOPTBL and produces a
sequence of options in ezoptbl.def.
Note:
For CA Easytrieve Report Generator on Windows, you can also use the Configuration Manager to create and maintain the
options table.
2. Specify the options that you want by editing ezoptbl.def. For more information about the options, see OptionCategories.
3. Update the options table by typing the following command on the command line:
etopload -b <ezoptbl.def
CREATEFILE
• Read File
The Read File command reads the existing site options and writes the records to an output file. This output file can be used
later to rebuild your site options after installing a new version of CA Easytrieve Report Generator or if your site options are
destroyed.
follow these steps:
READFILE
Note: The EZOPTBL DD statement must be specified while running an ETOPLOAD job. This is in contrast to when you are
compiling or executing a CA Easytrieve Report Generator program where the EZOPTBL DSN can be determined without the
use of an EZOPTBL DD statement in the JCL.
Option Categories
Options are categorized as follows. Click each link for information about the options in the category.
• Compiler Options are general program compilation options that include listing options and compile-time debugging aids.
• Execution Options are general program execution options.
• Environmental Options are general environmental options.
• Sort Options control how sort uses storage and sort messages.
• SQL Options control SQL program compilation and execution.
• IDMS Options control CA IDMS processing.
CA Easytrieve® Report Generator 11.6
Compiler Options
This article describes the Compiler options that you can specify in the options table. The options are listed
in categories.
This article describes the Compiler options that you can specify in the options table. The options are listed in categories.
SCANCOLS nn
• Limits: 1 - 80
• Default: 1
SCANCOLE - End Column
SCANCOLE establishes the ending column number scanned for CA Easytrieve Report Generator source input. This option is
in the Source Statement Scan Columns section in Configuration Manager.
CA Easytrieve® Report Generator 11.6
This is a compile-time option. You cannot override this value during program compilation.
SCANCOLE nn
WARNSYM x
• Default: +
ERORSYM - Errors
ERORSYM specifies the symbol the product uses on error messages to identify the word causing the flagged condition. Enter
any single character. This option is in the Syntax Check Locator Symbols section in Configuration Manager.
This is a compile-time option. You cannot override this value during program compilation.
ERORSYM x
• Default: $
ASCSIGN - Zoned Numeric Sign
ASCSIGN specifies which system to use to create zoned numeric fields. All systems are valid upon input. This option is only
supported in Windows, UNIX, and Linux for zSeries environments. z/OS always uses the D value.
This is a compile-time option. You cannot override this value during program compilation.
ASCSIGN {D|2|7|H}
• D
Zoned numeric fields are in EBCDIC. The zone portion of a digit is a 0xF0 unless the digit is the last digit of a negative
value. The zone portion of the last digit of a negative value is 0xD0.
• 2
Zoned numeric fields are in ASCII. The zone portion of a digit is a 0x30 unless the digit is the last digit of a negative value.
The zone portion of the last digit of a negative value is 0x20. This is the default.
• 7
Zoned numeric fields are in ASCII. The zone portion of a digit is a 0x30 unless the digit is the last digit of a negative value.
The zone portion of the last digit of a negative value is 0x70.
• 5
Zoned numeric fields are in NETCOBOL ASCII format. The zone portion of a digit is a 0x30 unless the digit is the last
digit of a negative or positive signed value. In those cases, the zone portion of the last digit will be: 0x50 for a negative
value, or 0x40 for a positive value.
• H
CA Easytrieve® Report Generator 11.6
Zoned numeric fields are in ASCII. The zone portion of a digit is a 0x30 unless the digit is the last digit of a negative
value. The zone portion of the last digit of a negative value is the ASCII translation of the EBCDIC negative digit. See the
following table for values.
LISTUC {Y|N}
• Y
Translates to uppercase if printer does not support lowercase.
• N
Do not translate to uppercase. This is the default.
DMAP - Data Map
DMAP specifies whether a data map of the files and fields is produced in the program as a result of a compilation. This option
is in the Listing Control Options section in Configuration Manager.
This is a compile-time option. You can override this value with PARM DEBUG DMAP.
DMAP {Y|N}
• Y
Produces the data map.
• N
Suppresses the DMAP. This is the default.
PMAP - Program Map
PMAP specifies whether a program map of the program's generated code is produced as a result of a compilation. This option
is in the Listing Control Options section in Configuration Manager.
This is a compile-time option. You can override this value with PARM DEBUG PMAP.
Note:
CA Easytrieve® Report Generator 11.6
PMAP {Y|N}
• Y
Produces the program map.
• N
Suppresses the PMAP. This is the default.
CLIST - Condensed Map
CLIST specifies whether a condensed program map of the program's generated code is produced as a result of a compilation.
This option is in the Listing Control Options section in Configuration Manager.
This is a compile-time option. You can override this value with PARM DEBUG CLIST.
Note:
CLIST Y and PMAP Y are mutually exclusive options.
CLIST {Y|N}
• Y
Produces the condensed program map.
• N
Suppresses the CLIST. This is the default.
LISTPRM - Parms/Summary
LISTPRM specifies whether a summary of the compilation is produced. The summary contains the parameters that are in
effect during the compilation. This option is in the Listing Control Options section in Configuration Manager.
This is a compile-time option. You can override this value with PARM LIST PARM.
LISTPRM {Y|N}
• Y
Produces the summary.
• N
Suppresses the summary. This is the default.
XREF - Name Cross-Reference
XREF specifies whether a name cross-reference of the compilation is produced. This option is in the Listing Control Options
section in Configuration Manager.
This is a compile-time option. You can override this value with the DEBUG XREF parameter of the PARM statement.
XREF {L|S|N}
• L (long)
Produces a long cross-reference that includes unreferenced names.
• S (short)
Produces a short cross-reference that only includes referenced names.
• N (no)
Suppresses the XREF. This is the default.
CA Easytrieve® Report Generator 11.6
COMPNAME - Company
COMPNME specifies the company name to center in the title area of the compilation listing. This option is in the Listing
Control Options section in Configuration Manager.
This is a compile-time option. You cannot override this value during program compilation.
• Limits: 50 characters
• Default: COMPUTER ASSOCIATES, INC. FIELD INSTALLATION.
Syntax Control Options
FLDCHK - Unavailable Fields
FLDCHK specifies whether data references to each field are validated during execution. A data reference is invalid if a field
was referenced in a file that has no active record. An invalid reference can cause a program check or a reference to invalid
data. This option is in the Syntax Control Options section in Configuration Manager.
This is a compile-time option. You can override this value with PARM DEBUG NOFLDCHK.
FLDCHK {Y|N}
• Y
Validates references. This is the default.
• N
Suppresses reference validation.
Macro Library Control Options
MACTYPE - Macro Library Type (z/OS Only)
MACTYPE specifies the type of macro library support. This option is on the Macros tab in Configuration Manager.
This is a compile-time option for z/OS only.
MACTYPE {P|E|N|D}
• P
Specifies CA Panvalet.
• ESpecifies CA Endevor
• N
Specifies none.
• D
Specifies PDS. This is the default.
MACDDN - Macro DD Name (z/OS Only)
MACDDN indicates the DD name used by the standard CA Easytrieve Report Generator macro library facilities to reference
the desired macro library. This option is on the Macros tab in Configuration Manager.
This is a compile-time option for z/OS only.
MACDDN xxxxxxxx
• Limits: Up to 8 characters. If the MACTYPE option is P, (Panvalet), the MACDDN value can be no longer than 5
characters. If the MACTYPE option is E, (Endevor), the MACDDN value can be no longer than 7 characters.
CA Easytrieve® Report Generator 11.6
• Default: PANDD
MAC#LIB - Number of Libraries (z/OS Only)
MAC#LIB specifies the number of CA Panvalet or CA Endevor libraries to be searched if the CA Panvalet or CA Endevor
macro library support is used. This value is used as a suffix to the name specified by MACDDN. This option is on the Macros
tab in Configuration Manager.
This is a compile-time option for z/OS only. No override is available.
MAC#LIB n
• Limits: 1-9
• Default: 1
Example
MAC#LIB is specified as follows:
MACDDN = PANDDMAC#LIB = 2
PANDD1PANDD2
MACMOD modname
• Default: PANMODI
Other Options
Note:
These options are not available in the Configuration Manager.
NEWFUNC - New Functional Mode (z/OS only)
The NEWFUNC option specifies whether to use the current version of the compiler or the Release 6.4 (Compatibility Mode)
compiler to compile your CA Easytrieve Report Generator programs. This option does not have any impact on link-edited CA
Easytrieve Report Generator application programs.
This is a compile-time option for z/OS only. There is no PARM statement override.
NEWFUNC {Y|N}
• Y
Compiles and runs your programs using the latest product release thereby providing all new functionality therein. This is
the default.
CA Easytrieve® Report Generator 11.6
• N
Compiles and runs your programs using the compatibility mode of CA Easytrieve Plus. This feature provides you with
more control over the process of moving your applications to CA Easytrieve Report Generator Version 11.0 and above.
SINXIT - SYSIN Exit Routine (z/OS only)
SINXIT specifies the name of a user supplied SYSIN exit routine. The module name must be a valid program name. The
SYSIN Exit Routine is called at compile time only to allow pre-processing of Compiler input source statements. More
information about the SYSIN exit capability can be found in Installing in the Unit Record Exits section.
This is a compile-time option for z/OS only. There is no PARM statement override.
SINXIT xxxxxxxx
RUNSYM x
• Default: @
UPDTVS - VSAM Updates (z/OS only)
UPDTVS specifies whether or not VSAM file updates are allowed. The ability to update VSAM files is checked at different
times depending on the FILE statement parameters specified. If SEQUENTIAL, INDEXED, or RELATIVE is specified on the
FILE statement, the program is checked during execution. If VS is specified on the FILE statement, the program is checked
during compilation. The program is checked at different times because SEQUENTIAL, INDEXED, and RELATIVE do not
necessarily apply to VSAM files, and, therefore, these files cannot be checked until the program executes.
This is a compile-time and an execution-time option for z/OS only.
UPDTVS {Y|N}
• Y
Specifies that VSAM file updates are permitted. You cannot override this value during program compilation.
• N
Specifies that VSAM file updates are not permitted. This is the default.
Note:
The VS parameter of the FILE statement is maintained for syntax compatibility with older versions of CA Easytrieve Report
Generator.
DDIVRND - Round or Truncate Division Result
DDIVRND specifies whether the result of a division operation is rounded or truncated when the number of decimal places in
the result exceeds the number of decimal places that are defined for the field.
This is a compile-time option.
DDIVRND {Y|N}
CA Easytrieve® Report Generator 11.6
• Y
The result is rounded.
• N
The result is truncated. This is the default.
Note:
In the following examples, WS-PERCENT-P1 is defined as a 7-byte packed decimal field with 6 decimal places. The actual
result of 29 divided by 266.91 with nine decimal places is 0.108650856.
Example 1: DDIVRND is set to N
In this example, the lowest three decimal places of the result are dropped, as shown in the displayed result.
STRICTQU {W|N|E}
• W
The program is compiled and a warning message is issued that states which file was used to qualify the field. This is the
default.
• N
The program is compiled. No warning or error message is issued.
• E
The program is not compiled and error message EZTC0644E: MORE QUALIFICATION REQUIRED is issued.
Note:
For more information about data references and default qualification, see Define Files and Fields.
Example
CA Easytrieve® Report Generator 11.6
In the following code, the programmer intends for the file status of PERSONAL to be checked:
Because FILE-STATUS is not qualified, the following message is issued if STRICTQU is set to W:
Execution Options
This article describes the following Execution options that you can configure in the options table:
This article describes the following Execution options that you can configure in the options table:
AMODE31 {Y|N}
• Y
Allows all possible memory allocations to be made above the 16meg line. This is the default.
• N
Causes all possible memory allocations to be made below the 16 MB line.
BLOCK0 (z/OS only)
BLOCK0 specifies whether a system-determined block size is used for files that do not have logical record length and block
size coded. A zero is passed to the operating system that determines the optimum block size. This feature should be used only
if your operating system supports the use of the IBM system-determined block size. Override is through the BLOCKSIZE
parameter of the FILE statement.
This is an execution-time option for z/OS only. There is no PARM statement override.
BLOCK0 {N|D|P|A}
• N
Indicates that the system does not determine the block size for data sets. It must be specified through the JCL or FILE
statement.
• D
Indicates that the system determines the block size for disk and tape data sets. DSORG does not have to be coded in the
JCL with this option.
• P
Indicates that the system determines the block size for PRINTER data sets.
CA Easytrieve® Report Generator 11.6
• A
Indicates that the system determines the block size for disk, tape and PRINTER data sets.
FLOWSIZ - Flow Table Size
FLOWSIZ specifies the number of trace entries available for the FLOW option. The table of trace entries is used only when
FLOW is set to Y. Each entry requires 2 bytes of storage. You can override this value with the DEBUG FLOWSIZ parameter
of the PARM statement.
This is an execution-time option.
FLOWSIZ nnnn
• Limits: 1 - 4096
• Default: 100
LISTFIL - File Statistics
LISTFIL specifies whether file statistics are produced at the completion of each activity during execution. The statistics are
written to STDERR.
This is an execution-time option. You can override this value with PARM LIST FILE.
LISTFIL {Y|N}
• Y
Produces the statistics.
• N
Suppresses the statistics. This is the default.
STATE - Save Statement Number (z/OS only)
STATE specifies whether to maintain the statement number of the last statement executed. STATE or FLOW (see Trace
Program Flow) must be set to Y for the last statement number to appear on execution-time diagnostics messages.
This is an execution-time option for z/OS only. You can override this value through PARM DEBUG STATE.
STATE {Y|N}
• Y
Saves the statement number. This is the default.
• N
Does not save the statement number.
STORCHK - Check Storage Areas (z/OS only)
STORCHK specifies whether acquired storage is periodically validated. This is usually done at the direction of CA Support to
debug storage problems.
This is an execution-time option for z/OS only. You cannot override this value during program execution.
STORCHK {Y|N}
CA Easytrieve® Report Generator 11.6
• Y
Checks storage areas.
• N
Does not check storage areas. This is the default.
FLOW - Trace Statement Flow (z/OS only)
FLOW specifies whether the product traces statement execution. FLOW or STATE (see Save Statement Number) must be set
to Y for the last statement number to appear in execution-time diagnostics messages.
This is an execution-time option for z/OS only. You can override this value through PARM DEBUG FLOW.
FLOW {Y|N}
• Y
Saves the statement numbers in a table for display upon abnormal termination.
• N
Does not save the statement numbers. This is the default.
ABEXIT - Use Abend Exit (z/OS only)
ABEXIT specifies the type of processing that is performed when a program abnormally terminates.
This is an execution-time option for z/OS only. You can override this value through the ABEXIT parameter of the PARM
statement.
ABEXIT {S|P|N}
• S (Snap)
Tells the product to intercept any program checks and produce an Error Analysis Report. This is the default.
• P (nosnaP)
Performs the same function as S except that the CA Easytrieve Report Generator storage areas are not dumped.
• N (No)
Indicates that the product should not process any program checks.
TBLMAX - Maximum Table Entries (z/OS only)
TBLMAX specifies the maximum number of entries for a table that is loaded from an external file (not instream). If the value
you specify for TBLMAX is excessively high, then the total amount of storage required for CA Easytrieve Report Generator is
inflated. If the value is too low, then the product issues a diagnostic message when the file is loaded.
This is an execution-time option for z/OS only. You can override this value through the TABLE parameter of the table FILE
statement for particularly large tables.
TBLMAX nnnnn
• Limits: 0 - 32767. You should specify a value that is adequate for 90-95% of the tables used.
• Default: 256
Note: Although this option is still accepted, it is ignored and reserved for future use.
FLDMAX - Maximum Field Size (z/OS only)
CA Easytrieve® Report Generator 11.6
FLDMAX specifies the maximum size for a working storage field or a file buffer permitted at compile time. The compiler
generates a syntax error if the total size of a working storage field (field length multiplied by number of occurrences) exceeds
this value. The value for FLDMAX is specified in kilobytes (K). The actual value used is eight bytes smaller than the number
of kilobytes specified to allow for storage header information.
This is an execution-time option for z/OS only.
FLDMAX nnnnn
MTVSERR {Y|N}
• Y
The CA Easytrieve Report Generator I/O system treats an empty VSAM input file as an I/O error condition. This will cause
the immediate abnormal termination of the program.
• N
An empty VSAM input file to be handled as though it is at End-Of-File. This is the default.
UPDTDLI - DLI Updates (z/OS only)
UPDTDLI specifies whether the DLI update function codes DLET, ISRT, or REPL are allowed on the DLI statement.
This is an execution-time option for z/OS only. No override is available.
UPDTDLI {Y|N}
• Y
Codes are allowed.
• N
Codes are not allowed. This is the default.
SPRTXIT - SYSPRINT Exit (z/OS only)
SPRTXIT specifies the name of a user-supplied SYSPRINT/SYSLST exit routine. The modname must be a valid program
name. More information on the SYSPRINT/SYSLST exit capability can be found in the Unit Record Exits section in
Installing.
This is an execution-time option for z/OS only.
SPRTXIT modname
CA Easytrieve® Report Generator 11.6
UPDTIDD={YES|NO}
• YES
Override is available through the RETRIEVE parameter on the IDD NAME statement.
• NO
No override is available. This is the default.
Note: Although this option is still accepted, it is ignored and reserved for future use.
WARNCC - Warning Message Condition Code Option
WARNCC specifies which condition code the compiler returns for warning messages. Typically a compilation that reports
only warning messages returns with a condition code of 4.
You cannot override this value during program compilation.
WARNCC {F|S|Z}
• F
Returns a condition code of 4 for warnings. This is the default.
• S
Returns a condition code of 16 for warnings.
• Z
Returns a condition code of 0 for warnings.
Environmental Options
This article describes the following Environmental options that you can configure in the options table:
This article describes the following Environmental options that you can configure in the options table:
BUFNO nnn
• Limits: 0 - 255.
• Default: 2
ENVIRON - Environment COBOL (z/OS only)
ENVIRON establishes whether to establish the COBOL Language Environment (LE) prior to calling any subprograms. The
environment is established prior to the PROGRAM activity or each JOB activity that contains a CALL statement or accesses a
FILE EXIT. The environment is terminated after the activity for which it was established.
CA Easytrieve® Report Generator 11.6
This is an execution-time option for z/OS only. You can override the value using the ENVIRONMENT parameter of the
PARM, PROGRAM, or JOB statement.
ENVIRON {N|C}
• N
No environment is established. This is the default.
• C
The COBOL environment is established.
Note:
For more information about the ENVIRONMENT COBOL parameter, see Inter-Program Linkage.
WKDSNPF - Work Data Set Prefix (z/OS only)
WKDSNPF specifies the three-character prefix that is used for all internal work files. It must be three characters that are valid
as a file name prefix. A user-specified name cannot begin with this prefix.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
WKDSNPF xxx
• Default: EZT
WORKFILE - Use Report Workfiles (z/OS only)
WORKFILE specifies whether Report work files are to be used to store intermediate Reporting data.
This is a compile-time option for z/OS only. You can override this value through the WORKFILE parameter of the PARM
statement.
WORKFILE {Y|N}
• N
VFM files are used to store intermediate Reporting data. This is the default.
• Y
Temporary sequential disk files are used to store intermediate Reporting data.
WORKFSPA - Report Work Files Space (z/OS only)
WORKFSPA specifies the number of cylinders that are to be allocated to each Report work file.
This is an execution-time option for z/OS only. You can override this value through the WORKFILE parameter of the PARM
statement or by coding Report work file DD statements in the JCL that executes the CA Easytrieve Report Generator program.
WORKFSPA nnn
• Default: 20
CA Easytrieve® Report Generator 11.6
VFMDEV {DISK|MEMORY}
• DISK
Overflows to disk. This is the default.
• MEMORY
Overflows to main memory.
VFMSPAC - VFM Core Storage (z/OS only)
VFMSPAC specifies the maximum amount of storage that is used by the Virtual File Manager (VFM) for its buffer pool.
If the product is executed in a partition of 256K or greater, you should specify a value that is 25 percent to 40 percent of the
total partition space:
• For a 256K partition, a value of 64K is suggested.
• For a 1M partition, a value of 400K is suggested.
This is an execution-time option for z/OS only. You can override this value through the VFM parameter of the PARM
statement.
VFMSPAC nnnn
• Default: 64
• Limits: 6 - 4096
STDOUT - Standard Output Destination ID
STDOUT specifies the destination ID to which output is routed when a display or report is issued to the default system output
device (SYSPRINT). The value that you specify for STDOUT must be the destination ID of a valid printer profile definition.
This is an execution-time option. You cannot override this value during program compilation.
STDOUT destination id
• Default: TERMINAL
STDERR - Standard Error Destination ID (z/OS only)
STDERR specifies the destination ID to which error messages are routed when runtime error messages are issued. The value
that you specify for STDERR must be the destination ID of a valid printer profile definition.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
STDERR destination id
CA Easytrieve® Report Generator 11.6
• Default: TERMINAL
PRINTID - Report Destination ID (z/OS only)
PRINTID specifies the destination ID to which output is routed when the Report Display Facility prints a report. PRINTID is
also used when a report is routed to the originating terminal through the STDOUT option and no terminal is active. The value
that you specify for PRINTID must be the destination ID of a valid printer profile definition.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
PRINTID destination id
• Default: PRINTER. If the profile definition for PRINTID routes output to the originating terminal, an error occurs.
MSGID - Message Destination ID (z/OS only)
MSGID specifies the destination ID to which output is routed when the Report Display Facility prints an Error Analysis
Report. MSGID is also used when an Error Analysis Report is routed to the originating terminal using the STDERR option, but
no terminal is active. The value that you specify for MSGID must be the destination ID of a valid printer profile definition.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
MSGID destination id
• Default: PRINTER. If the profile definition for MSGID routes output to the originating terminal, an error occurs.
Sort Options
This article describes the following Sort options that you can configure in the options table:
This article describes the following Sort options that you can configure in the options table:
ALTSEQU {Y|N}
• Y
Defines that the product uses an alternate sequence table.
• N
Suppresses the table. This is the default.
ALTSEQ - Alternate Sequence Table
ALTSEQ specifies the name of an alternate collating sequence table for the sort process. The table is used when you specify Y
for the ALTSEQU option, described previously, or when your program contains a PARM SORT (ALTSEQ YES) statement.
CA Easytrieve® Report Generator 11.6
Enter up to eight characters specifying the name of a module containing the alternate collating table.
This is an execution-time option. You can override this value with the SORT parameter of the PARM statement.
ALTSEQ xxxxxxxx
• Default: EZTPAQTT
SORTNAME - Sort Program Name (z/OS only)
SORTNAME specifies the sort program on your operating system. Type up to eight characters specifying a valid program
accessible to CA Easytrieve Report Generator.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
SORTNAME xxxxxxxx
• Default: SORT
SORTMAX - Sort Use Available Storage (z/OS only)
SORTMAX specifies the maximum amount of storage that the sort program is allowed to use.
This is an execution-time option for z/OS only. You can override this value through the SORT MEMORY parameter of the
PARM statement.
SORTMAX {Y|N}
This is an execution-time option for z/OS only. You can override this value through the SORT MEMORY parameter of the
PARM statement.
SORTSIZ nnnn
• Limits: 0, 16 - 4096
• Default: 0
Note: See the description of SORTMAX for an explanation of how to set this option.
SORTRLS - Amount Released After Sort (z/OS only)
SORTRLS specifies the amount of free storage to be made available after the sort program is invoked. This space may be
required when the input or output file is controlled by an exit and the exit needs to allocate storage (as by opening a file).
This is an execution-time option for z/OS only. You can override this value through the SORT parameter of the PARM
statement.
SORTRLS nnnn
• Limits: 0 - 1024
• Default: 0
FASTSRT - Fast Sort (z/OS only)
FASTSRT specifies whether the sort program handles all of the I/O. This option applies only to sort programs that support
extended parameter lists and the fast sort feature.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
FASTSRT {Y|N}
• Y
Uses the fast sort interface.
• N
Uses standard sort interface. This is the default.
NUMWORK - Number of Work Areas (z/OS only)
NUMWORK specifies the number of work areas that are used by the sort.
This is an execution-time option for z/OS only. You can override this value through the SORT WORK parameter of the PARM
statement or the WORK parameter of the SORT statement.
NUMWORK nn
• nn
Specifies the number of work areas that are used by the sort.
CA Easytrieve® Report Generator 11.6
Default: 3
• 1 - 31 -- A number in this range tells the sort program to dynamically allocate this number of work data sets.
• 0 -- Specifies that the data sets are not dynamically allocated and must be defined in DD statements. If your operating
system does not support dynamic allocation of data sets, this field must be zero.
SORTWRK - Sort Work Device Type (z/OS only)
SORTWRK specifies the sort work device type for sort programs that dynamically allocate their sort work data sets. Type any
specific or generic device name that is valid for your operating system.
This is an execution-time option for z/OS only. You can override this value through the SORT parameter of the PARM
statement.
SORTWRK xxxxx
• Default: SYSDA
SORTPRT - DDNAME for Sort Messages (z/OS only)
SORTPRT specifies a valid DDNAME for sort messages.
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
SORTPRT xxxxxx
• Default: SYSOUT
SORTMSR - Route Sort Messages (z/OS only)
SORTMSR specifies the routing of sort messages.
This is an execution-time option for z/OS only. You can override this value through the SORT parameter of the PARM
statement.
SORTMSR {P|C}
Note: This option is ignored if you specify D for the SORTMSG option, described next.
SORTMSG - Level of Message Output (z/OS only)
SORTMSG specifies which messages are output from your sort program.
This is an execution-time option for z/OS only. You can override this value through the SORT parameter of the PARM
statement.
SORTMSG {D|N|A|C}
• D (Default)
Outputs the level of messages that are specified when the sort program was installed. This is the default.
CA Easytrieve® Report Generator 11.6
• A (All)
Outputs all messages.
• N (No)
Does not output messages.
• C (Critical)
Outputs critical messages only.
SQL Options
This article describes the SQL options that you can specify in the options table:
This article describes the SQL options that you can specify in the options table:
In the Configuration Manager, these options are on the SQL tab of the execution options.
SQLSYNTX - SQL Syntax Level
SQLSYNTX specifies the type of syntax checking to perform on the SQL statements.
This is a compile-time option.
SQLSYNTX {F|P|N}
• F (Full)
Fully syntax checks SQL statements using the facilities of the underlying DBMS. FULL syntax checking results in the SQL
statement undergoing a dynamic prepare. This is the default.
• P (Partial)
Checks SQL statements for valid keywords. No connection is made to the DBMS unless an INCLUDE statement is coded
for an SQL table. PARTIAL does not permit the program to execute until it has undergone FULL syntax checking.
• N (None)
Performs PARTIAL syntax checking.
SSID - Subsystem ID
SSID specifies the name of the subsystem (Ingres, SYBASE, or Db2 database name or ODBC data source name) to use for
compilation and execution.
This is a compile-time option. You can override this value through the SSID parameter of the PARM statement.
SSID subsystem-id
• Blank
No default subsystem specified. This is the default.
• SSID
All programs using this option execute with a specific subsystem.
Note: SSID is required for Ingres or SYBASE either through the PARM statement or this option. Mainframe Db2 subsystems
can also be obtained from the Db2 system default module DSNHDECP. Non-mainframe subsystems can be obtained from the
ID in the DB2DBDFT environment variable. Windows ODBC data sources can be obtained through a connection dialog if not
supplied through the PARM statement or this option.
PANSQL - PAN/SQL Prefix (z/OS only)
PANSQL specifies the prefix of the CA Pan/SQL modules. If your environment requires that the modules be renamed, you can
do so by specifying a new prefix. You must then rename the CICS CA Pan/SQL modules in your loadlib.
CA Easytrieve® Report Generator 11.6
This is an execution-time option for z/OS only. You cannot override this value during program compilation.
PANSQL xxxxxs
• Default: DQSPS
Note: See the CA Pan/SQL documentation for more changes.
PREPNME - Access Module/Plan (z/OS only)
PREPNME specifies the default name of the access module or access plan to be created for the SQL/DS or CA Datacom/DB
with SQL databases.
This is a compile-time option for z/OS only. You can override this value through the PREPNME parameter of the PARM
statement.
PREPNME xxxxxxxx
• Default: EASYPLUS
Note: We recommend that you avoid using the default and specify a unique name for each user program.
BIND - Bind (z/OS only)
BIND specifies the default Db2 bind that is used.
This is a compile-time option for z/OS only. You can override this value through the BIND parameter of the PARM statement.
BIND {A|S|D}
• Blank
No default value specified. This is the default.
• A
Either STATIC-ONLY or DYNAMIC is used.
• S
STATIC-ONLY is used.
• D
DYNAMIC is used.
IDMS Options
This article describes the IDMS options that you can specify in the options table:
This article describes the IDMS options that you can specify in the options table:
In the Configuration Manager, these options are on the IDMS tab of the execution options.
CALCDUP - Duplicate CALC Record Keys (z/OS only)
CALCDUP specifies whether CALC records with duplicate keys are to be retrieved for the IDMS RETRIEVE statement.
CA Easytrieve® Report Generator 11.6
This is a compile-time option for z/OS only. You can override this value with the DUPS/NODUPS parameter of the
RETRIEVE statement.
CALCDUP {Y|N}
• Y
Indicates that root records with the same tickler file key are returned.
• N
Indicates that only the first of the duplicate records is returned. This is the default.
UPDTIDM - IDMS Update Allowed (z/OS only)
UPDTIDM specifies whether IDMS statements that update the database (CONNECT, DISCONNECT, ERASE, MODIFY,
STORE) are permitted during syntax check and execution operations.
This is a compile-time and an execution-time option for z/OS only.
UPDTIDM {Y|N|C|R}
• Y
Indicates that update functions are permitted.
• N
Indicates that update functions are not permitted. This is the default.
• C
Indicates that update functions are permitted at compile time only.
• R
Indicates that update functions are permitted at runtime only.
Note:
The C and R options are not available in the Configuration Manager.
UPDTIDD - IDD Updated with Program Compilation Stats (z/OS only)
UPDTIDD specifies whether the dictionary is to be updated with program compilation statistics.
This is a compile-time option for z/OS only.
UPDTIDD {Y|N}
• Y
Override is through the RETRIEVE parameter on the IDD NAME statement.
• N
No override is available. This is the default.
VERFILE - IDD FILE Version (z/OS only)
VERFILE specifies the version of the non-database file that you want to retrieve.
This is a compile-time option for z/OS only. You can override this value with the VERSION parameter of the IDD FILE
statement.
CA Easytrieve® Report Generator 11.6
VERFILE {HIGHEST|LOWEST|nnnn}
• HIGHEST
This is the default.
• LOWEST
• nnnn
Indicates specific version number.
VERREC - IDD RECORD Version (z/OS only)
VERREC specifies the version of the record that you want to retrieve.
This is a compile-time option for z/OS only. You can override this value with the VERSION parameter of the IDD RECORD
statement.
VERREC {HIGHEST|LOWEST|nnnn}
• HIGHEST
This is the default.
• LOWEST
• nnnn
Indicates specific version number.
VERSCHM - IDD SCHEMA Version (z/OS only)
VERSCHM specifies the version of the schema owning the subschema that you want to retrieve.
This is a compile-time option for z/OS only. You can override this value with the VERSION parameter of the ID
SUBSCHEMA statement.
VERSCHM {HIGHEST|LOWEST|nnnn}
• HIGHEST
This is the default.
• LOWEST
• nnnn
Indicates specific version number.
IDDCOMP - IDD COMP Field Type (UNIX only)
IDDCOMP specifies the field type to generate for a CPMP type field from the IDD.
This is a compile-time option for UNIX only.
IDDCOMP {B|I}
• B
Indicates a mainframe binary format. This is the default.
• I
Indicates an integer field type.
Report Options
This article describes the Report options that you can configure in the options table:
CA Easytrieve® Report Generator 11.6
This article describes the Report options that you can configure in the options table:
LONGDTE {Y|N}
• Y
Displays SYSDATE-LONG on reports and the compile listing.
• N
Displays SYSDATE on reports and the compile listing. This is the default.
Note: Also see the DATE and DATESEP options.
LINESIZ - Characters on a Line
LINESIZ specifies the default length of a report line, excluding the carriage control character.
This is a compile-time option.
LINESIZ is used:
• When a report is routed to the default system output device, SYSPRINT
• When a report is routed to PRINTER and no LINESIZE parm is specified in the FILE statement or REPORT statement
• To define the length of the compiler output lines
You can override this parameter through the LINESIZE parameter of the REPORT statement or a PRINTER FILE statement.
The override is applicable only to report output, not to the compiler listing.
LINESIZ nnn
• Limits: 80 - 255
• Default: 132
PAGESIZ - Lines on a Page
PAGESIZ specifies the maximum length of a logical report page. This is the value that is compared by LINE statements for
end of page. This value also defines the page size of the compiler listing lines.
This is a compile-time option. You can override this value with the PAGESIZE parameter of the REPORT or FILE statement.
PAGESIZ nnnnn
• Limits: 1 to 32767
• Default: 58
DISPPAGE - Display Page Size
DISPPAGE specifies the maximum print length of a report page for the DISPLAY statement. This is the value that is
compared by DISPLAY statements for end of page.
CA Easytrieve® Report Generator 11.6
This is a compile-time option. You can override this value through the PAGESIZE (display-page-size) parameter of the
REPORT or FILE statement.
DISPPAGE nnnnn
• Limits: 0 - 32767
• Default: 0 (DISPLAY statements are not tested for end of page)
SKIP - Lines to Skip before Detail
SKIP specifies the number of blank lines that are inserted before each LINE 01 is printed, except for the first LINE 01 after a
page heading.
This is a compile-time option. You can override this value with the SKIP parameter of the REPORT statement.
SKIP nnn
TITLSKP nnn
SPACE nnn
This is a compile-time option. You can override this value with the SPREAD parameter of the REPORT statement.
SPREAD {Y|N}
• Y
Spreads the items.
• N
Keeps the items separated by the minimum space that is specified in the SPACE option of the REPORT statement. This is
the default.
SUMSPAC - Additional Positions for Summed Fields
SUMSPAC specifies the number of additional print positions to reserve for printing summed fields in a report. The additional
space prevents an overflow condition when the summed field exceeds its defined size.
This is a compile-time option. You can override this value with the SUMSPACE parameter of the REPORT statement.
SUMSPAC n
• Limits: 0 - 9
• Default: 3
TALYSIZ - Size of TALLY Field
TALYSIZ specifies the size of the TALLY field in digits. The value of SUMSPAC is added to TALYSIZ to determine the
effective size of the printed field. Using the defaults for SUMSPAC and TALYSIZ, the effective size of TALLY is five digits.
This is a compile-time option. You can override this value with the TALLYSIZE parameter of the REPORT statement.
TALYSIZ nn
• Limits: 1 - 18
• Default: 2
DTLCTL - Print Control Fields on Detail Lines
DTLCTL specifies the method of printing the value of control fields on detail lines in a control report.
This is a compile-time option. You can override this value using the DTLCTL parameter of the REPORT statement.
DTLCTL {F|E|N}
• F (First)
Prints all control fields on the first detail line at top-of-page and after each break. This is the default.
• E (Every)
Prints control fields on every detail line.
• N (None)
Does not print control fields on detail lines.
Note: For more information about this option, see the DTLCTL parameter of the REPORT statement in Language Reference
and Programming.
CA Easytrieve® Report Generator 11.6
SUMCTL {A|H|T|N}
• A (All)
Prints all control fields on all total lines.
• H (Hiar)
Prints control fields in hierarchical order on total lines. This is the default.
• T (Tag)
Tags each summary line with the control field.
• N (None)
Does not print control fields on the summary lines.
Note: For more information about this option, see the SUMCTL parameter of the REPORT statement in the Language
Reference and Programming .
ACROSS - Number of Labels Across
ACROSS specifies the number of labels to print across the print line.
This is a compile-time option.
ACROSS nnn
• Limits: 1 - 127
• Default: 4
DOWN - Number of Lines on a Label
DOWN specifies the number of lines in each label.
This is a compile-time option.
DOWN nnn
LABLSIZ nnn
NEWPAGE {Y|N}
• Y
Skip to the top of the next page.
• N
Do not skip to the top of the next page. This is the default.
Mask Options
This article describes the Mask option that you can specify in the options table.
This article describes the Mask option that you can specify in the options table.
USERMSK - Mask
You can use a mask ID in the MASK parameter of the DEFINE or ROW statement to identify a mask that is used in a CA
Easytrieve Report Generator program.
This is a compile-time and an execution-time option.
USERMSK x 'mask-literal'
• x
Valid values: A through Y
Note: Using letters at the end of the alphabet avoids conflicts with programmer-coded masks, as programmers typically
choose letters at the beginning of the alphabet.
• mask-literal
Describes the mask as it would be defined in a field definition.
Note: For information about coding masks, see the MASK parameter.
International Options
This article describes the international options that you can specify in the options table:
This article describes the international options that you can specify in the options table:
DATE {M|D|Y}
• M (Month)
MM/DD/YY format. This is the default.
• D (Day)
DD/MM/YY format.
CA Easytrieve® Report Generator 11.6
• Y (Year)
YY/MM/DD format.
DATESEP - Date Separator Character
DATESEP specifies the character that separates the month, day, and year of the date that is placed at the top of the listing and
stored in the system defined field SYSDATE.
This is an execution-time option. You cannot override this value during program compilation.
DATESEP x
TIMESEP x
MONEY x
PAGEWRD xxxxxxxxxx
• Limits: 1 - 10 characters
• Default: PAGE
FINALWRD - Word Used for FINAL
FINALWRD specifies the spelling for the English word FINAL for non-English language sites. The specified word replaces
the word FINAL in the annotation for the final total line when the TAG subparameter is used in a CA Easytrieve Report
Generator report.
CA Easytrieve® Report Generator 11.6
This is a compile-time option. You cannot override this value during program compilation.
FINALWRD xxxxxxxxxx
• Limits: 1 to 10 characters
• Default: FINAL
TOTALWRD - Word Used for TOTAL
TOTALWRD specifies the spelling for the English word TOTAL for non-English language sites. The specified word
replaces the word TOTAL in the annotation for the total lines when the TAG subparameter is used in a CA Easytrieve Report
Generator report.
This is a compile-time option. You cannot override this value during program compilation.
TOTALWRD xxxxxxxxxx
• Limits: 1 to 10 characters
• Default: TOTAL
SEPOTTH - Thousands Separator Character
SEPOTTH specifies the character that separates the thousands place in numeric fields.
This is a compile-time option. You cannot override this value during program compilation.
SEPOTTH x
SEPOTDC x
Destination ID
In Configuration Manager, displays the destination ID of the definition being added or maintained. It is taken from the
Environmental Options panel. You cannot change it here.
Printer Type
CA Easytrieve® Report Generator 11.6
Specifies the type of destination to which output is routed. Valid values are:
• S (System)
Specifies that this is a system printer to be dynamically directed to the operating system spooling system. When you type s,
only the values that are specified for the For System Printers fields are used.
• T (Terminal)
Specifies that this is a terminal printer. When you type t, only the values that are specified for the For Terminal Printers
fields are used.
• F (File)
Specifies that output routed to this destination is to be written to a file. When you type f, only the values that are specified
for the For File Output field are used.
Note: This option is not valid in CICS. If used, an execution error occurs.
Line Size
Specifies the default number of characters in a print line that is routed to this destination. This number includes the carriage
control character.
The valid range is 72 through 204 for TERMINAL and SYSTEM printers. For FILE printers the valid range is 72 through 255.
The default is 132.
You can override this value through the LINESIZE parameter of the REPORT statement for reports that are routed to this
destination, or through the LINESIZE parameter of the FILE statement for TERMINAL PRINTER files.
Page Size
This field specifies the default number of print lines for a report page that is routed to this destination. The valid range is 1
through 32767. The default is 58.
You can override this value through the PAGESIZE parameter of the REPORT statement for reports that are routed to this
destination, or with the PAGESIZE parameter of the FILE statement for TERMINAL PRINTER files.
Extended ID
This field specifies the extended reporting printer name as defined in the Printer Set Definition. See Create or Modify a Printer
Set Definition for more information.
For System Printers
Use these fields when the Printer type for this destination is S (System).
• Class
Specifies the spool class for the output. The default is A.
• Node
Specifies the destination location for the output. This is usually a local or remote printer device name or a network node
name. The default is blank.
• Userid
Specifies the userid of the recipient of the printed output. The default is blank.
For Terminal Printers
Use these fields when the Printer type for this destination is T (Terminal).
• Terminal Id
Specifies the name of the destination terminal. Blank routes the output to the originating terminal. The z/OS output can be
viewed using the Report Display Facility. In TSO and CMS as well as in non-mainframe environments, this field must be
blank. The default is blank.
Note:
Do not specify the originating terminal for a PRINTID or MSGID destination. This causes printed output to be returned to
the Report Display Facility.
• Use Form Feed
Specifies whether the product uses a form feed character to start a new page. Type y to use the formfeed character. Type n
to indicate that the formfeed character cannot be used to start a new page. The default is N.
• Page Eject After
Type y to eject a page at the end of each report. Type n for no page eject. The default is N.
• Page Eject Before
Type y to eject a page at the beginning of each report. Type n for no page eject. The default is N.
For File Output
CA Easytrieve® Report Generator 11.6
Use this field when the Printer type for this destination is F (File).
SYSNAME
Associates output with an external data set. Valid values are determined by your operating environment as follows:
• CMS—Up to eight characters specifying a FILEDEF name.
• TSO—Up to eight characters specifying a DD name.
• CICS—SYSNAME is invalid in CICS. If used, an execution error occurs.
• Non-mainframe—Up to eight characters specifying a File Description String. This name will be used as the physical file
name unless an environment variable exists by this name. In this case, the value of the variable names the physical file
name or device.
Examples: The following are valid examples of environment variables:
SYSPRINT=c:\data\myapp.rptSYSPRINT=\mynet\printer1
For example, to route the output to the DD statement or environment variable SYSPRINT, type sysprint in the SYSNAME
field. The default is blank.
5 Getting Started
Tutorial and overview of program sections.
CA Easytrieve® Report Generator is an information retrieval and data management system that is designed to simplify
report programming. Its English-like language and simple declarative statements provide you with the tools to produce
comprehensive reports and screens. If you are an experienced developer, CA Easytrieve provides you with the tools to perform
complex programming tasks.
CA Easytrieve operates in various mainframe, UNIX, Linux for zSeries, and Windows environments. CA Easytrieve runs
interactively for data inquiry, analysis, maintenance, and reporting. The output can be returned to your terminal or routed to a
printer.
The articles in this section explain how to write CA Easytrieve programs. The Programming Lessons section is a tutorial for
persons who are familiar with data processing concepts. Skills for other programming languages are not required. The tutorial
does not describe all product features, and some of the described features may not be available in all implementations of the
product. Because CA Easytrieve is a compiled language that runs in many data processing environments, the examples in this
section are generic and do not address variations between different installations.
Program Examples
Most program examples in this section use the sample input file PERSNL that is included when the product is installed.
You can use PERSNL when you run program examples. Report output in some examples has been edited or shortened for
illustrative purposes. Actual reports that are produced using the PERSNL file can be much longer.
Suggested Reading
To get familiar with the product, we suggest that you read the sections listed under Level One, Level Two, and Level Three.
Each level introduces more advanced concepts.
Level One
The level one articles explain how to:
• Write a complete CA Easytrieve program, using automatic input and output features.
• Generate standard reports and screens.
• Perform calculations and use conditional expressions.
• Be familiar with the system-defined fields that are provided with CA Easytrieve.
To begin learning about CA Easytrieve, we suggest that you read the following articles and sections:
• Programming Lessons — Lessons 1 through 4
• Library Section - Describe and Define Data
• Describe Files and Fields — Defining Data through DEFINE Within an Activity
• Job Activities — Job Statement through Parentheses in Calculations sections
CA Easytrieve® Report Generator 11.6
• Activity Section - Input and Output — Automatic Input and Output through Work File Processing
• Activity Section - Reporting
• Processing of Reports
Level Two
The level two articles explain how to:
• Write slightly more complex CA Easytrieve reports, using programmer-controlled input and output commands.
• Generate label reports.
• Perform data assignments and moves and use loops and branching in program logic.
• Perform basic debugging techniques.
After you read the level 1 articles, we suggest that you read the following articles and sections:
• Describe Files and Fields — Defining Static Working Storage through Implicit Start-location
• Job Activities — Assignment Statement through STOP Statement
• Activity Section - Input and Output — User Controlled Input and Output through PUT Statement
• Label Report and Testing Aid Parameters
Level Three
The level three articles explain how to:
• Use advanced FILE statement parameters, including VIRTUAL and EXIT.
• Perform sorts.
• Use procedures and tables.
• Perform programmer-controlled input and output of randomly accessed files, including VSAM.
• Use REPORT procedures.
After you read the level 2 articles, we suggest that you read the following articles and sections:
• Describe Files and Fields — FILE Statement Revisited through COPY Statement
• Job Activities — User Procedure (PROCS) section
• SORT Activities
• PROGRAM Activities
• Activity Section - Input and Output — POINT Statement through WRITE Format 2
• Format Determination Parameters
• Multiple Reports
• Report Procedures (PROCs)
Program Structure
Each CA Easytrieve program can contain an environment section, a library definition section, and one or more activity
sections. The environment and library definition sections are optional, but at least one activity section is required.
Figure 3: easytrieve_program
CA Easytrieve® Report Generator 11.6
Environment Section
The environment section establishes parameters for the program. This section lets you override standard CA Easytrieve options
and select a mode of operation. The environment section is not required for most of the examples in this section. For more
information about the environment section, see PARM Statement in Language Reference.
Library Definition Section
The library definition section describes the data the program processes, data files and their associated fields, and any working
storage requirements of the program. The library definition section is usually required; it is optional when the program does
not perform any file input or output.
Activity Section
The activity section is the only mandatory section of a CA Easytrieve program. The activity types are PROGRAM, SCREEN,
JOB, and SORT.
• PROGRAM
A simple top-down sequence of instructions. You can use a PROGRAM activity to conditionally execute the other types of
activities, using the EXECUTE statement.
• JOB
Reads information from files, examine and manipulate data, write information to files, and initiate printed reports.
• SORT
Creates sequenced or ordered files.
• SCREEN
Defines a screen-oriented transaction. Data can be displayed to a terminal operator and received back into the program.
Files can be read and updated. A SCREEN activity can EXECUTE a JOB or SORT activity to perform a special process,
such as printing a report.
Note:
Screen processing activities are available only in CA Easytrieve® Online.
You can code one or more procedures (PROCs) at the end of each activity. Procedures are separate modules of program code
that you use to perform specific tasks. See Activity Section - Processing and Logic for more information about procedures.
REPORT subactivities are areas in a JOB activity where reports are described. You can code one or more REPORT
subactivities after the PROCs (if any) at the end of each JOB activity. Code any PROCs used within a REPORT subactivity
(REPORT PROCs) immediately after the REPORT subactivity in which you use them.
The following table shows some CA Easytrieve keywords and other items in the sections where they are usually located. The
table gives the general order of CA Easytrieve statements in a program.
Section Items
Environment Section PARM ...
Library Section FILE ...
DEFINE ...
...
CA Easytrieve® Report Generator 11.6
(statements)
(program procedures)
JOB ...
(statements)
(job procedures)
REPORT ...
(report procedures)
SORT ...
(sort procedures)
SCREEN ...
(screen procedures)
...
Sample Program
A simple CA Easytrieve program example follows. This program produces a standard report that is used in the next section as
a starting point for the tutorial.
You can generate reports faster with CA Easytrieve than with other programming languages or report generators.
The programming lessons show how to start creating CA Easytrieve programs.
Programming Lessons
The CA Easytrieve tutorial includes four lessons:
The CA Easytrieve tutorial includes four lessons:
Report Output
The sample program produces the following report, which is an edited display of data from an employee file named PERSNL.
Note: The PERSNL sample file is provided with CA Easytrieve. Ask your system administrator where it is stored at your site.
The PERSNL file is created via the JOB08DEM job located in the CBAAJCL library.
Library Section Statements
This section shows the relationship between the sample program and the report, one statement at a time.
The FILE Statement
The first line of our program is:
The FILE statement contains the FILE keyword. A FILE statement must be included for every file that your program uses
for input or output. The FILE statement tells the program where to get the data that you want processed, and can also provide
information about how that data is stored. To do this, the statement must include a file name. In our example, the file name is
PERSNL.
The remainder of line 1 is optional. FB(150 1800) provides the program with information about how the PERSNL file is
stored, which makes accessing the file more economical. The PERSNL file contains fixed-length records of 150 characters that
are stored in 1800 character blocks. This is indicated as one parameter, FB(150 1800), where FB stands for Fixed, Blocked.
150 indicates the record length and 1800 indicates the block size. Multiple sub-parameters must be enclosed in parentheses.
The DEFINE Statement
Our program contains four DEFINE statements that describe fields in a PERSNL file record. The word DEFINE does not need
to appear in the statements because it is implied.
EMPNAME 17 8 A
EMP# 9 5 N
DEPT 98 3 N
GROSS 94 4 P 2
DEFINE EMPNAME 17 8 A
DEFINE EMP# 9 5 N
DEFINE DEPT 98 3 N
CA Easytrieve® Report Generator 11.6
DEFINE GROSS 94 4 P 2
Note:
If you need to define a working storage field outside of the library section, you can use DEFINE statements within your
program logic. When a field is defined there, the DEFINE keyword is required. See Library Section - Describe and Define
Data for more information about using DEFINE statements.
The previous DEFINE statements describe the four fields in a PERSNL file record that our program uses. DEFINE statements
do not have to describe all the fields in the record or the spaces between fields. You describe only the fields that the program
uses.
The basic components of a field definition are as follows:
Field Name Starting Position in Length of Field Data Type Number of Decimal
Record Positions
EMPNAME 17 8 A
EMP# 9 5 N
DEPT 98 3 N
GROSS 94 4 P 2
When describing a field, you must identify its name, starting position in the record, length, type, and the number of digits to
the right of the decimal point, if any.
The components must be coded in the order that is shown above (left to right) and the components must be separated by
spaces. In our code example, the components are aligned vertically for readability, although alignment is not required.
• Field Name
Identifies the field as a unique storage location and is what you use later to refer to your data.
• Starting Position
Specifies where the first character of the field begins in the record.
Beginning at the first character of data in a record of the PERSNL file, count nine characters to the right to find the first
character of the EMP# field. The first character of the EMPNAME field is 17 characters to the right of position 1.
Note: Fields do not have to be defined in your program in the same order that they occur in the record. In our example, we
define EMPNAME before EMP# even though it is physically after EMP# in the record.
• Field Length
Specifies the number of bytes (characters) of storage that the field occupies in the record. In the previous example, you can
see that EMP# with a field length of 5 occupies 5 bytes or character positions in the PERSNL record.
• Data Type
Describes the kind of data that is stored in a field. In the example, the fields are defined as three different data types as
follows:
• Decimal Positions
In our example, GROSS is the only field that contains numbers to the right of a decimal point. When this field is printed on
your report, it shows up with two numbers to the right of a decimal point (for example, 999.99).
Decimal Positions
########### |GROSS 94 4 P 2
Review
In this lesson, you learned about the FILE and DEFINE statements in the library section. These two statements define the
library of data that is used as input to processing activities:
• FILE describes the data file that the program is accessing (or creating).
• DEFINE describes the fields in the file that the program uses.
Note:
For more Information about the library section, see Library Section - Describe and Define Data.
Next Lesson
Once you have defined your data, you can continue with processing activities.
The next lesson is Lesson 2 - Activity section, JOB and IF statements.
A JOB statement indicates the beginning of processing. The JOB statement can also automatically provide input (if input is
available) to the processing statements that follow it. In our sample statement, the parameters that follow the word JOB are
optional.
Input to a JOB Activity
Typically, processing requires some kind of file input. Most programming languages require you to control the availability
of input files. Usually, files are opened and then an input statement is executed in a loop, with the end-of-file condition being
checked each time the loop is executed.
Although you can control input, CA Easytrieve can also provide automatic input capability.
Automatic Input
CA Easytrieve® Report Generator 11.6
The INPUT parameter of the JOB statement indicates that the named file (PERSNL in our example) should be made
automatically available to your program. It is like saying, "I want to use this file" and letting CA Easytrieve do the necessary
steps.
Because our sample program has only one input file (PERSNL), the INPUT parameter on the JOB statement is optional.
Without it, the program looks for input and uses the only file in our library section, PERSNL. If you do not specify INPUT,
the program looks for input and uses the first file described in the library section. However, if the JOB activity is preceded by a
SORT activity, the program uses the output from that SORT.
Note:
For more information about SORT, see Activity Section - Input and Output.
Naming a JOB Activity
The next parameter after INPUT in our sample program is NAME. This tells the program that a job name follows.
A JOB activity is typically named for documentation purposes only. It helps to give JOB activities a descriptive name,
especially when you have more than one activity in your program. In our example, we named the JOB activity FIRST-
PROGRAM. We did this by typing the parameter NAME followed by a name (FIRST-PROGRAM) of our choice.
Program Logic
In this section, we add logic to our program.
Conditional Processing
So far, our sample program simply extracts data from a file and creates a report. A more complex program contains conditions.
When a condition is encountered, a test is performed to determine the next processing step.
If This, Then That
Suppose the report that you are working on has to include net pay and deductions. This is the program that we have been
working on so far:
The program accesses the field named GROSS, which contains employee gross pay. You know that net pay is the gross
pay minus any deductions, and that employees who earn $500 or more get a 28 percent deduction; the rest do not get any
deduction.
The condition we have just described can be stated with a simple conditional expression:
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-PAY = GROSS - DEDUCTIONS
CA Easytrieve® Report Generator 11.6
ELSE
NET-PAY = GROSS
DEDUCTIONS = 0
END-IF
In this expression, we say, "If the gross pay is greater than or equal to 500, deduct 28 percent to give the net pay. Otherwise,
if the gross is less than 500, there are no deductions and net pay is the same as gross." CA Easytrieve requires an END-IF to
complete the expression.
Adding Logic to the JOB Activity
Now that we have a logical statement to describe our condition, we simply type it into our program, placing it in the JOB
activity after the JOB statement:
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-PAY = GROSS - DEDUCTIONS New
ELSE Logic
NET-PAY = GROSS
DEDUCTIONS = 0
END-IF
PRINT PAY-RPT
REPORT PAY-RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS
There are several details we still need to take care of. We need a place to store the results for our two new variables,
DEDUCTIONS and NET-PAY. They can be stored in a place known as working storage.
CA Easytrieve Working Storage
Unlike many other languages, CA Easytrieve makes defining working storage fields easy. You can place them in the library
section of your program or in the activity section before the logic that requires them.
To define a working storage field, you use the same type of attributes used to describe other fields. However, you use the letter
W to replace the numeric value that normally describes the start location.
DEDUCTIONS W 4 P 2
NET-PAY W 4 P 2
CA Easytrieve® Report Generator 11.6
The previous fields can be described as: working storage fields, 4 characters long, in packed decimal format with 2 decimal
places. We place these fields in the library section of our program. They are more easily seen in that section than if they were
placed in the activity section.
NET-PAY W 4 P 2 Fields
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-
PAY = GROSS - DEDUCTIONS
ELSE
NET-
PAY = GROSS
DEDUCTIONS = 0
END-IF
PRINT PAY-
RPT
REPORT PAY-
RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS
So far, we have used some elementary logic, calculated some values, and created a place to store those values.
Review
In this lesson, you learned how to add conditional logic and calculations to your program to compute new information. You
also learned how to store the new information. You know that:
• JOB initiates program processing activities and can also provide automatic file input.
• IF is a conditional expression that is used to make decisions, based on certain criteria.
• W designates a working storage field on the DEFINE statement.
Note:
For more Information about the JOB activity section, see Activity Section - Processing and Logic.
Next Lesson
In the next lesson, you learn about the LINE statement and the PRINT statement, which initiates printing of your report. The
MASK and HEADING parameters that let you edit and label your data are also explained.
The next lesson is Lesson 3 - Activity section, report output with PRINT Statement.
CA Easytrieve® Report Generator 11.6
END-IF
PRINT PAY-RPT
REPORT PAY-RPT LINESIZE 80
Once the conditional statements have been run against a record of the PERSNL file, the PRINT statement tells CA Easytrieve
to execute the report definition statements. In the previous PRINT statement example, these statements are identified by a
user-supplied name, PAY-RPT. This name ties the PRINT statement to a specific report of the same name as indicated on the
REPORT statement. If the report name is not included, the first report in the JOB activity section is executed, whether or not it
has a name.
After the report statements have been executed, control is returned to the beginning of the JOB activity section where the next
record is processed or end-of-file processing is performed. All output routines, line counts, and page advances are handled
automatically when the PRINT statement is executed.
LINE Statement
The last line in the program is currently:
This line causes the detail lines of the report to be printed. The LINE statement specifies the fields to print and the order in
which to print them.
To add DEDUCTIONS and NET-PAY to the report output, we add the field names in the order that they should appear in the
report:
The program with all the changes that we have made is as follows:
GROSS 94 4 P 2
DEDUCTIONS W 4 P 2
NET-PAY W 4 P 2
JOB INPUT PERSNL NAME FIRST-
PROGRAM
IF GROSS GE 500
DEDUCTIONS = .28 *
GROSS NET-PAY = GROSS -
DEDUCTIONS ELSE
NET-PAY = GROSS
DEDUCTIONS =
0 END-IF
PRINT PAY-RPT
REPORT PAY-RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
The sample output from this program follows. As you can see, the NET-PAY and DEDUCTIONS columns have been added.
For example, we have added edit masks to the three currency fields in our example program so that they print with dollar signs:
MASK is a parameter of the DEFINE statement that indicates that an edit mask follows. Edit masks are enclosed in single
quotes. In this code segment, the edit mask named A consists of the characters '$$,$$9.99'. Naming the mask lets you use the
same mask for other fields without defining it each time.
Adding the edit masks affects our report as follows:
Note: Leading zeros are suppressed and each value has a dollar sign. The BWZ parameter causes any all-zero values in the
DEDUCTIONS column to appear as blanks.
The following explanations and rules apply to the edit masks in our example:
• Each digit in a field must be designated in the edit mask. Because a four-byte packed decimal field is capable of containing
seven digits, we need to designate seven digits in the mask. This is done with $$$$999.
• Dollar signs ($) in the edit mask indicate that a dollar sign is to be printed prior to the first non-zero digit of the printed
field. This is called a floating dollar sign. It means that, if one or more high-order zeros are stored in the positions where a
dollar sign appears in the mask, they are suppressed and replaced with a single dollar sign. For example:
• As the number of leading zeros increases, the dollar sign automatically floats to the right.
• The digit 9 indicates that any value occurring in that position is printed as a digit. In the above example, all values
(including zeros) in the ones column or to the right of the decimal are printed as digits.
CA Easytrieve® Report Generator 11.6
• Commas and decimal points are printed just as indicated. In the above example, you can see that commas are suppressed
along with high-order zeros for numbers less than 1000.
• When the same mask is to be used on more than one field, you can avoid coding the mask more than once by naming it,
and then specifying only the name on subsequent fields. Names can be any letter from A to Y.
In our example, we named the mask used on the GROSS field A. Then we specified the letter A on the NET-PAY and
DEDUCTIONS fields instead of coding the mask again. Remember, multiple parameters and subparameters are enclosed in
parentheses.
• To suppress all-zero values from printing (if you find that desirable) simply code BWZ (blank when zero) after the mask or
mask name. Because some employees in our report can have zero deductions, we included BWZ.
Field Headings
So far in our example program, field (or column) headings have come directly from the field names themselves. CA Easytrieve
uses field names specified on the DEFINE statement as column headings by default, unless column headings are described.
One way to describe alternative column headings for better identification is with the HEADING parameter of the field
definition. For example, you can replace the default heading EMP# with the more descriptive heading EMPLOYEE NUMBER
as follows:
EMPNAME 17 8 A
EMP# 9 5 N HEADING ('EMPLOYEE' 'NUMBER')
DEPT 98 3 N
By placing each word in single quotes, you indicate that the heading should be stacked, one word over the other.
The following report segment shows the effect of adding the HEADING parameter:
Review
In this lesson, you learned how the PRINT statement works and also how to use the MASK and HEADING parameters to
make your reports more readable. You have learned that:
• PRINT activates a report declaration resulting in a printed report.
• LINE determines which fields are printed on your report and in what order they are printed.
• MASK lets you change the look of fields on your report.
• HEADING enables you to customize column headings on your report.
In this lesson, we have made some minor changes to our ongoing program example. Here is how our program currently looks:
GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-PAY = GROSS - DEDUCTIONS
ELSE
NET-PAY = GROSS
DEDUCTIONS = 0
END-IF
PRINT PAY-RPT
REPORT PAY-RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
Note:
For more Information, see Activity Section - Input and Output about the PRINT statement.
Next Lesson
In the next lesson, you will learn about report declarations.
The next lesson is Lesson 4 - Activity section, REPORT statement and report definition statements
REPORT PAY-
RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
In this lesson, we introduce the following statements and add them to our program:
• SEQUENCE
• CONTROL
• SUM
• HEADING
The REPORT Statement
The REPORT Statement must be the first statement in your report declaration. This statement precedes the report description,
and identifies the type of report and its various physical characteristics.
In our sample program, we identify the report by name (PAY-RPT) and also specify a LINESIZE of 80, but both of these
properties are optional. Because our program has only one report, we could have left the report name off both the PRINT and
the REPORT statements. A line size of 80 restricts report output to 80 characters to each printed line. If you enter programs as
we proceed and review the output at your terminal, then 80 characters per line is appropriate. Most terminals display only 80
characters on a screen.
Report Definition Statements
Report definition statements define the contents of a report. These statements are presented in the order they must occur in
your report declaration. We add new statements to our example program as we go, showing the effects on report output.
CA Easytrieve® Report Generator 11.6
There are six report definition statements in CA Easytrieve. When used, they must occur after the REPORT statement in the
following order:
• SEQUENCE
• CONTROL
• SUM
• TITLE
• HEADING
• LINE
A mnemonic for these statements and their order is:
Brief explanations of these statements follow. The order in which the statements are written is logical.
The SEQUENCE Statement
The SEQUENCE statement causes your report to be sorted on a specified key in ascending or descending order. In our
example, the report output should be sequenced on department in ascending order. We accomplish this by placing the
SEQUENCE statement and the field name DEPT after the REPORT statement:
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
Ascending order is the default for the SEQUENCE statement. For descending order, enter D after the field name, separated by
a space.
When we run our program, this report is produced:
01/31/18
PERSONNEL REPORT EXAMPLE-1 PAGE 1
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-
PAY DEDUCTIONS
Note: The records are now in order by department number. When you use the SEQUENCE statement, you do not need to
define any extra files or additional input/output commands in your program.
The CONTROL Statement
The CONTROL statement defines a control break on a specified field that is called the control field. The CONTROL statement
causes all quantitative fields (that is, fields with decimal positions) to be totaled at the time of the control break and for a grand
totals to appear at the end of the report.
Because we have sequenced our report by the DEPT field, we can also request a control break on the same field. This gives us
totals of GROSS, NET-PAY, and DEDUCTIONS for each department. To accomplish this, we add the CONTROL statement
and the field name DEPT after the SEQUENCE statement:
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
CONTROL DEPT
With that additional statement, gross and net pay totals are shown for each department with grand totals at the end of the
report:
01/31/18
PERSONNEL REPORT EXAMPLE-1 PAGE 1
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-
PAY DEDUCTIONS
$3,496.16 $3,215.04
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
CONTROL DEPT
SUM GROSS
01/31/18
PERSONNEL REPORT EXAMPLE-1 PAGE 1
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-
PAY DEDUCTIONS
914 $2,403.36
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
CONTROL DEPT
SUM GROSS
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
You can change it to any appropriate title. Include the word TITLE followed by a title number, followed by your title in single
quotes. If you have only one title, you can omit the title number; it defaults to 01. When you want more than one title, you
must number all TITLE statements in ascending order.
The result of the TITLE statement follows.
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-
PAY DEDUCTIONS
The system date and the page number are automatically printed on the same line. The Activity Section -- Reporting section
explains how to override this feature.
CA Easytrieve® Report Generator 11.6
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
CONTROL DEPT
SUM GROSS
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
HEADING EMPNAME ('EMPLOYEE' 'NAME')
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
To be consistent with our other heading, EMPLOYEE NUMBER, we have described our new heading so that it stacks
EMPLOYEE on top of NAME. To do this, type single quotes around each word in the heading. The parentheses are required
because the two words, each in single quotes, are treated the same as any other multiple parameters. Here's how it prints:
01/31/18
PERSONNEL REPORT EXAMPLE-1 PAGE 1
EMPLOYEE EMPLOYEE
DEPT NAME NUMBER GROSS NET-
PAY DEDUCTIONS
The LINE statement defines the contents of a printed line (detail line) in your report.
Note:
You must include the LINE statement in your report declaration.
In our example program, it defines which fields we want printed on a line and the order in which we want them printed:
REPORT PAY-
RPT LINESIZE 80
SEQUENCE DEPT
CONTROL DEPT
SUM GROSS
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
HEADING EMPNAME ('EMPLOYEE' 'NAME')
LINE DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
Review
You have learned how the REPORT, SEQUENCE, CONTROL, SUM, TITLE, HEADING, and LINE statements are used in
the creation of a CA Easytrieve report.
In summary:
• REPORT designates the beginning of a report declaration and can specify the type of report and report characteristics.
• SEQUENCE puts your report in alphabetical or numerical order, based on the contents of a field or fields.
• CONTROL causes a control break, based on the contents of a field. It causes the printing of control totals and grand totals
for all quantitative fields.
• SUM overrides control totals and causes totals only for specified fields.
• TITLE causes the printing of major report titles.
• HEADING causes the printing of customized column headings.
• LINE specifies the fields to include on detail lines and the field order.
Note:
For more information about report declarations, see Activity Section - Reporting.
This concludes the tutorial. You can now create your own standard reports using what you have learned.
The statement area typically contains a single statement. However, you can enter multiple statements on a single line. A period
followed by a space indicates the end of a statement. The next CA Easytrieve statement can start at the next available position
of the statement area (after the space). For example, the following two CA Easytrieve statements are on one line:
Comments
When the first non-blank character of a statement is an asterisk (*), the remainder of that line is considered to be a comment
that is ignored by the CA Easytrieve compiler. You can use comment statements any place within a program, except within a
continued statement. A statement containing all blanks is also treated as a comment.
To place a comment on the same line as a statement, code a period (.), one or more spaces, an asterisk (*), then the comment.
Continuations
The last non-blank character of a statement terminates the statement unless that character is a minus (-) or a plus sign (+).
• The - indicates that the statement continues at the start of the next statement area.
• The + indicates that the statement continues with the first non-blank character in the next statement area.
The difference between - and + is important only when continuing a line in the middle of a word. Continuation of a line
between words is the same for both. The following continued statements produce identical results:
FIELD-NAME W 6 A +
VALUE 'ABC -
DEF'
FIELD-NAME W 6 A +
VALUE 'ABC +
DEF'
Delimiter Description
space The basic delimiter within each statement.
' single quote Encloses literals that are alphanumeric.
. period Terminates a statement.
, comma Used optionally for readability.
() parentheses Enclose 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 the left parenthesis and colon {( and :}. The word RECORD-COUNT is
shown below with various delimiters:
CA Easytrieve® Report Generator 11.6
RECORD-COUNT
FILEONE:RECORD-COUNT
(RECORD-COUNT)
'RECORD-COUNT'
RECORD-COUNT,
RECORD-COUNT.
Keywords
Keywords are words having specific meaning to CA Easytrieve. Some keywords are reserved words. You can use non-
reserved keywords in the appropriate context as field names, whereas reserved words cannot be used as field names. For a list
of all reserved keywords, see Symbols and Reserved Words.
Multiple Parameters
You must enclose multiple parameters within parentheses to indicate group relationships. If parentheses are not used, only one
parameter is assumed. The following example is a CA Easytrieve statement with multiple parameters:
Field Names
Field names are composed of a combination of not more than 128 characters chosen from the following:
• Alphabetic characters A to Z (lower and upper case)
• Decimal digits 0 to 9
• All special characters, except delimiters
The first character of a field name must be an alphabetic character, a decimal digit, or a national character (#, @, $). In
addition, a field name must contain at least one alphabetic or special character to distinguish the field name from a number. 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.
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
Labels
Labels identify specific PROGRAMs, JOBs, PROCedures, REPORTs, SCREENs, and statements. Labels can be 128
characters long, can contain any character other than a delimiter, and can begin with an alphabetic character (A to Z), a
numeric character (0 to 9), or a national character (#, @, $); they cannot consist of all numeric characters.
Identifiers
Identifiers are words that name things (field name, statement labels, etc.) in CA Easytrieve. Identifiers cannot contain these
delimiters:
CA Easytrieve® Report Generator 11.6
, comma
' single quote
( left parenthesis
) right parenthesis
: colon
Arithmetic Operators
CA Easytrieve® Report Generator arithmetic expressions use the following arithmetic operators:
• multiplication (*)
• division (/)
• addition (+)
• subtraction (-)
See Activity Section - Processing and Logic for more information.
The arithmetic operator must lie between two spaces.
Alphanumeric Literals
Alphanumeric literals are words meant to be taken literally. They are enclosed within single quotes, and can be up to 254
characters long. An alphanumeric literal can contain alphabetic characters A to Z and numeric characters 0 to 9. Whenever an
alphanumeric literal contains an embedded single quote, you must code two single quotes. For example, the literal O'KELLY
is coded as:
'O''KELLY'
Numeric Literals
Numeric literals can contain 18 numeric digits (characters 0 to 9). You can indicate the algebraic sign of a numeric literal
by attaching a plus (+) or a minus (-) prefix to the numeral. Also, you can use a single decimal point to indicate a maximum
precision up to 18 decimal positions. The following examples are valid numeric literals:
123
+123
-123.4321
Hexadecimal Literals
Hexadecimal literals are words used to code values that contain characters not available on standard data entry keyboards.
Prefix a hexadecimal literal with the letter X and a single quote (X'), and terminate it with a single quote. CA Easytrieve
compresses each pair of digits that you code within the single quotes into one character. CA Easytrieve permits only the digits
0 to 9 and the letters A to F. The following hexadecimal literal defines two bytes of binary zeros:
X'0000'
All of the files, their associated fields, and working storage fields in your CA Easytrieve Report Generator program must be
described before they are referenced.
This article includes the following information:
Defining Data
You typically define data fields in the section of your program called the library. The library defines the data in terms of fields,
records, and files. A typical file layout follows:
______________________________________________ )
. )
. )
. )
• FILE
Specifies that a file name and description are to follow. File-name and file attributes describe the file you are using and are
typically supplied by your data processing department.
• file-name
A 1- to 128-character name used to define your file to CA Easytrieve Report Generator. All statements that operate on the
file refer to this name. File-name is also typically used on your JCL, CLIST, or EXEC statements to reference the file.
Every FILE statement must have a file-name immediately following the FILE keyword and it must be unique within your
program.
• file attributes
The FILE statement has many parameters that describe file attributes. File attributes are as varied as the methods and
environments available for storing data. Most file attributes are beyond the scope of this article. In general, they include
parameters for describing file type, storage device type, and record format. They are all optional and depend on the
particular environment in which you are operating. For complete FILE statement syntax, see FILE Statement.
DEFINE Statement
The DEFINE statement specifies data fields within a record on a file or within working storage:
• Four parameters are always required: field-name, start-location, field-length, and data-type.
• Additional parameters include the number of decimal positions for quantitative fields, HEADING, and MASK.
This statement has the following format:
( ( ))
(MASK {[mask-identifier] [BWZ] ['mask-literal']})
( ( ))
• field-name
You create your own field-names or use already existing field names (provided to you in a record layout):
• Field-names must be unique within a file.
• The name cannot be all numeric characters.
• The name can be 1 to 128 alphanumeric characters in length.
• The name must begin with A to Z, 0 to 9, or a national character (#, @, $).
• Special characters, such as dollar sign and hyphen, can be used, but not delimiters.
• start-location
CA Easytrieve® Report Generator 11.6
The start location is the beginning location of a field in a record, relative to the first position (position 1) of the record. Start
location can be explicitly defined based on its distance from position 1 of the record:
Here is an example of where the NAME field would appear in the previous record:
NAME field
###########################
# # # # # # # # # # # # # # # # # X# X# X# X# X# X# X# X# .
###########################################################################
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
• field-length
You specify the length of a field in bytes (characters and/or spaces). The length of the NAME field in the previous example
is eight characters.
NAME 17 8
• data-type
You describe the type of data a field contains by coding the letter abbreviation for that type after the field-length. The data-
types are:
The data type of the NAME field (which probably contains only alphabetic characters) is A for alphanumeric:
NAME 17 8 A
• decimal-positions
This is an option that specifies the desired number of decimal positions for a field name. By specifying decimal positions in
your field description, you:
• Identify a field to CA Easytrieve Report Generator as being quantitative (a field that contains a quantity, as opposed to a
numeric identifier or code).
• Identify the field to be automatically totaled when specified in a CONTROL report.
• Allow for proper placement of commas and decimals with leading (high-order) zeros suppressed when the field is
printed.
CA Easytrieve® Report Generator 11.6
AMOUNT 40 5 N 2
CLIENT NAME
To stack a column heading, place each word in single quotes. You now must enclose the words in parentheses. For
example:
CLIENT
NAME
• MASK
Use the MASK parameter to create a customized edit mask. An edit mask is an optional pattern of characters specifying
how numeric data is to be printed. (Alphanumeric fields cannot be edited.) To create an edit mask, use combinations of the
following characters:
Character Meaning
9 Formats digits
Z Suppresses Leading zeros
CA Easytrieve® Report Generator 11.6
Each digit in the field must be designated by a character in the mask. For example:
For clarity, you can include commas in the edit mask. Commas are printed in whatever location you indicate in the mask,
but are suppressed if the field value does not exceed the number of places to the right of the comma.
Defining Edit Masks
Some standard edit masks you might use in your programs are shown here:
[MASK {[mask-
identifier] [BWZ] ['mask-literal']}]
• MASK is the CA Easytrieve Report Generator keyword that indicates an edit mask is to follow.
• Use the mask-identifier to name the edit mask that follows it. If you name a mask, you can reuse it on other field definitions
by specifying the name only. This means that once you have defined a mask, you don not have to define it again to use it
again. A name can be any single letter from A to Y.
• BWZ (blank when zero) specifies that a field should not be printed if the entire field contains zeros. Simply code the
letters BWZ whenever you want to suppress an all-zero field. BWZ is not carried over to other fields when using a mask-
identifier.
• The mask-literal is the actual format of the mask. It must be enclosed in single quotes and include one edit character for
each digit in the field being described.
Examples of Edit Masks
Given a numeric field with the contents 012345678, the following masks produce the results shown:
Mask Result
'999-99-9999' 012-34-5678
'Z99,999,999' 12,345,678
'ZZZ,ZZZ,999' 12,345,678
'$$$,$$$,999' $12,345,678
'***,***,999' *12,345,678
CA Easytrieve® Report Generator 11.6
Mask Result
'$$$,$$$,999 CREDIT' $12,345,678 CREDIT
'$$$,$$$,999-' $12,345,678-
'Z99,999,999-' 12,345,678-
The indicators CREDIT and minus (-) print only if the field contains a negative value.
Default Edit Masks
Quantitative fields (fields defined with positions to the right of a decimal point) have system default edit masks that account
for the automatic printing of commas and decimal points in printed totals.
Numeric fields with no decimal positions defined are printed without commas or decimal points and are not automatically
totaled on control reports.
Assuming a field named PAY has a value of 1000, the following table gives the corresponding default edit masks and results
for some possible field definitions:
WORK-DEDUCT W 4 N 2
| DEFINE EMP# 9 5 N
Library { DEFINE EMPNAME 17 20 A
... | DEFINE EMP-COUNT W 4 N
[ *
In contrast to the previous example, this example shows fields defined in the activity section of a program. (The DEFINE
keyword is required.)
When fields are defined within an activity, each field definition must start with the DEFINE keyword and physically be
defined before the field is referenced.
Defining Static Working Storage
Static working storage fields are fields used for storing accumulated values that are printed at the end of a report or are used to
compute some other values at the end of a report or at control breaks, such as averages.
To define static working storage fields in your program, type S in the position on the DEFINE statement where you typically
type the field starting position or a W. For example:
AVG-GROSS S 8 N 2
Static working storage fields are necessary because of the way CA Easytrieve Report Generator processes reports. In the
Activity Section - Input and Output article, we explain the PRINT statement and the process that occurs when reports are either
sequenced (by the SEQUENCE statement) or multiple within one JOB activity (more than one REPORT statement is used).
In both cases, data is sent to an intermediary file called a work file or spool file. Work files do not get formatted into reports
(through report definition statements) until they have first been sequenced or until the system printer becomes available.
Due to the use of intermediary work files, two different types of working storage fields are needed. The following discussion
provides the differences between them and helps you to understand the need for these two field types.
Static Versus Non-Static
CA Easytrieve® Report Generator 11.6
Unlike static working storage fields (type S), non-static working storage fields (type W) are sent to work files for every record
in the input file. This is done whenever the non-static working storage field is referenced in a REPORT subactivity. If such a
field is used to accumulate values during the processing of an entire file, its value, at the time each record is sent to the work
file, appears on the record in the work file. If the file is then sequenced, the non-static working storage fields are sequenced
with the rest of the fields on the record. This means that accumulated results do not appear, either internally or when printed,
in the order they were accumulated.
Therefore, any calculations based on the value of a non-static working storage field performed at the time of report formatting
are likely to produce results that are in error. This is true only for non-static working storage fields (type W) used to
accumulate values for sequenced reports. For example:
In the previous example, the W-type field is incremented by 1 each time a record is processed. Once the work file has been
sequenced and the report is formatted, the value contained in the W-type field when last processed (output to the report) is now
different than it was prior to sequencing. If you attempted to compute averages, based on this value, your results would be in
error.
Static working storage fields are not sent to work files. This means they are not affected by sequencing. The last value
accumulated into an S-type field remains unchanged regardless of what is done to the work file and is therefore suitable for any
end-of-report calculations such as averaging. For example:
This example illustrates that static working storage fields are not copied to work files and therefore are not sequenced, as
are non-static (type W) fields. The static field shown in the previous example contains the value seven (7) at the time any
averaging is performed at end-of-report.
CA Easytrieve® Report Generator 11.6
CURR-
MON W 10 A VALUE 'JANUARY'
Reset Option
The RESET option is used only for W working storage fields. When coded on the field definition for a W field, RESET returns
the field to its initial value whenever JOB or SORT executes. You cannot use RESET for redefine fields (fields having overlay
redefinition).
Redefining a Field
Sometimes it is necessary to break a field into several parts to get the exact information you want. A birth date, for example,
might have been entered originally as one field in a record. Now, you want to access this information by the month, day, or
year.
Explicit Redefinition
You can explicitly redefine the field as follows:
DATE-OF-BIRTH 103 6 N
MONTH 103 2 N
DAY 105 2 N
YEAR 107 2 N
Explicit redefinition requires the exact starting location of each field. Here is a physical representation of the previously-
defined field:
DATE-OF-BIRTH
| | | | | | |0|2|1|0|5|5| | | | |
| | |
position 103 105 107
in
record:
In this example, the MONTH (02) starts in position 103 and occupies positions 103 and 104. The DAY starts in 105 and
occupies positions 105 and 106. Finally, the YEAR starts in 107 and occupies positions 107 and 108.
Overlay Redefinition
CA Easytrieve® Report Generator 11.6
You can perform overlay redefinition of a field by including the original field-name as the starting location for all subsequent
fields in the redefinition. This is especially useful when redefining a working storage field that does not have a numeric starting
position. For example:
DATE-OF-BIRTH W 6 N
MONTH DATE-OF-BIRTH 2 N
DAY DATE-OF-BIRTH +2 2 N
YEAR DATE-OF-BIRTH +4 2 N
To specify the starting position of the redefining field, use the original field name plus any offset (+2 or +4 in the previous
example).
When using overlay redefinition, verify that the redefining fields fit within the storage boundaries of the redefined field.
Implicit Start-location
You can define the start-location of a field with an implicitly-defined position in the record. Implicitly defining a start-
location eliminates the need to identify the actual start-location of a field. Implicit start-locations are most useful when you
are creating output files, because output files generally have contiguous field locations.
Use an asterisk in place of the numeric start-location when implicitly defining a field. The asterisk implies that the field begins
in the next available starting position (highest location defined so far, plus one). The following example defines contiguous
fields in a record. Because EMP# begins in position 1, NAME begins in position 6, FILLER1 in position 22, and ADDRESS in
position 32. All locations between 1 and 70 are accounted for.
EMP# 1 5 N
NAME * 16 A
FILLER1 * 10 N
ADDRESS * 39 A
| | [F]
FILE file-name [VIRTUAL [RETAIN]] [V] logical-record-length
| | [U]
VFM provides an easy method for establishing temporary work files without special job control or file allocation statements.
By using VFM, you can establish your own extract or temporary files, using only CA Easytrieve Report Generator keywords.
The FILE keyword and a user-defined file name are required.
• VIRTUAL
CA Easytrieve® Report Generator 11.6
Designates that the named file is to be a temporary VFM file. VFM files consist of a dynamically-allocated space in
memory (64K default). If the allocated space is exhausted, VFM automatically writes the excess data to a single spill area
on disk.
• RETAIN
Specifies that the VFM file is to remain in memory until the end of the associated CA Easytrieve Report Generator
execution. If RETAIN is not specified, the VFM file is deleted when it has been read back into your program.
• logical-record-length
You must specify a record length for all output files. When specifying record length, you must also specify record type (F,
V, or U). Block size is not required, because VFM files are automatically blocked.
EXIT Parameter
The EXIT parameter on the FILE statement invokes a user routine for every input or output operation performed on the named
file. You can use EXIT to access your own user-written routine to convert non-standard data files that CA Easytrieve Report
Generator does not process directly.
Note: EXIT is not valid for VFM.
[ | ] |
|USING ({ parm-field-name }... ) | [MODIFY] )] +
| | parm-literal | |
[ [ ] ]
[WORKAREA area-length]
The EXIT parameter followed by program-name indicates the routine or subprogram to be executed.
• USING
Specifies any parameters to be passed to the exit routine. It is limited to working storage fields, system-defined fields, and
card literals.
• MODIFY
Specifies that CA Easytrieve Report Generator provides input or output services but that the exit can inspect and modify
each record after input and before output.
• WORKAREA
Specifies that CA Easytrieve Report Generator sets up a special area of storage to be used as the data buffer for the file.
Area-length is used to specify the length of the data buffer.
COPY Statement
The COPY statement duplicates the field definitions of a named file. You can copy the field definitions of a given file an
unlimited number of times.
This statement has the following format:
COPY file-name
If you copy the same field name into more than one file and the files are used in the same activity, you must qualify the field
when referencing it in your programs; otherwise, CA Easytrieve Report Generator cannot uniquely identify the data reference.
You can qualify fields in CA Easytrieve® Report Generator by preceding them with their file name and a colon. For example,
OUTFILE:NAME.
CA Easytrieve® Report Generator 11.6
JOB Activities
2
JOB Statement
The JOB statement defines and initiates processing activity. It also identifies the name of the automatic input file.
This statement has the following format:
The file-name identifies the automatic input files. It can identify any file defined in the library section of the program
eligible for sequential input processing.
• NAME job-name
The optional NAME parameter names the JOB activity and is normally used only for documentation purposes. The job-
name:
• Can be up to 128 characters long
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters.
The following example shows the location of the JOB statement and the subactivities in a CA Easytrieve® Report Generator
program:
** Library **
*
You can use the logic subactivity to examine and manipulate data, initiate printed reports, and write data to a file.
You can use the report subactivity to format the desired report.
Conditional Expressions
Data selection and manipulation takes place in the logic section of a CA Easytrieve® Report Generator program. Logic is
coded immediately after the JOB statement.
IF Statement
Processing within a JOB activity can be dependent on the conditional (IF) statements present in the program:
• When an IF statement is present, records read from the input file are processed according to the conditions it states.
• Every IF statement must end with END-IF.
[EQ = ]
|NE -
=| #field two #
IF field one {GT > } #literal #
|GE >=| #arithmetic-
expression #
CA Easytrieve® Report Generator 11.6
|
LT < |
{LE <=]
[ELSE-IF alternate-
expression]
[ELSE]
END-IF
IF Statement Examples
• Comparing the value of a field to a literal:
IF DEPT = 910
IF EMPNAME = 'SMITH'
IF AMT GE 500
IF DIV = HOLD-DIV
Arithmetic Operators
These arithmetic operators are valid in conditional statements:
Operators Meaning
EQ = Equal to
NE Ø= Not equal to
GT > Greater than
CA Easytrieve® Report Generator 11.6
• IF/ELSE
ELSE directs CA Easytrieve® Report Generator to perform alternative processing when the condition established by the IF
statement is not met:
• For true IFs, all commands up to the ELSE (or END-IF if no ELSE is present) are executed.
• For false IFs, commands between ELSE and END-IF are executed.
• Following END-IF, processing continues regardless of the result of the IF.
IF/ELSE Example
In this example, records with a DIVISION field containing values in the range A to L are processed according to the statement
between the IF and ELSE statements (DEDUCTIONS = GROSS * .15). For records with DIVISION not in the range A to L,
the statement following ELSE (DEDUCTIONS = GROSS * .18) is executed. END-IF signifies the end of the condition.
In words, we could restate the condition in the above example something like this, "For divisions A to L, deductions are equal
to 15 percent of the gross; for all other divisions, deductions are equal to 18 percent of the gross."
• ELSE-IF
ELSE-IF is optional and identifies a conditional expression to be tested when the previous conditional expression is false.
ELSE-IFs permit multiple conditions to be nested without requiring an END-IF for each condition. You can code as many
ELSE-IFs as necessary.
ELSE-IF Example
Special IF Statements
Use special IF statements to check the integrity of the data in your files.
This statement has the following format:
( ALPHABETIC )
( NULL )
( NUMERIC )
CA Easytrieve® Report Generator 11.6
Keyword Condition
ALPHABETIC Value containing characters A to Z and blank spaces
NULL No current value
NUMERIC Value containing digits 0 to 9
SPACE Value containing all blank spaces
SPACES
ZERO Value containing all zeros (0)
ZEROS
ZEROES
Special IF Examples
This statement is true when DIVISION is equal to a letter in the range A to L and when AMOUNT is also greater than or equal
to 15. Both conditions must be true for the entire statement to be true. The following statement uses the OR connector:
This statement is true when DIVISION is equal to a letter in the range A to L or when AMOUNT is greater than or equal to 15
or when both conditions are true. Either one or both of the conditions can be true to make the entire statement true.
When used together in the same statement, conditions connected by AND are examined before conditions connected by OR.
For example:
CA Easytrieve® Report Generator 11.6
In this statement, CA Easytrieve® Report Generator examines the portion "DIVISION = 'A' AND AMOUNT GE 15" first. If
both sides of the AND in that portion are found to be true then the entire statement is true. If not, then the portion "OR STATE
= 'GA'" is examined and, if it is found to be true, the entire statement is still true. If conditions on both sides of the OR are
false, then the entire statement is false.
The following table helps you visualize the concept of logical connectors. The assumptions for the table are:
DIVISION = A
AMOUNT = 15
STATE = GA
Note: Inserting parentheses around a set of conditions can alter the outcome of the statement. Remember these rules:
• All conditional expressions are considered one statement.
• AND statements are evaluated before OR statements.
• Parentheses may alter the normal order of evaluation.
Calculations
There are four arithmetic operations in CA Easytrieve® Report Generator:
• Multiplication (*)
• Division (/)
• Addition (+)
• Subtraction (-)
Multiplication and division are performed before addition and subtraction in order from left to right. There must be a space
before and after the arithmetic operators.
[ ] [ * ]
| = | | / |
Parentheses in Calculations
CA Easytrieve® Report Generator 11.6
You can use parentheses to override the normal order of operation. Operations contained in parentheses are performed first.
For example:
You can nest parentheses to further alter the order of operation. Operation proceeds from the innermost set of parentheses to
the outermost:
In this example, AMT and DEDUCT are added before being subtracted from GROSS. After subtraction, the difference is
multiplied by 1.3 and the product of this is assigned to the RESULT field.
Assignment Statement
The assignment statement establishes a value in a field by copying the value from another field or literal. The value on the
right of the equal sign is copied to the field on the left of the equal sign. The assignment statement also accomplishes data
conversion, such as packing or unpacking numeric data.
[= ] ìsend-field-name ]
receive-field-name { } ísend-literal }
[EQ] îarithmetic expression]
HOLD-DIV = DIV
DEPT-NAME = 'ACCOUNTING DEPT'
RATE = 1.1
MOVE Statement
CA Easytrieve® Report Generator 11.6
Use the MOVE statement to transfer data from one location to another. MOVE is useful for moving data without conversion
and for moving character strings with variable lengths:
• You can move a field or a literal to a field, or move a file to a file.
• A sending field longer than a receiving field is truncated on the right.
• A receiving field longer than the sending field is padded on the right with spaces or an alternative fill character.
• Spaces or zeros can be moved to one or many fields.
The MOVE statement has two formats.
MOVE Format 1
[send-file-name ] [ ] [receive-file-name ]
MOVE {send-field-name} |send-length| TO { } +
[send-literal ] [ ] [receive-field-name]
When you specify Format 1, data moves from one field to another, filling with spaces or a specified fill character on the
right. The FILL parameter enables you to place specified characters in the unused spaces of the new field (the default is blank
spaces).
Note: The MOVE statement does not convert data as it is moved. To convert the data from one field's data type to another's,
use the Assignment statement.
Example 1
This example moves the first 20 characters of the NAME field to the HOLD-NAME field.
Example 2
In this example, a numeric length for the sending field (NAME) is replaced by a field name CTR. CTR contains a numeric
value that determines the number of characters moved to HOLD-NAME. Any remaining spaces after the move (assuming the
sending field is smaller than the receiving field) are filled with asterisks.
MOVE Format 2
Syntax
[ NULL ]
| SPACE |
MOVE { SPACES } TO field-name-1 field-name-n
| ZERO |
| ZEROS |
CA Easytrieve® Report Generator 11.6
[ ZEROES ]
This example fills all of the named fields with blank spaces.
MOVE LIKE Statement
MOVE LIKE moves the contents of fields in one file to identically-named fields in another file.
Syntax
It is important to understand that the MOVE LIKE statement creates assignments of each LIKE field. These assignments
perform data conversions, if necessary.
Example
FILE INFILE1
EMPNAME 17 20 A
DEPT 98 3 N
AMT 90 4 P 2
FILE OUTFIL1
AMT 1 7 N 2
EMPNAME 8 11 A
JOB INPUT INFILE1 NAME MOVE-LIKE-EXAMPLE
** Logic **
*
** Logic **
In this example, the EMPNAME field of INFILE1 is moved to the EMPNAME field of OUTFIL1, where the last nine
characters are truncated. The AMT field of INFILE1 is moved to the AMT field of OUTFIL1, where it is converted to numeric
format from packed decimal format.
DO/ENDDO Statements
Use the DO and END-DO statements to provide a controlled loop for repetitive program logic.
CA Easytrieve® Report Generator 11.6
Syntax
[WHILE]
DO { } conditional-expression
[UNTIL]
** Logic **
END-DO
• [WHILE]
• {}
• [UNTIL]
A WHILE loop evaluates the condition at the top of a group of statements. The UNTIL loop evaluates the condition at the
bottom of a group of statements.
• conditional-expression
Specifies the condition that is the basis for the continuing execution of the loop. Conditional expressions follow the rules of
IF statements.
• 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 Example
DO WHILE CTR LT 10
CTR = CTR + 1
** Logic **
END-DO
This DO WHILE statement causes "CTR = CTR + 1" to repeat until CTR is equal to 10. At that point, control transfers to the
first statement after the END-DO statement.
DO UNTIL Example
CTR = 0
CA Easytrieve® Report Generator 11.6
DO UNTIL CTR GE 10
CTR = CTR + 1
** Logic **
END-DO
This DO UNTIL statement causes "CTR = CTR + 1" to execute the logic once, and then repeat until CTR is equal to 10. At
that point, control transfers to the first statement after the END-DO statement.
As you can see from these examples, you can use the WHILE and UNTIL parameters of the DO statement to perform identical
tasks. The rule of thumb to follow when trying to determine which parameter to use is to use UNTIL if you want to be sure the
logic (CA Easytrieve® Report Generator statements) is executed at least once. The UNTIL parameter causes CA Easytrieve®
Report Generator to perform the logic and then evaluate the conditional expression.
Use WHILE if you do not want the logic executed. The WHILE parameter causes CA Easytrieve® Report Generator to
evaluate the conditional expression and perform the logic only if the condition is true.
DO Nesting Example
You can nest DO statements. (The inner logic loop must be completely within the outer logic loop.)
** Logic ** Loop
Outer
END-DO Loop
CTR1 = CTR1 + 1
** Logic **
END-DO
In this example, the inner DO WHILE loop executes five times for each single execution of the outer loop. When CTR1 is
equal to 10, control is passed to the first statement following the outer END-DO statement.
CASE and END-CASE Statements
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.
CA Easytrieve® Report Generator 11.6
Syntax
CASE field-
name
[OTHERWISE]
(statements)
END-CASE
• field-name
Specifies a field that contains a value that is compared to the values represented by compare-literal [THRU range-literal].
Field-name can be a field of any type except a varying length alphanumeric field. If field-name is alphanumeric, it must be
254 or fewer bytes in length. If field-name is numeric, it must have zero or no decimal places.
• 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.
• compare-literal [THRU range-literal]
Compare-literal is the value to be compared with field-name. You can specify a single literal, a series of literals, or a range
of literals. A range is represented by compare-literal THRU range-literal. A range is satisfied when field-name is greater
than or equal to the lesser of compare-literal and range-literal and is less than or equal to the greater of compare-literal and
range-literal.
When field-name is alphanumeric, compare-literal and range-literal must also be alphanumeric and must be equal in length
to field-name. When field-name is defined as a numeric data type, compare-literal and range-literal must also be numeric
and must not have any decimal places. Numeric literals need not be equal in length to field-name.
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.
• OTHERWISE
An optional statement that specifies a group of statements to be executed if no WHEN comparison was satisfied. If
OTHERWISE is not specified and field-name does not equal any of the specified WHEN conditions, execution continues
with the statement following END-CASE.
• END-CASE
Terminates the body of the CASE statement. END-CASE must be specified after each CASE statement and its associated
statements.
Nesting CASE Statements
A CASE statement can be nested within a CASE statement. Other conditional execution statements can also be nested within a
CASE statement. A CASE statement can be nested within any other conditional execution statement.
Example
The following example uses CASE to compare the value in JOB-CATEGORY to the range specified in the WHEN clauses and
calculate Christmas bonuses, based on that value:
CA Easytrieve® Report Generator 11.6
GOTO Statement
You use the GOTO statement to branch out of the normal top-to-bottom logic flow in a program.
Syntax
[GOTO ] [label ]
{ } {JOB }
[GO TO ] [SCREEN]
This statement directs program control to another area in the program. CA Easytrieve® Report Generator accepts either GOTO
or GO TO.
• GOTO label
Label refers to a statement label. GOTO label transfers control immediately to the first statement following the named
statement label. The statement label can be anywhere in the same activity or procedure. A statement label can:
• Can be up to 128 characters long
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
• GOTO JOB
Transfers control to the top of the current JOB activity. This is useful to stop specific records from further processing.
• GOTO SCREEN
Transfers control to the top of the current SCREEN activity.
CA Easytrieve® Report Generator 11.6
Example
** Logic ** # Control
#
CHECK-REG-ROUTINE <################
** More Logic **
STOP Statement
A STOP statement enables you to terminate an activity.
Syntax
STOP [EXECUTE]
• STOP ends the current JOB or SORT activity, completes the report processing for the activity, if any, and then goes on to
the next JOB or SORT activity, if one exists. A FINISH procedure (if one is present) is still executed before going on to the
next JOB or SORT activity.
• STOP EXECUTE immediately terminates all CA Easytrieve® Report Generator execution.
Example
PERFORM proc-
name
• proc-name
Specifies the name of a user-defined procedure located at the end of the activity in which it is performed. Proc-name can:
• Can be up to 128 characters long
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
As mentioned at the beginning of this section, procedures are discrete modules of program code that perform a task.
When coded, procedures must have this format:
proc-name. PROC
** Procedure Logic **
END-PROC
• PROC
The PROC keyword must follow the proc-name, separated by a period and a space. Proc-name is the same name as on the
PERFORM statement.
• END-PROC
Every PROC must have an END-PROC, which marks the end of the procedure. At END-PROC, control is returned to the
statement following the PERFORM statement that invoked the PROC.
Procedure Example
The following example performs two simple procedures, based on the value of a field named CODE:
IF CODE = 1
PERFORM CODE1-RTN
ELSE
PERFORM CODE2-RTN
END-IF
** Logic **
CODE1-RTN. PROC
ORDER = 'NO'
END-PROC
CODE2-RTN. PROC
ORDER = 'YES'
END-PROC
Nesting PROCs
CA Easytrieve® Report Generator 11.6
A PERFORM statement within a procedure can invoke another procedure. For example:
IF DEPT = 911
PERFORM PROCA
END-IF
** Logic **
PROCA. PROC
IF ST = 'NY'
PERFORM PROCB
ELSE
TAX = GROSS * .05
END-IF
END-PROC
PROCB. PROC
TAX = GROSS * .1
END-PROC
START/FINISH Procedures
You use the optional START and FINISH parameters of the JOB statement to automatically incorporate procedures into
processing activities.
Syntax
The format for invoking these procedures is as follows:
• START start-proc-name
START procedures are used to execute routines prior to execution of the logic in the body of the JOB activity:
• The procedure is invoked automatically after the file is opened but before reading the first input record.
• A typical START procedure might initialize working storage fields or establish a position in a keyed sequenced file.
• FINISH finish-proc-name
FINISH procedures are used to identify a procedure to be executed during the normal termination of the JOB activity:
• The procedure is invoked after the last input record is processed but before any files are closed.
• A typical FINISH procedure displays control information accumulated during execution of the JOB activity.
• CA Easytrieve® Report Generator still executes FINISH procedures if a STOP statement is encountered during the
course of the program, but not if a STOP EXECUTE is encountered.
Processing Tables
A table is a collection of uniform data records in a form suitable for quick reference.
Much like books in a library, a table has two components; an identifier that helps you find the information you are looking for
(analogous to a card catalog number) and the information you are looking for (a book). With tables however, the identifier is
called a search argument; the information you are after is called the description. Each entry in a table must consist of:
CA Easytrieve® Report Generator 11.6
• A search argument that uniquely identifies the entry -- this is defined as a field with the name ARG after the FILE
statement.
• A description (the data) associated with the search argument -- this is defined as a field with the name DESC after the FILE
statement.
Your objective is to obtain the description from a table, based on the search argument. Rules governing the processing of
search arguments are as follows:
• A table file must be arranged in ascending order by search argument.
• No duplicate search arguments can be placed in the file.
• You can use any number of tables in a job.
• A minimum of three entries is required in a table.
The following example shows a table with search arguments and descriptions. The argument is a numeric code used to look up
a descriptive state name:
ARG DESC
01 ALABAMA
02 ALASKA
03 ARIZONA
...
47 WASHINGTON
48 WEST VIRGINIA
49 WISCONSIN
50 WYOMING
[INSTREAM ]
FILE file-name TABLE | |
[max-table-entries]
• TABLE
The TABLE parameter of the FILE statement declares that the file is the object of a CA Easytrieve® Report Generator
SEARCH statement, which is used to access tables. Tables can be either external (stored in a file outside your program) or
instream (data is included within your program). External table files must be sequentially accessible.
• INSTREAM
Denotes that the table file data is within your program. Such data immediately follows the file description after the ARG
and DESC field definitions.
• max-table-entries
Specifies the maximum number of entries (records) in an external table. Specify a value here only if the number of entries
is greater than the maximum stored in the Site Options Table.
Instream Table Example
CA Easytrieve® Report Generator 11.6
The word ENDTABLE must be the last entry in an instream table and must be coded in columns 1 to 8:
This example defines a table of state names that can now be looked up according to a two-digit code.
Accessing Table Files
SEARCH Statement
The SEARCH statement is used to perform a search of a table. SEARCH can be:
• Coded any place within a JOB, PROGRAM, or SCREEN activity
• Issued any number of times against any number of tables.
Syntax
The SEARCH statement has this format:
• file-name
The name of the table that appears on the FILE statement.
• search-field
The name of a field that contains a value that is compared to the search argument. It must be the same length and type as
the search argument (ARG).
• result-field
The name of a field into which the description is placed if a match exists between search-field and the search argument. It
must be the same length and type as the description (DESC).
After using the SEARCH statement, you can test to determine whether a match was found between the search-field and the
search argument by using a special IF statement.
The IF statement has this format:
IF [NOT] file-
name
CA Easytrieve® Report Generator 11.6
FILE PERSNL
EMPNAME 17 8 A
STATE 69 2 A
ZIP 71 5 N
GROSS-PAY 94 4 P 2
POST-OFFICE-DESC W 20 A
FILE ZIPTABLE TABLE 5000
ARG 1 5 N
DESC 7 20 A
JOB INPUT PERSNL NAME TABLE-SEARCH
IF STATE = 'DC' 'IL'
IF NOT ZIPTABLE
POST-OFFICE-DESC = 'BAD ZIP CODE FOUND'
END-IF
PRINT STATE-REPORT
END-IF
REPORT STATE-REPORT
SEQUENCE STATE
CONTROL STATE
TITLE 1 'REPORT OF EMPLOYEE SALARIES BY STATE'
LINE 1 STATE EMPNAME GROSS-PAY ZIP POST-OFFICE-DESC
SORT Activities
SORT is a separate activity (outside the activity of the JOB statement) that sequences an input file in
alphabetical or numerical order based on fields specified as keys. You can sort on as many fields as your
system allows. The SORT activity uses the sort utility provided by your system.
SORT is a separate activity (outside the activity of the JOB statement) that sequences an input file in alphabetical or numerical
order based on fields specified as keys. You can sort on as many fields as your system allows. The SORT activity uses the sort
utility provided by your system.
SORT Statement
Use the SORT statement to specify your sorting requirements.
Syntax
USING (sort-key-field-
name [D] ...) +
CA Easytrieve® Report Generator 11.6
NAME sort-name
• input-file-name
The input file to be sorted.
• sorted-file-name
The output file.
• USING sort-key-field-name
Identifies those fields from input-file-name that you use as sort keys. Keys are specified in major-to-minor order. This
dictates how information is sorted. For example, you could sort a file of employee records by region, and then by location
under region, and then by department under location. Region would be the major sort key, location would be minor, and
department would be more minor.
• D
Optionally sorts the field contents in descending order (ascending order is the default).
• NAME sort-name
Like NAME on the JOB statement, this parameter identifies the sort activity and is normally used for documentation
purposes only. Sort-name:
• Can be up to 128 characters long
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
Sort Example
NAME SORT-EXAMPLE-1
This SORT example sorts the file PERSNL in ascending order, first by DEPT and then by GROSS-PAY under DEPT. This
produces a file containing records in order by department and records with LIKE departments in order by gross pay.
SORT Procedures
CA Easytrieve® Report Generator normally sorts all input records and outputs them into the TO file of the SORT statement
automatically. The output file usually has the same format and length as the input file. However, sometimes it is desirable to
sort only certain records or to modify the contents. To do this, you must write a SORT procedure, which must immediately
follow the SORT statement.
A SORT procedure is executed through the BEFORE parameter of the SORT statement.
Syntax
NAME sort-name +
[BEFORE proc-name]
SELECT
In this example, SELECT-REC is the name of the SORT procedure. The procedure causes only those records with a gross pay
of greater than or equal to 500 to be selected for sorting.
CA Easytrieve® Report Generator 11.6
PROGRAM Activities
You can use a PROGRAM activity for simple processing activities or to control the execution of JOB,
SORT, and SCREEN activities.
You can use a PROGRAM activity for simple processing activities or to control the execution of JOB, SORT, and SCREEN
activities.
DEFINE RESULT W 4 P 2
In this example, the PROGRAM activity controls which JOB activity is executed, based on the time of day. If a PROGRAM
activity had not been specified, the JOB activities would have been executed sequentially from the first JOB activity.
EXECUTE Statement
The EXECUTE statement invokes a JOB, SORT, or SCREEN activity from either a PROGRAM or SCREEN activity. The
EXECUTE statement transfers control to an activity. After the activity is executed, control returns to the next executable
statement following the EXECUTE.
Note: You cannot invoke a JOB, SORT, or SCREEN activity within a JOB or SORT activity.
EXECUTE statements within a SCREEN activity can invoke other activities. This is called activity nesting.
Syntax
When you specify INPUT and a file name, the records of that file are automatically made available to the logic in your JOB
activity section. However, there are some implied statements being executed, which you do not see in your program. The
following steps are taken when the JOB statement is executed with automatic input:
You can omit the INPUT parameter from the JOB statement. If you do, the automatic input is provided by either the first file
that is described in your library section or the output of a directly previous SORT, if any.
Printing Reports
To initiate the printing of reports, use the CA Easytrieve Report Generator PRINT statement, which looks like this:
Syntax
PRINT [report-name]
PRINT is not completely automatic, in that it does permit you a certain amount of control. You can execute PRINT anywhere
in your JOB activity logic and you can use conditional logic to determine when it should execute. However, when PRINT is
executed, it activates the designated report declaration and takes care of all output considerations automatically.
Usually, your reports do not go directly to a printer through a print file. Reports go to a CA Easytrieve Report Generator work
file (sometimes called a spool file) instead. Work files are necessary in two cases:
• When the printer (print file) is already activated by a previous report of the same JOB activity (multiple reports directed to
the same printer).
• When a report requires sequencing (specifically, when a SEQUENCE statement is present).
The following example illustrates how the PRINT statement is executed for reports going to a single printer:
CA Easytrieve® Report Generator 11.6
[ ] [ [ ]
]
DISPLAY [display-file-name] [{TITLE | NOTITLE}] [ [+]offset
]+
[SKIP skip-integer] [ [-]
]
[ ] [ [ ]
]
[ COL column-number
]
[ POS position-
number]
[
]
[ ] [ ]
[literal-1 ] [literal-n ]
[ ] [ ]
• display-file-name
If you specify display-file-name, data is printed to the named file. If you do not specify display-file-name, the default is
SYSPRINT.
• TITLE | NOTITLE
The TITLE option specifies that a skip to a new page occurs before the data is printed. Any titles and headings are also
produced. NOTITLE specifies that a skip to a new page occurs but titles and headings are not produced.
• SKIP skip-integer
The SKIP option specifies that the designated number of lines are skipped before the data is printed.
• offset
Coding a positive or negative offset modifies the horizontal spacing between display items.
• COL column-number
The COL column-number option specifies the print column number where the next display item is placed.
• POS position-number
When used in report procedures, the POS position-number option causes the next display item to be positioned under the
corresponding position on the LINE 01 statement.
• literal-1,n or field-name-1,n
Code literals or field-names in the order you want them to appear on the printed line.
CA Easytrieve® Report Generator 11.6
DISPLAY Example 1
DISPLAY Format 2
Syntax
[ ] [ ]
[ ] [ ]
In this format, a hexadecimal and character dump of the current record or the specified field-name is produced. The
parameters, other than HEX, operate the same as in Format 1.
DISPLAY Example 2
Produces:
CHAR WIMN
ZONE ECDD4444444444444444
NUMR 69450000000000000000
1...5...10...15...20
GET Statement
The GET statement retrieves the next record of the named file into the file input area.
Syntax
GET file-name
CA Easytrieve® Report Generator 11.6
• file-name
Identifies the input file that is defined in the library section.
Note: When you use the GET command, you must test for end-of-file (EOF).
GET Example
GET MASTER
IF EOF MASTER
STOP
END-IF
IF GROSS > 500
PRINT RPT1
END-IF
REPORT RPT1
LINE 1 EMP# EMPNAME GROSS
You cannot use GET for an automatic input file. To inhibit automatic input, specify INPUT NULL on the JOB statement. For
example:
You might GET a secondary file while automatically accessing a primary file.
PUT Statement
The PUT statement outputs to a file sequentially.
Syntax
• output-file-name
Identifies a file that is defined in the library section to which you are writing data.
• FROM input-file-name
Using the FROM option is like performing a MOVE of data from input-file-name to output-file-name before performing
the PUT.
PUT Example 1
EMP# 9 5 N
EMPNAME 17 16 A
GROSS 94 4 P 2
FILE NEWPAY2 F(20)
EMPNAME 1 16 A
GROSS 17 4 P 2
JOB INPUT PERSNL NAME PUT-EXAMPLE
** Logic **
MOVE LIKE PERSNL TO NEWPAY2
PUT NEWPAY2
PUT Example 2
*
END-IF
POINT Statement
Use the POINT statement to establish a starting position for sequential processing of a keyed file. This statement is for use
on INDEXED and RELATIVE files. CA Easytrieve does not require that you specify the length or location of the record key
field.
Data becomes available to your program only after the next successful sequential retrieval either by automatic file input or by a
GET statement.
Syntax
{ = } { }
POINT file-name { EQ } { field-name } [STATUS]
{ GE } { }
{ GQ } { literal }
{ >= } { }
• file-name
An INDEXED or RELATIVE file that is described on a FILE statement in the library section of your program.
• field-name or literal
CA Easytrieve® Report Generator 11.6
Any valid field-name or literal can be used as a key search value for the POINT statement. This search value is compared
to the record key value in the file to determine the starting location for sequential access.
• STATUS
Causes the system-defined field FILE-STATUS to be set with a return code. By checking FILE-STATUS at some point
in your program after coding STATUS, you can determine whether the input/output request was performed properly. The
FILE-STATUS field normally contains a value of zero after a successful I/O request. This parameter is also used on the
GET, PUT, READ, and WRITE statements.
POINT Example
The following example causes sequential processing of an INDEXED file to begin on a record with a key value of 01963 or, if
no such key exists, on a record with the next higher key value:
IF FILE-
STATUS NE 0 OR EOF PERSNL
DISPLAY 'BAD POINT...FILE STATUS= ' FILE-
STATUS
STOP
END-
IF
GET PERSNL STATUS
IF FILE-
STATUS NE 0
DISPLAY 'BAD GET...FILE STATUS= ' FILE-
STATUS
ELSE
DISPLAY PERSNL
END-
IF
STOP
{key-field-name}
READ file-name KEY { } [STATUS]
{'key-literal' }
CA Easytrieve® Report Generator 11.6
• file-name
The file name on a FILE statement in the library section of your program.
{key-field-name}
{ } [STATUS]
{'key-literal' }
Key-field-name contains the value of the record key to be found. This key value can also be expressed as a literal for
INDEXED files.
READ Example
The following example involves the use of two files: PAYROLL and MASTER. PAYROLL is a sequential transaction file
containing key values. MASTER is a master file that is keyed for random access.
The PAYROLL file is made available to the program through automatic input. Key values from this file, which is located
in the EMP-NO field, are used to READ the MASTER file. READs returning non-zero FILE-STATUS values cause the
DISPLAY of an error message.
FILE PAYROLL
EMP-NO 1 3 N
FILE MASTER INDEXED
EMP-NAME 40 10 A
*
JOB INPUT PAYROLL NAME READ-EXAMPLE
** Logic **
WRITE Statement
Use the WRITE statement to add a new record, update an existing record, or delete a record from an INDEXED or RELATIVE
file.
• When you use WRITE, you must specify the UPDATE parameter on the FILE statement of the file being written to.
• Before you can issue a WRITE to delete or update, you must already have read the record that you are writing.
WRITE Format 1
Use Format 1 when adding to or updating a record.
CA Easytrieve® Report Generator 11.6
Syntax
[ ] [ ]
[ ]
WRITE Example 1
This example involves two files: TRANS and PAYVS. TRANS is a sequential transaction file containing transaction records,
with a key value located in the EMP-NO field. PAYVS is a master file that is keyed for random access.
The TRANS file is made available to the program through automatic input. The EMP-NO field of the TRANS file is used as a
key to READ the PAYVS file.
The value returned to the FILE-STATUS field after a READ is checked to find out if a record with a matching key value was
found. If no record was found, then an ADD is performed.
If a record was found, then an UPDATE is performed. In either case, procedures (not shown) are performed to check the FILE-
STATUS value for each WRITE statement executed.
FILE TRANS
EMP-NO 1 3 N
GROSS 15 4 P 2
*
FILE PAYVS INDEXED UPDATE
GROSS 15 4 P 2
*
JOB INPUT TRANS NAME UPDATE-PGM
READ PAYVS KEY EMP-NO STATUS
IF PAYVS:FILE-STATUS NE 0 . * RECORD NOT FOUND
PERFORM ADD-STATUS-CHK
GOTO JOB
END-IF
IF PAYVS:FILE-STATUS = 0 . * RECORD FOUND
MOVE LIKE TRANS TO PAYVS
PERFORM UPDATE-STATUS-CHK
GOTO JOB
END-IF
WRITE Format 2
CA Easytrieve® Report Generator 11.6
WRITE Example 1
FILE TRANS
TRANS-KEY 14 3 A
TRANS-CODE 17 1 A. * TRANS-CODE value of D means Delete
*
FILE PAYVS INDEXED UPDATE
JOB INPUT TRANS NAME VSAM-DELETE
IF TRANS-CODE = 'D'
READ PAYVS KEY TRANS-KEY STATUS
IF FILE-STATUS = 0
PERFORM WRITE-STAT-CHECK
ELSE
DISPLAY 'ERROR IN STATUS CHECK'
END-IF
END-IF
<######################LINESIZE######################>
######################################################
# TOP MARGIN #
###################################################### ###
# TITLE AREA (optional) #
# where titles are printed # #
###################################################### P
# HEADING AREA (optional) # A
# where headings are printed # G
###################################################### E
# # S
# # I
# REPORT BODY # Z
# # E
# where lines or line groups are printed # #
###################################################### #
# BOTTOM MARGIN # ¯
###################################################### ###
Titles
The title is the first item printed on each report page. The report title is specified in your program by the TITLE statement. You
can have up to 99 TITLE statements in your program. The following diagram shows the title area of a report.
<#########################LINESIZE########################>
If more than one TITLE statement is coded in your program, TITLE must be followed by sequence numbers (01 to 99). The
following list highlights some points to remember about standard report titles:
• TITLE 01 items are printed at top-of-form.
• The current date and page count are automatically placed at either end of the TITLE 01 line.
• Title lines are centered within the space indicated by the LINESIZE parameter of the REPORT statement.
• The title sequence number controls the vertical spacing of titles relative to the first title.
• The SPACE parameter of the REPORT statement controls the number of blank characters (spaces) between title items.
The following shows two TITLE statements and the resulting titles:
CA Easytrieve® Report Generator 11.6
Statements:
Produce:
IN DEPARTMENT 903
Note: A blank line was inserted where a TITLE 02 item would have otherwise been printed.
Headings
Headings in a report describe the content of line items. Line items are the single pieces of information that make up a line
on a report. Usually, they form vertical columns. Each heading is centered over its associated line item. The following list
highlights points to remember about headings:
• If no headings are defined, CA Easytrieve uses the field names of the DEFINE statement as headings.
• Headings can be specified by HEADING statements in the report subactivity or by HEADING parameters on DEFINE
statements.
• HEADING statements override any HEADING parameters defined for the same field.
• Line items that are literals (do not come from defined fields) do not have headings.
• Headings can be stacked (take up more than one vertical space).
The following diagram shows the positioning of headings in a typical report:
T I T L E A R E A
CA Easytrieve® Report Generator 11.6
HEADING
HEADING Heading
The following example shows how headings can be defined in your program:
Statements:
EMPNAME 17 20 A
PAY-
NET 90 4 P 2
JOB INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65
HEADING PAY-NET ('NET' 'PAY')
Produce:
SOCIAL
SECURITY NET
Line Group
A line is the result of a single LINE statement in your program. Each time a PRINT statement is executed, all of the fields
indicated on the LINE statement are sent to the printer as a single formatted line. If there is more than one LINE statement in
your program, then they are output in groups for each PRINT statement issued. All of the LINE statements of the report make
up a line group, which is also called a logical report line:
LINE 01 ...ü
LINE 02 ...ý line group (logical report line)
LINE 03 ...þ
...
SOCIAL ü
SECURITY SEX ý Heading
EMPLOYEE NAME NUMBER CODE þ
For more information about line item positioning, see CA IDMS Database Processing.
CA Easytrieve® Report Generator 11.6
Processing of Reports
The PRINT statement discussed in the Input and Output section identifies records for output to a report
and initiates the execution of a report declaration. This does not directly cause the printing of the report.
Reports are printed and formatted by the statements that make up the report declaration. Sometimes the
report is called subactivity, because report declarations are considered subactivities of the JOB activity.
The PRINT statement discussed in the Input and Output section identifies records for output to a report and initiates the
execution of a report declaration. This does not directly cause the printing of the report. Reports are printed and formatted by
the statements that make up the report declaration. Sometimes the report is called subactivity, because report declarations are
considered subactivities of the JOB activity.
There are two parts to every report declaration:
REPORT Statement
The REPORT statement is the first statement that is coded in a report declaration. The report statement includes the keyword
REPORT and various report parameters.
Report parameters are keywords that permit you to assign values that alter the physical characteristics of the final report.
Although you can specify many report parameters, you can produce most reports using default (defined by CA Easytrieve
Report Generator) parameter values.
Report statement parameters provide you with a simple way to define tailored reports. They can be divided into three
categories:
• Spacing control parameters
• Testing aid parameters
• Format determination parameters
Spacing Control Parameters
The following REPORT statement parameters control spacing on a standard format report:
• PAGESIZE
Specifies the lines per page. The default is 58.
• LINESIZE
Specifies the length of each line. The default is 132.
• SKIP
Specifies the number of blank lines to be inserted between line groups. The default is 0.
• SPACE
Specifies the number of blanks inserted (horizontally) between field columns and between fields and literals in title and
detail lines. The default is 3.
• TITLESKIP
Specifies the number of blank lines inserted after last title line and before the first heading or detail line. The default is 3.
• SPREAD
Requests that the columns of data be spread evenly over the entire line; overrides the SPACE parameter. The default is
NOSPREAD.
• NOADJUST
Requests that title lines and report be left-justified on the page. The default is to center the report on the page. SPREAD and
NOADJUST are mutually exclusive.
• NODATE
Inhibits printing the system date in positions one through eight of the first title line.
• NOPAGE
Inhibits the printing of a page number.
• NOHEADING
Inhibits the printing of column headings.
Spacing control parameters are all optional. When used, they can be coded on the REPORT statement in any order. The
general format for these parameters is:
REPORT report-name +
CA Easytrieve® Report Generator 11.6
É ù Spacing
êSPREAD ú Control
êNOSPREAD ú + Parameters
ë û
[NOADJUST] +
[NODATE] [NOPAGE] +
[NOHEADING] +
SPREAD TITLESKIP 4
This program produces the following report (only two pages are shown):
EXAMPLE PROGRAM
CA Easytrieve® Report Generator 11.6
EMPLOYEE
NAME EMP# DEPT GROSS
EXAMPLE PROGRAM
EMPLOYEE
NAME EMP# DEPT GROSS
SEQUENCE Examples
CONTROL Statement
A CONTROL statement specifies that a report should automatically accumulate and print totals. A control break occurs
whenever the value of any control field changes or end-of-report is reached. Control fields can be any non-quantitative field
from any input file or any W working storage field. At each control break, totals are printed for any quantitative fields that are
specified in the report.
• You can specify an unlimited number of control fields.
• Fields are coded on the CONTROL statement in major to minor order.
Syntax
É ù É ù
CONTROL êfield-
nameú êNEWPAGEú [NOPRINT] ...
ê FINAL ú ê RENUM ú
ë û ë û
• Final totals are automatically provided. You can alter the default by coding FINAL NOPRINT.
• NOPRINT following any field-name suppresses the printing of totals for that field (which are still accumulated) at the
corresponding control break.
• NEWPAGE following any field or FINAL causes a new page after the printing of the control break totals (or, in the case of
FINAL, before the printing of the final totals). Page numbers continue.
• RENUM following any field or FINAL causes a page break and restarts page numbers at 1 after the printing of the control
break totals (or, in the case of FINAL, before the printing of the final totals).
Control Examples
SUM Statement
The SUM statement specifies that only certain quantitative fields are to be totaled for a control report. Normally on control
reports, CA Easytrieve Report Generator totals all quantitative fields that are specified on the LINE statement (to be discussed
later). The SUM statement overrides this process; only the fields specified on the SUM statement are totaled.
• You can use SUM only in control reports.
• You can SUM any quantitative field from any active file or any W working storage field.
Syntax
SUM Example
TITLE Statement
CA Easytrieve® Report Generator 11.6
The TITLE statement lets you define a title for your report. Up to 99 titles are permitted. You can specify literals and field
names on the TITLE statement.
Syntax
{[ ] field-name}
{[#font-number] }
TITLE [title-number] {[ ] 'literal' } ...
{+offset }
{-offset }
{COL column-number }
• You use ± offset to alter the normal horizontal spacing between literals or fields on the title lines. Spaces are added to or
subtracted from the SPACE parameter (which normally has a default of 3).
• COL column-number specifies the print column number where the next title item is to begin.
• If no TITLEs are coded, the date and page number, which are normally automatically included in the title, are not printed.
TITLE Examples
prints:
Statements:
1/17/18
REPORT FOR THE STATE OF DC PAGE 1
1/17/18
REPORT FOR THE STATE OF MD PAGE 2
1/17/18
REPORT FOR THE STATE OF VA PAGE 3
$2,752.06
HEADING Statement
As with the DEFINE statement in the library section, you can define an alternate column heading for a field in the report
declaration. The HEADING statement overrides a HEADING parameter that is coded for the same field in the library section
of the program. If alternative headings are not defined, either by a HEADING statement or by the HEADING parameter of
DEFINE, then the field name is used as the heading.
• Use one HEADING statement per field.
• Words in a heading can be stacked to save space in the column. To do this, place individual words in single quotes.
Syntax
HEADING Example 1
This example prints a column heading on the report that looks like:
EMP NO
HEADING Example 2
SOCIAL
SECURITY
NUMBER
LINE Statement
The LINE statement defines the content of a report line. Multiple LINE statements define a line group. Use LINE 01 to
designate headings for the report columns.
• You can specify up to 99 lines per record.
• You can specify any field from an input file or working storage.
CA Easytrieve® Report Generator 11.6
Syntax
{[ ] field-name }
{[#font-number] }
{[ ] 'literal' }
LINE [line-number] {+offset } ...
{-offset }
{COL column-number }
{POS position-number }
• If literals are specified, they print on all lines but are not used as headings.
• ± offset is used to alter the normal spacing between line items. nn is added to or subtracted from the SPACE parameter
(which normally has a default of 3).
• COL (column) specifies the print column number where the next field is to begin.
• POS (position) provides for aligning fields under the corresponding column heading positions that are indicated on the
LINE 01 statement.
LINE Example
Label Report
Use the label report capability of to print mailing labels and other applications that require inserting
variable data in a repetitious format. A label report is different from a standard report in the following
ways:
Use the label report capability of CA Easytrieve® Report Generator to print mailing labels and other applications that require
inserting variable data in a repetitious format. A label report is different from a standard report in the following ways:
• Label reports do not have titles and headings.
• Multiple labels can be printed side-by-side.
• Controlled label reports permit control breaks, but do not automatically total quantitative fields. Totals, however, can be
specified on a SUM statement and processed in BEFORE-BREAK and AFTER-BREAK procedures (discussed later in this
chapter).
You can use the label report function whenever a complete logical print page is to be produced by each PRINT statement.
CA Easytrieve® Report Generator 11.6
Label Format
To specify label reports, use the LABELS option of the REPORT statement. The following diagram illustrates the basic label
report page format:
#<#SIZE (30)#>#
<#####################LINESIZE######################>
ACROSS (4)
A label line consists of one or more labels positioned across the label page. In this diagram, labels 1 to 4 compose a label line.
A single line group composes each label. Therefore, CA Easytrieve produces a label for each PRINT statement execution. CA
Easytrieve formats the labels on the page in the order shown in the diagram. DOWN and SIZE (subparameters of the LABELS
option) indicate the dimensions of each label.
LABELS Parameter
Format determination parameters are parameters of the REPORT statement that determine the type of report to be printed. The
LABELS parameter is responsible for formatting reports that print mailing labels.
LABELS specifies that the report is to be in label format rather than the standard report format. It automatically inhibits the
printing of the date, page, headings, and titles. The following subparameters are used with LABELS:
• ACROSS specifies the number of labels printed across the print line (default is 4).
• DOWN specifies the number of lines down from the first line of the first label to the first line of the second label (default is
6).
• SIZE specifies the number of print positions from the first position on the first label to the first position on the second label
(default is 30).
The LABELS parameter has the following format:
[LABELS ] + Format
[SIZE nn])
LINE 01 NAME
LINE 02 ADDR-
STREET
LINE 03 ADDR-CITY ADDR-
STATE
LINE 04 ADDR-ZIP
REPORT [report-
name] +
[LIMIT number-of-
records]
[EVERY n-number-of-lines]
• The LIMIT option limits the number of records processed by the report. The value, number-of-records, can be any integer
literal in the range 1 to 32,767.
• The EVERY option enables you to specify that only every nth line is to be printed in the report. The value of n-number-of-
lines can be any integer literal in the range 1 to 32,767.
DTLCTL Parameter
The DTLCTL (Detail Control) parameter of REPORT establishes the method for printing control field values on detail lines
of a control report by using the subparameters EVERY, FIRST, and NONE. The following example program uses DTLCTL
options. This program can be run with any of the three options. For more information, see Processing of Reports.
FILE FILE1
LAST-NAME 1 5 A
CA Easytrieve® Report Generator 11.6
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 +
DTLCTL option (* replace with one: EVERY, FIRST, or NONE
*) SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
SUMCTL Parameter
The SUMCTL (Sum Control) parameter of REPORT establishes the method for printing control field values on total lines
of a control report by using the subparameters ALL, HIAR, NONE, and TAG. (The DTLCOPY subparameter controls all
non-control non-total field values on total lines and is shown, with the SUMMARY parameter, later in this chapter.) The
following example program uses these options. This program can be run with any of the four options. For more information,
see Processing of Reports.
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 +
SUMCTL option (* replace with one: ALL, HIAR, NONE, or TAG
*) SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
SUMMARY Reports
SUMMARY is a parameter of the REPORT statement that causes the report to print as a summary report.
Summary reports consist of only total lines, which normally include only control fields and totals. All detail lines are inhibited
from printing.
DTLCOPY Subparameter
It can be helpful on summary reports to have detail field information printed on the total lines to provide greater readability.
The DTLCOPY option of the SUMCTL parameter of the REPORT statement copies detail fields (non-control and non-total
fields), as they appear just before the control break, onto the total lines of the summary report.
The following example shows a program that produces a summary report and includes the DTLCOPY option. If this option
were not used, the LAST-NAME values would not print.
DTLCOPY causes the detail information to be printed only on the first control level of the report. DTLCOPYALL causes the
detail to be printed on all summary lines.
CA Easytrieve® Report Generator 11.6
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
Data:
Report:
Summary Files
A summary file, containing all the control and summed field values at each minor break, can be optionally generated during
processing of a control report. JOB activities in your program can subsequently process the summary file to provide reports
not otherwise available through the standard report facilities of CA Easytrieve® Report Generator. To request the summary
file, define the file in the library and then reference it with the REPORT SUMFILE parameter. For more information,
see Processing of Reports.
Multiple Reports
You can use to produce multiple reports.
You can use CA Easytrieve® Report Generator to produce multiple reports.
EMPNAME 17 8 A
DEPARTMENT 98 3 N
NET 90 4 P 2
GROSS 94 4 P 2
DEDUCTIONS W 4 P 2
JOB INPUT PERSNL NAME MULTRPTS
PRINT RPT1
DEDUCTIONS = GROSS - NET
PRINT RPT2
IF DEPARTMENT = 911
PRINT RPT3
END-
IF
*
REPORT RPT1
TITLE 1 'REPORT ONE'
LINE 1 EMPNAME DEPARTMENT GROSS NET
*
REPORT RPT2
SEQUENCE DEPARTMENT
TITLE 1 'REPORT TWO'
LINE 1 DEPARTMENT EMPNAME GROSS NET DEDUCTIONS
*
REPORT RPT3
CONTROL
TITLE 1 'REPORT THREE - DEPT 911'
LINE 1 EMPNAME GROSS NET DEDUCTIONS
REPORT report-
name
CA Easytrieve® Report Generator 11.6
[PRINTER file-name]
The following example shows a CA Easytrieve® Report Generator program that produces two reports, each sent to separate
printers.
FILE PAYFILE
EMPNAME 17 16 A
ADDRESS 57 20 A
STREET 37 20 A
EMP-
NUMBER 9 5 N
*
*
JOB INPUT PAYFILE NAME MULT-
PRINTERS
IF EMP-
NUMBER LE 12345
PRINT FIRST-
REPORT
PRINT NORM-
REPORT
END-
IF
*
SEQUENCE EMP-
NUMBER
LINE 1 EMPNAME
LINE 3 STREET
LINE 5 ADDRESS
*
REPORT NORM-REPORT
The first report declaration produces a report to a print output file designated SPFORM in the second file statement. This print
file gets tied to a physical printer through your Job Control Language (JCL) statements.
The second report declaration produces a report that is output to the default printer used with other CA Easytrieve® Report
Generator programs.
CA Easytrieve® Report Generator 11.6
Code any report procedures immediately after the last LINE statement of each report in your program. To identify report
procedures in your program, use the . PROC keyword, as shown below:
REPORT statement
LINE statement
É ù
ê REPORT-INPUT. PROC ú
ê BEFORE-BREAK. PROC ú
ê AFTER-BREAK. PROC ú
ê BEFORE-LINE. PROC ú
ê AFTER-LINE. PROC ú
ê ENDPAGE. PROC ú
ê TERMINATION. PROC ú
ë û
** procedure logic **
END-PROC
FILE PERSNL
BRANCH 2 2 N
EMP# 9 5 N
EMPNAME 17 20 A
PAY-
NET 90 4 P 2
TOT-
NET S 5 P 2
CA Easytrieve® Report Generator 11.6
PCT-NET-TO-
TOT W 3 P 1
*
JOB INPUT PERSNL NAME RPTINPT
TOT-NET = TOT-NET + PAY-
NET
PRINT PCT-
RPT
*
REPORT PCT-
RPT LIMIT 20
SEQUENCE BRANCH EMP#
CONTROL FINAL NOPRINT BRANCH NOPRINT
TITLE 1 'EXAMPLE OF REPORT-
INPUT PROC'
LINE 1 BRANCH EMPNAME EMP# PAY-NET PCT-NET-TO-
TOT
*
REPORT-INPUT. PROC
SELECT
END-PROC
Produce:
EMPLOYEE NET
BRANCH EMPLOYEE NAME NUMBER PAY PCT-NET-TO-
TOT
BEFORE-BREAK. PROC
The BEFORE-BREAK. PROC allows for modification of totals and special annotation before total line printing caused by the
CONTROL statement. A system-defined field named LEVEL can be tested to determine the appropriate break:
In the following example, the BEFORE-BREAK. PROC causes the DEPARTMENT annotation at each of the breaks and
modifies the total in PCT to be the percentage, based on total amounts:
Statements:
FILE PAYROLL
EMP# 9 5 N HEADING ('EMPLOYEE' 'NUMBER')
NET 90 4 P 2 HEADING ('NET' 'PAY')
DEPT 98 3 N
GROSS 94 4 P 2 HEADING ('GROSS' 'PAY')
DED W 3 P 2
PCT W 4 N 2
JOB INPUT PAYROLL NAME CORRECT-
PCT
IF DEPT = 911 914 921
DED = GROSS - NET
PCT = DED / GROSS * 100
PRINT PCT-
REPORT
END-
IF
CA Easytrieve® Report Generator 11.6
REPORT PCT-
REPORT LINESIZE 73
SEQUENCE DEPT
CONTROL FINAL NOPRINT DEPT NOPRINT
TITLE 1 'THIS REPORT WILL ILLUSTRATE USE OF'
TITLE 2 'BEFORE-
BREAK PROCEDURE'
LINE DEPT EMP# GROSS NET DED PCT
BEFORE-BREAK. PROC
DISPLAY SKIP 1
END-IF
END-IF
END-PROC
Produce:
BEFORE-
BREAK PROCEDURE
AFTER-BREAK. PROC
An AFTER-BREAK procedure can be used to produce special annotation on control reports. The value of LEVEL (a system-
defined field) can be used to determine which control break is being processed. In the following example, the total line for the
second control field ZIP receives special annotation.
AFTER-BREAK Example
CA Easytrieve® Report Generator 11.6
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
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
CA Easytrieve® Report Generator 11.6
SMITHTX7521866666
Produce:
2222.09
ENDPAGE. PROC
You can use an ENDPAGE procedure to produce page footing information. It is invoked whenever end-of-page is detected. It
is typically used to produce page totals or other annotations, as in the following example of page footer annotation.
ENDPAGE 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
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-
NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
CA Easytrieve® Report Generator 11.6
ENDPAGE. PROC
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Produce:
...
* CONFIDENTIAL - FOR INTERNAL USE ONLY *
############################################################
...
TERMINATION. PROC
A TERMINATION procedure is invoked at the end of the report. You can use this procedure to print report footing
information, including control totals and distribution information. The following is an example of report footing.
TERMINATION Example
Statements:
FILE FILE1
CA Easytrieve® Report Generator 11.6
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 NOTITLE
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
CA Easytrieve® Report Generator 11.6
SMITHTX7521866666
Produce:
...
###################################################################
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 +
DTLCTL EVERY
SEQUENCE STATE ZIP LAST-
NAME
CONTROL STATE ZIP
CA Easytrieve® Report Generator 11.6
AFTER-LINE. PROC
IF PAY-NET GE 500
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Produces:
IL 1444.32
TX 777.77
2222.09
System-Defined Fields
System-defined fields are fields that automatically defines and maintains internally. You can access
these fields in your program to retrieve data that can be useful in processing, or in certain types of error
trapping.
System-defined fields are fields that CA Easytrieve® Report Generator automatically defines and maintains internally. You
can access these fields in your program to retrieve data that can be useful in processing, or in certain types of error trapping.
This section includes the following articles:
SYSDATE
SYSDATE is a read-only field that contains the system date at the start of CA Easytrieve Report Generator execution. The
DATE option of the Options Table determines the format of the date. Normally, a slash (/) separates the month, day, and
year components of the date (for example, MM/DD/YY). For more information about the DATE option, see the Language
Reference section.
SYSDATE-LONG
SYSDATE-LONG is a read-only field that contains the system date at the start of CA Easytrieve Report Generator execution
and is similar to SYSDATE, except that it includes the century (for example, MM/DD/YYYY).
SYSTIME
SYSTIME is a read-only field that contains the system time at the start of CA Easytrieve Report Generator execution.
Normally, a colon (:) separates the data into hours, minutes, and seconds (for example, HH:MM:SS).
RETURN-CODE
RETURN-CODE is a field whose contents are returned to the operating system in register 15 when CA Easytrieve Report
Generator terminates. RETURN-CODE is initialized to zero, but you can set it to any value. RETURN-CODE applies only to
MVS systems.
UIBFCTR
CA Easytrieve® Report Generator 11.6
When processing an IMS/DLI database in a CICS environment, UIBFCTR contains the values from the UIBFCTR fields in the
CICS UIB. For a description of the UIBFCTR fields, see the IBM CICS Application Programmer's Reference Manual.
UIBDLTR
When processing an IMS/DLI database in a CICS environment, UIBDLTR contains the values from the UIBDLTR fields in
the CICS UIB. For a description of the UIBDLTR fields, see the IBM CICS Application Programmer's Reference Manual.
UIB-ADDRESS
When processing an IMS/DLI database in a CICS environment, UIB-ADDRESS contains the address of the CICS UIB. It only
contains the UIB-ADDRESS following the execution of a Format 5 DL/I statement. For a description of the UIB, see the IBM
CICS Application Programmer's Reference Manual.
These fields are stored as part of working storage but can be qualified by file-name. As working storage fields, they are not
subject to invalid file reference errors.
RECORDLENGTH
RECORD-LENGTH is a field with zero decimal places that is used for all file types to determine or establish the length of the
current data record. For variable-length records, this field contains only the length of the record's actual data. CA Easytrieve
Report Generator automatically adjusts the field to account for the 4-byte record-control word and 4-byte block-control-word.
For variable-length files, assign the length of the record to the RECORD-LENGTH field before the PUT or WRITE statement
is executed.
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.
RECORDCOUNT
RECORD-COUNT is a read-only field with zero decimal places that contains the number of logical I/O operations that are
performed on a file.
For CA IDMS and IMS/DLI files, only automatic input increments RECORD-COUNT.
FILESTATUS
FILE-STATUS is a read-only field that contains the results of the most recent I/O operation on a file. FILE-STATUS is
available when you code STATUS on the I/O statement. If you do not code STATUS, an appropriate error message is
generated. The error message contains one of these codes.
For CA IDMS files using automatic input, FILE-STATUS contains IDMSSTATUS. For IMS/DLI files, FILE-STATUS
contains the status code from the PCB.
FILE-STATUS codes and their meanings are:
• 0000 Operation successful.
Explanation: This is not an error condition. It indicates that the last I/O operation was successful. No additional
information is required.
• 0004 End of file.
Explanation: This is not an error condition. It indicates that the file position has been moved beyond the last record in the
file.
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.
• 0008 Record with a duplicate alternate key exists.
Explanation: This is not an error condition. It indicates that the key of this record matches the key of the record that
follows it in the sequential order of this 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.
Following a READ statement, this condition indicates that there is at least one more record in the file with a matching key
(a GET statement must be used to retrieve any remaining records).
CA Easytrieve® Report Generator 11.6
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.
• 0012 Duplicate key.
Explanation: This error condition indicates that an attempt was made to store a record with a duplicate key, or that there is
a duplicate record for an alternate index with the Unique Key option.
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 that is 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:
• There is at least one alternate index that is associated with this file.
• The alternate index was defined with the unique key and the upgrade option.
• The updated record caused a duplicate key condition to occur when the alternate index was updated.
• 0016 Record not found.
Explanation: This error condition indicates that the record that is designated by the KEY parameter is not found in the file.
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 that is specified by the statement. For a RELATIVE
file, it indicates that the slot that is designated by the relative record number is empty.
• 0024 Logical or physical error condition.
Explanation: This error condition indicates that a logical or physical error condition was detected by the access method
routines that are used to access the file. The specific cause of the error is displayed in a runtime abend message. For a list of
the feedback codes, see Messages and Codes.
PATH-ID
For CA IDMS and IMS/DLI files, PATH-ID is field that contains the ID value of the lowest record retrieve in a path, using the
RETRIEVE statement. For more information, see the Programming section.
IDMSCOM
IDMSCOM contains a set of fields that are defined for the CA IDMS Communications Block. For more information, see the
Programming section.
SLC
SLC contains a set of fields that are defined for a logical record communications block. For more information, see the
Programming section.
SQLCA
SQLCA contains a set of fields that are defined for the SQL communications Block. For more information, see the
Programming section.
These fields are stored as part of working storage and are read-only.
LINE-COUNT
LINE-COUNT contains the number of lines printed on the page.
LINE-NUMBER
LINE-NUMBER contains the number of the line being printed within the line group.
PAGE-COUNT
PAGE-COUNT contains the number of pages printed.
PAGE-NUMBER
PAGE-NUMBER contains the number of the page being printed.
CA Easytrieve® Report Generator 11.6
TALLY
TALLY contains the number of detail records that comprise a control break. You can use TALLY on a LINE statement or you
can use it in calculations within report procedures. TALLY is commonly used to determine averages for a control level.
TALLY is a field with zero decimal places. This definition is used for calculations contained within report procedures. The
TALLYSIZE parameter of the REPORT statement defines the number of digits that are printed for TALLY. A TALLY
accumulator is created for each control break level.
LEVEL
LEVEL is a system-defined field provided for determining which control break is currently active. The value of LEVEL
indicates the control break level and varies from 0 to n based on the number of field names on the CONTROL statement of the
associated report. LEVEL contains the logical position number of the controlling field name. This value also applies to FINAL,
whether it is coded or not.
LEVEL Example
BREAK-LEVEL
BREAK-LEVEL indicates the highest field in the break.
6 Using
Create a report, compile, link, and execute a program, and use the Workbench.
CA Easytrieve® Report Generator is an information retrieval and data management system designed to simplify computer
programming. Its English like language and simple declarative statements provide the new user with the tools needed to
produce comprehensive reports and screens with ease, and its enhanced facilities provide the experienced data processor with
the capabilities to perform complex programming tasks.
CA Easytrieve® Report Generator operates in a variety of mainframe, UNIX, Linux for zSeries, and Intel Windows
environments. CA Easytrieve® Report Generator runs interactively for data inquiry, analysis, maintenance and reporting. The
output can be returned to your terminal or routed to a printer.
This section describes how to compile, link edit, and execute CA Easytrieve® Report Generator programs. Use this section,
along with Language Reference and Programming, to provide the information you need to use CA Easytrieve® Report
Generator for all of your programming needs.
Using the link-edit method instead of the compile-and-go method provides enhanced performance capabilities. Load modules
are less prone to unauthorized and inadvertent changes than source code. Also, compiling a program once reduces the number
of resources required.
Use Debugging Aids
You can use ABEXIT, SORTMSG, or other external debugging aids to debug your programs. We recommend that you use the
default values that are provided in the Options Table for testing purposes.
If you encounter a problem, CA Support may ask you to add the code that follows to the JCL and send the documentation. By
enabling these debugging aids for any documentation sent to CA Technologies, turnaround time for a Support issue can be
reduced.
Follow to the first line of the CA Easytrieve® Report Generator program (if not already specified):
LIST ON MACROS
Note:
Generally, parameters that are useful for debugging are not the best choice when executing your program. They can add
unnecessary overhead to the execution of production programs. For example, a snap dump (produced with ABEXIT SNAP)
is ideal for debugging a S0C7 data exception ABEND. However, ABEXIT NO is a better choice to debug actual source code
problems. The default values that are provided in the Options File are ideal for testing purposes.
Avoid Using Reserved Words
We recommend that you use unique, uncommon, and lowercase or mixed case words in your programs for naming the fields,
files, or labels. CA Easytrieve Report Generator uses uppercase, hyphenated, and common English words as reserved words.
Avoid using such words because they can be added to the list of reserved words in future releases.
If you use reserved words, change them for your program to compile with the new release. See Symbols and Reserved Words.
Use VSAM KSDS Instead of Large Tables
We recommend using the VSAM Key Sequenced Data Set (KSDS) files instead of tables with many entries.
Large tables require a larger REGION size as compared to the VSAM KSDS files. The VSAM KSDS files also let you work
with variable record sizes and segmented data areas, which is not possible with tables.
Note:
• If the estimated number of table entries exceeds 32767, use the VSAM KSDS setting.
• For more information about the FILE statement INDEXED option (for VSAM KSDS), see FILE Statement.
Use the IDD Interface
CA Easytrieve® Report Generator 11.6
We recommend that you use the IDD interface instead of manually coding the definitions. The IDD interface automatically
generates definitions for files, records, logical records, element records, and fields. The definitions are taken from the CA
IDMS Integrated Data Dictionary.
The IDD interface greatly reduces the effort that is associated with database processing. The interface also provides relevant
programming information, which saves time and spares the database administrator an interruption.
Automatically Generate SQL Field Definitions
We recommend automatically generating CA Easytrieve Report Generator field definitions from the database catalog by using
the SQL INCLUDE Statement. The SQL INCLUDE statement names the SQL table or view for which column names and data
types are obtained. The statement then defines the location at which the field definitions are generated. The SQL INCLUDE
statement must precede any other SQL or SELECT statements and must be coded in the library section of your program.
Using the SQL INCLUDE statement for automatically generating field definitions eliminates the need to code host variable
definitions in the library section of your program.
Use Macros
We recommend that you use macros in your programs. Macros let you add and remove sections of code based on functionality.
You can also add file and field names into macros. You can show macros inline or hide them to reduce the program size.
Using macros is an efficient and effective method for reusing code and reducing the coding time. Using macros is a better
method than copying code within your program. Copying the entire existing programs may make their development easy but
then programs are difficult to maintain and have excessive overhead.
Note:
• You can purchase CA Easytrieve Toolkit macros, CA PanAudit Plus macros, and their related routines separately. These
macros perform several time, date, and conversion functions and JIF layouts.
• For more information about macros, see the Macro Facility section
Reduce CPU Overhead
Sorting data during a CA Easytrieve Report Generator report run increases CPU overhead. For example, the SORT statement
and using a SEQUENCE statement within a REPORT statement both increase CPU overhead.
We recommend the following methods for reducing CPU overhead:
• If possible, keep your master file in sorted order. Do not perform sorting during CA Easytrieve Report Generator program
execution.
• Before you merge new records with a master file, presort them using the same order as the master file.
• If sorting is necessary, filter the data in the file before sorting using the SELECT statement or an E15 sort exit.
Note:
• This article includes basic information about creating a report. For more detailed examples and information about the
features and options that are available in all implementations of the product, see the other articles in the Using section and
the Language Reference section.
• For information about interfacing CA Easytrieve Report Generator programs with programs that are written in other
languages such as COBOL, C, or C++, see the Programming section.
• Because CA Easytrieve Report Generator is a compiled language that runs in many data processing environments, the
examples in this article are generic and do not address variations between different installations. It is beyond the scope of
this article to address the specifics of all the operating environments in which the product can run.
Create a Report
A sample CA Easytrieve Report Generator program follows. You can enter the code and run the program from your terminal.
CA Easytrieve® Report Generator 11.6
When specified, this program produces a formatted report including date, page number, title, column headings, properly spaced
detailed lines, and more as follows:
This report is simply an edited display of fields from an employee file named PERSNL.
Note: The PERSNL sample file is provided with the product. Ask your system administrator where it is stored at your site.
The FILE and DEFINE Statements
The FILE and DEFINE statements define the library of data that is used as input to any processing activities.
The first line of this program contains the FILE statement. A FILE statement must be included for every file you use as input
to or output from your program. It tells the program where to get the data that you want processed and can also describe how
the data is stored.
There are four DEFINE statements in our sample program. The first definition is EMPNAME. DEFINE statements describe
fields in a record of the PERSNL file.
CA Easytrieve® Report Generator 11.6
You do not see the word DEFINE in the previous lines, but it is implied. For example, we could have specified:
DEFINE EMPNAME 17 8 A
Note: You can also use DEFINE statements within the program logic to define working storage. In that case, the DEFINE
keyword is required.
The JOB and IF Statements
The JOB and IF statements define and initiate all processing activities in our sample program. You can also add conditional
statements and calculations for salary deductions.
The JOB statement indicates the beginning of some form of processing. The JOB statement can also automatically provide
input (if input is available) to the processing statements that follow it.
Although CA Easytrieve Report Generator lets you control input, automatic input is provided as an alternative.
Automatic Input
Using the INPUT parameter of the JOB statement indicates that the named file (in this case PERSNL) is to be made
automatically available to your program.
If INPUT is not specified, the program looks for input and uses the first file that is described in the library section, unless the
JOB activity is preceded by a SORT activity. In that case, the program uses the output from that SORT. For more information
about SORT, see Sorting Files. Because our sample program has only one input file (PERSNL), the INPUT parameter on the
JOB statement is optional. Without the INPUT parameter, our sample program checks for input and uses the first file that is
encountered, which is PERSNL (the only file in our library section).
Naming a JOB Activity
The next element after the INPUT parameter in our sample program is the word NAME. NAME indicates that a job name
follows.
The IF Statement
In the previous report program, we have only extracted some data from a file and printed it out. You can also include IF
statements to add conditions to the program.
In the sample program, the program accesses a field called GROSS, which contains employee gross pay. Because net pay (take
home pay) is the gross pay minus any deductions, you realize that you must determine what to deduct. For example, we deduct
28 percent from employees who earn $500 or more.
You can state this condition as follows with a simple conditional expression:
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-PAY = GROSS - DEDUCTIONS
ELSE
NET-PAY = GROSS
DEDUCTIONS = 0
END-IF
In the previous expression, if the gross pay is greater than or equal to 500, deduct 28 percent to obtain the net pay. Otherwise,
if the gross is less than 500, there are no deductions and net pay equals gross pay. CA Easytrieve Report Generator requires an
END-IF statement to complete the expression.
To add conditional logic to the program, place it in the JOB activity section after the JOB statement. You can store the results
of the new variables, DEDUCTIONS and NET-PAY, in working storage.
Working Storage
CA Easytrieve® Report Generator 11.6
Unlike many other programming languages, the definition of working storage fields in CA Easytrieve Report Generator is
easy. You can place them in the library section of your program, or in the activity section before the logic that uses them.
To define a working storage field, use the same type of attributes that are used to describe other fields. However, use the letter
W to replace the numeric value that typically describes the start location.
DEDUCTIONS W 4 P 2
NET-
PAY W 4 P 2
The code describes two working storage fields, four characters in length, in packed decimal format, with two decimal places.
The PRINT Statement
When the conditional statements have run against a record in the PERSNL file, the PRINT statement tells the program to
execute the report definition statements. In the previous PRINT statement example, these statements are identified by a user-
supplied name, PAY RPT. This name ties the PRINT statement to a specific report of the same name as indicated on the
REPORT statement. If the report name is not included, the first report in the JOB activity section is executed regardless of
whether it has a name.
A report declaration consists of a series of statements that define the format and content of a report. These statements consist of
the REPORT statement, report definition statements, and report procedures. So far, we have seen three such statements in our
sample program:
• REPORT
• TITLE
• LINE
When the report statements have been executed, control is returned to the beginning of the JOB activity section where the next
record is processed or end of file processing is performed. All output routines, line counts, and page advances are handled
automatically.
The LINE Statement
The LINE statement is responsible for printing detail lines on the report. It tells the program what fields to print and the order
in which to print them.
To add DEDUCTIONS and NET PAY to the report output, specify:
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-
PAY = GROSS - DEDUCTIONS
ELSE
NET-
PAY = GROSS
DEDUCTIONS = 0
END-
IF
PRINT PAY-
RPT
REPORT PAY-
RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
The sample output from this program follows. Two new columns have been added: NET-PAY and DEDUCTIONS.
In the following example, edit masks have been added to the three currency fields in our example program so they print with
dollar signs:
The MASK parameter of the DEFINE statement indicates that an edit mask follows. In the previous example, the actual mask
consists of the characters '$$,$$9.99'. Masks are always enclosed in single quotes.
The effect on our report of adding these masks is as follows:
Note: Any leading zeros are suppressed and each value has a dollar sign. Any all-zero values in the DEDUCTIONS column
are printed as blanks.
Field Headings
So far in our example program, field (or column) headings have come directly from the field names themselves. The program
automatically uses field names specified on the DEFINE statement as column headings, unless column headings are described
separately.
One way to describe alternative column headings is with the HEADING parameter of the DEFINE statement. For example,
you can replace the somewhat cryptic heading EMP# with the more readable heading EMPLOYEE NUMBER as follows:
EMPNAME 17 8 A
EMP# 9 5 N HEADING ('EMPLOYEE' 'NUMBER')
DEPT 98 3 N
CA Easytrieve® Report Generator 11.6
Placing each word in single quotes indicates that the headings should be printed on separate lines, one word over the other.
The following example shows how the new heading prints when the program is run:
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-
PAY DEDUCTIONS
You can include headings on the DEFINE statement for any fields that need better identification than the field name.
Controlling Compilation
You can control the compilation of your program using the following statements:
You can control the compilation of your program using the following statements:
• PARM -- lets you customize your operating environment during the compilation of your program.
• LIST, NEWPAGE, SKIP, POP, PUSH -- let you control the physical layout of the compile listing.
PARM Statement
The PARM statement, if coded, must be the first statement in your program. It is also known as the environment section of the
program. When CA Easytrieve is installed, certain compiler options are specified for your site. The PARM statement lets you
override these site options for a specific program. The following table summarizes the site options you can override by coding
parameters on the PARM statement:
ALTSEQ
Note:
For more information, see the PARM Statement.
Listing Control Statements
Listing control statements let you format the physical layout of the compile listing as follows:
• You can place listing control statements anywhere in the CA Easytrieve® Report Generator source.
• Listing control statements must be on a source line by themselves.
CA Easytrieve® Report Generator 11.6
• Listing control statements do not appear in the printed output of your program.
Note:
For complete syntax and use of the listing control statements, see the Language Reference section.
LIST
The LIST statement regulates the printing of all or portions of your program.
• LIST OFF suppresses the printing of all subsequent statements.
• LIST ON prints all subsequent statements.
• LIST MACROS/NOMACROS controls the printing of code stored in CA Easytrieve® Report Generator macros (pre-
written sections of source code).
The default is LIST ON MACROS.
Note:
For more information about macros, see the Macro Facility section.
NEWPAGE
The NEWPAGE statement prints the next source statement at the top of the next page.
SKIP
The SKIP skips the specified number of lines before printing the next source statement. You can use SKIP to make your
program more readable.
POP and PUSH
You use the PUSH statement to save the current settings of LIST ON/OFF MACROS/NOMACROS. You can then change the
settings temporarily, using the POP statement to restore the previous settings.
You can use PUSH and POP in macros to control the listing of the macro expansion without affecting listing control for the
entire program.
For example, if there is a portion of the macro that you do not want to print, you could specify LIST OFF in the macro, then
LIST ON to turn printing back on. However, if you specified LIST OFF before invoking the macro, LIST ON in the macro
prints the remainder of the program, though you may have explicitly specified LIST OFF.
Alternatively, start the macro by PUSHing (saving) the program's listing control settings. You can then code LIST OFF and
LIST ON as appropriate in the macro. End the macro by POPping (restoring) the program's settings so that the program
continues with the intended settings.
Note:
For more information about macros, see the Macro Facility section.
Note that if Visual Studio or Visual Studio .NET is detected, you can specify that your program will result in a standard
executable program (EXE extension). This can be controlled through the Program Profile Manager. See Workbench Tools and
Utilities for more information.
The P-Code file is executed using the CA Easytrieve Report Generator interpreter (ezterp).
See Execute a Program for details.
Compile Listing
The compile listing documents a CA Easytrieve Report Generator program. The listing includes the program statements,
diagnostics, a cross reference table, data map, and a compilation summary. You can use this information alone or with the
Error Analysis Report to debug a program's logic and data. See Error Analysis Report for information.
The compile listing is written to a .lst file in the directory that contains the source file when you specify the -L or +L
compilation parameter.
PARM Statement Listing Options
You can code optional PARM statement parameters to select the types of printed output the compilation generates. Default
values are taken from the options table. A compiled program uses the compile time options that were in effect at the time of
compilation.
The following table provides a list of optional printed output that can accompany the standard statement listing. You can code
LIST OFF as the first statement in your program to turn off the statement listing.
PARM/NOPARM
Statement Listing
The statements in your program are listed and numbered. The statement listing shows:
• The origin of each statement, if it is contained in a macro
• Macro statements after parameter substitution is performed
• Warning and error messages.
The statement listing has three columns:
• (a)
CA Easytrieve® Report Generator 11.6
Macro name
• (b)
Statement number
• (c)
Statement
You receive warning and error messages inserted into your source code. The messages are specific and easily identifiable. The
messages normally use a special character that directs you to the word on the statement most likely causing the error.
For example, the SEQUENTIAL parameter of the FILE statement may be misspelled. The error message uses a dollar sign ($)
to point to the word in error. A dollar sign identifies a critical error and a plus sign (+) begins a warning message.
Note: Characters identifying critical errors and warning messages can be different at your site. See your system administrator
for the characters used at your site.
In another example, an error message tells you that the data type of J in the definition of BRANCH is invalid because valid
types are A, B, N, P, or U. Finally, a warning message may tell you that the MYPROC procedure is never referenced.
Note: You can still execute a program with warning messages, but we recommend that you resolve warning conditions before
you execute the program.
DMAP
The DMAP (data map) provides the location of file and work fields. The DMAP also reports the attributes of all files and fields
in your program.
• (a)
The section title.
• (b)
The group header identifying the owner of the following fields.
• (c)
The Base identifies the storage block where a field is located. The storage block's address is given in the Error Analysis
Report.
• (d)
The location specifies:
• W
Fields defined as W working storage fields
• S
Fields defined as S working storage fields
• I
Names defined by INDEX
• Nn
The location, relative to 1, for regular file fields
• D
System-defined fields
• (e)
The field's displacement from the beginning of the storage block. In this example, field EMP# in file PERSNL is in storage
block 14, at displacement 10. The displacement is in hexadecimal format.
• (f)
The length of a single occurrence in decimal format.
• (g)
The field's format or type: A, B, I, N, P, or U. V indicates the VARYING option.
• (h)
The number of decimal positions for a numeric field.
• (i)
The number of times a field occurs, as declared by the OCCURS clause of the DEFINE statement.
• (j)
ED indicates HEX or BWZ editing for this field.
• M
Identifies given mask name, A through Y.
• R
Indicates that the R (RESET) parameter was specified for a W field.
• KE
CA Easytrieve® Report Generator 11.6
Indicates that this is a key field. The character C in this column indicates a CA IDMS CALC key.
• (k)
The level of the field.
• (l)
The field name. The name is indented one character for each level, up to level 7. Level 8 through level 50 names are
indented the same as level 7 names. If a field name does not fit on the page, it is truncated.
• (m)
Relative file number.
• (n)
File name.
Compile Summary
The Compile Summary summarizes any errors in your program and lists the set of compiler options, execution options, and the
list of macro libraries used during the compilation. The Compile Summary also lists the size of the code generated.
• (a)
The section title.
• (b)
Diagnostic (error) counts reported by type.
• (c)
The options in effect.
• (d)
The macro library search list identifies the macro directories for CA Easytrieve Report Generator macros.
Warning:
In all JCL examples, ensure that all lowercase entries are examined and changed.
In the following JCL examples, PGM=EZTPA00 is used to run Compile-only and Compile-and-Go jobs. For compatibility
with older product releases, PGM=EZT (for Compile-and-Go) and PGM=EZTCOM (for Compile-only) are still accepted.
However, these program names are deprecated and may not be supported in the same manner in the future. For this reason, we
recommend writing new application JCL using PGM=EZTPA00.
Compile-only of a CA Easytrieve Program
The following example illustrates the JCL necessary to compile-only your CA Easytrieve application program.
//SYSIN DD *
PARM SYNTAX or PARM COMPILE
...CA Easytrieve Report Generator source statements...
//
If you are sending SYSPRINT output to a data set and wish to see both the program compile listing and any runtime errors,
you must put DISP=MOD into your JCL.
Example:
//SYSPRINT DD DSN=name,DISP=(MOD,KEEP),
// SPACE=(TRK(1)),UNIT=SYSDA
//SYSPRINT DD SYSOUT=A
//SYSLIN DD UNIT=SYSDA,SPACE=(400,(100,50)),DISP=(,PASS),
// DSN=&&SYSLIN
//SYSIN DD *
PARM LINK(TESTPGM)...
...<easy> source statements...
//LKED EXEC PGM=IEWL
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&&SYSLIN,DISP=(OLD,DELETE)
//SYSLIB DD DISP=SHR,DSN=your.ezt.product.loadlib
//SYSLMOD DD DISP=SHR,DSN=your.ezt.application.loadlib
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,5))
If an Extended Printer is specified on a FILE in the CA Easytrieve program, and if that Extended Printer is defined in a Printer
Set Definition file that was generated and ftp’d from the Configuration Manager, the following DD statement must be added to
the compilation step of the previous JCL:
//EZTXRPSD DD DISP=SHR,DSN=your.psd.file.from.ftp
Information about the Configuration Manager was provided earlier in this section. For more information about extended
reporting and extended printers, see Programming and Language Reference.
Executing a Compiled Program
This example illustrates the JCL necessary to execute a previously compiled and link-edited CA Easytrieve program:
//STEPLIB DD DSN=IMSVS.RESLIB,DISP=SHR
// DD DSN=IMSVS.PGMLIB,DISP=SHR
// DD DSN=your.eztp.loadlib,DISP=SHR
//IMS DD DSN=IMSVS.PSBLIB,DISP=SHR
// DD DSN=IMSVS.DBDLIB,DISP=SHR
//SYSPRINT DD SYSOUT=A
//EZOPTBL DD DISP=SHR,DSN=your.easytrieve.r11.EZOPTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSOUT DD SYSOUT=A
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,1)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,1)
When executing CA Easytrieve programs with both IMS and DB2 for z/OS statements (if you are running a version of DB2 for
z/OS prior to 1.3), change the previous PARM statement to:
// PARM=(BMP,&MBR,&PSB,&BUF,
You also need to add the IBM DB2 SSPGM library and the CA Pan/SQL load library to the STEPLIB statement.
When executing CA Easytrieve® Report Generator Report Generator programs with both IMS and DB2 for z/OS statements,
see Mixed IMS and DB2 for OS/390 and z/OS Execution.
Executing with CA IDMS Under Central Version
The following example illustrates the JCL to compile and link-edit a CA Easytrieve program using CA IDMS under central
version:
//EZOPTBL DD DISP=SHR,DSN=your.easytrieve.r11.EZOPTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSLIN DD UNIT=SYSDA,SPACE=(400,(100,50)),DISP=(,PASS),
// DSN=&&SYSLIN
//SYSIN DD *
...<easy> source statements...
/*
//LKED EXEC PGM=IEWL
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&&SYSLIN,DISP=(OLD,DELETE)
//SYSLIB DD DISP=SHR,DSN=your.ezt.product.loadlib
//SYSLMOD DD DISP=SHR,DSN=your.ezt.application.loadlib
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,5))
The following example illustrates the JCL to execute a previously compiled and link-edited CA Easytrieve program with CA
IDMS under central version:
// DSN=&&SYSLIN
//SYSIN DD *
...<easy> source statements...
/*
//LKED EXEC PGM=IEWL
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&&SYSLIN,DISP=(OLD,DELETE)
//SYSLIB DD DISP=SHR,DSN=your.ezt.product.loadlib
//SYSLMOD DD DISP=SHR,DSN=your.ezt.application.loadlib
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,5))
The following example illustrates the JCL to execute a previously compiled and link-edited CA Easytrieve program with CA
IDMS under local mode:
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//EZOPTBL DD DISP=SHR,DSN=&OPTTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSLIN DD UNIT=SYSDA,SPACE=(400,(100,50)),DISP=(,PASS),
// DSN=&&SYSLIN
//SYSIN DD *
... <easy> DB2 source statements ...
/*
//* Link-edit the EZT application program
//LKED EXEC PGM=IEWL
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&&SYSLIN,DISP=(OLD,DELETE)
//SYSLIB DD DISP=SHR,DSN=&EZTLOAD
//SYSLMOD DD DISP=SHR,DSN=&APPLOAD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,5))
//*
//* Execute the EZT application program
//RUN EXEC PGM=TESTPGM
//STEPLIB DD DISP=SHR,DSN=&EZTLOAD
// DD DISP=SHR,DSN=&PSQLLOAD
// DD DISP=SHR,DSN=&DSNLOAD
// DD DISP=SHR,DSN=&APPLOAD
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//EZOPTBL DD DISP=SHR,DSN=&OPTTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSIN DD * (optional CARD input)
The following example illustrates the JCL necessary to execute CA Easytrieve with DB2 for z/OS using static SQL mode:
// DD DISP=SHR,DSN=&PSQLLOAD
// DD DISP=SHR,DSN=&DSNLOAD
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//EZOPTBL DD DISP=SHR,DSN=&OPTTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSLIN DD DISP=SHR,DSN=&APPOBJ.(myeztpgmname)
//GENDATA DD DISP=(NEW,PASS),DSN=&&EZTDB2,
//
DCB=(BLKSIZE=3120,LRECL=80,RECFM=FB),UNIT=SYSDA,
// SPACE=(3120,
(100,50),RLSE)
//SYSIN DD *
PARM +
SSID('myssid') +
BIND STATIC-ONLY SQLSYNTAX NONE +
PLAN (myplanname) ENVIRONMENT(NONE) LINK
... <easy> DB2 source statements ...
/*
//
*
//
**********************************************************
//
*
//
UNIT=SYSDA,
//
DCB=(BLKSIZE=3120,LRECL=80,RECFM=FB),
// SPACE=(TRK,
(2,1))
//CMDPGM3 DD
DISP=(NEW,PASS),DSN=&&CPGM3,
//
UNIT=SYSDA,
//
DCB=(BLKSIZE=3120,LRECL=80,RECFM=FB),
// SPACE=(TRK,
(2,1))
//CMDPGM4 DD
DISP=(NEW,PASS),DSN=&&CPGM4,
//
UNIT=SYSDA,
//
DCB=(BLKSIZE=3120,LRECL=80,RECFM=FB),
// SPACE=(TRK,
(2,1))
//SYSPRINT DD
SYSOUT=*
//ERRREPT DD
SYSOUT=*
//
**********************************************************
//
*
//SYSIN DD
DISP=(OLD,DELETE),DSN=&&CPGM1
// DD
DISP=(OLD,DELETE),DSN=&&CPGM2
// DD
DISP=(OLD,DELETE),DSN=&&CPGM3
CA Easytrieve® Report Generator 11.6
// DD
DISP=(OLD,DELETE),DSN=&&CPGM4
//SYSCIN DD
DSN=&&DB2OUT,DISP=(NEW,PASS),
//
UNIT=SYSDA,DCB=BLKSIZE=3120,
// SPACE=(TRK,
(3,3))
//SYSUT1 DD SPACE=(800,
(1000,1000)),UNIT=SYSDA
//SYSUT2 DD SPACE=(800,
(1000,1000)),UNIT=SYSDA
//SYSPRINT DD
SYSOUT=*
//SYSTERM DD
SYSOUT=*
//
**********************************************************
//
*
//
**********************************************************
//
**********************************************************
//
*
//
**********************************************************
//AUTH EXEC
PGM=IKJEFT01,DYNAMNBR=20
//DBRMLIB DD DISP=SHR,DSN=&DBRMLIB
//SYSPRINT DD
SYSOUT=*
//SYSTSPRT DD
SYSOUT=*
//SYSOUT DD
SYSOUT=*
//REPORT DD
SYSOUT=*
//SYSTSIN DD
*
DSN
SYSTEM(myssid)
LIB('db2.RUNLIB.LOAD')
END
/
*
//SYSIN DD
*
GRANT EXECUTE ON PLAN myplanname TO
PUBLIC;
CA Easytrieve® Report Generator 11.6
/
*
NAME totalpgmname(R)
//SYSLMOD DD DISP=SHR,DSN=&APPLOAD
//SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,
(1,5))
//*
//* Execute the EZT DB2 application program
//RUN EXEC PGM=totalpgmname,REGION=1024K,COND=(4,LE,LKEDEZT)
//STEPLIB DD DISP=SHR,DSN=&EZTLOAD
// DD DISP=SHR,DSN=&PSQLLOAD
// DD DISP=SHR,DSN=&DSNLOAD
// DD DISP=SHR,DSN=&APPLOAD
//* The following DD allows you to specify SSID and PLAN.
//PAN$SQL DD *
PLAN=myplanname,SSID=myssid
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//EZOPTBL DD DISP=SHR,DSN=&OPTTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//
// DD DSN=your.eztp.loadlib,DISP=SHR
// DD DSN=your.pansql.loadlib,DISP=SHR
//IMS DD DSN=IMSVS.PSBLIB,DISP=SHR
// DD DSN=IMSVS.DRDLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//DDOTV02 DD DSN=&&TEMP,DISP=(NEW,PASS),SPACE=(TRK,(5,5),
UNIT=SYSDA,DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096)
//DDITV02 DD *
SSN,LIT,ESMT,RTT,ERR,CRC,CONNECTION_NAME,PLAN,PROG
/*
//SYSIN DD *
... <easy> statements ...
.
.
.
/*
//
Note: Under the control of DB2 for z/OS or DLI batch support, your STEPLIB must define the IMS RESLIB before the DB2
for z/OS library.
The DDITV02 DD defines the following parameters:
Parameter Description
SSN DB2 for z/OS subsystem
LIT Language Interface token value
ESMT Initialization module name, must be DSNMIN10
RTT Resource Translation Table
ERR Region Error Option
CRC Command Recognition Character
CONNECTION_NAME A unique one-to eight-character name
PLAN DB2 for z/OS plan name
PROG Application program name to execute -- either EZTPA00 or
linked program name.
Refer to your IBM DB2 guides for a detailed explanation of these parameters.
Compilation Condition Codes
Compilation of a CA Easytrieve program will end with one of these condition codes:
• 00
Identifies successful compilation with no errors or warnings.
• 04
Identifies successful compilation with warning messages.
• 16
Identifies failed compilation due to severe errors.
If warnings occur in a Compile-and-Go run, the 04 compilation condition code is not retained, and the final condition code will
be from the “Go” part of the Compile-and-Go.
Compilation warning messages may or may not result in an execution-time failure. Each warning message should be reviewed
in order to determine if there may be an execution-time affect.
CA Easytrieve® Report Generator 11.6
-c
-I macro-directory
-l system-library-name
+L
-L
-n
-N
-o executable-file-name
+OC
+OS
-P
-q
-Q
-s
CA Easytrieve® Report Generator 11.6
-S
-v
-w
-W x,arg1[,arg2...]
-x
-z
-Z
source-files
The ezt command accepts CA Easytrieve source files and linker (ld) source files on the command line. You can specify both
types of source files with a full path specification (for example, /ezt/usr/user1/browse.ezt). The resulting files are always
placed in the current directory.
Note:
In Windows, only source files are accepted.
CA Easytrieve Source Files
All CA Easytrieve source files must have the .ezt extension. Files whose names end with the file extension .ezt are assumed to
be CA Easytrieve source files. You can specify any number of CA Easytrieve files on the command line.
In UNIX, Linux/PC and Linux for zSeries, each source file is compiled with the CA Easytrieve compiler and an executable
(.out), Assembler (.s), or object (.o) file (see -c, -P, and -S options below) is created. If you specify only one CA Easytrieve file
on the command line and do not specify a -c, -P, or -S option, the intermediate object file is deleted.
In Windows, each source file is compiled with the CA Easytrieve compiler and a P Code (.pco) file is created. The - c and - S
options are ignored.
Linker Input Files (UNIX, Linux/PC and Linux for zSeries only)
CA Easytrieve assumes all other types of files are linker input files. These types of files include object (.o) and library (.a)
files. These files are passed to the linker program (ld) along with object files CA Easytrieve compilations created.
Options
This section provides more information about the EZT command options:
• Compile Only Parameter (-c) (UNIX, Linux/PC and Linux for zSeries only)
The compile only parameter (-c) tells the EZT command to stop before the link edit phase. Object files for each
successfully compiled source program are left in the current directory. These object files must be link-edited before
execution.
• Macro Search Directory Parameter (-I macro-directory)
The macro search directory parameter (-I macro-directory) specifies a single directory where the EZT command searches
for macro source files. You can specify this parameter multiple times, each with a different search path. CA Easytrieve
always searches the directory of the source file before any directories specified with this parameter.
For each macro invocation statement in your CA Easytrieve program, ezt looks for a macro in a file named macro-
name.mac in each of the specified directories, where macro-name is the name of the macro on the macro invocation
statement.
For example, if you specify the following, ezt searches the directories /usr/usr1/source, /usr/usr1/macros, and /ezt/macros
for each macro file:
• Linker System Library Parameter (-l system-library-name) (UNIX, Linux/PC and Linux for zSeries only)
The linker system library parameter (-l system-library-name) specifies a system library for the system linker (ld)
command to search for unresolved references. The -l parameter is passed directly to the ld command. The EZT command
automatically supplies the system libraries that are required for the CA Easytrieve runtime environment.
• Generate a Compiler Listing to Standard Output Parameter (-L)
CA Easytrieve® Report Generator 11.6
The generate compiler listing parameter (-L) causes the compiler to generate a listing to the standard output device. You
can use the standard UNIX redirection symbols (>, >>, and so forth) to redirect the listing to a file. The default is not to
produce a listing.
• Generate a Compiler Listing to a File Parameter (+L)
The generate compiler listing parameter (+L) causes the compiler to generate a listing for each CA Easytrieve source file to
a separate listing file. The listing file name is created from the base name of the source file with an added extension of .lst.
For example, for the source file /usr/usr1/browse.ezt, the +L option generates a listing file in browse.lst in the current
directory. The default is not to produce a listing.
• Linker Generate Shared Output Parameter (-n) (UNIX, Linux/PC and Linux for zSeries only)
The linker generate shared output parameter (-n) marks the output from the linker (ld) as sharable. This parameter is passed
directly to ld.
• Linker Generate Unshared Output Parameter (-N) (UNIX, Linux/PC and Linux for zSeries only)
The linker generate unshared output parameter (-N) marks the output from the linker (ld) as unsharable. This parameter is
passed directly to ld.
• Specify Executable Name Parameter (-o executable-file-name) (UNIX, Linux/PC and Linux for zSeries only)
The specify executable name parameter (-o executable-file-name) names the executable file that is created by the linker.
The default is a.out.
• Omit C-ISAM Parameter (+OC) (UNIX, Linux/PC and Linux for zSeries only)
The omit C-ISAM parameter (+OC) causes the EZT command to omit the C ISAM libraries from the default system
libraries that are specified to the linker. If you have the C-ISAM libraries directory in EZTPATH but you are not accessing
C-ISAM with your CA Easytrieve program, specify this parameter to reduce the size of your executable file.
• Omit SQL Parameter (+OS) (UNIX, Linux/PC and Linux for zSeries only)
The omit SQL parameter (+OS) causes the EZT command to omit the SQL libraries from the default system libraries that
are specified to the linker. If you have the EZTSQL variable set but you are not accessing SQL with your CA Easytrieve
program, specify this parameter to reduce the size of your executable file.
• Generate P-Code File Only Parameter (-P)
The generate P-Code file only parameter (-P) causes the EZT command to produce a P-Code file for each CA Easytrieve
source file that is specified on the command line. The P-Code file name is created from the base name of the source file
with an added extension of .pco. For example, for the source file /usr/usr1/browse.ezt, the -P parameter generates a P-Code
file in browse.pco in the current directory.
• Linker Generate Demand Loadable Executable Parameter (-q) (UNIX, Linux/PC and Linux for zSeries only)
The linker generate demand loadable executable parameter (-q) marks the output from the linker (ld) as demand loadable.
This parameter is passed directly to ld.
• Linker Generate Nondemand Loadable Executable Parameter (-Q) (UNIX, Linux/PC and Linux for zSeries only)
The linker generate nondemand loadable executable parameter ( Q) marks the output from the linker (ld) as not demand
loadable. This parameter is passed directly to ld.
• Linker Strip Executable Parameter (-s) (UNIX, Linux/PC and Linux for zSeries only)
The linker strip executable parameter (-s) strips the output of the linker of its symbol table information. This reduces the
size of the resulting executable file. This parameter is passed directly to ld.
• Generate Assembler File Only Parameter (-S) (UNIX, Linux/PC and Linux for zSeries only)
The generate Assembler file only parameter (-S) causes the EZT command to produce an Assembler file for each CA
Easytrieve source specified on the command line. The Assembler file name is created from the base name of the source file
with an added extension of .s. For example, for the source file /usr/usr1/browse.ezt, the -S option generates an Assembler
file in browse.s in the current directory.
The Assembler file contains code to call the CA Easytrieve interpreter with an imbedded copy of the P-Code. It must be
assembled and link-edited with the CA Easytrieve runtime environment to produce an executable program.
• Verbose Parameter(-v)
The verbose parameter (-v) displays the name of each process (compilation, Assembler generation, assembly, and linkage
editor) as it is invoked along with the command line options that are passed to that process. The verbose parameter displays
this information to the standard-error device.
• Suppress Warning Messages Parameter (-w)
The suppress warning messages parameter (-w) suppresses the display of warning messages to the standard-error device
during compilation. Warning messages are always generated in the listing file (if requested). The default is to display
warning messages along with error messages on standard-error.
• Pass Arguments to Process Parameter (-W x,arg1[,arg2...])
The pass arguments to process parameter (-W x,arg1[,arg2...]) passes options directly to a process invoked by the EZT
command.
Valid values for x are:
• c
CA Easytrieve compiler.
CA Easytrieve® Report Generator 11.6
Command line parameters specifying part of a search path (for example, -I or -l) are processed so they are read on the
command line.
Note: Examples in the following sections do not show syntax or conventions specific to every non-mainframe operating
system or environment. For information about the syntax and convention specific to your operating environment, see your
operating environment manuals.
CA Easytrieve® Report Generator 11.6
ezt -c browse.ezt
You can link edit the program by typing the following command:
Because you specified only an object file on the EZT command line, ezt skips the compile and proceeds to the link-edit phase.
The resulting executable file is named browse.
Note:
• This option is enabled only if Visual Studio or .NET is detected on the development computer.
• The following warning can occur when you link a CA Easytrieve Report Generator program in a 64-bit Linux for zSeries or
Linux PC environment:
If you receive this warning, you can add a switch to your EZTOPTS environment variable that forces the assembler to
create a 32-bit .o file.
For a Linux PC environment, add the following switch:
-W a,--32
-W a,-m31
Note: A shared library's full path name is stored in the executable unless you use the +s linker option. The +s option causes
the operating system to use the path list defined in the SHLIB_PATH environment variable.
By default, the HP-UX linker uses shared libraries ahead of archive libraries when both exist. You can force use of archive
libraries by using the compilation parameter, -Wl,-aarchive, or removing the shared libraries from the directory.
Add the following command to the EZT command line to ensure shared object lib usage in AIX:
-Wl,-brtl
This uses the AIX ld option -brtl while linking to ensure usage of the shared object. Without this option, all applications
become statically linked executables.
See your operating environment manuals for more details.
Link-Editing with Other Systems
If your CA Easytrieve Report Generator program accesses Ingres, Oracle, C-ISAM, DB2, or ODBC, link-edit the program
with the libraries for those products.
Note: If you are running CA Easytrieve Report Generator in a Linux PC environment, you cannot link-edit the program to
Ingres, Oracle, or DB2. You can link-edit to C-ISAM and ODBC. See the commented lines in the eztprofile that is provided
with the program.
The UNIX ODBC interface has been tested using the unixODBC freeware product, which can be downloaded from
www.unixODBC.org. Consult your database documentation for the proper CONNECT string to code in CA Easytrieve Report
Generator. Each database purveyor has different rules when connecting using ODBC.
You can specify the +OS parameter for Ingres, Oracle, DB2, and ODBC, or the +OC parameter for C-ISAM. If you do not,
the EZT command automatically supplies the necessary commands to the linker (ld) to access the library directories for those
products. However, you must add the library directories to your EZTPATH environment variable. Also add the library names
to your EZTLIBS environment variable to access the correct libraries.
Note: For Ingres, Oracle, DB2, and ODBC, you can alternately include an -L directive to EZTLIBS to direct the linker to the
correct library directory.
To verify correct library specification, consult your Ingres, Oracle, C-ISAM, DB2, or ODBC documentation. CA Easytrieve
Report Generator provides an -L linker parameter specifying the Ingres, Oracle, C-ISAM, DB2, or ODBC directory specified
in EZTPATH. However, each user must supply the correct library names in EZTLIBS, as illustrated in the following examples.
Warning: Because CA Easytrieve Report Generator is a 32-bit product, ensure that the environment is pointing to the
32-bit versions of the libraries.
Note: For an Oracle database, review the libraries that the proc.mk make file uses. These libraries are located in
$ORACLE_HOME/proc/demo.
• For Ingres, specify:
-lingres
-lclntsh
CA Easytrieve® Report Generator 11.6
-ldb2
-lodbc
-lisam
A standard Informix C-ISAM library is required. You cannot link with the modified C-ISAM library that is distributed with
COBOL.
Note: If the database cannot be found, the EZT command processes as if you specified +OS (for Ingres, Oracle, DB2, and
ODBC) or +OC (for C-ISAM).
Link-Editing Programs with Called Subroutines
You can call subroutines that are written in other languages using the CALL statement or the EXIT parameter of the FILE
statement. You can link-edit called subroutines as follows:
• Statically link-edited with your program (STATIC)
• Dynamically loaded (DYNAMIC)
The default in Windows is DYNAMIC. The default on UNIX platforms is STATIC. You can override this default with the
DECLARE statement or the CALL parameter of the PARM statement. See the Programming section for more information.
Link-Editing with STATIC Subroutines
To link-edit STATIC subroutines with your program, you must compile the subroutine with the correct compiler to produce an
object module. When you compile your program, specify the object module on the EZT command line.
For example, if your program is named browse.ezt and it calls a subroutine named sqrt that is written in C, you must perform
the following steps:
1. Use the following command to compile the C program to produce an object file:
cc -c sqrt.c
2. Use the following command to compile and link-edit your program with the sqrt program:
For example, if your program is named browse.ezt and it calls a subroutine named sqrt that is written in C, you must perform
the following steps:
1. Use the following command to compile the C program to produce an object file suitable for inclusion in a shared library:
cc -c +z sqrt.c
2. Use the following command to link-edit the sqrt program to produce a shared library:
ld -b -o sqrt sqrt.o
At execution time, the browse program loads the sqrt program during the initialization of the activity that contains the CALL
statement. CA Easytrieve® Report Generator searches for the file using the PATH environment variable in the same way that
the shell searches for executable files. Your PATH environment variable must contain the directory where sqrt resides.
Generally, if your program contains the following statements:
You must then create a shared library containing the program using the following commands:
cc -c +z file-name.c
ld -b -o program-name ... file-name.o...
...
int program-name( parameters )
{
...
}
...
CA Easytrieve® Report Generator 11.6
You can also link-edit more than one subroutine into a single shared library. You must give the shared library the name of one
of the subroutines on the ld command and then create additional links for the other subroutines.
For example, if you have subroutines cos, sin, and tan, you must follow these steps to create a single shared library named cos
that contains all three subroutines:
1. Use the following command to compile all subroutines to produce object files:
3. Use the following command to define additional links for the other subroutines:
ln cos sin
ln cos tan
cl -c sqrt.c
2. Use the following command to link-edit the sqrt program to produce a DLL:
At execution time, the interpretation of the browse program loads the sqrt program during the initialization of the activity that
contains the CALL statement. CA Easytrieve Report Generator searches for the file using the current directory and the PATH
environment variable in the same way that the command interpreter searches for executable files. Your PATH environment
variable must contain the directory where sqrt.dll resides if it is not in the current work directory.
Generally, if your program contains the following statements:
You must then create a DLL containing the program using the following commands:
cl -c file-name.c
link /dll /out:program-name.dll file-name.obj
...
int program-name( parameters )
{
...
}
...
You can also link-edit more than one subroutine into a single DLL. You must then provide the name of the DLL in the
EZTDLLS environment variable to ensure that they are loaded correctly.
See the Workbench Utilities section and the Workbench Tools and Utilities section for more information.
For example, if you have subroutines cos, sin, and tan, you must follow these steps to create a single DLL named funcs.dll that
contains all three subroutines:
1. Use the following command to compile all subroutines to produce object files:
Execute a Program
This section describes how to execute a CA Easytrieve program in:
This section describes how to execute a CA Easytrieve program in:
• UNIX or Linux for zSeries using an executable file and the services that are supplied by the operating environment
• Windows using the interpreter (ezterp) and the compiler-generated P Code file and optionally creating executable files
• z/OS using JCL to execute your link-edited program
The Error Analysis report that you can use to debug an abnormal termination (ABEND) of your program is also described.
For more information, see the following articles:
CA Easytrieve® Report Generator 11.6
[path]file-name [parameter]
If your path includes the directory where file-name resides, path is not required. You can specify a parameter to pass if
allowed by your program.
Executing Your Program Using Parameters
You can specify a parameter to pass using statements similar to the following:
DEFINE PARM-FIELD S 16 A
PROGRAM NAME MY-PROGRAM USING PARM-FIELD
The PARM-FIELD field contains the data that you entered on the command line or specified in the LINK or TRANSFER
statement. For portability with CA Easytrieve® Report Generator in other operating environments, the data is placed in the
USING field as is. This means that CA Easytrieve® Report Generator attempts to pass the command line just as the UNIX
shell received it before translation.
For example, if double quotation marks prevent spaces from being translated in the shell, double quotation marks are placed
back into the data in the USING field to recreate the data. It is up to your program to account for the double quotation marks in
your data.
Temporary Files
Virtual (VFM) files and sort work files are written as temporary files. Your operating system directs temporary files to a
default location (typically, /tmp). You can redirect sort work files by setting the TMPDIR environment variable.
If your path includes the directory where ezterp resides, path is not required. You can specify a parameter to pass if allowed by
your program.
Executing Your Program Using Parameters
You can specify a parameter to pass using statements similar to the following:
DEFINE PARM-FIELD S 16 A
PROGRAM NAME MY-PROGRAM USING PARM-FIELD
The PARM-FIELD field contains the data that you entered on the command line or specified in the LINK or TRANSFER
statement. For portability with CA Easytrieve® Report Generator in other operating environments, the data is placed in the
USING field as is. This means that CA Easytrieve® Report Generator attempts to pass the command line as the command
interpreter received it before translation.
For example, if double quotation marks prevent spaces from being translated in the command interpreter, double quotation
marks are placed back into the data in the USING field to recreate the data. It is up to your program to account for the double
quotation marks in your data.
Temporary Files
Virtual (VFM) files and sort work files are written as temporary files. Your operating system directs temporary files to a
default location. You can redirect sort work files by setting the TMP environment variable.
You can specify a parameter to pass using statements similar to the following:
DEFINE PARM-FIELD S 16 A
PROGRAM NAME MY-PROGRAM USING PARM-FIELD
The PARM-FIELD field contains the data that you entered on the command line or specified in the LINK or TRANSFER
statement or specified in the JCL (that is, // EXEC PGM=PROG,PARM='data value'). For portability with CA Easytrieve®
Report Generator in other operating environments, the data is placed in the USING field as is. This means that CA
Easytrieve® Report Generator attempts to pass the command line just as it received it before translation.
Temporary Files
Virtual (VFM) files and sort work files are written to the EZTVFM data set when required.
EMPLOYEE=file-description-string
export EMPLOYEE
set EMPLOYEE=file-description-string
For more information about how to set the variable, see The Environment Manager Utility.
Setting the String on the SYSNAME Parameter
You can set the file description string directly or indirectly in the SYSNAME parameter on the FILE statement. For example:
Note: You can also set SYSNAME dynamically by using a field-name. For more information, see the Language Reference
section.
Format
The file description string format follows:
file-specifier [ [file-descriptor] ]
Where:
• file-specifier
Specifies the path required to locate the file. It can include the drive, directories, and file name. For example:
c/data/persnl.dat
• file-descriptor
Specifies the information that, optionally, describes the format type, access method of the file, and access method-
dependent information. You must enclose the file-descriptor in brackets. Separate multiple parameters by colons.
A file-descriptor can be used for FILE statements in case of sequential files that do not contain record format and record
length parameters. These are valid on the mainframe because the operating system supplies the information when the file is
opened. In non-mainframe environments, you can specify this information through a file-descriptor. The following example
demonstrates the usage:
A program on the mainframe was executed by JCL that used a DDNAME of PERSNL and DCB attributes, which include
a DSORG of FB, a record length of 150 bytes, and a block size of 3000. Given the file was ported and exists within
Windows as “persnl.dat” and is located in the “Test” subdirectory, the file-specifier and file-descriptor can be coded with
the following command:
Set PERSNL=c:\test\persnl.dat[F:L150]
Where F represents the record format of the file (use either F or V since “blocking” is not supported within Windows) and
‘L150’ represents the logical record length of the file.
The other valid format-descriptors are for INDEXED files:
File Descriptor
For CA Easytrieve® Report Generator to recognize the file format of an INDEXED file, you must supply a file descriptor. The
file descriptor provides the X format that CA Easytrieve® Report Generator requires to determine which type of file you are
processing. For more information, see File Description String (Non-Mainframe Only).
The following example shows an entire file description string:
C:\data\persnl[X]
Optional Sub-parameters
For an INDEXED file, the form of the file descriptor is as follows. If X is present, it must be the first item in the descriptor; the
other items can be in any order.
where:
• X
Specifies a CA Easytrieve® Report Generator INDEXED file. An INDEXED file must have one primary key and from
zero to 62 alternate keys contained in a record. The beginning offset of each key in a record must be different. For any
primary key value, only one record can occur in the file. More than one record can have the same value for an alternate key,
if the WITH DUPLICATES phrase is included in the ALTERNATE RECORD KEY phrase in the SELECT for the file.
• Bnn
Specifies the index block size in kilobytes (1 kilobyte equals 1024 bytes). In general, this value should not exceed the
operating system unit of transfer; that is, FAT/cluster size. The default value for B is 4 (4 kilobytes).
• Inn
Controls the number of index blocks held in memory. If this parameter is not specified, the number of index buffers is
computed by using the following formula:
(512 / B) + nKeys * 16
where:
B
Specifies the index buffer size in kilobytes (as specified by the B parameter described previously).
• nKeys
Specifies the number of keys in the file.
CA Easytrieve® Report Generator 11.6
For example, specify the following to indicate that the file has one primary and two alternate keys.:
This means that the memory usage for the index buffers for the file will be:
This is a fairly aggressive use of memory. You may want to reduce this usage if your program has many index files.
The I parameter has the most profound effect on indexed file I/O performance when alternate indexes are defined. This is
illustrated by the following table:
These results should be used for comparison only. You must experiment to find the optimum value that meets your
performance and memory constraints. In general, you should use as much memory as you can afford without burdening
the virtual memory system of the operating system that you are using. The value you specify for I should be greater than or
equal to 2. If you specify a value of 1, I is set to 2.
• Dnn
This parameter controls the number of data blocks held in memory. In most cases, this parameter has a marginal effect.
In special cases, it can improve performance based on your hardware and file utilization requirements. You will have to
experiment to find the optimum value for D.
The default for this parameter is 2.
The block-length parameter is always ignored for INDEXED files because buffers for INDEXED file processing are
always allocated dynamically. The record-length parameter determines the maximum record length for the file, and also
whether the records are fixed- or variable-length. If an existing file is opened, the maximum record length must match the
length supplied when the file is created, and the position and lengths of the primary key and all alternate keys must also
match.
No special utility is required to create an INDEXED file. However, if you need an empty INDEXED file, you can create
one using a simple program such as:
File Descriptor
CA Easytrieve® Report Generator 11.6
For CA Easytrieve® Report Generator to recognize the file format of a Btrieve INDEXED file, you must supply a file
descriptor. The file descriptor provides the Z format that CA Easytrieve® Report Generator requires to determine which type
of file you are processing. For more information, see File Description String (Non-Mainframe Only).
The following example shows an entire file description string:
C:\data\persnl[Z:EXIT(CARFSWBT):V:Pnnnn:Mnn:Ann:O'owner']
Optional Sub-parameters
For a Btrieve INDEXED file, the form of the file descriptor is as follows. If Z:EXIT(CARFSWBT) is present, it must be the
first item in the descriptor; the other items can be in any order.
• :Vnnnn
Specify V if the file is variable length. Specify the maximum record size if necessary.
• :Pnnnn
Specify the file page size. This parameter is optional. If not specified, the best file page size for the file will be
automatically set. If specified, this parameter must be a multiple of 512 between 512 and 4096. See your BTRIEVE
documentation for more information.
• :M[-]nn
Specify the file open mode. This parameter is optional. If it is not set, the file will be opened in normal mode except when
opened for output, in which case the file will be opened in accelerated mode to provide faster file loading.
Following are the possible values of the file open mode (note that unless the value is zero, this is a negative number):
• 0
Indicates that the file open mode is normal.
• -1
Indicates that the file open mode is accelerated.
• -2
Indicates that the file open mode is read-only.
• -3
Indicates that the file open mode is verify.
• -4
Indicates that the file open mode is exclusive.
• :Ann
Specify the file access mode. This parameter has effect only when the file is being created and an owner (below) has been
specified for the file. If the access mode is not specified, the default access mode is 0.
The following table lists the possible values of the file access mode:
• 0
Requires owner name for any access; no data encryption
• 1
Permits read-only access without an owner name; no data encryption
• 3
Requires an owner name for any access; data is encrypted
• 4
Permits Read-only access without an owner name; data is encrypted
• O'owner' or O”owner”
Specify the file owner. This parameter specifies a password for access to the file as specified by the access mode.
BTRIEVE File Status Codes
The BTRIEVE installable file system automatically maps underlying BTRIEVE error codes to CA Easytrieve® Report
Generator file status values provided that the error can be mapped to a meaningful file status value. In the cases where the
BTRIEVE error code cannot be mapped, a file status value of 9Z (installable file system error) is returned. If you do not
specify the FILE STATUS phrase on the I/O statement in your program, the program is terminated with an appropriate error
message.
C-ISAM file was created using the modified version COBOL supplies, review the list of differences
between standard and modified C-ISAM in the COBOL System Reference.
In UNIX and Linux for zSeries, CA Easytrieve® Report Generator supports the C-ISAM file system as an installable file
system [Z]. CA Easytrieve® Report Generator uses the standard C-ISAM libraries. You must have access to the C-ISAM
product from IBM Inc. If your C-ISAM file was created using the modified version COBOL supplies, review the list of
differences between standard and modified C-ISAM in the COBOL System Reference.
CA Easytrieve® Report Generator supports C-ISAM file access for files sizes greater than 2 GB. CA Easytrieve® Report
Generator uses C-ISAM release 7.2.6 and requires access to the libisam.a C-ISAM library. Make the libisam.a library available
to CA Easytrieve® Report Generator by adding its location to the environment variable LIBPATH.
Contents
File Descriptor
For CA Easytrieve® Report Generator to recognize the file format of a C-ISAM INDEXED file, you must supply a file
descriptor. The file descriptor provides the Z format that CA Easytrieve® Report Generator requires to determine which type
of INDEXED file you are processing. For more information, see File Description String (Non-Mainframe Only).
Log File
To help control the integrity of your C-ISAM files, CA Easytrieve® Report Generator performs commit processing. For more
information about commit processing, see Programming.
When you are creating or updating a C-ISAM file, CA Easytrieve® Report Generator opens the C-ISAM log file. You
specify the name of the log file in the CISAMLOG environment variable. The log file must exist before you execute the CA
Easytrieve® Report Generator program. If it does not exist, an error occurs. For more information, see your C-ISAM guide.
Examples
The following is an example of the CISAMLOG variable for Bourne and KORN shell users:
CISAMLOG=/cisam/cisam.logexport CISAMLOG
Display Order
The order in which printed output is displayed with the Report Display Facility is:
CA Easytrieve® Report Generator 11.6
1. Output from JOB activities with non-spooled reports is displayed first. The non-spooled reports are displayed in the order
in which they were defined, including any DISPLAY statements within the JOB activity which are output to the terminal.
2. Spooled reports are displayed next in the order in which they were defined. A report is spooled when:
• The report is SEQUENCEd
• A previously defined report uses the associated print file (when you have multiple reports in a single JOB activity).
See Print Statement (Report Processing) for more information.
3. Any other output from DISPLAY statements within an activity is displayed at the end of the activity that opened the
PRINTER file. For DISPLAYs to SYSPRINT, this occurs at the end of the entire program.
4. Any runtime errors sent to the terminal are displayed last on the Error Analysis Report. See Error Analysis Report for
details on the contents of this report.
Panel Title
The panel title is displayed on the first line of the panel. The left corner is reserved for the panel identifier when requested with
a panelid command.
Command Line
The second line of the panel contains the command area. You can type Report Display Facility commands after Command
===>. However, most commands have a function key equivalent. See Function Keys for more information.
Scroll Field
The Scroll field allows you to specify how much the text on the panel moves when you press F7 (Backward) or F8 (Forward).
Valid scroll amounts are the following.
CURS
Symbol Meaning
< indicates more report columns to the left
> indicates more report columns to the right
- indicates more report lines backward or above
CA Easytrieve® Report Generator 11.6
If all report lines are currently displayed on the panel, there is no symbol displayed.
Panel Body
The panel body, which contains the report, is separated from the above header items by a line of dashes (----).
The first line of each page in the report is preceded by a line of equal signs (====).
Function Keys
Function keys and their assignments are displayed on the last two lines of the panel. You can turn off the display of the
function keys with the keys command. See Commands for more information.
The valid function keys for the Report Display Facility are the following.
Key Function
F1 (Help) Display the Help panel for the Report Display panel.
F2 (Keys) Toggle the display of the functions keys on or off, depending
on the current setting.
F3 (Exit) Terminate the display of the report (more reports may
follow). Same as F12 (Cancel).
F5 (Refresh) Discard any requests or changes to the current panel, and
redisplay the panel.
F6 (Print) Send the current report to the default output destination as set
up by your system administrator in the Site Options Table.
F7 (Backward) Scroll the report backward by the amount specified in the
Scroll field.
F8 (Forward) Scroll the report forward by the amount specified in the
Scroll field.
F10 (Prev) Scroll the report backward to the previous top of page.
F11 (Next) Scroll the report forward to the next top of page.
F12 (Cancel) Terminate the display of the report (more reports may
follow). Same as F3 (Exit).
F19 (Left) Move the report to the left by the amount specified in the
Scroll field.
F20 (Right) Move the report to the right by the amount specified in the
Scroll field.
F22 (Top) Scroll the report backward to the top of the report.
F23 (Bottom) Scroll the report forward to the bottom of the report.
Commands
The commands supported by the Report Display Facility are listed below. Command formats show the full spelling of
each command and its operands. You need only type enough of the command to make it or its operands unique. You enter
commands after Command ===> at the top of the panel.
Backward nnnn page half max csr/cursor
The backward command scrolls the amount you specify toward the top of the report (backwards).
• nnnn
Moves the report backward nnnn lines.
• Page
Moves the report backward a page, that is, the number of report lines displayed on the panel.
• Half
Moves the report backward half the number of report lines displayed on the panel.
• Max
CA Easytrieve® Report Generator 11.6
If you do not specify a scroll amount, the amount displayed in the Scroll field is used.
You can use F8 in place of the forward command.
Help
Help displays the help panel for Report Display.
You can use F1 in place of the help command.
Keys on off
The keys command allows you to control the display of the function keys. On indicates that the keys are to be displayed. Off
indicates that the keys are not to be displayed. If no operand is specified, the current setting is toggled from off to on or from
on to off.
Left nnnn page half max csr/cursor
The left command scrolls the amount you specify toward the left of the report.
If you do not specify a scroll amount, the amount displayed in the Scroll field is used.
You can use F19 in place of the left command.
Next nnnn
The next command scrolls the report forward so that the next top of page in the report is positioned at the top. Use nnnn to
specify the number of report pages to be scrolled.
You can use F11 in place of the next command.
Paneid on off
The panelid command controls the display of the panel identifier in the title line. On indicates that the panel identifier is to be
displayed. Off indicates that the panel identifier is not to be displayed. If no operand is used, the current setting is toggled from
off to on or from on to off.
Prev nnnn
The prev command scrolls the report backward so that the previous top of page in the report is positioned at the top.
Use nnnn to specify the number of report pages to be scrolled.
You can use F11 in place of the prev command.
Print
The print command sends the report to the default output destination as set up by your system administrator in the Site Options
Table.
You can use F6 in place of the print command.
Refresh
The refresh command discards any requests or changes to the current screen and redisplays the screen.
You can use F5 in place of the refresh command.
Right nnnn page half max csr cursor
The right command scrolls the amount you specify toward the right of the report.
If you do not specify a scroll amount, the amount displayed in the Scroll field is used.
You can use F20 in place of the right command.
Top
The top command moves to the top of the report.
You can use F22 in place of the top command.
The following highlights some of the information presented in the previous report:
• EZABX000
Identifies the name of the program that abended as specified in the PROGRAM statement. If no PROGRAM statement is
coded or there is no program name on the PROGRAM statement, the name is taken from the PARM LINK parameter. If no
PARM LINK parameter is specified, the name is taken from the command line.
This message also instructs the viewer of the report to contact the party responsible for the application. Remember, the
viewer of the abnormal termination can be the end user of the application. Make each user aware of the procedures to
follow if this report displays.
• EZEIP003
Identifies the error that caused the abend. This message can be different, depending on the type of abend.
• EZEIP992
Identifies the PCODE executing when the abend occurred. This information might be required if you contact CA Support.
• EZABX008
Identifies the number of the statement executing when the abend occurred. The statement number can be different than the
source line number. See the compiler listing to identify the correct statement.
• EZABX016
Displays the flow table. If the FLOW option is in effect when an abnormal termination occurs, CA Easytrieve® Report
Generator prints a formatted list consisting of statement numbers beginning with the most recently executed statements.
• EZABX020
Lists the active files and pertinent information at the time of the abend.
CA Easytrieve® Report Generator 11.6
CGI Programming
CGI (Common Gateway Interface) programs are executed on a web server. CGI programs usually perform a task, for example,
a search or storing information on the server and normally generate a dynamic HTML page in response to a request.
You can write CGI programs using CA Easytrieve® Report Generator. Your program can accept the parameters passed from
the web browser and use extended reporting to create output in HTML format.
You should have a basic working knowledge of HTML (Hypertext Markup Language), the language used to create web pages,
before trying to use CA Easytrieve® Report Generator to create CGI programs. The following are examples of how you can
use CA Easytrieve® Report Generator as a tool in your CGI programming.
Making a CGI Application
To use CA Easytrieve® Report Generator as a CGI application, you must add an entry to the web server applications list so
that the server can map the file extension of your P-Code files to an executable file that the server can run. The following
example shows how to set up CA Easytrieve® Report Generator as a web server application using Microsoft Internet
Information Services (IIS):
1. Open the properties for the web site and select the Home Directory tab.
The Default Web Site Properties dialog appears.
2. Click Configuration, and then click Add to create a new mapping.
3. Enter the fully-qualified path of the CA Easytrieve® Report Generator P-Code Interpreter (ezterp.exe) as the Executable in
the following format:
[path-name]\ezterp.exe %s %s
The Browser FILE allows the program to display output in the web browser. When you enter http://myserver.com/echo.pco?
Hello in the address field of your web browser, the following appears in the web browser window:
To make a web page invoke the echo program, enter the following HTML:
This displays Say Hello as a hyperlink in your web page. When you click the hyperlink, the HTML invokes the echo.pco file,
which passes the literal Hello.
Form Input
Input to a CGI program comes from a user's response to a web page. The web page can contain a form that has edit controls
of fields. Each field is assigned a name and a value. The following is an example of a simple form that accepts an employee
number as input:
When this form sends information to a server CGI program, EmployeeNo would be a variable name and the value would be
whatever the user types in the edit box. A form has two methods for sending information to a CGI program: GET and POST.
The HTML for this web page contains a FORM tag, which indicates what type the page is (method=GET) and which CGI
program to run on the server (action="lookup.pco").
GET Versus POST
A GET provides the user's input to the CGI program as an environment variable called QUERY_STRING. The CGI program
reads this environment variable (using the C getenv() function) and parses it to get the user's input. A GET method also
shows the input data to the user in the URL area of the browser, showing a string like www.somewhere.com/lookup.pco?
EmployeeNo=12345. The GET method is acceptable for small amounts of data and is the default method when a CGI program
is run through a link.
A POST provides the user's input to the CGI program as if it was typed at the keyboard, using the standard input device or
stdin. This section discusses the GET method only.
CA Easytrieve® Report Generator does not have a built-in function to return an environment variable; therefore, you must
code a small C program to return the value and length. The following is an example:
#include <stdio.h>
declspec(dllexport)
int getdata(char *pszOutstr)
{
char *pszEnvdata;
pszEnvdata = (char *)getenv("QUERY_STRING");
if (!pszEnvdata) {
pszOutstr = strcpy("no data");
return (0);
}
else {
strcpy(pszOutstr, pszEnvdata);
}
return(strlen(pszOutstr));
CA Easytrieve® Report Generator 11.6
You can make this C program into a Windows DLL with the following commands:
cl - c getdata.c
link /DLL /OUT:getdata.dll getdata.obj
EmployeeName=Smith%2C+John
<html>
<head>
CA Easytrieve® Report Generator 11.6
<title>Find Employee</title>
</head>
<body>
<form action="lookup.pco" method="GET">
Employee #: <input type="text" name="EmployeeNo" />
<input type="submit">
</form>
</body>
</html>
The following is the CA Easytrieve® Report Generator program, which is compiled into lookup.pco. An explanation of the
program follows the source code.
THE PERSNL FILE statement defines the PERSNL table and its columns are defined using the SQL INCLUDE catalog
interface. The default edit masks of two columns are then overridden.
DECLARE the external getdata subroutine as dynamic.
Working-storage fields are defined to accept the parameters received. The fields are defined to enable access to the five-digit
numeric employee number in the received string: 'EmployeeNo=nnnnn'.
The program first calls the getdata C subroutine shown previously, which accepts the QUERY_STRING environment variable
and passes it back in the PARMS field. The result is edited for validity before the result set is selected and fetched. If the
employee is found, the program executes a JOB activity to display the employee's name and social security number in the
browser.
Advanced Parsing
As discussed previously, the input received by the CGI program must be parsed. Be aware of the following:
• All field values appear combined as one long string.
• Each value is actually a paired value: "fieldname=fieldvalue"
• Multiple field-value pairs are separated by an & character
• All spaces are converted to a + character
• Special characters (like \n) are converted to a %, followed by the ASCII code for the character
When parsed, it is usually convenient to store the input parameters in an array of strings. You would probably want a function
to search the stored parameters to retrieve their values. A table file makes an excellent mechanism. The following program
illustrates these concepts.
The PROGRAM activity retrieves the value of the QUERY_STRING environment variable using the getdata C routine. It then
executes the LOAD-TABLE JOB activity, which parses the resulting string into words. An ampersand (&) delimits a field-
value pair. An equal sign (=) delimits the field name from the field value. A plus sign (+) is converted into a space. A percent
sign (%) signifies the next two characters are an ASCII code requiring translation. In the following case, a comma is translated.
This parsing handles a string such as "Num=31&Player=Maddux, Greg".
When a table argument and description are parsed, the entry is written to a virtual file.
The PROGRAM activity then executes a SORT activity to ensure the correct order for searching. The virtual file is sorted and
written to a file, which can then be searched for the expected fields. The resulting record is then inserted into the database.
STOP
WRITE-ENTRY. PROC
VPARMS:descword = word
word-indx = 0
MOVE SPACES TO word
PUT VPARMS
END-PROC
SORT VPARMS TO VPARMS USING argword NAME SORT-TABLE
etaltseq -b -l >eztpaqtt.def</dev/null
Windows:
CA Easytrieve® Report Generator 11.6
etaltseq -b -l >eztpaqtt.def</nul
This command invokes the etaltseq utility that builds a default alternate collating sequence table called EZTPAQTT. It also
produces a file, eztpaqtt.def, which contains a listing of the alternate sequence table. You can edit this file to update the
alternate sequence table.
2. Edit and update eztpaqtt.def.
3. Update the table by typing the following command on the command line:
etaltseq -b <eztpaqtt.def
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0x00010203 0x04050607 0x08090A0B 0x0C0D0E0F // 0
0x10111213 0x14151617 0x18191A1B 0x1C1D1E1F // 1
0x20212223 0x24252627 0x28292A2B 0x2C2D2E2F // 2
0x30313233 0x34353637 0x38393A3B 0x3C3D3E3F // 3
0x40414243 0x44454647 0x48494A4B 0x4C4D4E4F // 4
0x50515253 0x54555657 0x58595A5B 0x5C5D5E5F // 5
0x60616263 0x64656667 0x68696A6B 0x6C6D6E6F // 6
0x70717273 0x74757677 0x78797A7B 0x7C7D7E7F // 7
0x80818283 0x84858687 0x88898A8B 0x8C8D8E8F // 8
0x90919293 0x94959697 0x98999A9B 0x9C9D9E9F // 9
0xA0A1A2A3 0xA4A5A6A7 0xA8A9AAAB 0xACADAEAF // A
0xB0B1B2B3 0xB4B5B6B7 0xB8B9BABB 0xBCBDBEBF // B
0xC0C1C2C3 0xC4C5C6C7 0xC8C9CACB 0xCCCDCECF // C
0xD0D1D2D3 0xD4D5D6D7 0xD8D9DADB 0xDCDDDEDF // D
0xE0E1E2E3 0xE4E5E6E7 0xE8E9EAEB 0xECEDEEEF // E
0xF0F1F2F3 0xF4F5F6F7 0xF8F9FAFB 0xFCFDFEFF // F
CA Easytrieve® Report Generator 11.6
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
The table consists of 256 values from 0 to 255 displayed in hexadecimal. The value at each position remaps the position to a
new collating value.
Edit this table to change the sequence. Spaces serve as delimiters but are otherwise not important. A double slash (//) begins a
comment. Comments terminate at the end of the line.
The syntax rules for updating etaltseq are as follows:
Value Description
table_spec ::= character_spec table_spec
character_spec ::= [reposition_order] collating_values
reposition_order ::= ( literal )
collating_values ::= char_string | hex_string | octal_string | literal
literal ::= character_literal | hex_literal | octal_literal |
decimal_literal
char_string A sequence of characters that are surrounded by double
quotes. Use the escape sequences listed for character_literal.
hex_string 0x prefixing multiple pairs of hex digits
octal_string 0 prefixing multiple triples of octal digits
character_literal A character that is surrounded by single quotes. Use \ as an
escape character. \a, \b, \f, \n, \r, \t, \v, \\\?, \', \", \ooo for
octal, \xhh for hex.
hex_literal 0x prefixing a pair of hex digits.
( 0..9, a..f, A..F )
When you create a table, the table is initialized to collate every character as itself.
Collating_values specify either a single collating value or a sequence of values. The first value affects the character at the
current position, then increments the current position. The next value affects the character at the new current position, then
increments the current position.
The current position begins at 0x00. Reposition_orders change the current position. Collating_values use the current position
to determine which character they affect.
Example One
If you want ASCII 0 through 9 to collate as an EBCDIC 0 through 9, make the following changes:
The original line looks like:
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
.
.
.
0x30313233 0x34353637 0x38393A3B 0x3C3D3E3F // 3
.
.
.
CA Easytrieve® Report Generator 11.6
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
.
.
.
0xF0F1F2F3 0xF4F5F6F7 0xF8F93A3B 0x3C3D3E3F // 3
.
.
.
Example Two
In the following code, ( 'a' ) is a reposition-order that sets the current position to 'a'. "ABCDEFG" is a collating-values string
that makes 'a' through 'g' collate as if they were 'A' through 'G'.
( 'a' ) "ABCDEFG"
Extended Reporting
This article assumes you are familiar with the CA Easytrieve® Report Generator language and understand basic data
programming concepts.
Contents
Here we introduce the major components of the reporting environment and explains the report printer definition language and
command language; this will help you use the Extended Reporting environment to produce reports on printer devices or files
without being concerned with environment and device specific characteristics in printing operations.
Note that reports written to files can be used with special browsers rather than actual printer devices. You can use Extended
Reporting to create specially formatted file outputs, such as HTML and RTF. Therefore, the term printer in the context of
Extended Reporting can mean either a printer device or file output.
Environment Overview
Printer definition and report printing are the two major processes of the reporting environment. These two processes are
illustrated in the following diagram:
CA Easytrieve® Report Generator 11.6
Printer Support
CA Easytrieve® Report Generator 11.6
The Reporting Environment supports a variety of printers. Each printer has its own characteristics, especially with respect
to the identification of the font, the presentation of print records, and the distinction between character sets. To support each
printer's characteristics, a printer set definition module is used. This module defines the type of printer supported and the font
codes that a program supports.
A default printer set definition module (eztxrpsd) is provided as part of a normal installation. Sample definitions for HTML
and RTF are provided in Configuration Manager.
Printing Concepts
This article introduces you to some of the concepts used in printing reports.
This article introduces you to some of the concepts used in printing reports.
Note:
For more detailed information, see Printer Characteristics and Font Characteristics.
This article includes the following information:
Terminology
This section defines the terminology used throughout this section. It is important that you thoroughly understand these terms
before reading the later sections in this section.
• Font
A font is an assortment of character images belonging to one data format. Fonts have one size, shape, style, and design.
A font defines all of the information necessary to create character images of that font on a specific printer. This information
includes the characteristics of the font to format a report (such as height and width). It also includes the printer control
codes that specific printers require for output records that use the font.
If any of this information changes between two character images, the two characters belong to different fonts.
• Proportional Spaced Fonts
A proportional spaced font is a font in which each character occupies a different amount of horizontal spacing. This can
reduce the amount of white space between characters. For example, the letter i occupies less horizontal space than the letter
w. Proportional spaced fonts are commonly used in books and regular reading material. The Reporting Environment does
not support proportional spaced fonts.
• Fixed Space Fonts
A fixed space font is a font in which each character occupies the same amount of horizontal spacing. This can cause more
white space to appear between characters. For example, the letter i will occupy the same horizontal space as the letter w.
With fixed space fonts, each character is aligned up and down the page in a vertical line. Most computer reports use fixed
space fonts. The Reporting Environment supports fixed space fonts.
• Characters Per Inch
Characters per inch (CPI) refers to the number of fixed space characters that can fit in one horizontal inch.
• Pitch
Pitch means the same as characters per inch (as discussed earlier).
• Lines Per Inch
Lines per inch (LPI) refers to the number of printed lines that can fit in one vertical inch.
• Unit of Measure
Prior to the Reporting Environment, when processing printed text, each character is to be printed using the same font. This
means that each character has the same height and width. Furthermore, it means that each print item (field or literal) on a
print line occupied an amount of horizontal space that is directly proportional to the number of characters in that print item.
All the calculations that determined the positioning of print items on a print line did not need to take into consideration the
size characteristic of the font being used to print that particular item. The size is assumed to be fixed.
This methodology is still used when using one font for a report. With the Reporting Environment, you can use multiple
fonts in the same report where each font can have a different height or width. As a result, a print item now occupies an
amount of vertical space equal to the height characteristic of the font and an amount of horizontal space (equal to the
number of characters in the item multiplied by the width characteristic of the font).
The Reporting Environment must position items on a print line using both the size of the print item and the size of the font
associated with that print item. To perform this, we must define the size characteristic of each font as a multiple of a unit of
measure that is standard for all the fonts in a given printer.
The specific unit of measure assigned to a particular printer is of no consequence for the reporting mechanism. What is
important is that the sizes of all fonts assigned to a particular printer be defined in terms of the selected unit of measure.
Sample units of measure include points, dots, and PELs.
• Points
CA Easytrieve® Report Generator 11.6
Points are a linear unit of measurement normally associated with the width (or height) of typefaces. A point is
approximately equal to 72 dots per inch.
• Dots
A dot is the fundamental unit of imaging and digitization for electro-photographic printers. The size of a dot varies
depending upon the resolution of the printer. The resolution is normally expressed as the number of dots per inch. The
larger the number of dots, the higher the resolution quality of the printer. For example, the Xerox 8700 and Xerox 9700
support 300 dots per inch; the MELCOM 8290, IBM 3200, and HITACHI 8196 support 240 dots per inch; the TORAY
8500 supports 140 dots per inch.
• PELs
A PEL (picture element) is the IBM term used to refer to the fundamental unit of imaging on the IBM 3800 printing
systems. A PEL is the same as a dot, but it is also used as the addressable unit for "All Points Addressable" printing on the
3800 Model III and VIII, and the 3820. For these printers, 240 PELs per inch are supported.
Usually, any one of the units of measure can give the same results. The following diagram illustrates this:
actual unit of measure selected (such as points, dots, and PELs), a number of H-units and a number of W-units define a
font.
Using these base units, this section discusses the meaning of the size of a font. The Reporting Environment must know the
characteristics of a font to accurately determine the positioning of print items on a line or page. The definition of the size of
a font is expressed as the height and width of the character cell assigned to the font.
• Character Cell
Each fixed pitch font is associated with a character cell. The Character Cell defines the area required to encompass the
images of the characters of a particular font. The following diagram illustrates that the height and width of a character cell
is not always the same as the height and width of the actual character image. The reason is that the character cell includes
any additional vertical and horizontal spacing required to encompass images of the font's characters.
• Downward Adjustment
For Downward Vertical Adjustment, the bottom of the character cell is actually positioned below the baseline. To support
this adjustment, you must calculate the height of the font as the character cell's height minus the vertical adjustment. This
defines the correct height that the Reporting Environment requires. It is then your responsibility to ensure that the next
baseline is vertically displaced a sufficient amount to allow room for the portions of characters that prints below the current
baseline.
For example, assume that a font normally prints with a height of 12 points. If you defined this font in such a manner that
the printer performed a downward adjustment of 4 points, then you would have to define the height of the font as 8. You
define the height of the font on the FONT specification. For more detailed information see Font Characteristics.
• Width
A font's width is the amount of horizontal space (in W-units) that a printed character occupies. This means that the width of
the font (in W-units) is the width of the character cell associated with the font. The Reporting Environment supports only
fixed pitched fonts in which all of a font's character patterns occupy the same horizontal or lateral space. Some printers
support special horizontal adjustment functions that you can use to expand the horizontal size of a character or squeeze the
character. If you select either of these options, the width of the font that these function codes identify must incorporate the
horizontal adjustment factors.
For example, assume that a font normally prints with a width of 12 points. If you defined this font in such a manner that the
printer performed an expansion of 4 points, then you would have to define the width of the font as 16. You define the width
of the font on the FONT specification. For more detailed information see Font Characteristics.
• Print Records
In terms of the Reporting Environment, a print record is the base unit for a print output request. After a record is built, it is
output to the print data set.
Standard reporting associates the production of one print line with the output of one print record. This is appropriate for
basic printing on Line Printers.
With the Reporting Environment, the production of one print line is no longer associated with the output of one print
record. This is because some printers do not allow you to mix print items from different fonts on the one print line.
Multiple print records must be output by the Reporting Environment and the printer combines these records to form a
single print line.
Print records that the Reporting Environment builds have four components:
• Paper Control Codes (PCC)
• Overprint Codes
• Function Codes
• Print Data.
• Paper Control Code (PCC) - Carriage Control
At the start of each print record is a control field that defines the required vertical movement that occurs before printing the
text that follows. If you are combining multiple print records to form a single print line, then the first print record contains
the carriage control information that specifies the start of a new line. Additional print records for the same logical print line
would use a SKIP 0 carriage control.
• Overprint Code
This control field follows the PCC. Printers that output multiple print records to form a single print line use this control
field. It indicates the characteristics of the font(s) that this particular print record uses. Multiple print records destined for
the same print line would use different overprint codes to output text using different fonts.
Not all printers require overprint codes. Therefore, they will only be incorporated into print records when the assigned
printer requires them.
Overprint Codes are called Table Recognition Codes (TRC) on IBM printers that support multiple fonts while running in
Line Compatibility mode.
• Function Codes
Printers that require one print record to support the printing of multiple fonts on the same print line process print records as
a combination of two data types:
• Text
• Control information
The text is that portion of the print record that is to actually appear on the printed page.
Function Codes consist of control information that instructs the printer how to process the text. To perform this:
• Define the type of font
• Size of the characters
• Data type (single or double byte data)
• Special operations (such as repeating a character and underlining text)
CA Easytrieve® Report Generator 11.6
The Reporting Environment processes function codes before data (Header Function Codes), or after data (Trailer Function
Codes). When you use the font to which function codes are assigned, the Reporting Environment combines the appropriate
function codes with the item in the print data.
• Print Data
Print Data refers to the actual text or data that appears on the report.
Printer Types
This section describes the printer types that the Reporting Environment uses to generate the correct print data set for the
appropriate printer. There are three types of printer characteristics that the Reporting Environment supports:
• Printer Type -- defines the method used to build print records and how different fonts are combined onto the same print
line.
• Paper Control Code -- identifies the method used to control vertical positioning on a page.
• File Type -- defines the attributes of the print data set that the Reporting Environment creates as it outputs print records.
Printer Type
The printers that the Reporting Environment supports use different techniques to identify fonts and print items in a print
record. The seven categories of printers that the Reporting Environment supports are displayed in the following diagram.
CA Easytrieve® Report Generator 11.6
Basic Printing
CA Easytrieve® Report Generator 11.6
A printer in its simplest form will take a line of input data and display that data on the paper in the printer. It will then take
another line of data and then display that data on the next line of the printer. Repeating this process, eventually, all of the input
data is displayed by the printer. Input to a printer can be either blocked or unblocked.
Print Data
A basic print record follows:
In addition to the previous control characters, a printed report could be associated with a specific form and that form could
have data that must be displayed on a specific line on the form. When this situation arises, a Forms Control Block (FCB) could
be used. An FCB associates Channel Skips with a particular output line. The channel skip is specified as a control character
like the ANSI carriage controls discussed earlier.
A channel skip is one of eleven codes (C'2', C'3', C'4', C'5', C'6', C'7', C'8', C'9', C'A', C'B', C'C') given to the printer. Exactly
what line the data is displayed on is coded in the FCB. The name of the FCB to be used is given in JCL for the job execution.
Channel skips are often referred to by their printer codes. For example, a channel 2 skip would have a C'2' in the control
character, regardless of what line it actually prints on. The channel skips of C'A', C'B', and C'C' are often referred to as channel
10, channel 11, and channel 12 skips.
Machine Characters
Some printers can be driven using print Machine Control Characters. These characters are similar in concept to ANSI print
control characters. The following table shows a small sampling of the machine print control characters that are available.
The complete set of machine print control characters can be found in the manufacturers printer manuals.
HEX Action
X'0B' Space 1 line, then print the data.
X'09' Print the data, then space 1 line.
X'03' Print the data. Do not space before or after printing.
X'8B' Skip to channel 1, then print the data.
X'89' Print the data, then skip to channel 1.
Some printers have the ability to use multiple fonts in a single report. This is accomplished through an overprint code. This
overprint code should not be confused with an overprint print control character (as discussed earlier). An overprint code is
often referred to as a TRC character.
The overprint code immediately precedes the print data in the output record. While the print control character tells the printer
which line to place the data on, the overprint code tells the printer which font to use to print this data. When used with an
overprint print carriage control character, multiple fonts can be used on a single print line.
The printing system must be told about the presence of the overprint code. This is accomplished by the following IBM MVS/
JCL statement:
//ddname DD ...,DCB=OPTCD=J
// SETPRT SYSxxx,TRC=Y
Print Data
The format of print data that contains an overprint code is illustrated below:
Overprint Techniques
The two techniques that the Reporting Environment supports for overprinting multiple print records to form a single print line
are:
• Merge Overprint
The Merge Overprint technique merges the print records by character position in the print record
• Print Overprint
The Print Overprint technique combines the print records by their physical position in the final print line. The results of the
print overprint technique are similar to those obtained when overprinting on an impact line printer.
The printer hardware defines the technique that should be used. The Reporting Environment automatically compensates for the
characteristics of the appropriate technique that the printer uses.
Merge Overprint
When merging multiple print records into a single print line, the merge process combines the data on a character-by-character
basis. The twelfth character in a print record, for example, merges with the twelfth character in another print record. This
happens regardless of where those characters must otherwise appear (as a result of differences in character width) on the print
line.
The rules that the printer uses to merge print records (of the same or different font widths) into one print line are:
• A printable character in a following record replaces an identical character or a blank.
• A blank in a following record does not replace either a blank or a printable character.
CA Easytrieve® Report Generator 11.6
• A printable character trying to replace a previous printable character different from itself results in a data check, and the
character in the new record does not replace the character in the previous record.
• When merging blanks of different W-units, the resulting blank has the W-unit of the first one.
• When a printable character is merged with a blank, the resulting character has the W-units of the printable character.
To illustrate this process, assume that three print records are being merged and the W-units are in points. The first record
contains 7 point characters, the second contains 12 point characters, and the third contains 9 point characters. Each print record
contains four characters (three blanks and one printable character). The following diagram illustrates the three print records
and the resulting print line.
Print Overprint
The Print Overprint technique overprints print records the same as does a normal impact line printer. The printer develops the
image (or images) each print record independent of any other print record for the same line. It is the imaged or physical lines
that are combined. With this technique you can have one character from one print record overlay another character because the
physical images of the two records occupy the same position on the line.
To illustrate this technique, the same three records that demonstrate the merge process are used. Therefore, 7, 12, and 9 point
print records are used. As the following diagram demonstrates, the independent imaging of the three records results in an
overlap of character boundaries. For example, the character from the first record is overprinted by the character on the second
imaged record because they occupy the same physical space on the print line. In addition, there is a 3 point gap between the
character on the third imaged record and the 12 point character on the second imaged record.
CA Easytrieve® Report Generator 11.6
The following diagram uses the same 7, 12, and 9 point print records to illustrate the format of the print records that do not
cause overlaying of characters. The reason is that the print records have been built compensating for the attributes of the print
overprint technique.
Notice that the first record requires four blanks in front of the printable character. When imaged, the four blanks of 7 points
each give 28 points of lateral spacing in front of the character, thus positioning the character to the right of the second
character. Not only must the Reporting Environment take this additional spacing into account when building the print records,
but it also must compensate for the gaps that appear between characters. For example, the 3 point gap between the 9 and the 12
point character and the 4 point gap between the 12 and the 7 point character.
Function Codes
As opposed to using overprint codes, some printers require a sequence of Function Codes to define the control information to
the printer. The control information is used to define the type of data font, and so on. One implementation of function codes is
the ESCAPE sequences used by PC printers.
Function codes are not limited to one code per print record like overprint codes are. For more information about the font
header and trailer specifications, see Using the Configuration Manager.
Print Data
The format of print data that contains function codes is illustrated below:
Figure 20: Format of Print Data with Overprint and Function Codes
Limitations
When placing items on a page, alignment is limited to a combination of the available fonts. The reason is that the Reporting
Environment cannot line up a given item in a particular column. When this occurs, the alignment is slightly to the right so any
previous data will not be overlaid.
Conversion Aids
This section contains conversion tables for IBM 3800 and Xerox printers.
IBM 3800 Printers
The IBM 3800 family of printers produces output with 240 dots (PELs) per inch resolution. The following conversion aids
should be used when working with IBM printers:
72/points = pitch
72/pitch = points
The height of a line cannot be controlled in Line Compatibility mode. It is controlled by the font itself and the FCB specified
on the JCL statement.
XEROX Printers
The XEROX 8700 and 9700 printers produce output with 300 dots per inch resolution. The following conversion aids should
be used when working with XEROX printers:
30 10
22 13.6
20 15
300/dots = pitch
300/pitch = dots
300/dots = lpi
300/lpi = dots
Page Printers
The Reporting Environment does not currently support Page Mode or "All Points Addressable" (APA) printers.
Printer Characteristics
This article explains the printer characteristics that uses to generate the correct print data set for the
appropriate extended reporting printer. The three types of printer characteristics are:
This article explains the printer characteristics that CA Easytrieve® Report Generator uses to generate the correct print data set
for the appropriate extended reporting printer. The three types of printer characteristics are:
Printer Type
CA Easytrieve® Report Generator 11.6
The printer type defines the method that is used to build print records and defines how different fonts are combined onto the
same print line. The supported printers use different techniques to identify fonts and print items within a print record. The six
categories of printers that CA Easytrieve supports are shown in the following diagram.
Note: CA Easytrieve does not currently support page printers (category 1).
Page Printers
CA Easytrieve® Report Generator 11.6
In contrast to line mode devices, which associate one print record with one print line, page printers are devices that process a
data stream containing printer commands and print data.
Note: CA Easytrieve does not currently support page printers.
Line Mode
Line mode printers support print data sets whose print records contain data and control information particular to a line. Line
mode printers restrict control of mapping print items to a page allowing only the positioning of items along the current line. At
the start of each print record, carriage control codes control the vertical position on a page.
Line printers can be further divided into six more finite classifications that are based on their ability to support overprint and
function codes in the print record.
Overprint Codes
Printers that support only one font per print record use overprint codes. Therefore to combine more than one font on a print
line CA Easytrieve must build multiple print records. However, a print item is only output on the print record whose overprint
code matches the overprint code of that print item font. Line spacing occurs before the first print record. Each additional print
record overprints the first. The printer then merges all the print records to form one print line. CA Easytrieve uses two methods
of merging print records depending on the extended reporting printer characteristics. The two methods are merge overprint and
print overprint. This article explains both of these overprint methods.
The overprint feature is a function of the printer hardware. For both overprint techniques, CA Easytrieve generates multiple
print records containing the required data and printer control codes. However the layout of the data in the print records that CA
Easytrieve produces for each overprint technique must be different for the print items on the report to line up properly. This
becomes evident upon examining the different techniques.
The following diagram illustrates the overall structure of the print records built for printers that support overprint codes.
Figure 22: Structure of the Print Records Built for Printers that Support Overprint Codes
Function Codes
Printers that support both control and print data in the same print record use function codes. Printer manufacturers assign
the control information special values (function codes) that identify it from the normal print data. The printer does not print
function codes on the report but uses them to define the function that is to be performed. A function code defines the format of
the data (EBCDIC or DBCS), the size of the characters, and so on.
The following diagram illustrates the structure of print records that are supported by function code printers:
CA Easytrieve® Report Generator 11.6
Overprint Techniques
Merge overprint and print overprint are two supported techniques for overprinting multiple print records to form a single print
line. The printer hardware defines the technique that is used. The characteristics of the appropriate technique that the extended
reporting printer uses are automatically compensated for.
Merge overprint merges the print records by character position in the print record.
Print overprint combines the print records by their physical position in the final print line. The results of the print overprint
technique are similar to those obtained when overprinting on an impact line printer.
Merge Overprint
When merging multiple print records into a single print line, the merge process combines the data on a character by character
basis. For example, the 12th character in a print record merges with the 12th character in another print record. This happens
CA Easytrieve® Report Generator 11.6
regardless of where those characters might otherwise appear on the print line (as a result of differences in character width). The
rules that the printer uses to merge print records of the same or different font widths into one print line are:
• A printable character in a following record replaces an identical character or a blank.
• A blank in a following record does not replace either a blank or a printable character.
• A printable character trying to replace a previous printable character different from itself results in a data check, and the
character in the new record does not replace the character in the previous record.
• When merging blanks of different W-units, the resulting blank has the W-unit of the first one.
• When a printable character is merged with a blank, the resulting character has the W-units of the printable character.
To illustrate this process, assume that three print records are being merged and the W-units are in points. The first record
contains 7 point characters, the second contains 12 point characters, and the third contains 9 point characters. Each print record
contains four characters (three blanks and one printable character in each case). The following diagram illustrates the three
print records and the resulting print line.
Print Overprint
The print overprint technique overprints print records the same as does a normal impact line printer. The printer develops the
image (or images) of each print record independent of any other print record for the same line. The imaged or physical lines
are combined. With this technique you can have one character from one print record overlay another character because the
physical images of the two records occupy the same position on the line.
To illustrate this technique, the same three records that demonstrate the merge process are used. That is, 7, 12, and 9 point print
records. As the following diagram illustrates, the independent imaging of the three records results in an overlap of character
boundaries.
CA Easytrieve® Report Generator 11.6
For example, the character from the first record is overprinted by the character on the second imaged record because they
occupy the same physical space on the print line. In addition, there will be a three point gap between the character on the third
imaged record and the 12 point character on the second imaged record.
Figure 27: Data Format prior Combination onto Single Print Line
CA Easytrieve® Report Generator 11.6
To overcome the problem of characters overlaying one another, CA Easytrieve must build the print records to provide the
necessary spacing to separate the characters in the different print records. Each print record must provide sufficient spacing
characters so that when the record is imaged, the characters on the physical lines will not overlay each other. CA Easytrieve
automatically compensates for this characteristic.
The following diagram uses the same 7, 12, and 9 point print records to illustrate the format of the print records that do not
cause overlaying of characters. In this case, the print records have been built compensating for the attributes of the print
overprint technique. Notice here that the first record requires four blanks in front of the printable character.
When imaged, the four blanks of 7 points each give 28 points of lateral spacing in front of the character, thus positioning the
character to the right of the second character. CA Easytrieve must consider this additional spacing when building the print
records and must also compensate for the gaps that appear between characters. For example, the 3 point gap between the 9 and
the 12 point character, and the 4 point gap between the 12 and the 7 point character.
Page Printers
Page printers use structured fields to support "All Points Addressable" printing.
Note: CA Easytrieve currently does not support page printers.
Line Mode
When using a printer that processes print records corresponding to print lines, CA Easytrieve uses the paper control code to
define the vertical positioning to be performed before printing a print record. The paper control code is positioned at the start
of each print record. The extended reporting facility supports these four paper control codes:
• ANSI Carriage Control plus a Forms Control Block
• Machine Carriage Control Codes plus a Forms Control Block
• ANSI Carriage Control with no Forms Control Block
• Point Skip vertical spacing control
ANSI Carriage Control with a Forms Control Block
This form of line mode carriage control indicates that the extended reporting printer supports a Forms Control Block and that
print records can use ANSI carriage control codes for paper control. When using an FCB, values in the FCB define the line
spacing that the printer is to use. A print record then provides the appropriate ANSI code for skipping the appropriate number
of lines. The printer determines the vertical spacing from the line sizes that are defined in the FCB.
Control over the paper is restricted to the ANSI codes. The values set in the FCB dictate the amount of space that is skipped for
any one line. The FCB parameter on the OS JCL DD or OUTPUT statement for the report data set specifies the FCB that any
extended reporting output uses. For DOS, the LST JCL statement defines the FCB.
CA Easytrieve® Report Generator 11.6
A line counter of a report output to an ANSI plus FCB printer is maintained by incrementing the line counter by the number of
lines that are skipped for a particular print record. Therefore the line counter indicates the number of lines that are processed
on the current page. This value does not indicate the vertical spacing in H-units. You could obtain this value by multiplying the
value of the line counter by the H-units for each printed line that is defined in the FCB.
Machine Carriage Control Codes with a Forms Control Block
This form of line mode carriage control is processed exactly like ANSI codes except that the value of the carriage control
codes are the machine code equivalents of the ANSI codes.
ANSI Carriage Control with No Forms Control Block
This printer supports ANSI codes but the height of each line is dependent upon the height of the tallest font in the current
line and the height of the tallest font in the previous line. The larger of these two values is the amount of vertical space that is
allocated to the current line. In other words, the height of the current line is determined by the height of the tallest font in use
in the previous line except when the height of the tallest font on the current line is greater. In this situation, the height of the
tallest font in use on the current line defines the height of the current line. Therefore, if printing fonts of different heights on
the same report, the height of each line on the report varies. Fonts of equal height result in equal spacing between lines on the
page.
For this category of printer, the ANSI carriage control characters are used but all line skipping is output using the font that
defines the printer default height (see the default size specification for a printer in Using the Configuration Manager). This
means that all blank lines print at the default height of the extended reporting printer.
Also, to ensure that the first line on any new page has the same displacement from the top of the form, a blank line is printed as
the last record before the top of form print record. This print record uses the font that defines the printer default height.
The line counter for a report on this type of printer is updated by maintaining the vertical positioning as a count of H-units. The
value of the line counter is determined by performing the following calculation:
The line counter value is always rounded up to give the maximum displacement down a page.
Point Skip Vertical Spacing Control
The printer uses a special function code to start a new line if the ANSI carriage control for vertical spacing is not supported.
The largest H-unit of the fonts that are defined to appear on the new print line determines the spacing between the baseline of
the current line and the baseline of the new line. The new line request can include vertical spacing in addition to the vertical
spacing generated by the new line request. This function is referred to as point skip processing.
CA Easytrieve performs the following steps to perform line feed operations:
1. Obtain the H-unit for the highest font to be printed on the line.
2. Using the H-unit that is defined as the base height for this extended reporting printer, the H-unit of the tallest font is
rounded up to a multiple of this base height. This gives the amount of vertical space that is assigned to this print line. The
value that the largest font H-unit was adjusted up is the value of the point skip operation. That is, all the print lines occupy a
vertical space amount that is a multiple of the base height.
3. By dividing the vertical space amount by the base height, CA Easytrieve obtains the amount that it adds to the line counter
for this line. Therefore the line counter is maintained as a multiple of the base height setting in the extended reporting
options module.
The skipping of blank lines is in multiples of the defined base height for the extended reporting printer. This means that a
request to skip one and then print a line containing 8 point characters where the base height is set to 9 point lines (eight lines
per inch), results in a point skip of 10 points (nine points for the blank line and one point for the adjustment to the print line to
round it up to a multiple of the base height).
CA Easytrieve® Report Generator 11.6
File Type
The file type defines the attributes of the print data set that CA Easytrieve creates as print records are output. Reports are
output to data sets. The product is not concerned with whether the data sets may be under the control of a spooling system, like
JES and POWER, or whether the data sets are normal disk and/or tape files that are not controlled by a spooling system. A data
set that CA Easytrieve builds as a result of printing operations using the Extended Reporting Facility must contain the records
in a format that the extended reporting printer supports. The format of this data set varies depending upon the printer you are
using.
For line mode printers, a print data set consists of three types of records. The following diagram illustrates these records:
CA Easytrieve® Report Generator 11.6
The format of a print data set defines the relationship between print records that CA Easytrieve builds and the physical records
that are output to the data set. The three formats for a print data set that the extended reporting facility supports are: unblocked
records, blocked records, and concatenated records. The following diagram illustrates the three formats:
Blocked Records
This file type supports logical records that are either fixed or variable in length. CA Easytrieve combines the records to form a
block.
CA Easytrieve builds variable length print records. Their size is the minimum that is required to contain the components
required to produce the print line. For print data sets that support variable length records, the length of the print record remains
the same. For files requiring fixed-length records, CA Easytrieve must pad the print record to fit into the defined record length.
The padding operation uses two attributes of the extended reporting printer that you must identify in the extended reporting
options module. A record-end string defines one or more control characters that delimit the print record. The report-pad string
defines one or more characters that begin immediately after the record-end and continues to the end of the record.
Unblocked Records
This file type is similar to the blocked records format except that each logical record is also a physical record.
CA Easytrieve builds variable length print records. Their size is the minimum that is required to contain the components
required to produce the print line. For print data sets supporting variable or undefined record lengths, The print record is output
using the length of the original print record. For fixed-length record print data sets, CA Easytrieve must pad the print record
to fit into the defined record length. The padding operation uses two attributes of the extended reporting printer that you must
identify in the extended reporting options module. A record-end string defines one or more control characters that delimit the
print record. The Report-Pad string defines one or more characters that begin immediately after the record-end and continues to
the end of the record.
Concatenated Records
CA Easytrieve® Report Generator 11.6
Externally, this file type looks like the unblocked file format. In contrast though, this file type concatenates logical records of
varying lengths into one long data stream of print records. Each time a print line is output, it concatenates the associated print
records onto the end of the file's current physical record. The physical record is output only when a print record does not fit
into the remainder of the file's physical record area. This process is similar to the building of a block consisting of variable
length records except with concatenated records, the four-byte RDW (Record Description Word) that contains the record
length is not added to the start of the record.
When a print record length exceeds the maximum record length of the print data set, a runtime error occurs.
For file types using variable and undefined record formats, the length of the output record equals the total of all the
concatenated print records that fit into the maximum physical record.
To support the fixed-length physical record (that is "F lrecl") with the concatenation option, the extended reporting options
module must identify a record-end and a record-pad string. Because CA Easytrieve generates print records that are variable in
length, there is no guarantee that each block ends at the end of the fixed-length physical record. Therefore, to fill out a block,
CA Easytrieve inserts a record-end string immediately after the last print record. CA Easytrieve adds the pad string to the end
of the physical record starting immediately after the record-end string.
This file format requires separate consideration with structured field printers and line mode printers.
Concatenated Records (Line Mode)
For line mode printers, CA Easytrieve concatenates output records except for file trailer records. For concatenated records, the
file trailer records are output at the start of their own physical record. The last physical record containing print records is output
before the print data set is closed. Then CA Easytrieve concatenates the file trailer records at the start of a new physical record.
This new record, once built and output, is the last one on the print data set. The following diagram illustrates this relationship
for Line Mode print data sets requiring concatenated records.
CA Easytrieve® Report Generator 11.6
Font Characteristics
In addition to defining the characteristics of the extended reporting printers, you also must define the
fonts that a program can use in a print line.
In addition to defining the characteristics of the extended reporting printers, you also must define the fonts that a program can
use in a print line.
Contents
In terms of this discussion, a font is a collection of graphic characters of a given typeface and size. You must define fonts in
the extended reporting printer set definition. Fonts are associated with an extended reporting printer and each one is given a
unique font identifier number (1 to 256).
CA Easytrieve® Report Generator 11.6
It is the font identifier that you code in a program to associate the characteristics of a font to a print item, such as a field or a
literal. Using these characteristics the Extended Reporting Facility is able to position the item correctly on the print line (using
the W-unit and H-unit assigned to the font) plus build the print record(s) to produce the correct results.
The following diagram illustrates the use of a CA Easytrieve® Report Generator font identifier:
CA Easytrieve® Report Generator automatically compensates for space replacement when it assigns fields to print positions
on a print line and when it determines the spacing between print items. However, CA Easytrieve® Report Generator cannot
directly control the occurrence of spaces in the fields or literals that it moves into print records. CA Easytrieve® Report
Generator assumes that each character in a print item is output at the same size; that size being defined by the width of the print
item's assigned font. CA Easytrieve® Report Generator prints the size of space characters in an overprint record as the size of
the space in the first record. The following diagram demonstrates this:
CA Easytrieve® Report Generator 11.6
is up to you to ensure that no other print items are positioned in the same area of those print lines that a Line Complex element
occupies. If this occurs, a syntax error results.
CA Easytrieve® Report Generator 11.6
To access your source control manager, use the Workbench File menu. The Source Control menu item has a submenu that
contains all of the Workbench Source Control functions.
Most typical source control functions are provided directly by individual menu items. These functions include:
• Selecting source control projects
• Managing files with the following commands:
• Get latest version
• Check out
• Check in
• Check undo
• Add to source control
• Remove from source control
• Generating common reports
• History report
• Difference report
• File properties report
For these common functions, the source control interface is independent of any particular product.
Depending on the product's capabilities, some functions may be disabled. For example, not all products allow you to remove
files from source control. In those cases, the Remove from Source Control menu item is disabled.
Options specific to the active source control manager can be accessed by clicking the Advanced button, which is present on
many of the common source control dialogs.
Source Control Manager
The Workbench also provides the ability to invoke the product's main application by selecting the File, Source Control,
Source Control Manager command. This command accesses the application as if you had selected it directly from Windows to
perform product-specific Source Control functions.
Use the Source Control Manager to perform any source control function that is not directly supported by the Source Control
menu. Typical functions, which are performed using the Product-Dependent Interface include:
• Creating and modifying source control projects
• Performing any source control maintenance not directly supported by the common interface
• Generating any reports not directly supported by the common interface
Create a Workbench Application
Once your source control projects have been defined, you can create your applications. An application retains the name of
the source control manager and the name of the selected project. When an application is opened, the related source control
manager and the previously selected project are also opened.
Note: Remember to save new applications when you close the application or exit the Workbench. Click Yes when prompted
to save the changes.
Add New Files to Source Control
Once you set up the source control project for your application, you can add files to the source control project.
Note: If you are an existing source control user and files have already been added to the source control system, you do not
need to perform this step.
• Utilities -- Describes CA Easytrieve Report Generator Workbench utilities.
• Sample Sessions -- Steps you through a typical development and test cycle using the PERSONEL sample application.
Sample Session
In this session, you will set up a source control project.
Prerequisites
Before you can perform any source control tasks, you must meet the prerequisites.
Follow these steps:
1. Install CA Easytrieve Report Generator in the Windows environment.
2. Install one or more source control managers:
CA Easytrieve® Report Generator 11.6
• Microsoft SourceSafe
• Merant PVCS
• CA SCM
3. Select an installed source control manager for your specific development project.
4. Perform administrative source control management tasks, such as:
• Adding users and groups to the development team
• Defining projects
You must do these tasks from within the source control manager.
5. Use CA Easytrieve Report Generator to create an application.
Once these tasks have been completed, you can set up a source control project and add files to it.
Select a Project
Follow these steps:
1. Start CA Easytrieve Report Generator Workbench.
2. From the File menu, point to Source Control, then choose Select Project.
The Create local project from (source control) dialog appears.
Note: This example uses SourceSafe. Other source control managers display appropriate dialogs.
3. Click Browse, then select the local folder you want to use for storing the project files.
4. Select the desired project in the source control section and click OK.
This makes the connection between the source control application and the local folder. In the example, files can be
transferred between the sample folder and the local EZTPGMS folder.
You can now access the files using the following commands on the File, Source Control menu, if supported by the source
control manager.
• Get Latest Version
• Check Out
• Check In
• Undo Check Out
• Add to Source Control
• Remove from Source Control
Workbench
The CA Easytrieve Workbench is a Windows application that lets you build, run, and debug ezt
programs.
The CA Easytrieve Workbench is a Windows application that lets you build, run, and debug CA Easytrieve Report Generator
programs.
Start the Workbench
To start the Workbench click Start, Programs, CA, Easytrieve, Easytrieve Workbench.
The CA Easytrieve Workbench main window appears.
Messages
All system information, error, and warning message are described in the Messages and Codes section.
Environment Variables
The CA Easytrieve Report Generator for Windows installation creates many files and sub-directories. These directories are
referenced using the following environment variables and values:
Throughout this section, EZTOPTS and CA_EZTSettings refer to the path values associated with these environment variables.
Sample Programs
CA Easytrieve® Report Generator 11.6
Sample programs are located in the EZTpgms directory in the directory pane of the main window. For example:
c:\Users\user\Documents\EZTpgms
Main Window
The main window in a Windows session contains a menu bar at the top and a status bar at the bottom.
The area between these two objects is known as the client area and is typically occupied by one or more
windows. Each document window displays a portion of an analysis or edit file as follows:
The main window in a CA Easytrieve® Report Generator Windows session contains a menu bar at the top and a status bar at
the bottom. The area between these two objects is known as the client area and is typically occupied by one or more windows.
Each document window displays a portion of an analysis or edit file as follows:
• Use edit windows to modify source (.EZT) and macro (.MAC) files, as well as other files. You can edit any ASCII file. Use
the keyboard and edit commands, such as cut, copy, and paste to make changes. For more information, see Edit Source or
Text Files.
• Use analysis windows to display analytical information in .CVX files, which are created each time you compile a program.
Analysis windows are read-only; they let you perform static analysis and debugging. Analysis and debugging of a CA
Easytrieve® Report Generator program always begins by opening the .EZT file, which detects if the program has been
compiled and the .CVX file exists. If so, debugging and analysis becomes enabled.
Contents
Title Bar
Each document window has a title bar that uniquely identifies it. The title bar for an edit window always contains the name of
the file being edited. The title bar for an analysis window contains a shorthand notation as follows:
• filename
The name of the file.
• (n)
The WorkSheet instance (1-15).
• Windowid
The type of window (WorkSheet or Twin).
• lbl=lblname
Used only for a WorkSpace window where:
• lbl FLD
Field definition name.
• Lblname
The name of the field.
• Progname
The name of the program, which might not be the same as the file name.
Examples
CA Easytrieve® Report Generator 11.6
The following identifies the window as the first WorkSheet for a file named myupdte containing the source to a program called
myupdate:
myupdte(1) WORKSHEET/myupdte
The following identifies the window as a WorkSpace open on a file called myupdte, but contains just the subactivity portion of
the program. It is associated with the first WorkSheet.
myupdte(1) FLD=LASTNAME/myupdte
Toolbar
Use the toolbar buttons instead of the commands from the main menu. To get a brief description of the function of a toolbar
button, move the mouse to a toolbar button and read the brief help that appears in the pop-up window. Whenever possible,
procedures in this section use the toolbar button.
To move the toolbar, place the mouse pointer on an empty portion of the toolbar until the grabber hand appears. Then click and
hold the left mouse button while dragging the toolbar to another location in the Workbench window.
Status Bar
The status bar at the bottom of the window displays messages and information about the active worksheet. If the cursor in the
analysis window is on a data item, information about the type and size of the data item is displayed, otherwise the following is
shown.
• Color Button
Click to change the current color that is used to highlight analysis files.
• Ln
Displays the current line number in the file.
• Col
Displays the current column number in the file.
• Pgm=
Displays the program name for a worksheet
• Activity=
Displays the current location of the worksheet: job, sort, or file activity name, a report sub activity or procedure name.
When the Debugger is active the following are also present:
• Debug Button
Click in a debugging session to execute the next debug command, such as Monitor, Initiate, or Run.
• Status Light
Indicates the current state of the debugging session, such as halted
You can also view messages from the compiler as well as abbreviated help for all menu commands on the status bar. In
addition, while in an analysis file, when you select a data item, the status bar displays its type. When you select a quoted literal,
the status bar reflects it as a string.
WorkSheet Windows
Whenever you open a .CVX file, the Workbench opens a window called a WorkSheet window. A WorkSheet window initially
starts as a Tree view, but can be toggled between Text and Tree views.
All WorkSheets have the word WORKSHEET in their title bar to help you identify them. You can have any number of
WorkSheets open at the same time for a file. Each WorkSheet is managed separately from the other WorkSheets so that each
can represent an entirely different set of analysis queries. A query in one WorkSheet has no effect on the content of any other
WorkSheet. For example, you can hide everything but move verbs in one WorkSheet while showing all statements in another.
Twin Window
CA Easytrieve® Report Generator 11.6
You can split a worksheet into a Twin window. A twin window shows a Tree view in the left-hand pane and the Text view
in the right-hand pane. The panes are closely related so that when you select text in one pane, the other pane scrolls to match.
This feature lets you navigate conveniently through large source files by using the Tree view as an outline of the source shown
in the Text view. To view the twin window, select the View menu and choose Twin.
Selecting a node in the Tree view causes the Text view to scroll to the first line of the matching source code. Selecting text in
the Text view causes the Tree view to scroll to reflect the new selection.
Workspace Windows
A WorkSpace is a Text-only window that contains the text for all of a program or any labeled subset of a program. The
WorkSpace lets you restrict analysis to just one section of code. For example, you can double-click a PROC statement to open
a WorkSpace with the procedure you selected. You can open as many additional WorkSpaces as you need.
WorkSpaces are different from WorkSheets:
• WorkSheets can be toggled between the two view modes: Tree and Text. WorkSpaces can be viewed in Text mode only.
• WorkSheets always contain a complete program while WorkSpaces can be opened on a subset of a program, such as a JOB
activity, a procedure, or any data definition. A WorkSpace can also be opened on the entire program.
A WorkSheet can have any number of WorkSpace windows open on it. The portion of the file shown in the WorkSpace can
also be shown simultaneously in other WorkSpaces. For example, you can define one WorkSpace for an entire Procedure,
while another is defined for a section in the procedure, and another for a line in the section, and so on.
Analysis commands performed on a WorkSheet affect every WorkSpace opened on that WorkSheet. For example, if you hide
all statements in a WorkSheet, all WorkSpace windows opened from that WorkSheet have all of their lines hidden. Conversely,
if you hide all of the lines in a WorkSpace that is open on a single paragraph, the Text view of the WorkSheet shows that
paragraph as hidden.
You can use the WorkSheet in Tree view as a road map or table of contents to help you locate the various WorkSpaces that
you have open.
To use the WorkSheet in Tree view as a road map:
• Click the node to immediately view that object's WorkSpace window.
• Double-click any white space area (anywhere there is no text shown) in the WorkSpace
To switch between a WorkSheet and Workspace:
1. Use the Tree view of the WorkSheet to locate a WorkSpace, and then double-click a label. You are placed in a WorkSpace
for the selected object.
2. Double-click in any non-text (white space) area and you are placed back in the tree.
3. Double-click another branch in the tree.
This is an example of how you can use just a series of double-clicks to quickly locate windows in CA Easytrieve® Report
Generator without having to search the list of open windows in the Window menu.
Selecting Objects in a Window
You can select objects such as verbs, data items, files, labels, and strings in an analysis window with a click of the left or right
mouse button. The left mouse button selects the object while the right button opens a pop-up menu of commands for that
object.
To select an object, place the cursor over the object and click the left mouse button.
Pop-up Menus
A pop-up menu is a context-sensitive list of commands available for a selected object. Pop-up menus let you choose a
command without returning to the menu bar. A pop-up menu appears when you click the right mouse button on a selected
item, or when you place the cursor on an object and click the right mouse button. The selected item can be in the Tree view or
any word in Text view.
The words that you can select in a Text view window for a CA Easytrieve® Report Generator program include:
• Labels
The naming label for a procedure.
• Label references
Any reference to a procedure name.
• File references
Any reference to a file -- implicit or explicit. For example, a PUT statement implies the file to which the record belongs.
• Data items
CA Easytrieve® Report Generator 11.6
Any data item defined in the Library Section but selectable from any portion of the program.
You can also invoke pop-up menus from the Tree view by right-clicking a node.
Context Sensitivity
All commands are sensitive to the selected object. For example, you select a data item, PAYROLL-AMT, from a statement in
a JOB activity like: MOVE ZEROES TO PAYFILE:PAYROLL-AMT. The selected object refers to the data item PAYROLL-
AMT as defined in the PAYFILE FILE definition. If there are other data items called PAYROLL-AMT within other FILE
definitions, then they are completely excluded from the processing of commands invoked when this specific instance of
PAYROLL-AMT is selected.
You can select strings and use analytical capabilities to locate references to strings, but the real power of CA Easytrieve®
Report Generator Workbench lies in its ability to perform object-specific actions on instances of a selected object. Whenever
you select a verb, file reference, data item, label, or label reference, all of the commands that you issue apply to the selected
object only -- not to similar strings.
The status bar is usually updated with the record number and column position of the selected object. There are two exceptions:
• If the selected object is a quoted literal string, a hexadecimal notation of the string is displayed in the status bar.
• If the selected object is a data item, its size in bytes and type are displayed in the status bar.
Opening Windows
This article describes how to open windows in a WorkSpace.
This article describes how to open windows in a WorkSpace.
Contents
Open a Window
You can open a window by double-clicking an object. Use this technique to open a window from:
• Any word in a Text view that refers to a program, job, procedure, or data item. Also included are statements in a JOB
activity with a reference to a data item or file name, and all references to procedures in transfer of control statements, such
as PERFORM.
• The labels to the right of the icons in the Tree view.
You can also use the Window menu to open, close, and arrange windows. All open windows are listed at the bottom of the
Window menu in the window cache. Selecting a window from the list brings the selected window into focus.
Open a Window on a Selected Label
To open a WorkSpace window on a selected label, select the View menu and choose the Open Window On command. The
window displays just that section of the program.
Unlike the View Jump To command, the View Open Window On command does not reposition you; it opens a window on the
selected label and overlays the active window. After you finish reviewing the selected paragraph you can close the window.
Note: You can open a window on a label by double-clicking the label name, or clicking the right mouse button to get a
context-sensitive pop-up menu of the commands available for processing labels.
In the following screen, the GET_FIELD_DATA label was highlighted and Open Window On was selected from the View
menu. The result is a new window containing GET_FIELD_DATA Procedure.
This feature lets you look at the code in GET_FIELD_DATA without losing your place in the current activity. (Use the
Windows Tile command to neatly arrange all of your open windows without any overlapping.)
Open Files
Use either of the following methods to open a file:
CA Easytrieve® Report Generator 11.6
An application does not have to specify a file list, but doing so speeds file manipulation throughout the development cycle.
For example, you can open all source and macro files, all analysis files, or both using a single command. Or, you can select
specific files from a dialog to quickly open a few files at a time. In addition, any CA Easytrieve Report Generator file in a file
list can be monitored for a debugging session without first opening it.
Create an Application
Follow these steps:
1. Click File, Application, Open. For help, press F1.
2. Select the options that you require as follows:
• Load Analysis Files
Loads the analysis files.
• Save As Default
Automatically opens the application and any files that are checked by default when you open the Workbench.
3. Type a file name (for example, TEST.app) in the File Name field.
4. Click OK to create your application.
You have now created an application.APP file.
Note: Once you have created an application, you can open the source control manager project. In this way, the Workbench
always associates an application with a project.
Open an Application
Follow these steps:
1. Click File, Application, Open. The Application Open dialog appears.
2. Select your desired application and click OK.
3. Check Save As Default to open the application every time you open CA Easytrieve Report Generator.
Edit an Application File List
After you open an application, you can edit the files that are listed on its file list using the File Application Edit File List
command.
Follow these steps:
1. Open the application.
2. Press F8.
3. Use the Edit Application dialog to perform any of the following tasks:
• To add another program module to the application, highlight your program in the File List box. Click Add.
• To remove a program module, highlight the program in the File List box. Click Delete.
• To view a Compile report on a CVX file, select a CVX file and click Details.
• To change the order that the application build process should process your files, select each file that you need to move
(in the bottom list box), and use the arrow buttons to change its position in the file list.
• To open all CVX files, select Load Analysis Files.
4. To return to the previous display and save the changes to your application file, click OK; to return and lose the changes,
click Cancel.
Note: You can double-click one or more files in the bottom list area to tag them for opening. Tagged files (highlighted in
cyan) are opened when you click OK to exit the dialog.
Close an Application
Follow these steps:
1. Click File, Application, Close, or open another application.
2. If the application is the default application, you are asked if you want to remove it as the default application.
• Click Yes to remove it as the default application.
• Click No to keep it as the default application.
3. If you made changes to any CA Easytrieve Report Generator options, you are asked if you want to save the changes to the
application file.
• Click Yes to save the changes so that they are saved in the application file.
• Click No to not save them with the application.
CA Easytrieve® Report Generator 11.6
1. Click File, Source Control, and select Get Latest Version. The Get Latest Version dialog appears.
2. Use any of the standard Windows selection techniques to select the files that you want to check out. You can click the
Select All button to quickly select all the files.
3. Click the Advanced button to invoke any special check-out criteria that are permitted by your source control manager. For
example, you may want to check out a particular revision of a file. See your source control manager documentation for
details.
4. When you have finished, click OK. The Workbench sends your request to your source control manager for processing.
Cancel a Check Out
Undo Check Out lets you cancel a previously checked out project file and discard any changes that were made to it.
Follow these steps:
1. Click File, Source Control. Then select Undo Check Out. The Undo Check Out dialog appears.
2. Use any of the standard Windows selection techniques to select the files that you want to undo. You can click the Select All
button to quickly select all the files.
3. Click the Advanced button to invoke any special check-out criteria that are permitted by your source control manager.
For example, you may want to undo the check out a particular revision of a file. See your source control manager
documentation for details.
4. When you have finished, click OK. The request is sent to your source control manager for processing.
Check In Updates
After you update a file, you can check the file back into the source control manager.
Follow these steps:
1. Click File, Source Control, and select Check In. The Check In dialog appears.
2. Use any of the standard Windows selection techniques to select the file or files that you want to check in. You can click the
Select All button to quickly select all the files.
3. Click the Advanced button to invoke any special check-in criteria that are permitted by your source control manager. For
example, you may want to check in a particular revision of a file. See your source control manager documentation for
details.
Check the Keep checked out box if you want to check in your changes and keep the file checked out for more editing.
You can also specify comments using the text box at the bottom of the dialog.
4. Click the Differences button to display a difference report for the selected file. If you select more than one file, the one with
the dotted box around it is used. The difference report displays the changes that were made to the file that is to be checked
in.
5. When you have finished, click OK. The request is sent to your source control manager for processing.
Add Files to the Project
Add to Source Control adds the selected file to your project. Depending on your site, the Add function can be restricted to
authorized users. If you are not authorized to use the Add function, the source control manager displays an error.
Follow these steps:
1. Click File, Source Control, and select Add to Source Control. The Add to Source Control dialog appears.
2. Use any of the standard Windows selection techniques to select the files that you want to check in. You can click the Select
All button to quickly select all the files.
3. Click the Advanced button to invoke any special check-in criteria that are permitted by your source control manager. For
example, you may want to check in a particular revision of a file. See your source control manager documentation for
details.
Check the Keep checked out box if you check in your changes and keep the file checked out for more editing.
You can also specify comments using the text box at the bottom of the dialog.
4. When you have finished, click OK. The request is sent to your source control manager for processing.
Remove Files from a Project
Remove from Source Control removes the selected files from your project. Depending on your site, the Remove function can
be restricted to authorized users. If you are not authorized to use the Remove function, the source control manager displays an
error.
Follow these steps:
1. Click File, Source Control, and select Remove from Source Control. The Remove from Source Control dialog appears.
CA Easytrieve® Report Generator 11.6
2. Use any of the standard Windows selection techniques to select the files that you want to check in. You can click the Select
All button to quickly select all the files.
3. When you have finished, click OK. The request is sent to your source control manager for processing.
Run Reports
You can run the following reports:
• History -- Provides details on the history of check-outs and check-ins, and so forth.
• Differences -- Lets you compare versions of a file and generates a detailed report of differences.
• Properties -- Provides statistics such a file size and type.
To run any of these reports for a file, it must be the currently selected file in the Workbench editor.
Invoke the source control manager application to run any other reports that are supported or to run reports on multiple files.
4. Click Yes.
The Save As dialog opens.
5. Specify the file name and extension. For example, specify .EZT for a CA Easytrieve Report Generator source program.
6. Click Save.
Create a Clone
Use the View Create Clone command to place the contents of a WorkSheet or WorkSpace window into an edit window.
Follow these steps:
1. With a .CVX file open in Text view, use the View commands to select the text that you want to clone.
2. Click View, Clone. An unnamed Edit window opens containing the selection from the .CVX file. From here, you can edit
the text, copy and paste it into another edit window, or save the file.
Example
Use the View Tree command and scroll down through the branches, or use the View Expand or View Collapse commands to
isolate a section of code.
Double-click the section. A WorkSpace window opens for the selected section.
• Use the View Exclude command to exclude lines that you do not want to place in the clone. For example, if you do not
want the cloned section to contain comments or blank lines, select View Exclude Comments and View Exclude Blank
Lines before you select Edit Clone.
• Select the View menu and select Clone, and an unnamed Edit window opens with the section from the .CVX file displayed.
Select Text
Use standard mouse and keyboard methods for selecting text.
For example, to select all the text in an edit window, click Edit, Select All.
Positioning and Scrolling
You can move to different portions of your program using the Edit menu.
Jump to a Selected Label
Use the View Jump To command to jump to a selected label in a .CVX file in Text view. For example, if you are looking at a
PERFORM statement and want to see the paragraph being performed, highlight the label (paragraph name) and select View
Jump To. This action repositions you to the selected paragraph.
Note: You can also jump to a label without having to return to the menu bar. Click the right mouse button for a context-
sensitive pop-up menu of commands available for a program label and select Jump To Label.
Scroll to Labels
Use the Scroll To Labels command when you do not know the exact spelling of a label name in a .CVX file.
To scroll to a label, click View, Scroll To Labels. Hierarchy shows the hierarchy of the selected label from the highest to the
lowest level. This lets you select from two or more labels that have the same name but have different qualifications. When you
make your selection, your window repositions to that location. Press F1 for help.
Going to a Line Number
Follow these steps:
1. Select a file, if more than one file is open.
2. Click Edit, Go to Line #. The Go To Line dialog indicates the first and last line numbers in your view range in the selected
file. You can only jump to a line in the Viewable Range that is specified in the dialog.
The current line (Ln) and column (Col) numbers for the active window appear in the status bar at the bottom of the screen.
Find a String or Object
Use the Find bar at the bottom of the main window to search for text.
Follow these steps:
1. Click in the combo box in the Find bar and enter the text string that you want to locate. Or, you can double-click text to
place it in the combo box on the Find bar.
2. Use the search option buttons at the right of the Find bar to limit the scope of your search, if necessary.
CA Easytrieve® Report Generator 11.6
3. Click one or more of the VCR buttons to move to an instance of the selected text. If the file is .CVX file, click the Show
All button to display all instances of the selected text.
Replace Text
To find and replace a string of characters two methods are available:
Method one:
Click Edit, Replace.
The Find and Replace dialog is displayed.
Method two:
1. Click Edit, Replace.
2. Enter the text sting you want to replace in the text box on top. Enter the text string that you want entered in its place in the
Replace with box.
3. Use the VCR buttons to position to the strings that you want to replace and click the Replace button. Or click the
Replace All button to replace all instances of the string in the file. Replace All starts at the top of the file and replaces all
occurrences of the string, regardless of your starting position.
4. To cancel a replace operation, click Edit, Undo until you have backed out each replace operation.
If the text string is not found, a message appears on the status bar.
Note: This is a one-way search from the cursor position to the end of the file. Position the cursor at the top of the file to
search and replace a string throughout the entire file.
Undo and Redo Changes
Undo
If you make a mistake cutting or pasting text, use the Edit, Undo or Edit, Undo All commands to restore your file. These
commands work backwards, starting with the most recent change that you made to the file.
Note:
Note the following information about the Undo and Undo All Commands:
• They can even restore saved changes -- to a point. For example, you delete ten lines of text from a file and select File Save.
Then move to another location in the file and delete 15 more lines. Selecting Edit Undo returns the fifteen lines to their
former place in the file. Selecting Edit Undo again returns the first ten lines to their original location, effectively undoing
the save.
• Try not to undo more changes than you can remember.
• They cannot restore changes after you close the window.
• They treat Replace All as a sequence of individual Replace commands. You must undo each replaced string.
Use Edit Undo to undo Show commands that are issued for a .CVX file. If you still see highlighting, use the Navigate Clear
Highlighter command.
Redo
If you undo a change you meant to keep, use Edit, Redo. The following are limitations of the Redo command:
• Redo restores only the action that were performed by the last Undo command. Until you select Edit, Undo again, the Redo
command is inactive. You can select Redo as many times as you performed consecutive Undo commands.
For example, you delete ten lines of text from a file. Then you move to another location in the file and delete 15 more lines.
Selecting Edit Undo returns the 15 lines. Selecting Edit Undo again returns the first ten lines to their original location.
Selecting Edit Redo, deletes the last ten lines again.
• Redo cannot restore changes after you close the window.
Display Compiler Messages
The editor displays compiler error messages in the source file with red highlighting.
Follow these steps:
1. Compile the source file. If the compile produces errors, the error messages appear highlighted in the text as follows:
If the file has already been compiled, click Edit, Display Errors. Then click the Errs button on the Find bar to enable the
VCR buttons.
2. Use the VCR buttons on the Find bar to locate the errors in the file.
3. If you want to change the colors for the errors, click Options, Compile Feedback.
CA Easytrieve® Report Generator 11.6
You can display each level or message in a different color. For example, make severe errors appear with a red background,
and make less serious informational messages appear with a lighter background, such as cyan.
4. Save the file, or edit the file to fix the errors and recompile. You can add new lines or edit existing lines without having to
worry about getting the error messages out of sync with the source text. The messages only appear to be in your file. They
are not saved in your source file.
Enter Non-Graphic Characters
If you need to enter characters which do not appear as keys on your keyboard, they can be entered using either of the following
two mechanisms:
Note: The null character (x'00') cannot be entered using either of these mechanisms.
• For characters below x'20' an escape sequence must be used. Type <ctrl>+D (or <ctrl>+d) followed by a character (upper
or lower-case) which represents x'01' thru x'1f" according to the following table:
• For characters above x'20', the standard Windows ALT-numpad process can be used: while holding the ALT key down,
type in the decimal value of the character you want to enter, and then release the ALT key. For example, to enter a £
character, hold the ALT key down, and enter (with numlock selected) 1 then 5 then 6 (on the number pad) and then release
the ALT key.
When you want to compile one or more programs within an application you need to perform these basic steps:
• Open the application that contains your source files. (If the application does not exist, create it.)
• Select the files that you want to build.
• Execute the build request.
• When the program is successfully built, you can run it or initiate a debugger session.
The Workbench processes your build requests as background jobs so you can continue to use the Workbench without having to
wait for the job to finish. You can even queue multiple jobs to run one after the other.
Build Programs and Applications
What Happens When You Build
When you choose the Build command from the Build menu, a Batch Server session is initiated. The batch session lets you
continue to use the Workbench while your programs are being processed in the background. The following describes the files
created by the Build process.
You can run the batch session in the background (the default) or place it in focus (by turning on the Show Batch Window
option from the Options menu). The Script processor (R2SCRIPT) manages your batch jobs. As jobs finish, R2SCRIPT sends
status messages to the edit window title bars and the Workbench status bar to keep you aware of their progress. R2SCRIPT
appears as an icon on the desktop so that you can minimize or maximize it at any time.
CA Easytrieve® Report Generator 11.6
File Description
<filename.CVX> Analysis File. This file is used for analysis and debugging.
<filename.ERR> Compiler Error Listing File.
<filename.LST> Listing File.
Compile Feedback
If errors are detected during a compile, the errors are displayed in the source edit window, directly below the statement
triggering the error.
In addition, the VCR buttons on the Find Bar now let you position to compiler warnings. As you move to the errors, you can
correct them (adding or deleting lines of text) without the error messages getting out of sync with the source lines. After you
have finished correcting the errors, you can recompile the program. When you recompile, the error messages are not saved
with the source file, but removed automatically.
Note: You can control the type of error messages that are reported, and the colors used to display them. For more information,
see Changing the Color of Compile Errors.
Build Programs within an Application
The following sections describe the steps required to build a program or programs within an application.
Key Compiler Options
Before you compile, ensure that the location of all CA Easytrieve® Report Generator macros used within your program
are known to the Workbench and the compiler. This is controlled by the environment variable EZTOPTS. Its value should
point to the subdirectory containing your macros. If they do not exist there, the product will look in the location that the CA
Easytrieve® Report Generator program was loaded from.
Compile a Single Program
Follow these steps:
1. Open the source file.
2. Do one of the following:
• For programs within an application:
1.1 Select File, Application, Edit. The Edit Application dialog appears.
2.1 In the lower list box, double-click the files you want to open and click OK.
• When not working within an application:
1.1 Use the File Open dialog to open the source file.
2.1 Select the source file you want to build.
3.1 Press F7 or select the Build menu and choose Build.
Build an Application
Follow these steps:
1. Select the Build menu and choose Build Application. The Application Build dialog appears.
2. Select the items you want to build (or all of them by pressing Select ALL), and press Build Files.
Note: The programs are processed in the order they are defined in the application's file list. Make sure programs that are
needed to successfully link other programs are processed prior to ones dependent upon them.
3. When the last program that you requested has been compiled the Application Build Results dialog appears.
The Show Application Build Log command in the Build menu lets you view the Application Build Results dialog any time.
Start the Debugger
You can also start the debugger from the Build menu.
Follow these steps:
1. Select the Build menu and choose Debug: programname, or click the Debug toolbar button.
CA Easytrieve® Report Generator 11.6
2. Click the Step Into debug-button or select the Debug menu and choose Go.
Debug Programs
This section explains how to debug your programs using the debugger. The Debugger uses a Windows
interface for visual presentation while the program itself runs in separate window.
This section explains how to debug your CA Easytrieve® Report Generator programs using the debugger. The Debugger uses
a Windows interface for visual presentation while the program itself runs in separate window.
Contents
Debugger Features
The debugger provides visual, CA Easytrieve® Report Generator intelligent facilities that are designed to dramatically
reduce the amount of time it takes to debug a program or an entire application comprised of numerous programs. Some of the
Workbench’s debug capabilities are:
• Complete GUI object-action support. For example, you set breakpoints by selecting a line (object) and then an action: Set
Breakpoint.
• Convenient command selection. Pop-up menus appear when you click the right mouse button in a debug window.
• Program selection. You can select one or more programs in an application for monitoring to restrict the session to just those
programs you feel are relevant.
• Drag and drop support. You can monitor data items by dragging a reference to the data item into a Data Director.
• Watchpoints. You can place a watch on data items so that program execution halts whenever their values change.
• Breakpoints. You can set conditional or unconditional breakpoints in one or more programs by selecting a line from a text
view of a program. Also, you can define conditional breakpoints and conditions that take affect when the value of a data
item changes or when a condition is met.
The debugger facilities in the Workbench are completely integrated with the analysis facilities. This means that you can
perform analytical tasks at any time -- even while debugging!
For example, while waiting for a breakpoint to be reached, or perhaps while in a halted state brought about by an abend
condition, you can perform any number of analysis commands, such as switching from Text view to Tree, showing or hiding
statements, or tracing a program path.
Terms and Concepts
The Workbench debugger uses terms and concepts that you are already familiar with, but it also adds its own unique
capabilities and terminology. You should understand the following terms before you begin a debug session:
• Active Breakpoints
Breakpoints that have been defined by the user and are not disabled.
• Debug-Button
The button that appears on the right side of the status bar whenever a debugging session is started. The most likely
command for the current state of the debugger is set in the auto command button.
• Automatic Breakpoints
Breakpoints that are automatically triggered by the Workbench host debugger when it detects a statement whose execution
would cause an abend or serious program failure, such as an addressing error, data or program exception, or subscript
violation.
• Breakpoints
User-specified program locations, where program execution is to halt either unconditionally or under certain conditions.
• Conditional Breakpoints
User-requested interruptions that take effect at particular lines during debugging execution when execution reaches the
breakpoint line and a specified condition is true. A condition is defined as an expression that compares a data item’s
value to either a literal value or the value of another data item. The comparison is made using any of the standard CA
Easytrieve® Report Generator logical operations: equal, not equal, less than, less than or equal, greater than, and greater
than or equal.
• Current Statement
The statement where execution has halted in the application being debugged.
• CVX File
A file combining information from an original source member with information from compiler output, used in analysis and
debugging.
• Data Director
CA Easytrieve® Report Generator 11.6
An optional dialog window where you can edit data items and perform other debugging tasks, such as setting a watch on a
data item.
• Data Items
Any of the named variables defined in your program.
• Disabled Breakpoints
Breakpoints that have been defined and then made temporarily non-functional by the user.
• Debug Session
The activities related to the test execution of an application. A host connection is established by starting a session. Initiating
a session starts application execution. Killing or terminating the session ends execution. Ending the session severs the host
connection.
• Debug Window
A window where a monitored program is displayed for debugging.
• Execution Profile
A file that identifies the JCL and programs of a batch application that are to be tested.
• Focused Program
The program or program appearing in the active window.
• Module
A program contained in a .CVX file. A .CVX file is required to debug a program.
• Number Margin
The area on the left side of a debug window that contains line numbers from the compilation listing.
• Program
A program contained in a .CVX file. A .CVX file is required to debug a program.
• Session
An instance of the debugger. Multiple debugging sessions can be active simultaneously. Any program being debugged
contains the name of the related debugging session in the left side of its window title.
• Status Light
A round object that appears in the right-hand side of the status bar whenever a debugging session has been started. The
color of the light indicates the current state of the debug session.
• Unconditional Breakpoints
User-requested interruptions that take effect at particular lines during debugging whenever execution reaches the
breakpoint line. Every time a line with an unconditional breakpoint is executed, the program stops at that line.
• User Window
A window in which the user’s program executes. This window is automatically created whenever you issue the Debug Start
Session command.
• Watched Data
Data that will trigger an immediate breakpoint if its value changes.
Using Debug Windows
To debug a program, you must first start a debug session and monitor one program (a program is another name for the program
contained in a .CVX file). When you monitor a program, all of the windows open for that program automatically become
debug windows. The Debug Session Identifier appears in brackets on the left side of their title bars.
WorkSheets and WorkSpaces
A program can have any number of WorkSpaces opened on a debugging WorkSheet. Additional (non-debug) WorkSheets can
also be active for a program at the same time. This means that you can have analysis WorkSheets available that are not in any
way affected by the debugging of the program.
As with all WorkSpaces owned by a WorkSheet, WorkSpaces opened on a debug WorkSheet reflect what is displayed in other
WorkSpaces opened on the same WorkSheet. For example, if you open a WorkSpace on the entire Procedure Division and also
one on the first paragraph in the Procedure Division, breakpoints added to either of the WorkSpaces are displayed in the other.
Features such as the Number Margin, the Status Light, debug-button and pop-up menus make it easy to observe and control
your debugging session.
Line Number Margin
The gray area on the left side of a debug window is a line number margin. It displays the line numbers from the compiler
listing. These line numbers have no relation to the line numbers contained in columns 1-6 or 73-80 of the source.
Select the View menu and choose Line Numbers. Press F1 for a description.
Use the number margin to select lines for Debug commands.
• Click the left mouse button in the number margin to select the entire line.
CA Easytrieve® Report Generator 11.6
• Click the right mouse button in the number margin to display a pop-up menu of Debug commands for that line.
Because many of the Debug commands require you to first select a line, the View Line Numbers command is automatically
activated when you select a program to be monitored.
Status Light
The Status Light appears as a round object on the right-hand side of the Workbench status bar whenever you are debugging.
The color of the Status Light changes as your session proceeds to show the state of the debugger session. The following table
lists the colors meaning:
Color Meaning
White A debug session has been started, but the focused window
does not contain a monitored program.
Cyan Monitored. The program in focus is being monitored, but the
session has not been initiated.
(Light Blue)
Blue Initiated. The application to be debugged has been initiated,
but is not yet running.
Red Wait. The debug session is busy and the user cannot enter
commands.
Green Running. The program is executing.
Dark Gray The application has terminated. The debug session is still
active as are all monitored programs and breakpoints.
Light Green Halted. The focused program is attached to a session that has
been halted because of a breakpoint, interrupt, or other cause.
Black The debug session has been terminated and data not
available.
To the left of the status light is a debug-button that contains the name of a command. Use the debug-button to perform various
debugging commands, such as Step Into, Auto, and Interrupt. Clicking this button executes the command. The debugger tries
to anticipate the command that you are most likely to issue next and places that command in the debug-button.
Object Pop-up Menus
When the mouse pointer is positioned on a data item in your program, a click of the left mouse button selects and highlights
the object. A click of the right mouse button displays an Object Pop-up menu.
Object Pop-up menus list basic commands that are appropriate for the selected object. If the object is a data item, additional
menu items are enabled:
• Show All -- Shows all references for CVX files. Press F1 for details.
• Open Window On -- Open a WorkSpace window.
• Set Conditional -- Displays the Conditional Breakpoints dialog with the selected data item already defined in the left-hand
side of the condition. Use it to specify conditions for a breakpoint that will be located at the statement you have selected.
• Add to Data Director -- Adds the selected data item to the Data Director dialog for the module. If a Data Director is not yet
defined, then one is created, and the data item is added as its first entry.
• Watch -- Adds the selected data item (as a watched data item) to the Data Director dialog for the module. If a Data Director
is not yet defined, then one is created, and the data item is added as its first entry.
Debugging a Program
Follow these steps:
1. Open the program RPTHTML.EZT. If it had been previously compiled, the Debug icon and the Build Debug menu item as
well as the Debug Session menu item are enabled. Select one of these items.
The debugger stops at the first executable statement in a monitored program. At that point, the session's state changes to
halted as evidenced by the status light's light green color. The first executable statement is shown in green highlighting.
The session stays in a halted state until you direct the Workbench to resume execution of the program with an execution
command.
2. Set Breakpoints. You can set breakpoints on one or more lines in the program before or after you initiate the program.
3. Select the Step Into debug-button to begin stepping through the code.
CA Easytrieve® Report Generator 11.6
Program execution proceeds asynchronously, which means you are free to use the other facilities in the Workbench, or any
other Windows programs, while waiting for your program to halt.
In addition, you may want to begin by setting debug options. The following sections describe each of these steps in detail.
Program Execution Commands
The execution commands are used to advance the execution of the program being debugged. You have the option of executing
any of the following Debug menu commands to change the state of the debug session. The execution commands are enabled
only when the session is in a halted state. Selecting an execution command causes the session's state to change to a running
state, indicated by a dark green status light.
Go
Go (Ctrl+G)
Execution proceeds without any indication of which statement is currently being executed, until the program terminates or
a breakpoint is encountered. If no breakpoints have been set, the program executes from beginning to end, stopping only for
exception conditions or normal program termination.
Step Into
Step (Ctrl+I)
The program single steps to the next statement.
Auto-Step
Auto-Step (Ctrl+A)
The program executes statement by statement, displaying each statement as it is executed. Auto Step is considered a series of
Step Into requests. Execution can be interrupted at any time by the use of the Interrupt hot key, Ctrl+Q (same as Debug Session
Interrupt).
• Run to Line
The program begins execution (using the Go command) and continues until it reaches the specified line. A temporary break
is established on the line that is reset when execution reaches the line.
• Set Next Line
Highlight a line within a monitored program and select Set Next Line. The next execution command will continue from this
point.
Interrupt
Interrupt (Ctrl+Q)
Interrupts the execution of a program and is enabled if running in Auto-Step mode.
Trace Backward and Forward
Trace
The debugger retains a log of previously executed statements. You can use the Trace Backward and Trace Forward commands
to navigate through this information. The current line indicator (the green bar) identifies each line in the trace. For example,
you might use the Trace feature to determine how you arrived at a breakpoint. To resume execution, choose one of the other
execution commands.
Auto-Focus User Window
When checked, this command automatically places the User Window in focus each time the User Window is updated or each
time the keyboard is interrogated by the user program. For example, execution of a DISPLAY statement automatically places
the User Window in focus.
Manage Breakpoints
You can set unconditional and conditional breakpoints as follows before or after you initiate debugging of a program to
interrupt execution:
• Unconditional breakpoints -- Interrupt the execution of the program whenever the execution reaches the specified line.
• Conditional breakpoints -- Take effect when execution reaches a specified line and a condition is met. Specify the
breakpoint conditions using a dialog.
When a breakpoint is reached, execution halts. You can inspect and modify the contents of any data item, set and remove other
breakpoints, and perform other debugging activities. You can then decide to resume execution or close the session.
You can put unconditional and conditional breakpoints on the same line in any combination.
Set Breakpoints
You can use any of the following techniques to set a breakpoint:
CA Easytrieve® Report Generator 11.6
Operator Description
= equal to
<> not equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to
CHG the value of the left-hand data item has changed (The right-
hand data item is not required).
For example if you specify 5, the breakpoint occurs the sixth time execution reaches the statement. If you do not specify a
condition, you can use this option to set a breakpoint with no conditions other than the number of executions to be skipped.
Sample of a Completed Dialog
The following is an example of a completed Set Conditional Breakpoint dialog.
REGION from the PERSNL File has been selected as the first data name in this example.
For example, enter 3 in the Right box. When REGION is equal to 3, the breakpoint takes effect. The test is to be made before
the breakpoint statement is executed, and no true occurrences are to be skipped.
Display Active Conditions
After you set breakpoints, you can display the active conditions and then edit or delete them.
Follow these steps:
1. Select the Debug menu and choose Breakpoints Active Conditions. The Active Conditions dialog for the program appears.
All active conditions, including Unconditional, are listed at the top. In the previous example, we see the first condition is
condition, Unconditional. The second condition is on variable change, which means that a specified variable must change
to meet the condition.
2. Highlight any of the conditions in the Conditions list at the top to see the affected breakpoints in the Breakpoints list at
the bottom. For example, if you select Unconditional, a list of all statements where unconditional breakpoints are set is
displayed.
3. Use the buttons at the bottom of the Active Conditions dialog to alter the active conditions, or perform the same function by
means of the keyboard.
•Disable/Enable -- If a condition is selected, disables the highlighted condition, but leaves it marked so that you can still
see it. To enable it again, click the same button, now labeled Enable.
• Add -- If a condition is selected, brings up the Set Conditional Breakpoints dialog, where you can add a condition.
• Change -- If a condition is selected, brings up the Set Conditional Breakpoints dialog, where you can change a
condition. Not available if a breakpoint is selected.
• Delete -- Deletes the selected breakpoint.
4. When you have finished, click Close to make the changes and exit the dialog.
Examine and Modify Data
The debugger provides the Data Director tool for you to use to examine and modify data after you initiate the program. The
Data Director displays a set of data items that you have selected. For each item you can modify its value, add it to or remove
it from the Data Director, or add it to the data items being watched or monitored by the debugger. Select View then Data
Director.
Use the Data Director
The Data Director is an optional dialog that lets you perform a wide variety of tasks relating to data items:
• Monitor a data item
• Stop the monitoring of a data item
• Modify data
• Add or remove a data item from the watched list
• Modify the data item specification by adding or modifying its subscripts, indexes, or reference modification to the data item
name
CA Easytrieve® Report Generator 11.6
The Data Director displays a list of variables with their names and current values.
Selecting a Data Item or Subscript
To place a data item into the Data Director, type the name of the data item directly into the Data Name box. To place a
subscript into the Data Director, type the name of the subscript directly into the Data Name box. You can place multiple data
items in the Data director. However, only one data item or subscript can be processed at one time by the Data Director.
Alternatively, you can use the following procedure to drag any reference to the data item or subscript from a text window into
the Data Director window.
To drag a data item:
1. Select the data item by pressing the left mouse button over any reference to the data item in a window in Text View. If the
data item has a subscript, select the subscript. You can only drag and drop the subscript, not its data item.
2. Hold the left mouse button down and slowly drag the mouse until a Var with a plus sign appears next to the cursor.
3. Without letting go of the left mouse button, drag the data item or subscript into the Data Director window and release the
button.
The data name of the data item now appears in the Data Name box of the Data Director window, and its current value in the
Data Value box.
If you selected a subscript, the subscript appears in the Data Name box of the Data Director window, and its current value in
the Data Value box.
Note: When you drag a data item into the Data Director you are guaranteed that you are getting the specific data item based
on that data name qualification present in the text. You cannot qualify a data name by entering a phrase such as follows in the
Data Director:
A of B
Set Preferences
You can customize ezt to meet your requirements. The Options menu controls global options for the
entire ezt session. Options settings that are changed while an application is open are saved with the
application. If an application is not open, the options are saved for all ezt sessions.
You can customize CA Easytrieve Report Generator to meet your requirements. The Options menu controls global options for
the entire CA Easytrieve Report Generator session. Options settings that are changed while an application is open are saved
with the application. If an application is not open, the options are saved for all CA Easytrieve Report Generator sessions.
This article explains the following items on the Options menu:
Color
You can select the text color for comments, macro lines, source lines, gap lines, and select the highlight color. The Color menu
item is available only when a .CVX file is the current file.
Follow these steps:
1. Click Options, Color.
2. The Color dialog appears.
3. Select a color type and color, and click Apply.
The change appears in the current file.
4. Click OK.
Font
You can select the font that is used in the product. To select the font, a file must be open.
Follow these steps:
1. Click Options, Font.
2. The Font dialog opens.
3. Select the font and properties.
4. Click OK.
The settings affect the entire Workbench and all of its windows. Font setting changes are in effect during the current and future
sessions.
Source Control
If you are using source control management, you must specify the source control manager login information.
Note: Before you can use this option, your source control manager must be initialized and the user name must be defined. For
more information about source control, see Set Up Source Control Supports.
Follow these steps:
1. Click Options, Source Control.
The Source Control Options dialog opens.
2. Select the source control provider, enter you user name, and click OK.
Note:
If a password is required for the User Name, you are prompted to enter it after you click OK.
3. If you are prompted, enter your password and click OK.
Source Filter Strings
Some files from the mainframe include embedded JCL that must be filtered out before the program can be compiled on the
PC. For example, if you want the CA Easytrieve Report Generator Windows compiler to ignore all statements that begin
with // and /* (as typically found in JCL), specify them as filter strings. A filter string lets you filter such files without major
changes to the original file.
If you enable Use Default Filter Strings on the Filter tab of the Program Profile Manager dialog, the filter strings that you
define in this procedure are used.
Follow these steps:
1. Select Options, Source Filter Strings.
The Default Source Filter Strings dialog opens. The dialog is similar to the Filter strings section on the Filter tab of the
Program Profile Manager dialog.
CA Easytrieve® Report Generator 11.6
If you select *.MNU, all matching MNU files are logically concatenated to show all the defined items on the Tools menu.
3. Click OK.
File Save
You can specify save options for the files that you are editing.
Follow these steps:
1. Click Options, File Save.
The File Save Options dialog opens.
2. Select the following options as needed:
• AutoSave
When the AutoSave option is enabled, any open files that you have changed are saved every n minutes. Otherwise, you
must explicitly save the file. You are prompted to save when you close a modified file.
• Create BAK file
When the Create .BAK file option is enabled, the editor creates a copy of your original file at the beginning of the edit
session. If this option is enabled, the following actions occur:
• If you save the file during the session, the original copy is saved with .BAK appended to the file name.
• If you do not make changes to the file and quit the session, the temporary copy is erased. A .BAK file from a
previous session is not overwritten.
When this option is not enabled, the editor does not create a backup copy of your file.
3. Click OK.
Show Toolbar
To display the CA Easytrieve Report Generator Workbench toolbar, click Options and select Show Toolbar.
Show Batch Window
You can view the Batch Session window during a compile and during batch program execution. To view the Batch Session
window, click Options and select Show Batch Window.
The batch window is placed in focus when you:
• Compile and link programs
• Run batch programs from the Tools menu
Normally, the Show Batch Window option is not selected and the batch commands are executed in the background.
Note: The Show Batch Window option has no effect on the Debug User Window.
Pause Control Window
Normally, a batch session is closed when the program that is running within it ends. However, you may need to view output
that is displayed to the console before the batch session is closed.
To view the output, click Options and select Pause Console Window. The batch session remains open after program
termination.
To close the batch session after program termination, select the window and press any key.
Enable JES Tab
The JES control lets you manage the jobs and job output that is contained in the mainframe JES (Job Entry Subsystem) from
within the Workbench IDE. Because not all CA Easytrieve Report Generator users are mainframe clients, the JES interface is
not visible by default. If the JES tab does not appear at the bottom of the Explore window, click Options, Enable JES Tab.
Note:
For more information about the JES control tab, see JES control.
Configuration Manager
The Configuration Manager tool in the lets Windows users create, view, and modify the Options Table
and Printer Set Definition (PSD).
The Configuration Manager tool in the Workbench lets Windows users create, view, and modify the Options Table and Printer
Set Definition (PSD).
CA Easytrieve® Report Generator 11.6
Both configurations are saved as XML files for the Workbench. You can also create binary configuration files for the Intel,
UNIX, Linux, and z/OS platforms from the Build menu.
The Options Table has the following categories:
• Compiler
• Execution
• Report
• Mask
• International
• Profiles
The Printer Set Definition has the following types:
• HTML
• RTF
Note:
The Printer Set Definition binary is used for extended reporting and the Options table binary is used to set default values for
the compiler. The generated binary files are compatible in Windows, Linux for zSeries, UNIX, and z/OS environments.
To open the Configuration Manger from the Workbench, click Tools, Configuration Manager. Alternatively, click Start,
Programs, CA, Easytrieve, Easytrieve Configuration Manager. The current Options Table or Printer Set Definition
appears.
The following XML files are created with default values during installation:
• eztopt.xml (Options Table)
• eztpsd.xml (Printer Set Definition)
More Information:
4. Click File, Save. If you are creating a new option table, enter a file name and click Save.
5. (Optional) Click Build and select the targeted environment (Intel, UNIX, Linux, or Z/OS) to build the binary file.
The binary file is created and is ready to move to the target system.
Define Compiler Options
Follow these steps:
1. Select compiler in the left pane of the Configuration Manager.
The Compiler Options page appears in the right pane.
2. Accept the default, or specify a new value in the option fields.
3. Enable or disable the appropriate check box options.
4. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
Define Execution Options
Follow these steps:
1. Select execution in the left pane of the Configuration Manager.
The Execution tab fields appear in the right pane.
2. Accept the default, or specify a new value in the option fields.
3. Enable or disable the appropriate check box options.
Note: Options marked with (z/OS) affect execution in z/OS only.
4. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
Define Environmental Options
Follow these steps:
1. Click the Environmental tab.
2. Accept the default, or specify a new value in the option fields.
Note: For options marked as z/OS, the value only affects execution in z/OS.
3. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
Define Sort Options
Follow these steps:
1. Click the Sort tab.
2. Accept the default, or specify a new value in the option fields.
3. Enable or disable the appropriate check box options.
Note: For options marked as z/OS, the value only affects execution in z/OS.
4. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
Define SQL Options
Follow these steps:
1. Click the SQL tab.
2. Accept the default, or specify a new value in the option fields.
Note: For options marked as z/OS, the value only affects execution in z/OS.
3. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
CA Easytrieve® Report Generator 11.6
• Expand profiles, and select the profile that you want to modify.
• Right-click profiles, and click Add Printer Profile.
3. Accept the default, or specify a new value in the option fields.
4. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to save the default settings.
Save the Options Table
To save the options table, do one of the following actions:
• Click File, Save.
• Click File, Save As, enter a file name, and click Save.
Create a Binary Version of the Options Table
To create the binary version of the options table, select the appropriate platform from the Configuration Manager Build menu.
Select one of the following platforms:
• Intel
• Unix
• Linux
• z/OS
A message appears, confirming that the options table has been built. The default location of the file is the same folder that
contains the options table XML file. If the binary file is to be used on another system, you must ftp it to the system.
Mainframe Considerations
If the destination system of the ftp is a z/OS mainframe, the resulting file on the mainframe must be specified on the
EZOPTBL DD statement in the compilation and execution JCL that is used to compile and run the CA Easytrieve Report
Generator program. This target file on the mainframe was allocated by the CA Easytrieve Report Generator installation job
JOB01ALC, and its DSN ends with "…EZOPTBL". If you are adding a new data set, allocate using the same attributes as the
installed file.
1.1 Click the plus box for the printer you are defining to show the links. The links are dataset, defaults, fileheaders,
filetrailers, or fonts.
2.1 Click the link in the left pane to display the properties page you want to modify.
3.1 Define the attributes on the page.
4.1 Click Apply to save the changes.
5.1 Repeat Steps b through d for each property page.
5. Click File, Save. If you are creating a new printer set definition, enter a file name and click Save.
6. (Optional) Click Build and select the target environment (Intel, Unix, Linux, or z/OS).
The binary file is created and is ready to move to the target system.
Add a New Printer
Follow these steps:
1. Right-click the set icon.
The Add Printer pop-up button appears.
2. Click Add Printer.
The New Printer dialog appears.
3. Enter the new name of the printer and click OK.
A new printer is added.
Copy a Printer
Follow these steps:
1. Right-click the printer icon for the printer you want to copy.
The pop-up menu appears.
2. Click Copy Printer.
The New Printer dialog appears.
3. Enter the name of the new printer and click OK.
An icon for the new printer appears in the left pane.
Rename a Printer
Follow these steps:
1. Right-click the printer icon.
The pop-up menu appears.
2. Click Rename Printer.
The New Printer dialog appears.
3. Enter the new name of the printer and click OK.
The printer is renamed.
Delete a Printer
Follow these steps:
1. Right-click the printer icon.
The pop-up menu appears.
2. Click Delete Printer.
The printer is deleted.
Printer Codes
The Printer Set Definition holds several printer codes that are sent directly to the printer device. If you must insert hexadecimal
codes, insert them in the format X’xx’ where xx is one or more pairs of hexadecimal characters (0-9 A-F).
Define Printer Properties
Use the Printer page to define properties that describe the basic printer characteristics.
Follow these steps:
1. Select the appropriate printer and configure the options on the Printer page.
2. Specify the following properties:
• Printer Name
Enter the name of the reporting printer. Each reporting printer in a printer set definition must be assigned a unique
name. This name is used to identify to the Reporting Environment which reporting printer is to be the target of a report.
CA Easytrieve® Report Generator 11.6
• Printer Type
This attribute identifies a reporting printer type as a line printer.
• Printer Description
Enter an optional keyword that you can use to assign a description for the reporting printer.
• Printer Use
This attribute identifies a reporting printer as a SYSTEM printer.
• Control
This attribute specifies the technique that is supported by the printer to control the vertical line position on a page.
Select one of the following options:
• ANSI: Specify that ANSI print control characters are to be used to control vertical position. This is the default.
• ANSI, NOFCB: Specify that the ANSI print control characters are to be used without a forms control block. When
you do not specify the NOFCB operand, the Reporting Environment implements the ANSI print control characters
in association with a forms control block.
• FEEDCHAR: Specify that feed characters are to be used to control vertical position on a page. When you specify
the FEEDCHAR operand for the CONTROL keyword, you must also specify the FORMFEED and LINEFEED
commands to define the feed characters.
In addition, if you specified the OVERPRINT keyword for this reporting printer, you must also specify the RETURN
command to define the carriage return feed character so that the Reporting Environment can overprint print records.
• MACHINE: Specify that machine print control characters are to be used to control vertical position.
• MACHINE, NOFCB: Specify that the machine print control characters are to be used without a forms control block.
When you do not specify the NOFCB operand, the Reporting Environment implements the machine print control
characters in association with a forms control block.
• NONE: Specify that no printer control code is to be used for the reporting printer and vertical position on a page is
maintained by outputting blank print records.
• POINTSKIP: Specify that point skip control code is to be used to control vertical position on a page. When you
specify the POINTSKIP operand for the CONTROL keyword, you must also specify the PSNEWPAGE and
PSNEWLINE commands to define the point skip control codes.
• Overprint
This attribute specifies the technique that the printer supports for print records that overprint.
Specify one of the following values:
• MERGE: Specify that the reporting printer supports the merge overprint technique to combine multiple print records
into one print line.
• PRINT: Specify that the reporting printer supports the print overprint technique to combine multiple print records
into one print line.
• Maximum Records
Enter a value from 1 through 256. This attribute defines the maximum number of print records that can be overprinted
for one print line.
• Linefeed
Enter the control code that causes a NewLine for a printer using the FeedChar form of paper control. This command
is required for a line printer type when you specify FEEDCHAR for the CONTROL option. You can only specify one
LINEFEED command per reporting printer.
• FormFeed
Enter the control code that is used to define the control code that causes a NewPage for a printer using the FeedChar
form of paper control. This command is required for a line printer type when you specify FEEDCHAR for the
CONTROL option. You can only specify one FORMFEED command per reporting printer.
3. Specify the following properties in the Point Skip Attributes section for a printer using the Point Skip form of paper control
(the Control option):
• New Line Printer Control Code
• Enter the control code that causes a NewLine for a printer using the point skip form of paper control.
• New Page Printer Control Code
Enter the control code that causes a NewPage for a printer using the Point Skip form of paper control.
• Start Position
Enter the start position in the Point Skip printer control code for a merge operation.
• Length
Enter the length in the Point Skip printer control code for a merge operation.
• Type
This attribute specifies the type of value to be merged into the Point Skip printer control code.
Select one of the following types:
CA Easytrieve® Report Generator 11.6
• BINARY
• UNSIGNED PACKED
4. Specify the following properties:
• Record End
Enter the printer control code that must delimit the end of each print record output to the printer.
• Record Pad
Enter the printer control code that must pad the end of each fixed-length print record output to the printer.
• Return
Enter the printer control code that causes a carriage return without a NewLine for a printer using the FeedChar form of
paper control (the Control option).
5. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to undo the changes.
Define Dataset Properties
Use the Dataset page to define properties that describe the basic record characteristics of the report printer.
Follow these steps:
1. In the left pane, select dataset under the appropriate printer.
The Dataset page appears in the right pane.
2. Specify the following properties:
• ASA
Enable this option for the default RECFM=A attribute of the data set generated by the Reporting Environment for the
reporting printer. Disable when you do not want the RECFM=A attribute assigned to the data set.
• Record Format
This attribute controls the default record format, record length, and blocksize attributes of the data set generated by the
Reporting Environment for the reporting printer.
Specify one of the following options:
• F: Specify fixed length, unblocked print records. Also enter a value for Record Length.
• FB: Specify fixed length, blocked print records. Also enter values for Record Length and Block Length.
• V: Specify variable length, unblocked print records. Also enter a value for Record Length.
• VB: Specify variable length, blocked print records. Also enter values for Record Length and Block Length.
• U: Specify print records output in blocks of undefined length. Also enter a value for Block Length.
• Record Length
Enter the fixed length of the print record. The default is 2048.
• Block Length
For blocked records, enter the block length.
• Device Type
This attribute specifies the default device attribute of the data set from the drop-down list.
Specify one of the following types:
• DISK: Specify that the data set generated by the Reporting Environment is to be output to a disk device.
• PRINTER: Specify that the data set generated by the Reporting Environment is to be output directly to the printer.
• TAPE, NORWD: Specify that the data set generated by the Reporting Environment is to be output to a tape device;
stops the tape being rewound both when the data set is opened and when the data set is closed.
• TAPE, REWIND: Specify that the data set generated by the Reporting Environment is to be output to a tape device;
causes the tape to be rewound when the data set is opened on the tape.
• TAPE, UNLOAD: Specify that the data set generated by the Reporting Environment is to be output to a tape device;
causes the tape to be rewound and unloaded when the data set is closed.
• Print Record Maximum Length
Enter the maximum length of the print record that is supported by the reporting printer.
• Print Record Maximum Bytes
Enter the maximum number of bytes for the print record that is supported by the reporting printer.
Note:
Print data is not the same as the length of a print record. In addition to the bytes of data that actually print on a page
of a report, a print record can also contain various printer control codes (such as paper control codes, overprint codes,
function headers, and function trailers).
CA Easytrieve® Report Generator 11.6
If a reporting printer can only support a limited amount of print data in a print record, you can use the MAXDATA
keyword to specify that limitation. When you specify a MAXDATA value, the Reporting Environment will ensure that
no print record will be output to that reporting printer with print data in excess of the Print Record Maximum Bytes
value.
3. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to undo the changes.
Define Defaults Properties
Use the Defaults page to define the font and page properties of the report printer.
Follow these steps:
1. In the left pane, click defaults under the appropriate printer.
The Defaults page appears in the right pane.
2. Specify the Base Font (SBCS). Enter the reporting font that is assigned a data format of EBCDIC/ASCII. The default is 3.
Optionally enter the reporting formats assigned a data format of DBCS Font and Mixed Font if the printer supports DBCS
character sets. The reporting fonts must be defined for the reporting printer. For more information, see Supported Formats.
3. Specify the following in the Font Size section:
• Font Number (Width)
Enter the number of the font whose width attribute is used to convert column- and character-based widths and
horizontal positions into printer-based widths and horizontal positions. The default is 3.
• Font Number (Height)
Enter the number of the font whose height attribute is used to convert column- and character-based heights and vertical
positions into printer-based heights and vertical positions for printers that require them. This applies to Line printers
that support ANSI or machine paper control without an FCB and Line printers that support point skip paper control. The
default is 3.
4. Specify the following in the Page Properties section:
• Page Width
Enter the maximum width of a print line that is supported by the reporting printer.
• Page Height
Enter the maximum height of a page that is supported by the reporting printer.
5. Do one of the following actions:
• Click Apply to save the changes.
• Click Reset to undo the changes.
Define File Header Properties
Use the File Header page to define the record header properties of the report printer.
Follow these steps:
1. In the left pane, click fileheaders under the appropriate printer.
The File Header page appears in the right pane.
2. Do one of the following actions:
• To modify an existing file header, select it in the file header list. The current values are displayed. Continue with Step 4
and modify the values as needed.
• To create a file header, continue with Step 3.
• To remove a file header, select it in the file header list and click Remove.
3. Enter the printer control code data that is sent to the printer to accomplish positioning in the Print Control Code field.
4. Specify the following attributes in the Current Record Number Attributes section:
• Start Position
Enter the start position in the printer control code for the merge operation.
• Length
Enter the length in the printer control code for the merge operation.
• Type
This attribute specifies the type of the value to be merged into the printer control code from the drop-down list.
Select one of the following types:
• BINARY
CA Easytrieve® Report Generator 11.6
• UNSIGNED PACKED
5. Specify the following attributes in the Current Record Length Attributes section:
• Start Position
Enter the start position in the printer control code for the merge operation.
• Length
Enter the length in the printer control code for the merge operation.
• Type
Select the type of the value to be merged into the printer control code:
• BINARY
• UNSIGNED PACKED
6. Do one of the following actions:
• If you are modifying an existing header, click Modify.
• If you are creating a new header, click Add.
7. (Optional) To change the order of a file header, select it in the file header list and click Move Up or Move Down.
File Trailer Properties
Use the File Trailer page to define the record trailer properties of the report printer.
Follow these steps:
1. In the left pane, select filetrailers under the appropriate printer.
The File Trailer page appears in the right pane.
2. Do one of the following actions:
• To modify an existing file trailer, select it in the file trailer list. The current values are displayed. Continue with Step 4
and modify the values as needed.
• To create a file trailer, continue with Step 3.
• To remove a file trailer, select it in the file trailer list and click Remove.
3. Enter the printer control code data that is sent to the printer to accomplish positioning in the Print Control Code field.
4. Specify the following attributes in the Current Record Number Attributes section:
• Start Position
Enter the start position in the printer control code for the merge operation.
• Length
Enter the length in the printer control code for the merge operation.
• Type
This attribute specifies the type of the value to be merged into the printer control code from the drop-down list.
Select one of the following types:
• BINARY
• UNSIGNED PACKED
5. Specify the following attributes in the Current Record Length Attributes section:
• Start Position
Enter the start position in the printer control code for the merge operation.
• Length
Enter the length in the printer control code for the merge operation.
• Type
Select the type of the value to be merged into the printer control code:
- BINARY
- UNSIGNED PACKED
6. Do one of the following actions:
• If you are modifying an existing header, click Modify.
• If you are creating a new header, click Add.
7. (Optional) To change the order of a file trailer, select it in the file trailer list and click Move Up or Move Down.
Add a New Font
Follow these steps:
1. Right-click the font icon.
The Add Font pop-up button appears.
CA Easytrieve® Report Generator 11.6
CA Easytrieve Report Generator contains a subset of the extended reporting capabilities that are provided by other versions of
the product for the mainframe. This subset lets you produce reports that are formatted for line mode printers only.
CA Easytrieve Report Generator provides a printer set definition module that defines the following printers:
• Hypertext Markup Language (HTML)
• Rich Text Format (RTF)
The Configuration Manager lets you customize these definitions and add your own definitions.
HTML Printer Specification
The HTML printer wraps your report data in the special HTML codes required by HTML specifications. In addition, each item
is wrapped in codes necessary to format the item.
Fonts 1 through 7 format the data using HTML font sizes 1 through 7, respectively. For example:
<FONT SIZE=1>data</FONT>
<FONT SIZE=1><B>data</B></FONT>
Fonts 21 through 27 format the data using HTML font sizes 1 through 7, respectively, and add the ITALIC code. For example:
<FONT SIZE=1><I>data</I></FONT>
Font 99 is a special font used to insert a horizontal rule (<HR>) into the report. Horizontal rules are useful for separating areas
of your report. For example, because HTML does not contain page breaks, you may want to add horizontal rules as visual
breaks between report pages. To do this, simply add the following statements to your report declaration:
ENDPAGE. PROC
DISPLAY #99 ' '
END-PROC
Workbench Explore
The Workbench Explore window consists of the Open window, the FTP control and the JES control.
The Workbench Explore window consists of the Open window, the FTP control and the JES control.
The Workbench Explore window provides the following features:
The splitter bar provides tab control access to each of these features.
Note: The splitter bar width can be changed by positioning the caret over the splitter bar. At this point, the mouse will be
captured and the mouse pointer will change to an east/west caret. To resize the splitter bar, hold down the left mouse button
and drag the splitter bar left or right to the desired width. All windows within the Tab Control will be resized to reflect the
width of the splitter bar.
The Open Window
The Open window gives the user a graphical tree display of the files that are contained on a particular drive, directory, and
subdirectory; it consists of:
• A combo box for Drives
• A combo box for File names
• Files list box
• Directory tree
How to Select a Drive, Directory, and File
Follow these steps:
1. Select a drive from the Drives combo box.
The folders and files on the targeted drive are displayed in the Directory and File Name list boxes.
2. Locate the directory that contains your programs.
Double-click a directory to drill down into the subdirectories and display the files.
Note: A single click displays the subdirectories under a directory and adds a plus sign to the tree.
3. Do one of the following:
• Enter a complete file name and file type in the File Name combo box.
• Enter a partial name with wildcards (for example, P*.* will display all files that start with the letter P).
• To locate your file:
CA Easytrieve® Report Generator 11.6
1.1 Display the list of pre-programmed file types (*.ezt, *.mac, *.lst) in the File Name combo box.
2.1 Select your file type
3.1 Select your file from the list in the Files combo box.
4. Double-click the file name to display your file in an Edit window.
Update a File
Follow these steps:
1. Locate and select the file. See How to Select a Drive, Directory, and File for more information.
The file is displayed in the Edit window.
2. Use the commands on the Edit menu and customary word processing editing procedures to modify your file.
3. Click the Close file button in the upper right corner.
A confirmation dialog is displayed.
4. Click Yes to update the file.
Clone a File from an Existing File
Follow these steps:
1. From the Files combo box, right click a file.
2. Click Copy.
3. Right-click in the Files combo box again
4. Click Paste
The Paste to File dialog appears.
5. Enter a new name and click OK
The new file appears in the File Name combo box.
Manage Files and Directories in the Open Window
You can use the Dir and File Name combo boxes to manage the files in your directory.
Follow these steps:
1. Double-click a directory to display files and subdirectories. Right-click a file in the Files combo box to display the
command menu.
Note: If you are attempting to copy text from one file to another, copied text replaces any text in an existing file, it does
not append.
2. In addition to the standard Cut, Copy, Delete, Rename commands, use the following as needed. Note that all commands
except Refresh and Create Directory relate to the object selected in the Files window.
• Paste
This option is enabled only if there is a text object on the clipboard.
Paste the text that was copied to the clipboard into the current directory file. You will be prompted to enter the name of
an existing file or a file that is to be created.
• Upload
Upload the selected file to the current FTP session. You will be prompted for the name of the file that is to be created on
the host system.
This option is enabled only if there is an active FTP session.
• Create Directory
Create a subdirectory under the current directory. You will be prompted for the name of the directory to be created.
Close or Activate the Explore Window
After installation, the Explore window opens by default. It can be closed or activated as needed.
• Close the Explore window
Click the red X icon in the upper right corner of the window.
• Activate a closed Explore window
Select View, Explore window.
JES Control
The JES control lets you to manage the jobs and job output contained in the mainframe JES (Job Entry Subsystem) from
within the CA Easytrieve® Report Generator Workbench IDE. Since not all CA Easytrieve® Report Generator users are
mainframe clients, the JES interface will not be visible at install time and must be enabled to make it available.
CA Easytrieve® Report Generator 11.6
The JES control is selected by clicking the JES tab in the splitter bar.
When there is no active JES session, the JES control consists of the following:
• A combo box (Profile)
The Profile combo box contains a list of previously used profiles. Pressing the down arrow will display the list. Clicking on
an item will connect to JES using the selected profile.
• A connect button
• A disconnect button
• A refresh button
• An edit control (Owner prefix) and a static text message area.
The Owner prefix edit control allows you to select the owner of the jobs that you want displayed. This is useful for
controlling the amount of entries displayed so that only the desired jobs are displayed or for viewing JES items not directly
associated with your logon ID.
Connect to the JES Queue
The values stored in the Host Profile are used to make the MVS connection to the JES queue.
Follow these steps:
1. If necessary, activate the JES tab from Options, Enable JES tab.
2. Do one of the following:
• Click a profile in the Profile combo box.
If you have previously used the JES tab, the Profile combo box will be populated with your most recently used list. You
will automatically be connected to the host you select from the list.
Note: You can have multiple host profiles but only the hosts you go to get added to that combo box.
• For a first-time connection to a host: Click Connect on the JES tab.
The Select Host Profile for JES dialog is displayed. Click Add.
The Add Host Profile dialog is displayed Add a new profile.
See Host Profile Manager for more information.
The new profile is included on the list in the Select Host Profile for JES dialog and is selected.
Click Select.
The JES connection is made and a list of the jobs in the JES queue is displayed in tree view. The list contains all of the jobs
for the targeted owner prefix, not just the jobs that were submitted using the workbench; this is similar to the type of listing
displayed by products like SDSF or SYSVIEW.
If the connection cannot be established or the system is not a z/OS system, an error message is displayed.
3. Click the disconnect button when done.
Change the Owner Prefix
The Owner Prefix edit control allows you to change the owner prefix you are using to access JES listings.
Enter the owner prefix as you would if you were viewing the JES queue under SDSF or SYSVIEW.
Only the jobs for the targeted user will be displayed.
Manage Jobs in the JES Queue
The various components and output files for a job can be viewed, or, a job in the JES queue can be deleted or canceled.
View the Component Files of a Particular Job
Follow these steps:
1. Click the plus sign next to the job.
The tree expands to show the various output files managed by JES for that job.
2. Pass the pointer over a job or a component.
A tooltip window is displayed that shows complete information about the item.
3. Click the targeted component file to display it.
The file is displayed in a read-only window.
Delete a Job and its Components
Follow these steps:
Right-click a job and one of the following will occur:
• If the job has completed, you can delete the job and components
CA Easytrieve® Report Generator 11.6
• If the job has not completed, use the menu to cancel the job
All of its associated components will also be removed from the JES queue.
Note: Click Refresh to refresh the contents of the JES control at any time.
FTP Control
The FTP control is selected by clicking the FTP tab in the splitter bar. The FTP control lets you download and upload
programs or data files directly from within the CA Easytrieve® Report Generator Workbench.
You connect to remote FTP servers using the values specified within a profile which is defined and maintained using the Host
Profile Manager.
When there is no active FTP session, the FTP control consists of the following:
• A combo box containing previously accessed remote hosts
• Connect and Disconnect buttons
• An ASCII transfer button (ABC icon) and a binary transfer button (010 button)
See Enable ASCII Upload and Download for an FTP Session for more information.
• A static text message area
• An abort button.
Note: Hovering the cursor over the buttons will display a tooltip for the button.
How the FTP Control Works
The Host Profile Manager lets you create and manage the profiles you use to make FTP connections. Clicking on any item in
the Profile combo box connects you to FTP using that profile. See Host Profile Manager for more information.
Once the FTP session has been established, the Files list box and Dir (directory) tree view for that definition are displayed in
the Files and Dir combo boxes.
Note: For MVS systems, a directory refers to a PDS or PDSE file structure; if selected the members contained within the
PDS(E) are displayed within the file list.
Manage Files and Directories Accessed Using FTP
Download and update files and directories using FTP.
Follow these steps:
1. Double-click a file in the Files combo box. The following actions occur:
• The file is downloaded into the temp directory as specified by the environment variable TEMP or TMP.
• The file is displayed in the Workbench edit window.
• The number of bytes downloaded is displayed as the download progresses. Right-click a file to display the commands
that can be used on the file and directory.
In addition to the standard Cut, Copy, Delete, Rename, and Refresh commands, use the following as needed.
• Paste
Paste the text that was copied to the clipboard to the current FTP session. You will be prompted to enter the name of the
file that is to be created. The file will be created in the current directory (or PDS).
Note: This option is enabled only if there is a text object on the clipboard.
• Download
Download the selected file to your local system. You will be prompted for the name of the subdirectory/file that is to be
created as well as the mode to be used for the file transfer.
• Create Directory
Create a subdirectory under the current directory. You will be prompted within a dialog for the name of the directory to
be created.
• Change Directory
Allows you to change to another subdirectory (or high-level qualifier on z/OS) on the host. You will be prompted
within a dialog for the name of the directory to change into.
Note: When you specify a subdirectory on a z/OS host, you are, in effect, changing the high-level qualifier (HLQ) on
that host. This should be specified in the 'HLQ' (the quotes are important within this command).
• Properties
Display the properties for the selected file. The name, creation date, creation time, size and attributes are displayed. This
display will vary based upon the type of system.
To abort a transfer
CA Easytrieve® Report Generator 11.6
• Directory
Enter the initial directory that is to be used once the connection has been established.
• For MVS systems: Enter the high level qualifier in single quotes with the components separated by periods.
• For UNIX: Enter the directory name with the components separated by forward slashes '/'. For Windows, enter the
directory name with the components separated by backwards slashes '\'.
• Port
The FTP port number (usually 21).
• Keep Alive
Check this box if you would like to keep the FTP session from timing out.
• Interval (sec)
The keep alive interval. The FTP session will be refreshed when the keep alive interval time limit has been reached. Set
this to a value that is less than the timeout value of the host FTP server.
• Code Page
This specifies the code page to be used for ASCII data translation between the mainframe and the PC during file upload,
download and remote job submission.
This value must be set to the proper code page so that the Workbench can display characters that are not defined in the
default code page.
For example, if you are using the Euro or other national characters, the code page can be set to 924 Multinational ISO
Euro.
Note: The Workbench font must also be set to a font that supports the Euro and other national characters, such as
Lucida Console.
• Use plink ssh client for job submission (UNIX Only) -
Enables the use of the plink SSH client for remote job submission to UNIX systems. The plink (PuTTY link) client is
used instead of the Windows rsh (remote shell) client.
• Transfer Type
The desired transfer type:
• ASCII Trimmed - The file is translated on download or upload according to the FTP server translation method
and trailing spaces are trimmed. This option removes trailing spaces when files are downloaded from a fixed length
MVS PDS.
• ASCII - The file is translated on download or upload according to the FTP server translation method.
• BINARY - The file is transferred as is. No translation is performed.
4. Click OK.
The profile information is added.
Use the Edit Host Profile Dialog
Follow these steps:
1. From Tools, select Host Profile Manager.
The Select Host Profile for JES or the Edit Host Profile dialog is displayed, depending on whether you started from the JES
tab or the FTP tab.
2. Click Edit.
The Edit Host Profile dialog is displayed.
3. Update the values in the fields as required.
4. Click OK.
The profile information is updated.
Enable ASCII Upload and Download for an FTP Session
Some UNIX systems (in particular - zLinux) may not have ASCII upload and download enabled by default.
Follow these steps:
1. Be sure that the file /etc/vsftpd.conf has "ascii_upload_enable=YES" and "ascii_download_enable=YES".
2. Click the ASCII button.
ASCII upload and download are enabled.
The four tabs in the Program Profile Manager dialog let you manage and store program compiler and execution options,
instructions for program submission, filter specifications, and package information.
This article includes the following information:
Note: Only one profile may be defined for a program or file name; its name will match the program or file active in an edit
window at the time of creation and it will match any entity with that name in the subdirectory. For example, program test.ezt
and file test.mysjcl will both use the same test.prf profile.
Program Profile Manager Dialog
Use the Program Profile Manager dialog to design and save your processing options, specify whether the profile is for a
specific program or file only, and indicate if it is to be used as the default for the entire subdirectory.
This dialog contains the following tabs:
• Program tab
• Submit tab
• Filters tab
• Package tab
• Set as Default button
Use the Program Profile Manager
Use the Program Profile Manager to create and store your program or file options.
Follow these steps:
1. Select your drive and program directory in the Explore Window.
2. Double-click a program or file in the Files list.
The file or program is loaded into the CA Easytrieve Report Generator Workbench.
3. Select Build, Program Profile.
Note:
You must open a program or file to use the Program Profile command.
The Program Profile dialog is displayed.
4. Click the appropriate tab and select the options. The sections that follow explain the options on each tab.
5. Click Set as Default if you want the profile to be used as a default profile for the directory.
Note:
For more information about the default profile, see Set Directory Defaults and Save the Profile.
6. Click OK.
The profile is saved and the dialog closes.
Program Tab
The Program tab lets you set compiler and execution options. You can specify what actions you want to happen during a
compile and supply any execution options that are to be used within the Workbench environment.
Specify Program Compiler and Execution Options
Follow these steps:
1. Click the button of the Compiler Option you want used when you run your program.
• Syntax check only
Performs a syntax check of the program. No PCode file or executable is created and no debugging information is
generated.
• Compile
Compiles the program and, if successful, creates a PCode file that can be executed by the CA Easytrieve Report
Generator interpreter or the debugger engine. Debugging information is generated (in a CVX file).
• Compile and create executable
Creates an executable version of the CA Easytrieve Report Generator program (.exe file). The .exe file can be run
stand-alone from the Command line without the need for the PCode interpreter (ezterp.exe).
No debugging information is generated.
CA Easytrieve® Report Generator 11.6
Note: This option is available only if Microsoft Visual Studio version 6.0, 7.0, 7.1, 8.0, VC Express, 9.0, 2010, 2012,
2013, and 2015 has been previously installed on the user's system. If your version is not currently supported, contact
CA Support to check on availability.
2. Specify whether Warning messages are to be displayed as a result of a program compile.
By default, warnings are not displayed unless an error also occurs. Warning messages are helpful during program
development to ensure that statements that might result in runtime errors (although the syntax is correct) are recognized and
fixed.
3. Set program Execution Options.
Define the parameter list that is to be passed to the program when it is executed from within the Workbench. These values
can be obtained and processed by the USING parameter of the PROGRAM statement. See the PROGRAM Statement for
more information.
4. Do one of the following actions:
• Click OK if your definition is finished.
• Proceed to the next tab.
Submit Tab
The Submit tab lets you specify the Host profile to use, the type of output that will be retrieved, and any wrapper files that are
to be included as part of the remote submission. See the Program Submission Utility for more information.
Specify Remote Submission Settings
Follow these steps:
1. Select the Host Profile name.
This is a profile created with the Host Profile Manager that you want to automatically use when you submit your program.
The profile supplies the information that is necessary for connecting to the remote system.
2. Click the desired Output retrieval option.
• All
Specifies that all output for the job will be retrieved in the Workbench Explore window.
• For MVS systems: All JES spool files will be concatenated when displayed; when the job output has been
retrieved, the JES spool files will be deleted.
• For UNIX systems: The job output that was sent to STDOUT and STDERR is displayed in separate edit windows
in the Workbench once the job has completed.
• Hold for select
The job output will not be retrieved in the Workbench window.
For MVS systems, the JES spool files will be left in the JES queue for later retrieval. You may want to use this option
for programs that generate hundreds of pages of output.
• SYSPRINT only
• MVS systems: Only the SYSPRINT output will be retrieved. Each SYSPRINT component will be retrieved in a
separate Workbench window.
• UNIX systems: Only the output that was sent to STDOUT will be retrieved.
Note: The selection of these options may change during the life-cycle of the application. During initial development,
'retrieve all output' may be desirable, but later as your application nears completion, you may simply want to see the
SYSPRINT output to validate program changes.
3. Specify the JCL prolog and epilog wrapper files that are to be used.
• MVS systems: When the program is submitted, it will be "wrapped" between the JCL Prolog and Epilog file. The
prolog file is copied to a temporary file, the program source code is appended, and finally, the epilog file is appended.
Note: An easy way to create the Prolog and Epilog files is to take the JCL from an existing CA Easytrieve Report
Generator compile-and-go execution. All JCL up to and including the "SYSIN DD *" statement should be used for the
Prolog file. Typically, for the z/OS environment, a "//" statement is all that is required for the Epilog file.
HINT: Creating and storing all Prolog and Epilog files within a single subdirectory allows them to be located and
modified easily as you move within different projects and applications.
• UNIX systems: A command shell is created to compile, execute and capture the output that is sent to STDOUT and
STDERR.
The JCL prolog and epilog files are copied to this script before and after the compilation/execution commands. These
two files allow you to set up the parameters needed to compile and execute the program on a particular UNIX platform.
Typically, the prolog file will contain the exported environment variables needed to configure database options and
define the external names of required files and is the only Prolog "wrapper" file required. See Program Profile Manager
for more information about the required export variables.
CA Easytrieve® Report Generator 11.6
Note: If the remote shell script fails because output to STDERR was captured, this output will be brought up in a
separate edit window for inspection. A file will be created in the TEMP (or TMP) directory with the file name, job
number and an extension of ".submission error text".
4. Click OK if your definition is finished or proceed to the next tab.
Package Tab
The Package tab lets you add additional items needed to properly package your program.
This feature assists in the packaging process for a specific program. Note that if that program has external dependencies
outside of the runtime environment--for instance, called programs or programs executed using the LINK or TRANSFER
statements within the CA Easytrieve Report Generator language--it is the programmers' responsibility to add these programs
to the target subdirectory before delivering the application package. Additionally, data files are not packaged as part of this
process.
The environment variables that are specified will be added as set statements to the generated .cmd file so that when
run_xxx.cmd (where xxx is the name of the program) is invoked, the selected environment variables will be set properly for
execution.
The Package Variables list will be included with the program so that when it is executed, data files can be located. For more
information, see the Package Program Utility.
Specify Items to be Packaged With Your Program
Follow these steps:
1. To include an item with your program, click the appropriate option button.
• Options table
A copy of the Options table is to be packaged with the program.
Note: Package the Options table only if you have changed any of the execution options and these options are needed to
execute the program correctly.
• Report viewer
Indicates that a copy of the CA Easytrieve Report Generator report viewer is to be packaged with the program.
The report viewer is a Windows interface that allows you to view the output of the program (that is, the data that was
sent to STDOUT and STDERR). The report viewer allows you to view plain text, rich text (RTF) or Web-based HTML.
You can then scroll through your report data and print it.
2. Build a list of Environment Variables to be packaged with the program; you can add as many variables as you need.
Note: You can view the value of any environment variable by right clicking on it from either window.
The list of variables to be packaged with the program is complete.
Click OK if your definition is finished or proceed to the next tab.
3. To remove an environment variable from the Package variable list, do the following actions:
1.1 Click the variable.
The Add button changes to Remove.
2.1 Click the Remove button.
The variable is moved from the Package Variables list back to the Environment Variables list.
Filters Tab
When you compile a program on a PC, you do not need the JCL statements that may be found in mainframe programs. Use the
Filters tab to:
• Define one or more strings that are to be used to filter out source statements
• Specify a default filter that already has the strings defined.
For information about creating a set of default filter strings, see the Source Filter Strings Utility.
Define and Specify Filters
Any statement that starts with any of the text strings specified as a filter will be commented out before the program is
compiled. For example, if you want the Windows compiler to ignore all statements that begin with // and /* (as typically found
in JCL), specify these as filter strings.
Follow these steps:
1. Click the Filters tab in the Program Profile Manager.
2. Define the text strings that are to be used as filters:
CA Easytrieve® Report Generator 11.6
Workbench Utilities
ezt has several tools and utilities accessible from the File, Tools, and Options menus including:
CA Easytrieve Report Generator has several tools and utilities accessible from the File, Tools, and Options menus including:
Use the Data Conversion utility to convert data that has been downloaded to a PC to a format that matches your existing data.
The Data Conversion Utility applies a pre-defined CA Easytrieve Report Generator macro to your files that specifies which
fields in the input file are to be converted. An output file is generated that has those fields in the targeted format.
This section describes the Data Conversion process and how to use the Data Conversion utility.
Download Files
The Data Conversion utility uses the following types of files as input:
• Data files contain the source data that is used in the report
• Macro files contain data definitions
Note:
• When you download files, specify binary format for data files and text format for a macro files.
• PC file names (excluding directory) are limited to 8 character positions and should not have any ‘.’ characters in the name.
The macro file name that you specify must either end in .mac or no extension.
Sample Macro File
The following sample macro file is in hlq.CBAAJCL(PERSNL):
MACRO
*
* Personnel File (PERSNL) Field Definitions
*
*
REGION 1 1 N
BRANCH 2 2 N
SSN 4 5 P MASK '999-99-9999' -
HEADING('SOCIAL' 'SECURITY'
'NUMBER')
EMP# 9 5 N HEADING('EMPLOYEE' 'NUMBER')
EMPNAME 17 16 A HEADING 'EMPLOYEE_NAME'
NAME-LAST EMPNAME 8 A HEADING('LAST' 'NAME')
NAME-FIRST EMPNAME +8 8 A HEADING('FIRST' 'NAME')
ADDRESS 37 39 A
ADDR-STREET 37 20 A HEADING 'STREET'
ADDR-CITY 57 12 A HEADING 'CITY'
ADDR-STATE 69 2 A HEADING 'STATE'
ADDR-ZIP 71 5 N HEADING('ZIP' 'CODE')
PAY-NET 90 4 P 2 HEADING('NET' 'PAY')
PAY-GROSS 94 4 P 2 HEADING('GROSS' 'PAY')
DEPT 98 3 N
DATE-OF-BIRTH 103 6 N MASK( 'Z9/99/99') -
HEADING('DATE' 'OF' 'BIRTH')
TELEPHONE 117 10 N MASK '(999) 999-9999' -
HEADING('TELEPHONE' 'NUMBER')
SEX 127 1 N HEADING('SEX' 'CODE')
* 1 - FEMALE
* 2 - MALE
MARITAL-STAT 128 1 A HEADING('MARITAL' 'STATUS')
* M - MARRIED
* S - SINGLE
JOB-CATEGORY 132 2 N HEADING('JOB' 'CATEGORY')
CA Easytrieve® Report Generator 11.6
2. A CA Easytrieve Report Generator program EZTCONV is generated in the TEMP (or TMP) directory that includes the
macro. The record format, record length and blocksize (if specified) are taken from the data entered on the Convert File
dialog.
3. The Data Conversion Utility obtains the field definitions for the data file. All Alpha fields will be converted based on the
conversion method specified by the user.
A temporary file is created during the conversion process in the directory specified for the output file.
4. Once the conversion process completes successfully, the temporary file is renamed to the name specified for the output file.
This means that the input and output file names can be the same.
Note:
• If an error occurs during the compilation of the temporary program, a message box indicating the error will be
displayed.
• The file conversion information specified by the user is saved in a .prf file (profile). The .prf file has the same base
name as the convert macro name in the same directory as the macro file. The next time the conversion is performed
using this macro name, the specified information will be available.
Convert Files Using the Data Conversion Utility
Use the Data Conversion utility to locate the macro that is to be used to convert your data to the proper format and specify your
conversion parameters.
Follow these steps:
1. Select Tools, Convert File.
The File Conversion Macro dialog is displayed.
2. Do one of the following to specify the macro file that you want to use:
• Enter the name of the macro file and proceed to Step 3.
Note: The macro file name (excluding directory) is limited to 8 character positions. It must either end in .mac or no
extension and should not have any ‘.’ characters in the name.
• Click Browse to display the Select File Conversion Macro dialog.
1.1 Make a selection from the Files of Type combo box.
2.1 Highlight the macro file and click Select.
The Convert File dialog is displayed.
3. In the Convert File dialog, specify the following:
• Input file name
Note: The compiler limits the macro name to be no more than 8 characters in length (excluding the file extension).
• Output file name
• Record format (F, V, FB, VB)
• F-Fixed
• V-Variable
• FB-Fixed Block
• VB-Variable Block
CA Easytrieve® Report Generator 11.6
• Record length
• Blocksize (enabled only for FB and VB)
• Conversion method
• EBCDIC to ASCII
• ASCII to EBCDIC
4. Click OK to begin the conversion process.
Package Program Utility
The Package Program Utility lets you gather the required run-time files and all the user-written programs and files that are
required to run a program. These files are automatically copied to a targeted directory for easy distribution to your end users.
Use the Package Program utility to include files listed on the Package tab of the Program Profile Manager in a directory with
the executable file.
If default environment variables or program specific environment variables have been specified, these should be selected from
the Package tab within the Program Profile; these will be included as a command within the CMD file.
Once this utility completes, the entire directory should be delivered to the user of the CA Easytrieve Report Generator
application. For easy execution, a file ("program_name.CMD") is created that can be added to the user's desktop for a single-
click execution.
Follow these steps:
1. Select the file to be packaged.
The file is displayed in the Edit window.
The Package Program command on the File menu will be enabled if a PCode file (.pco) or an executable file (.exe) exists
for the program being edited.
2. Choose File, Package Program.
The Select Package Directory dialog is displayed.
3. Select a directory for the packaged program and click OK.
A message box indicating the result of the process is displayed. If the packaging operation fails, the cause of the failure will
be displayed in the message box.
Source Filter Strings Utility
Some files from the mainframe include embedded JCL that must be filtered out before the program can be compiled on the PC.
The Filter Strings Utility allows this to occur without major changes to the original file.
Filters allow you to specify one or more strings that are to be used to filter out statements that are not part of the CA Easytrieve
Report Generator language. Any statement that starts with any one of the filter strings will be commented out before it is sent
to the CA Easytrieve Report Generator compiler.
The Source Filter String utility lets you create a set of default filter strings. Once these strings are defined, you do not have to
define filters for each program you want to edit, you can simply use the defaults.
Note: The default filter strings will be saved in the registry so they will be available every time the workbench is started up.
Set Default Filters Using the Source Filter Strings Utility
The values that you set here will be used if you checked Use Default Filter Strings on the Filter tab of the Program Profile
Manager.
Follow these steps:
1. Select Options, Source Filter Strings.
A dialog, identical to the Filter tab on the Program Manager dialog is displayed where you can enter, edit, or delete a filter
string.
2. Update the default filter strings.
3. Click OK.
The default filters are saved.
Environment Manager Utility
Use the Environment Manager to control the environment variables that will be used during program compilation and
execution from within the CA Easytrieve Report Generator Workbench.
The environment variables dictated by the Environment Manager get created as local environment variables to the Workbench;
they are stored in the registry under the CA Easytrieve Report Generator key and are available to programs being compiled
and executed within the workbench environment. The environment variables may also be packaged and distributed with your
CA Easytrieve® Report Generator 11.6
application. When used to specify a location to a file, these work similar to JCL DD statements and can be effectively used to
produce applications that are portable from one system (or server) to the next. By simply changing the environment variable,
you can point to a different input or output file without having to change your CA Easytrieve Report Generator program.
Note: The system environment is NOT changed. (This is a departure from the previous version which required the EZTDLLS
and EZTOPTS values be set for the environment.)
Manage Environment Variables Using the Environment Manager
This section explains how to add, edit, or delete environment variables.
Follow these steps:
1. Select Tools, Environment Manager.
2. To add a variable, do the following:
1.1 Click New to add an environment variable.
The New Environment Variable dialog is displayed.
2.1 Enter the variable name and value and click OK.
The variable and value are accepted and are added to the other variables in the Environment Manager dialog box.
3. To edit or delete an environment variable, do the following:
1.1 Click the variable.
2.1 Click the Edit or Delete button and click OK.
Any changes made are accepted.
Program Submission Utility
The Program Submission utility lets you execute a program on a remote MVS or UNIX server. This section includes
information about:
• How remote job submission works for UNIX systems
• Submitting a program for execution
• How to use the Job List dialog
How Remote Job Submission Works for UNIX Systems
For UNIX systems, a command shell script is built and uploaded to the host system using FTP, if specified on the Submit Tab
of the Program Profile Manager, along with the program to be executed.
The shell script is executed using one of these methods:
• RSH (Remote SHell)
Verify that:
-- The remote shell daemon (RSHD) is running.
-- A ".rhosts" file exists in the home directory of the user requiring remote shell access.
A typical ".rhosts" file is as follows:
machine.xxx.com username
In this case, the local machine name where the CA Easytrieve Report Generator Workbench is running is
"machine.xxx.com" and the login name is "username". Your UNIX system administrator may need to set this up for you.
Note: Due to security reasons, your system administrator may require you to use an SSH client as opposed to RSH. CA
Easytrieve Report Generator has been designed to support the plink (PuTTY link) SSH client.
• Plink (PuTTY link).
The "plink ssh client" option was checked on the Host Profile Manager.
The plink client uses SSH protocol (Secured SHell) to communicate with the host system and therefore provides enhanced
security.
PuTTY is an SSH enabled telnet program that allows you to access SSH-enabled UNIX systems. It is free and
downloadable from the Internet. It also contains a batch command processor program called plink that allows the remote
execution of UNIX commands using the SSH protocol.
Submit a Program for Execution
CA Easytrieve® Report Generator 11.6
When you submit a job for execution, the values specified on the Submit tab of the Program Profile manager are used by this
utility.
Follow these steps:
1. Locate and select a file for editing.
2. Select File, Submit (or press F2).
• One of the following actions will occur:
•If no program profile is defined, the Host Profile Manager dialog is displayed where you can choose or define a host
and submit the program.
• The active program is submitted to the remote system using the defined program profile.
• The Jobs button is enabled and a message area indicating the status of the job is displayed.
• The type of output specified on the Submit tab in the Program Profile Manager is automatically downloaded into an edit
window for inspection.
3. (Optional) Click Jobs to display the results for compiled or completed jobs.
Use the Job List Dialog
Once the active program is submitted to the remote system, the Jobs button is enabled and a message area indicating the status
of the job is displayed on the taskbar. You may also have other jobs active at the same time. (For z/OS systems, the JES queue
will be polled every 500 milliseconds (1/2 second) to check the status of the jobs that have been submitted.
The Job List dialog provides more information about your jobs and is available from submission to job completion. If Hold
For Select was specified within the Program Profile Manager's Submit tab, this dialog will reflect that program status for the
duration of the Workbench session.
Use the Job List Dialog When Your Job is Compiling
Follow these steps:
1. Click Jobs (bottom taskbar, center) to display a list of the submitted jobs and their status.
2. Optionally, click Abort to terminate an active job.
Once terminated, any spool files created are deleted from the JES queue.
Use the Job List Dialog When Your Job has Completed
If the output type is:
• All
All JES spool files are concatenated together and downloaded to the edit window.
• Hold for Select
The job status display indicates that the job has completed and that it has been held. The job return code is also displayed.
Follow these steps:
1. Click Jobs.
The jobs that are currently active or have completed and are being held are displayed.
2. Click a job and click Select.
The individual JES spool files that have been created for the job are displayed.
3. Do one of the following:
• Double-click a selection
• Click Get
The file contents are displayed in an edit window.
4. Optionally, click Delete to cancel the job if it is active.
All job output associated with this job is deleted from the JES queue.
To collapse the spool file display, click the up arrow or click Close to close the Job List window.
The Tools menu file defines the content and operation of the Tools menu. The DEFAULT.MNU menu file is predefined to
perform core functions. In addition, you can customize it (or point to your own variation of it). Menu files can be customized
to:
• Invoke other Windows applications.
• Invoke DOS programs (.EXE) or even batch (.BAT) files that run as background tasks in a special command shell window.
• Invoke a script that controls a batch task.
• Display a generic dialog to collect information before invoking a script.
Note: You are encouraged not to modify the predefined DEFAULT.MNU file directly, since it serves as a convenient backup.
Instead, create your own copy of the DEFAULT.MNU file and make changes to the new copy. After modifying your .MNU
file, use the Options Tools Menu File command to point to your new menu file.
Create Menu Files
A menu file is an ASCII text file that contains one instruction per line. It has the following characteristics:
• Comment records start with an asterisk (*) in column 1.
• A line cannot exceed 256 total characters.
• Blank lines are acceptable.
Each non-comment, non-blank line in a menu file is an instruction line. The sequence of instructions is important, because
many of these instructions are related to prior instruction lines. For example, a MenuItem is always followed by one or
more lines of instruction that define the processing that is to occur when the menu (or submenu) item is selected. Likewise,
a SubMenu instruction indicates that one or more SubMenuItem instructions will follow. This forms a cascading menu
underneath the SubMenu entry.
The DEFAULT.MNU file invokes CA Easytrieve® Report Generator, as well as tools to run a program and establish a set of
environmental variables.
You can include your own tools on the Tools menu.
Follow these steps:
1. Create a copy of the default tools menu (DEFAULT.MNU) and give it an appropriate name, such as MYMENU.MNU.
2. Edit the new menu file. Add new menu and submenu entries along with instructions for what is to happen when the menu
or submenu entry is selected by the user.
3. Point CA Easytrieve® Report Generator to your new menu file. Select the Options Tools Menu File command and specify
your tools menu in the dialog box.
Note: To associate your customized menu with a specific application, have the application open when you select the
Options Tools Menu File command.
CA Easytrieve® Report Generator 11.6
The case of the keywords and parameters is insignificant, but each must be separated from the next by at least one space.
MenuItem and SubMenuItem instructions define menu text, accelerator keys, and scripts.
• A MenuItem instruction defines an entry in the main Tools pull-down menu.
• A SubMenuItem defines a menu entry that extends, or cascades, from a menu entry.
The format of the MenuItem and SubMenuItem instructions are identical; therefore, the remainder of this discussion focuses
on MenuItem instruction, but it is also applies to the SubMenuItem.
A MenuItem line has the following format:
The text that is to appear in the Menu follows the MenuItem instruction and is enclosed within double-quotation marks ("). An
ampersand (&) is used to indicate which of the characters in the menu text is the accelerator that will cause the menu entry to
be selected.
• Keyname
This optional parameter specifies the keyboard combination of Alt+Shift+function keys that invoke the command directly.
The format is Alt+Shift+Fn, where n is an integer from 1 to 12, allowing 12 valid key names.
• Scriptfile
CA Easytrieve® Report Generator 11.6
This optional parameter specifies the script that is to be invoked in response to the MenuItem being selected.
Run Program
• Title-bar text
The title-bar text is placed in the title-bar area of the generic dialog. A generic dialog is a user-defined dialog that contains
the following:
• OK -- Standard OK button that closes the dialog box and immediately invokes the script specified on the previous
MenuItem or SubMenuItem line.
• Cancel -- Standard Cancel button that closes the dialog and keeps the menu entry's script from processing.
• Prompts -- Edit controls and explanatory text that is used to gather information from the user. These are defined with
the Prompt instruction.
• File Prompts -- Edit controls for file names and buttons that are used to collect file-names from the user. These are
defined using the PromptFile instruction.
• Prompt
Each DialogBox instruction is followed by one or more Prompt and PromptFile instructions that define the generic dialog
controls and therefore always follow the DialogBox instruction. The Prompt instruction collects variable data from the user
so that it can be passed to the Workbench's script processor.
The format is as follows:
• title -- This required parameter is enclosed with double quotes. It specifies the text that appears to the left of an edit
control in the generic dialog.
• variable -- This required parameter specifies the 1-30 character name of a variable to which the user's input text string
will be assigned.
• Profile -- An optional profile keyword that, if supplied, causes the variable and its current value to be stored in the
Workbench profile when the OK button is clicked. Using the profile parameter is a convenient way to allow the
specified value to remain from session to session.
Variables are named with 1-30 uppercase and lowercase alphabetic and numeric characters. You can also use the hyphen
(-) and underscore (_) characters to make the variable name more readable. Case is unimportant; for example, ALPHA,
alpha, and Alpha all refer to the same variable.
Variables pass information between a generic dialog and a script. Each variable in a generic dialog is available as an
identifier in the script language when the script starts to execute. This is a one-way exchange so that the changes made to
the values of variables during script processing are not retained.
• PromptFile
Collects the name of a file from the user. The format is as follows:
The title parameter is required and enclosed in double quotes. It specifies the text that appears to the left of an edit control
in the generic dialog. The variable parameter is also required. It specifies the 1-30 character name of a variable to which the
filename specified by the user will be assigned.
The final parameter is an optional profile keyword that, if supplied, causes the variable and its current value to be stored in
the Workbench profile when the generic dialog's OK button is clicked.
• BrowseFilter
Optional instruction that can be used after a PromptFile instruction to control the file name filters that are shown in the
generic Browse dialog. It is used to specify the file name filters that are shown in the File Type list box that is shown in the
drop down list that lists the type of files in the lower left corner of the Browse dialog.
The format is:
BrowseFilter "title1^filter1^text2^filter2"
The double quotes surround one or more pairs of title and filter specifications each of which is separated by a caret (^)
character. The title portion shows up in the File Type drop-down list of file types while the filter shows up in the File Name
edit control when the file type is selected.
When you click on the Mapset File Name button, the Select BMS Map Name dialog box appears.
• MenuSeparator and SubMenuSeparator
These instructions place a horizontal bar in the menu or submenu in which they are defined.
• Invoke
Specifies the name of the DLL and the entry point for the function that is to be invoked. It must follow the MenuItem or
SubMenuItem or to which it refers.
• Launch
Specifies the name of the EXE or BAT file that contains the program that you want to execute. It must follow the
MenuItem or SubMenuItem to which it refers.
• BrowseTitle
CA Easytrieve® Report Generator 11.6
An optional instruction that specifies the text that is displayed in the Browse File dialog. If specified, it must follow the
PromptFile instruction to which it refers. In the example in the previous section, the BrowseTitle instruction is used to
place "Select BMS Map Name" into the file browse dialog.
• PromptDirectory
Collects the path to a directory from the user. The format is as follows:
The title parameter is required and enclosed in double quotes. It specifies the text that appears to the left of an edit control
in the generic dialog. The variable parameter is also required. It specifies the 1-30 character name of a variable to which the
pathname specified by the user will be assigned.
The final parameter is an optional Profile keyword that, if specified, causes the variable and its current value to be stored in
the Workbench profile when the generic dialog's OK button is clicked.
For example:
When you click on the Temp Dir button, the Browse for Folder dialog box appears.
Document Variables
The Workbench conforms to the object/action paradigm whereby a user selects an object and then selects an action to apply
to it. Tools can conform to this paradigm by applying actions to the document (i.e., file) that is currently in focus. To facilitate
this capability the Workbench stores information about the currently focused document file in a series of CA_DOC_FN (CA
DOCument File-Name) variables:
• CA_DOC_FN_Full
The complete file description. For example:
EZTPGMS\Samples\Report1.EZT
• CA_DOC_FN
The file-name. For example, REPORT1.
• CA_DOC_FN_Drive
The file's drive. For example, C.
• CA_DOC_FN_Path
The complete path of the file. For example, EZTPGMS\SAMPLES.
• CA_DOC_FN_Ext
The file extension. For example, EZT.
These variables, along with any other variables defined in generic dialogs, are passed to the R2SCRIPT script processor. If
there is no file in focus when the menu command is selected, then each of the above variables is set to a value of spaces.
R2SCRIPT is a script language interpreter used by the Workbench, and available for you to use when creating your own Tools.
R2SCRIPT has a particular advantage for Workbench users -- it allows your script to shell out to a DOS session, execute
commands, and have the results of the commands returned to your script, and thus to whatever invoked the script. Other
products allow shelling out, but R2SCRIPT can also evaluate responses.
For example, the Workbench runs an R2SCRIPT program whenever you compile a program. This script program invokes
the compiler in its own operating session. If the compiler detects errors, it passes a non-zero status code back to the script
processor (R2SCRIPT), which in turn passes the status code back to the Workbench. The Workbench reacts to a non-zero
status from a compile script by displaying the compile errors in the window that contains the source in error, and launching the
Find Errors dialog box.
This article includes the following information:
Example 2:
Note: Communication between the Tools Menu and the script processor is established by passing the Tools Menu variables
to the script processor. The invoked script can access any of the variables defined in the tools menu, not just the variables for
the current menu item. If a variable is used in more than one menu, the variable for the menu that invoked the script takes
precedence.
Run Command
From a command prompt, enter the following command string:
The interpreter terminates after script-file-name is executed when script-file-name is provided. If script-file-name is omitted,
the interpreter remains started in server mode. If script-file-name is provided but arguments are omitted, the interpreter
prompts for arguments.
Lexical and Semantic Considerations
This section describes lexical and semantic considerations:
• Comments
Delimited by a single quote ('). When a single quote is encountered, all text from the quote to the end of the line is ignored.
CA Easytrieve® Report Generator 11.6
• Blank lines
Blank lines are ignored.
• Literal strings
Delimited by matching double quotes. If the string is to contain the string delimiter, it may be doubled inside the string
(that is, "….""…."). A "\n" sequence within the string is translated to an ASCII linefeed character and hence is significant
to displayed text.
• Number
Internally represented as long integers. They may not contain a decimal place. Numeric conversions from strings are
attempted when required; for example, the literal -255 is equivalent to the string "-255" for arithmetic expressions.
• Case of identifiers
Reserved words, and so on. This is not significant.
• String comparisons
Not case sensitive. If an integer is compared to a string, the integer is converted to a string for the comparison. Two
integers are compared as integers.
• Identifiers
Can consist of the characters A-Z, a-z, 0-9, @, %, $, !, ?, and _. An identifier's first character must be non-numeric.
Identifiers are translated internally to uppercase.
Identifiers need not be defined before use. An identifier that is referenced before it is assigned to has the string value of the
identifier name.
Identifier values are not explicitly typed. Conversions to integer and/or string are performed as required. Inability to
perform a conversion results in a runtime error.
The following identifiers are reserved to the language.
• Identifiers with underscores are constants or variables.
• Identifiers without underscores are commands or functions.
• Environment Variables
A script can refer to existing environment variables (such as those in CONFIG.SYS) or change them. If a script changes a
variable, then shells out to a DOS session, the command session uses the changed variable.
When a script begins execution, the contents of the current environment are defined with their current values and can be
referred to wherever an identifier is valid.
The identifier has the value of the environment variable. Hence, all environment variables are directly accessible to the
script as identifier references. If the script changes the content of an environment variable, the new value becomes the
environment variable for subsequent command executions (actually, the entire interpreter symbol table becomes the
environment for subsequent command execution). Use the CLEAR command to remove an identifier from the symbol table
and thus prohibit the symbol from being defined in the environment when a command is being executed.
CA Easytrieve® Report Generator 11.6
• Characters
The following characters or character sequences are lexically significant:
Character Meaning
= Equal to or assignment
<> Not equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
+ Arithmetic binary addition or string concatenation
- Arithmetic binary or unary subtraction
* Arithmetic multiplication
/ Arithmetic integer division
( Open parenthesis
) Close parenthesis
; Semicolon
, Argument separator functions and procedure parameter lists
Relational Expressions
The language supports six relational operators:
Operator Meaning
= Equal to
<> Not equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
All relational expressions are binary (that is, they take two operands). You can connect relational expressions using the
logical operators And, Or, and Not. Relational expressions can only be used in an IF statement. String comparisons are not
case sensitive. If an integer is compared to a string, the integer is converted to a string for the comparison. Two integers are
compared as integers. An example of a relational expression used in an IF statement is "If _rc > 4 Then Exit Program".
Logical Expressions
The language supports three logical operators: And, Or, and Not. Logical operators can only be used as part of a relational
expression in an IF statement. An example of a statement using the logical connective "And" is "If a = b And b = c Then a =
c".
All relational expressions connected by the logical operators are evaluated before determining the truth of the logical
expression as a whole.
Arithmetic Expressions
The language supports five arithmetic operators:
* Binary Times
/ Binary Divide
Operators must be enclosed by spaces. Precedence can be modified by enclosing sub expressions in parentheses.
All arithmetic operators are integer operations (integers are represented as signed 32-bit binary numbers). If an operand of an
arithmetic operator is a string, an attempt is made to convert the string to an integer before performing the operation; if the
conversion fails, a runtime error is generated. An arithmetic expression can be used as an argument to any statement or built-in
function in the language.
String Expressions
The language supports one string operator, concatenation (+). Since plus (+) is also used to represent arithmetic addition,
concatenation occurs only if the interpreter is unable to convert both operands of the plus operator to integer (that is, integer
addition has precedence over string concatenation).
A string expression can be used as an argument to any statement or built-in function in the language.
Built-in Functions
A built-in function can be used anywhere an arithmetic or string expression can be used. The following built-in functions are
defined.
Command$ Function
The Command$ function returns a string containing the arguments provided on the command line to the script interpreter.
Leading and trailing white space is removed.
This function has the following format:
Command$
Example
commandline = Command$
LCase$ Function
The LCase$ expression returns a string containing the lowercase equivalent of <expression>.
This function has the following format:
LCase$(expression)
Example
MessageBox Function
This function displays a message box with the specified message and captions.
CA Easytrieve® Report Generator 11.6
• message expression
The text displayed in the message box.
• caption expression
The title of the message box window.
• type flag
Defines the type and number of buttons in the message box window. Type flag can be one of the following reserved
constants:
• icon flag
Specifies an icon to be displayed in the message box. Icon flag can be one of the following reserved constants (the default
action is to not display an icon in the message box):
• default button
Defines which of the buttons in message box is to be the default button (that is, which button is assumed when the Enter
key is pressed). Default button can be either 1, 2, or 3; 1 is the default. If there are fewer buttons displayed than indicated
by this constant, 1 is assumed without error.
The MessageBox function returns one of the following reserved values depending on which button is pressed by the user:
Value Cause
_Ok The OK button was pressed
_Cancel The Cancel button was pressed
_Yes The Yes button was pressed
_No The No button was pressed
_Abort The Abort button was pressed
_Retry The Retry button was pressed
_Ignore The Ignore button was pressed
CA Easytrieve® Report Generator 11.6
Example
UCase$ Function
UCase$ returns a string containing the uppercase equivalent of expression.
This function has the following format:
UCase$(expression)
Example
Language Statements
The language supports the following statements (that is, commands).
IDENTIFIER Statement
The computed value of expression is assigned to the variable IDENTIFIER. IDENTIFIER is created if it does not already
exist; if it does exist, the current value of IDENTIFIER is replaced with the new value.
This statement has the following format:
identifier = expression
Example
directory = "c:\r2script"
i = (j + 1) * 10
Example
EXIT Statement
Stops interpretation of the script and does not return a result to the user or program requesting interpretation of the script. The
PROGRAM keyword is optional and is assumed if it is not present.
This statement has the following format:
EXIT [PROGRAM]
Example
EXIT PROGRAM
IF Statement
Allows one or more statements to be conditionally executed. Relational expression is evaluated and if it evaluates to TRUE
then statement list 1 is executed. If relational expression is FALSE and the ELSE clause is present, statement list 2 is executed.
This statement has the following format:
Example
RETURN Statement
CA Easytrieve® Report Generator 11.6
Stops interpretation of the script and returns expression as the result of the script interpretation to the user or program
requesting interpretation of the script.
This statement has the following format:
RETURN expression
Example
RETURN _rc
SHELL Statement
Allows a DOS command to be executed in a DOS box. The response from executing the command is placed in the reserved,
read-only, constant _RC. The _DOS keyword is optional and is assumed if it is not present.
This statement has the following format:
Example
SETDIR Statement
Allows the script to set the current directory when a command is executed via the SHELL command. The current directory for
the script interpreter is not affected.
This statement has the following format:
SETDIR(expression)
CA Easytrieve® Report Generator 11.6
Example
SETDIR("C:\R2SCRIPT")
SHOWWINDOW Statement
Controls the display state of the batch window in which OS commands are executed via the SHELL command.
This statement has the following format:
SHOWWINDOW(flags)
Constant Effect
_SW_HIDE Hides the window and passes activation to another window.
_SW_MAXIMIZE Activates the window and displays it as a maximized
window.
_SW_MINIMIZE Minimizes the window to an icon and passes activation to
another window.
_SW_NORMAL Activates and displays the window. If the window is
minimized or maximized, it is restored to its original size and
position.
_SW_RESTORE Same as _SW_NORMAL.
_SW_SHOW Activates the window and displays it in its current size and
position.
_SW_SHOWMAXIMIZED Same as _SW_MAXIMIZE.
_SW_SHOWMINIMIZED Activates the window and displays it as an icon.
_SW_SHOWMINNOACTIVE Displays the window as an icon. The window that is currently
active remains active.
_SW_SHOWNA Displays the window in its current state. The window that is
currently active remains active.
_SW_SHOWNOACTIVATE Displays the window in its most recent size and position. The
window that is currently active remains active.
_SW_SHOWNORMAL Same as _SW_NORMAL.
Sample Scripts
Note: Saving Open Files - If you need to make sure any files opened by the Workbench have any outstanding changes saved
prior to running some process, you can specify: EEExternal "cawbdisp.dll" Proc WB_SaveAllFiles as Integer RC_EXT =
WB_SaveAllFiles().
Sample #1
This script sample demonstrates just how simple a script can be.
_MB_OK, _MB_EXCLAMATION, 1)
3 shell "set" 'dummy =
4 MessageBox("ReturnCode="+_rc, "return code",'
_MB_OK, _MB_EXCLAMATION, 1)
Line Function
1 The Shell command issues a DOS Dir command to the OS
window.
2 Message Box command displays the return code from the OS
dir command.
3 The Shell command issues a Set command to the OS to dump
the contents of the environment area to screen.
4 Message Box command displays the return code from the OS
Dir command.
Note: All variables within the current script are made available to the OS window as environment variables. Thus, it is
possible to pass environment variables from your script to OS command procedures. However, the environment variables that
are modified within the DOS shell are not passed back to the script processor.
Sample #2
For a sample script that demonstrates how to communicate between the Tools Menu and the CARUNDOS.SCR script file,
refer to the CARUNDOS.SCR file in the directory where you install CA Easytrieve® Report Generator. This is the actual
script invoked from the Run Program Tools menu item.
Workbench Help
The Workbench online help includes information about the user interface and tasks that you can perform,
such as configuring the options table and printer set definitions, and building and compiling programs.
The Workbench online help includes information about the user interface and tasks that you can perform, such as configuring
the options table and printer set definitions, and building and compiling programs.
The Workbench Help menu has the following items:
• Contents
Opens the Workbench online help.
• On Line PDF Documentation
Opens the documentation bookshelf. Links to the PDF guides that are installed with the product are provided.
• About CA Easytrieve Workbench
Displays the product version, build, and licensing information.
CA Easytrieve/Earl Usage
The /Earl file exit program is an assembly program that performs two functions.
The CA Easytrieve® Report Generator/Earl file exit program is an assembly program that performs two functions.
• Translate the CA Easytrieve® Report Generator exit parameter list to the CA Earl parameter list.
• Invokes a specific CA Earl program.
Contents
Syntax
PARM-REGISTER))
• filename
The DD name of the data file that the Exit reads.
• lrecl
The record length of the file.
• EARLEXIT
The name of the CA Easytrieve® Report Generator/EARL file exit.
• COMAREA
An 80-byte working storage field used as a communication area for the specific CA Earl exit being used. COMAREA must
be defined in the CA Easytrieve® Report Generator program as an 80-byte alpha field.
• exitname
The CA Earl exit supplied by a specific CA Technologies product.
• PARM-REGISTER
CA Easytrieve® Report Generator predefined field that contains the value of register 1 on the CA Easytrieve® Report
Generator program.
COMAREA must be passed to the exit as an 80-byte alpha field. It is redefined into two parts. The first four bytes of
COMAREA is an integer that contains the CA Earl return code. Its values are:
• -1 End of File
• -2 Record not found
• 0 User cancel.
Redefine the remaining 76 bytes of COMAREA per the requirements of the specific exit. This area can be used to pass
additional parameters required by the Exit or for user messages.
Please refer to the appropriate product documentation for information on supplied CA Earl exits.
Sample CA Easytrieve® Report Generator/Earl Exit
* FILE DEFINITION
* FILE NAME: AIRPORTS
* EARL EXIT NAME: EARLGET
* RECORD LENGTH: 48
FILE AIRPORTS WORKAREA 48 +
EXIT (EARLEXIT USING (COMAREA, 'EARLGET ', 'AIRPORTS ', +
PARM-REGISTER)) F (48)
NAME 1 18 A
CITY 20 16 A
COUNTRY 37 3 A
PASS 41 8 A
DEFINE COMAREA W 80 A
DEFINE EARLCOM-FLAG COMAREA 4 B
DEFINE EARLCOM-MSG COMAREA +4 76 A
JOB INPUT AIRPORTS
PRINT AIRPORTS
REPORT AIRPORTS
CONTROL
LINE 1 +
NAME +
CITY +
COUNTRY +
PASS
CA Easytrieve® Report Generator 11.6
CA Easytrieve SDS
CA Easytrieve Simplified Design System (CA Easytrieve SDS) is a Windows application that you can
use to create CA Easytrieve reports.
CA Easytrieve Simplified Design System (CA Easytrieve SDS) is a Windows application that you can use to create CA
Easytrieve reports.
Data for the report can reside on a local or remote computer. You design a report using the Easytrieve Report Painter feature
and then submit the job. Report output is displayed in CA Easytrieve SDS.
Note:
You must have a valid CA Easytrieve license to run reports using CA Easytrieve SDS.
Start CA Easytrieve SDS
To start CA Easytrieve SDS, double-click easytrieve.exe in the folder that contains the CA Easytrieve SDS files.
Note:
For the first use, click Go directly to SDS in the Welcome screen. After the first use, the application starts without displaying
the Welcome screen.
Create a Report
You can create a report by following this process:
1. Create a JCL/Submit Prolog Source File
2. Create a Project and Host Profile
3. Import File and Field Definitions
4. Design and Run a Report
More Information:
For more information about this application, see the CA Easytrieve Help.
Next Step:
Create a Project and Host Profile
• This procedure shows the minimum properties that are required. For more information about projects and host profiles, see
the CA Easytrieve SDS Help.
• To edit a host profile after you save it, right click the host profile name in the business objects tree and select Open.
• To edit the JCL/Submit prolog file after you save the host profile, right-click the host profile name in the business objects
tree and select Edit Prolog. Do not edit the source file that you select in Step 6.
• For a video demonstration of this procedure, click here.
Next Step:
CA Easytrieve® Report Generator 11.6
7 Programming
Programming reference for developers.
This section is for CA Easytrieve Report Generator programmers. As a programmer, you should be familiar with the CA
Easytrieve Report Generator language and understand basic data processing concepts.
This section has information about:
• Applying CA Easytrieve Report Generator programs to various application tasks
• Creating efficient CA Easytrieve Report Generator programs
• Analyzing and modifying existing CA Easytrieve Report Generator programs
This section can be used with the following implementations of the product:
• CA Easytrieve Report Generator Report Generator
• CA Easytrieve Report Generator in the UNIX, Linux for zSeries, Windows, and z/OS batch environments
This section and the Language Reference section can help you write CA Easytrieve Report Generator programs. To learn the
basic parts of a CA Easytrieve Report Generator program, see Getting Started.
Text Conventions
The following notations are used in syntax examples:
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 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 Report Generator
keyword, or within text descriptions, indicate a name or field
that is used in a program example.
• Both zoned decimal and packed decimal fields follow the same rules. The product packs all zoned decimal fields and
handles them as packed fields. The product uses the actual storage value in the field, but it is your responsibility to maintain
a positive sign. An EBCDIC F sign or an ASCII 3 sign is placed in any unsigned field that is used on the left-hand side of
an assignment statement.
• An unsigned packed decimal field (U format) is always unsigned. When you manipulate the field, The product supplies an
F sign.
• As is the case with signed (quantitative) integer numbers, unsigned (non-quantitative) integer numbers are processed in the
same way as unsigned binary numbers and are subject to the same limitations. The only exception is that integer numbers
are always stored in native byte order.
• For fixed-point ASCII numbers, the actual ASCII numeric data can reside anywhere within the field and can contain
leading and trailing blanks or zeros.
Code Programs
The organization of this section simulates the way an application program is developed. The basic
application development process steps are:
The organization of this section simulates the way an application program is developed. The basic application development
process steps are:
1. Design the program:
• Determine the task you want the program to accomplish.
• Define the files necessary to read and write the information used by the program.
• Fill in successive levels of the design until you have a program structure that accomplishes the task.
2. Code the program logic as designed:
• Code and test the basic flow of your program before filling in lower levels of the design.
For instructions on compiling, link-editing, and executing your program, see Using.
Structured Programming
The language supports structured programming concepts by requiring you to use defined activities and
special-named procedures. These activities and procedures help you create programs that are efficient,
reliable, and maintainable.
The CA Easytrieve® Report Generator language supports structured programming concepts by requiring you to use defined
activities and special-named procedures. These activities and procedures help you create programs that are efficient, reliable,
and maintainable.
CA Easytrieve® Report Generator also lets you practice structured programming concepts when you want to incorporate large
sections of procedural code into your program.
CA Easytrieve® Report Generator lets you easily break a large program into manageable modules by using PROGRAM, JOB,
SCREEN, and SORT activities, and REPORT and SCREEN special-named procedures. You can code each module to perform
a specific function for the program. Each specific function is then easily identified and maintained.
CA Easytrieve® Report Generator lets you create well-structured programs that can be read easily. To accomplish this, design
your program with the following items in mind:
• Keep modules (procedures) small (small enough to fit on one page of the compile listing).
• Use meaningful comments wherever possible so that others can easily read and modify your program.
• Use the CA Easytrieve® Report Generator control flow structures to make programs more readable and efficient. CA
Easytrieve® Report Generator provides two special GOTO statements that are very useful: GOTO JOB and GOTO
SCREEN. These statements provide a well-defined method to instruct CA Easytrieve® Report Generator to iterate the
activity process.
• Use the following structured programming statements to control your program in a clear and logical way:
• IF/ELSE/ELSE-IF
• CASE
• DO WHILE
• DO UNTIL
• EXECUTE
• PERFORM
CA Easytrieve® Report Generator 11.6
• Use consistent indentation that shows nesting and control flow. Indent statements that are enclosed in control flow
structures, such as IFs and DOs. When nesting these control flow structures, indent an additional level. For example:
Program Sections
A program consists of the following main sections:
A CA Easytrieve® Report Generator program consists of the following main sections:
You can code one or more procedures (PROCs) at the end of each activity. Procedures are separate modules of program code
you use to perform specific tasks.
REPORT subactivities are areas in a JOB activity where reports are described. You can code one or more REPORT
subactivities after the PROCs (if any) at the end of each JOB activity. You must code any PROCs used within a REPORT
subactivity (REPORT PROCs) immediately after the REPORT subactivity in which you use them.
The following exhibit shows some CA Easytrieve® Report Generator keywords and other items in the sections where they are
usually located, and gives the general order of CA Easytrieve® Report Generator statements within a program.
Section
FILE ... Library
...
PROGRAM
(statements) Activity
SCREEN
(screen procedures)
JOB
(statements)
(job procedures)
REPORT
(report procedures)
SORT
(sort procedures)
...
This example shows fields that are defined in the library section:
When fields are defined within an activity, each field definition must start with the DEFINE keyword and physically be
defined before the field is referenced. In the library section, using the DEFINE keyword is optional.
If the same field is defined more than once, the first definition is used and subsequent definitions are ignored.
Note:
For more information about the DEFINE statement format, see DEFINE Statement.
File Fields
File fields are normally defined immediately following the associated FILE statement in the library section of a CA Easytrieve
program. Their rules of usage are:
• CA Easytrieve accepts an unlimited number of fields for each file (constrained by available memory).
• Field names must be unique within a file.
• You can define file fields anywhere in a library or activity section, except within a REPORT sub-activity or a SCREEN
declaration.
• For more specific information about defining fields in a database file, see the appropriate SQL or CA IDMS
documentation.
Working Storage Fields
You can specify two types of working storage fields: S (static) and W (work). Each type is used in a different way, particularly
when used in reporting. It is recommended to ALWAYS use S fields unless you know exactly what W means to your
application and the special processing that is associated with spooled work fields.
Fields that are defined as type S are stored in a static working storage area and are not copied onto report work files. All
references to S fields in a report occur at the time the report is formatted and printed.
Fields that are defined as type W are copied onto the report work files at the time a PRINT statement is executed. A spooled
report is not formatted and printed at the same time the PRINT is executed. Therefore, the value of a W field on a report is set
at the time the report data is selected for printing, not at the time it is printed.
With this in mind, you should use S (static) working storage fields for:
• Temporary work fields for report procedures
• Line annotations that are controlled from report procedures
• Grand total values that are used to calculate percentages
CA Easytrieve® Report Generator 11.6
For examples of the use of W and S fields, see Report Processing. Working storage fields are typically defined in the library
section. Their rules of usage are:
• CA Easytrieve accepts an unlimited number of working storage fields (constrained by available memory).
• Working storage fields must be uniquely named within working storage.
• You can define working storage fields anywhere in a library section, activity, or procedure.
Data Reference
Every data reference (file or field) in your program must be unique. You can provide uniqueness in one of the following ways:
• Unique name -- A name is unique if no other file or work field has that name. For example, GROSS-PAY is unique if it
appears as field-name in only one DEFINE statement (and has never been copied to another file with a COPY statement).
• Qualification -- Qualification occurs when you prefix the optional qualifier file-name: to a field name. CA Easytrieve
requires the use of the qualifier whenever the field name alone cannot uniquely identify the data reference. The qualifier for
file fields is the associated file name or record name. For working storage fields, the qualifier is the keyword WORK.
• Default Qualification -- Through default qualification, CA Easytrieve attempts to determine which field you want to
reference when a field name is not a unique name.
If you are in the library section, the current FILE (if one is coded) and the WORK file are searched for an occurrence of the
field in question. If the field is not found in either the current file or the WORK file, or if the field occurs in both the current
file and the WORK file, an error message is issued, stating that additional qualification is required.
If you are in a SORT or JOB activity, and you code an INPUT filename on a JOB statement, the input file is searched for an
occurrence of the field in question. For synchronized file processing, all of the files that are coded on the INPUT parameter of
the JOB statement are checked for an occurrence of the field in question. If the field occurs in exactly one of the input files,
that field is used. If the field occurs in more than one of the default files, an error message is issued, stating that additional
qualification is required.
If the field does not occur in any of the default files, each of the remaining files (including WORK) is searched for an
occurrence of the field in question. If the field occurs in exactly one of the remaining files, that field is used. If the field occurs
in more than one of the remaining files, an error message is issued, stating that additional qualification is required.
If you do not specify an INPUT parameter on the JOB statement, a default input file is used. If the JOB activity immediately
follows a SORT activity, the output from the SORT activity is the default input file. If the JOB activity occurs at any other
point, the default input file is the first FILE coded that is not a TABLE file, a PUNCH file, or a PRINTER file. Once a default
input file is selected, default qualification occurs as described previously.
For PROGRAM, SCREEN, and JOB INPUT NULL activities, no default qualification occurs.
Indexing
Indexing is data reference that results from CA Easytrieve deriving a displacement value to correspond to a particular
occurrence in a field name that is defined with OCCURS. The formula for deriving the index value is: the number of the
desired occurrence minus one, multiplied by the length of the occurring field element. For example, if an occurring field is
defined as:
MONTH-INDEX = (3 - 1) * 9 = 18
The VARYING keyword on the DEFINE statement designates varying length alphanumeric fields. Varying length fields are
often used in SQL databases (VARCHAR). An example of a varying length field definition follows:
Because VARYING is used, this W-type work field has two parts, which are internally defined as follows:
When you reference this field in your statements, you can use FLDA to specify the field in any one of the following ways:
• To designate the entire field (both length and data portions), specify FLDA. This covers bytes 1 through 250.
• To designate only the length portion of the field (bytes 1 and 2), specify FLDA:LENGTH. This covers bytes 1 and 2 (the
alphanumeric portion).
• To designate only the data portion of the field (bytes 3 through 250), specify FLDA:DATA. This covers bytes 3 through
250 (the binary portion).
Note: When you reference the entire field, CA Easytrieve automatically uses the length portion of the field when it acts on the
field.
Displaying Varying Length Fields
The display window for varying length fields is based on the maximum length. However, the current value of the length
portion determines how much of the data portion is displayed in the window.
The length portion of the field is not typically displayed. However when DISPLAY HEX is used, length and data is displayed.
DISPLAY HEX displays length and the full data field in hexadecimal and character format. An example follows.
Statements:
Results:
ABCD CHAR
ABCD ZONE 00CCCC4
NUMB 0412340
Statements:
Results:
1. VALUE= LENGTH=
2. VALUE=12345678 LENGTH= 8
3. VALUE=12345 LENGTH= 5
4. VALUE=12345 LENGTH= 5
5. VALUE= LENGTH= 5
Note:
• If the sending field has a length of zero and the receiving field is a VARYING field, the receiving field has a length of zero.
• If the sending field has a length of zero and the receiving field is not a VARYING field, the receiving field is filled with the
fill character (blank for assigned, blank, or specified fill character for MOVE).
Comparing Varying Length Fields
Comparisons of varying length fields are based on the length of the data at the time of the comparison.
to work with 8-byte binary fields, the rule concerning maximum precision is relaxed. However, it is important to remember
that this applies solely to 8-byte binary fields.
Contents:
DEFINE TEST-B-FIELD W 8 B 0 +
MASK '-,---,---,---,---,---,--9'
JOB INPUT(NULL)
TEST-B-FIELD = 1000000
DISPLAY 'TEST-B-FIELD=' TEST-B-FIELD
TEST-B-FIELD = -1000000
DISPLAY 'TEST-B-FIELD=' TEST-B-FIELD
TEST-B-FIELD = -1000000000000000000
DISPLAY 'TEST-B-FIELD=' TEST-B-FIELD
STOP
TEST-B-FIELD= 1,000,000
TEST-B-FIELD= -1,000,000
TEST-B-FIELD=-1,000,000,000,000,000,000
Note: The last line of output includes all 19 digits of the value.
Assigning 8-Byte Binary Fields to Other Field Types
The 19-digit precision of 8-byte binary fields also affects the result of assignments to fields with other types. These other fields
have are restricted to a maximum precision of 18 digits. This means that there is a potential to lose the high-order digit of the
8-byte binary field on assignment. For example, consider the program:
TEST-B-FIELD=9,223,372,036,854,775,807
CA Easytrieve® Report Generator 11.6
TEST-P-FIELD=223,372,036,854,775,807
Note: The value lost the high-order digit of 9 during assignment from 8-byte binary to 10-byte packed.
Using 8-Byte Binary Fields in Expressions
As explained previously, the 8-byte binary field can lose its high-order digit during assignment. However, when an 8-byte
binary field appears as a term in an expression, the full value of the field is retained. For example, consider the program:
TEST-B-FIELD=9,223,372,036,854,775,807
TEST-P-FIELD=922,337,203,685,477,580
TEST-B-NEWFL=9,223,372,036,854,775,807
Note: The division causes the low-order digit to be discarded as expected. Also, the multiplication of the 10-byte packed value
produced a 19-digit intermediate value such that the addition produced the original input value, also as expected.
Declarations
This article explains the declarations that you can code using the DECLARE statement.
This article explains the declarations that you can code using the DECLARE statement.
Declare Screen Item Attributes (CA Easytrieve Online)
You can declare named screen attribute fields by using the DECLARE statement. These declared attributes are different from
ordinary fields that you DEFINE. Screen attributes contain information that controls the display of screen items such as their
color and brightness.
Use of declared attributes provides the ability to dynamically change screen attributes during program execution, and saves
you coding time when the set of attributes is used many times. Declared attributes can be used as follows:
• Use the DECLARE statement to name a set of screen attributes you want to use on multiple screen items.
For example, it is easier to use a declared attribute containing the INTENSE, BLUE, and MUSTFILL attributes on multiple
items than to code the three attributes on each item in the screen. Declared attributes can be used in the ATTR parameter of
the DEFAULT, TITLE, and ROW statements.
• You can use declared attributes to contain a dynamic set of attributes, that is, you can declare named attributes containing
various sets of attributes. To do this, declare an empty named attribute to use on your ROW statements. Before displaying
the screen, you can assign one of the declared attributes containing a specific set of attributes into the empty declared
attribute. This lets you dynamically set the screen attributes of items based on decisions that are made during execution.
Declare Input Edit Patterns
CA Easytrieve® Report Generator 11.6
You can also use the DECLARE statement to declare named input edit patterns. An input edit pattern allows you to specify a
character sequence that describes the format of the data in the field.
Note: Use a PATTERN to edit complex combinations of data types and character sequences. Use a MASK to edit numeric
data.
These named input patterns can then be used in the PATTERN parameter of multiple items on ROW statements in a SCREEN
activity. Input data is automatically checked against the pattern and if the data does not conform to its specified PATTERN, an
appropriate error message is issued to the terminal user.
As with declared attributes, using a declared pattern requires you to specify the PATTERN only once. Declared patterns can
then be used on multiple items on ROW statements.
Declare Subprogram Linkage
You can also use the DECLARE statement to specify how you want to link a subprogram. Subprograms can be linked
statically with your CA Easytrieve program or dynamically loaded.
Note:
• For more information about using screen attributes and patterns, see the Screen Processing section.
• For more information about subprogram linkage, see Inter-Program Linkage.
'O''KELLY'
Note: ASCII is supported on UNIX and on Windows. EBCDIC is supported on the mainframe.
Hexadecimal Literals
Hexadecimal literals are words used to code values that contain characters not available on standard data entry keyboards.
Prefix the hexadecimal literal with X' (the letter X and a single quote), and terminate it with a single quote. Each pair of digits
that you code within the single quotes is compressed into one character. Only the digits 0 through 9 and the letters A through F
are permitted. The following hexadecimal literal defines two bytes of binary zeros:
X'0000'
DBCS format literals contain DBCS characters only. Enclose a DBCS format literal within apostrophes. A DBCS format
literal can be up to 254 bytes long, including the shift codes. An example of a DBCS literal follows:
'[DBDBDBDBDBDB]'
The left bracket ([) and right bracket (]) indicate shift-out and shift-in codes.
MIXED Format Literals
MIXED format literals are words containing both SBCS and DBCS characters. Enclose MIXED format literals within
apostrophes. The presence of shift codes identifies DBCS subfields. Shift codes also identify the code system of that DBCS
data. The word coded within the apostrophes (including the shift codes) cannot exceed 254 bytes in length. A MIXED literal is
defined in the following example:
'EEEE[DBDBDB]'
The left bracket ([) and right bracket (]) indicate shift-out and shift-in codes.
Non-mainframe Data Format
In non-mainframe environments, the product assumes all literals and alphanumeric data are ASCII and performs no
conversion.
Format and Conversion Rules (Mainframe Only)
During compilation, all literals coded in the source program are converted into the correct DBCS code system and data format
(SBCS, MIXED, or DBCS) as dictated by the statements in which they appear. To understand the process used to determine
the correct code system and data format, it is important to identify the element of each program statement that is interpreted as
the subject of that statement. The subject dictates the correct code system and format type.
Literal Subject Elements (Mainframe Only)
Each program statement has a subject element whose DBCS code system and data format define the DBCS code system and
data format of all the other elements that appear on that statement.
The following table lists the subject elements of those statements that support the coding of literals. Those that do not have a
subject element are also included. They are indicated by the words "not applicable."
Keyword
FILE - EXIT..USING ASIS PROCESSING
DEFINE - HEADING ASIS PROCESSING
IF/DO...WHILE field-name field-name
Assignment field-name field-name
POINT ASIS file-name
HEADING ASIS file-name(printer)
TITLE (report) ASIS file-name(printer)
LINE ASIS file-name(printer)
KEY ASIS terminal
TITLE (screen) ASIS terminal
ROW ASIS terminal
Activities
CA Easytrieve Report Generator activities resemble the steps of a batch job, but they are not constrained by Job Control
Language (JCL) and associated operating system overhead. A CA Easytrieve Report Generator program consists of at least one
of the four types of activities: PROGRAM, SCREEN, JOB, and SORT.
A PROGRAM activity is optional. If used, only one PROGRAM activity can be coded in a CA Easytrieve Report Generator
program, and it must be coded before any other activities. PROGRAM activities can control the entire program. If used, the
PROGRAM activity must EXECUTE the other types of activities when they are to be initiated. If no PROGRAM activity is
coded, there is an implied PROGRAM activity that initiates other activities as follows:
• JOB and SORT activities are executed sequentially until a SCREEN activity is detected.
• The SCREEN activity is executed.
• Any remaining activities must be executed by the first SCREEN activity. Automatic sequential execution does not proceed
beyond the first SCREEN activity.
You can code one or more procedures (PROCs) at the end of each activity. Procedures are local to the activity after which they
are coded. You cannot perform procedures that are not associated with the activity in which the PERFORM is coded.
You can code one or more REPORT subactivities after the PROCs at the end of each JOB activity. You must code PROCs
used within a REPORT subactivity immediately after the REPORT subactivity in which you use them.
Program Flow
The PROGRAM activity is a simple top-down execution of the statements that are contained in it. PROGRAM activity is
delimited by another activity in the source. PROGRAM activity execution stops when any one of the following actions occurs:
• The end of the activity is reached.
• A STOP statement is executed in the PROGRAM activity.
• A STOP EXECUTE or TRANSFER statement is executed anywhere in the program.
If a PROGRAM activity is coded, it is responsible for the execution of other activities in the program.
CA Easytrieve® Report Generator 11.6
Screen Flow
The following code shows the basic flow of a SCREEN activity. See Screen Processing for more information.
Job Flow
The following code shows the relationship between JOB activity statements and shows implied statements that are attributed to
JOB:
IF ...
PERFORM proc-name
PRINT report-
name JOB activity statements
...
END-IF
of JOB statements
proc-name. PROC
... Optional procedures
END-PROC and reports are
REPORT report-name placed at end of JOB
statements
...
JOB/SORT/
SCREEN Other activities
CA Easytrieve Report Generator processes input records one at a time. You can use any valid combination of statements to
examine and manipulate the input record. CA Easytrieve Report Generator repeats the processing activity until the input is
exhausted or until you issue a STOP statement.
Sort Flow
The following example illustrates the flow of a SORT activity:
ELSE
Step 6
pass record to SORT No BEFORE proc,
pass all to SORT
END-IF
Step 7
Retrieve next record from input file (file-
a) Get next record from
input file
END-DO
Step 8
Perform SORT process (USING fld1, ...) Actually SORT the
records
CA Easytrieve® Report Generator 11.6
proc-
name. PROC Step 10
... Optional user-
written
SELECT procedure is placed
... after the SORT
END-PROC
JOB/SORT
• Once an activity with NOTERMINAL specified starts, all child activities execute with NOTERMINAL specified for
them until the parent activity terminates.
• When CA Easytrieve Report Generator determines that a program has been linked to, the linked to program always
behaves as if NOTERMINAL had been specified, that is, the child program always executes in fully-conversational
mode. See Inter-Program Linkage for more information about the LINK statement.
CA Easytrieve® Report Generator 11.6
When an activity terminates abnormally, a rollback is automatically issued to recover the updates that were made since the last
commit point.
If you execute a STOP EXECUTE statement in your activity, it is considered an abnormal termination.
Controlled Commit Processing
You can issue your own commit points and rollbacks as needed for your application by using the COMMIT and ROLLBACK
statements. These commits and rollbacks are performed in addition to the commits and rollbacks that are automatically issued
as a result of the COMMIT parameter on the activity statement.
Note: Controlled commits have no effect on whether programs run conversationally or pseudo-conversationally in CICS.
Recoverable Resources
With a recoverable resource, the actual processing that is performed by the execution of commits and rollbacks is determined
by the operating environment in which CA Easytrieve Report Generator is running. Each time a commit point is issued, CA
Easytrieve Report Generator causes the following actions to happen:
• An SQL COMMIT that closes cursors is executed.
• An IDMS COMMIT or IDMS FINISH is executed. IDMS FINISH statements end run-units and are used at the end
of activities or during terminal I/O. Following an IDMS FINISH statement, CA Easytrieve Report Generator does not
automatically bind the run-unit or re-establish currencies.
• HOLDs that have been issued are released.
• Browses of VSAM files are terminated. CA Easytrieve Report Generator can generally reposition the file for you.
However, the product cannot reposition an indexed file if the associated data set is a VSAM PATH and the auxiliary or
secondary index data set was defined with non-unique keys.
• Browses of C-ISAM files are terminated. Because only files with unique keys are supported, the product repositions the file
for you.
• In CICS, printer spool files are closed. CA Easytrieve Report Generator automatically defers opening these files until they
are used.
You must provide the necessary logic in your code to handle these events.
CICS
In the CICS environment, the following resources are generally recoverable:
• SQL databases
• VSAM data sets specified as recoverable in their FCT entries
• CA IDMS databases
• IMS/DLI databases
In CICS, a commit request (either automatic or controlled) issues a CICS SYNCPOINT command. A rollback request issues
a CICS SYNCPOINT ROLLBACK command. A CICS SYNCPOINT ROLLBACK command terminates the DLI PSB and
database positioning is lost. CA Easytrieve Report Generator does not automatically reschedule the PSB or reposition the DLI
database.
When CA IDMS is available, a controlled commit request issues an IDMS COMMIT command. An automatic commit
issues an IDMS FINISH command. A rollback request issues an IDMS ROLLBACK command. Each time an IDMS FINISH
command is issued, CA IDMS ends the run-unit. You must provide the necessary logic in your program to bind a new run-unit
and re-establish currencies as needed.
TSO and CMS
In TSO and CMS, SQL databases are the only recoverable resources. In TSO, CA IDMS databases are also recoverable.
When SQL is available, a commit request (either automatic or controlled) issues an SQL COMMIT command. A rollback
request issues an SQL ROLLBACK command.
Each time a commit point is issued, SQL closes all cursors. You must provide the necessary logic in your program to open
and reposition the cursor as needed. Exceptions can exist for specific SQL databases that maintain cursor positioning across
commits.
For DL/I files, issuing a commit point has no effect. In this case, DL/I CHECKPOINT and RESTART functions should be
used to manage logical units of work. DL/I files do not lose positioning when a commit point is issued.
When CA IDMS is available, a controlled commit request issues an IDMS COMMIT command. An automatic commit
issues an IDMS FINISH command. A rollback request issues an IDMS ROLLBACK command. Each time an IDMS FINISH
command is issued, CA IDMS ends the run-unit. You must provide the necessary logic in your program to bind a new run-unit
and re-establish currencies as needed.
CA Easytrieve® Report Generator 11.6
Non-mainframe
In non-mainframe environments, SQL and C-ISAM are recoverable resources.
When SQL is available, a commit request (either automatic or controlled) issues an SQL COMMIT command. A rollback
request issues an SQL ROLLBACK command. Each time a commit point is issued, SQL closes all cursors. You must provide
the necessary logic in your program to open and reposition the cursor as needed.
When C-ISAM is available, a commit request, either automatic or controlled, issues a call to iscommit. A rollback request
issues a call to isrollback. Each time a commit point is issued, CA Easytrieve Report Generator closes and reopens all active C-
ISAM files. Files are then repositioned upon the next browse operation.
Decision and Branching Logic
CA Easytrieve Report Generator uses certain statements to control the execution of your program using decision and branching
logic. These statements can govern program execution flow depending on the truth value of the conditional expressions. The
following statements are associated with decision and branching logic:
CASE IF
DO GOTO
EXECUTE PERFORM
PROC STOP
EXIT REFRESH
RESHOW
Conditional Expressions
Conditional expressions that are used as parameters of IF and DO statements offer an alternative to the normal top to bottom
execution of CA Easytrieve Report Generator statements. The syntax of a conditional expression is:
{IF } [ {AND} ]
{DO WHILE} condition [ { } condition ]...
{DO UNTIL} [ {OR } ]
CA Easytrieve® Report Generator accepts seven different conditions. There are five simple conditions (having at most two
operands) and two extended conditions (having potentially an unlimited number of operands):
Skeletal examples of each type of conditional expression that are used in an IF statement follow:
Type Example
Field relational IF field-1 = field-2
Field series IF field-1 = field-2, field-3, field-4
Field class IF field-1 ALPHABETIC
Field bits IF field-1 ON X'0F4000'
CA Easytrieve® Report Generator 11.6
For more information about each of these conditional expressions, see the Language Reference section.
Double Byte Character Set Support
The following conditions provide support for DBCS and MIXED fields:
• Field relational
• Field series
• Field class
• Field bits
As with the data equations, when conversion from EBCDIC to DBCS format is part of the conditional expression, CA
Easytrieve Report Generator converts the EBCDIC data using the following techniques:
• Lowercase EBCDIC values into the applicable DBCS Katakana characters
• Other valid EBCDIC characters into their equivalent English values
• Invalid EBCDIC values into DBCS spaces
Combined Conditions
Any of these conditions, simple and extended, can be combined by using the logical connectors AND or OR in any
combination.
For combined conditions, those connected by AND are evaluated first. The connected condition is true only if all of the
conditions are true. The conditions connected by OR are then evaluated. The combined condition is true if any of the
connected conditions are true. You can use parentheses to override the normal AND and OR relationships. The following table
illustrates the results of combining conditions with AND, OR, and parentheses. The values x, y, and z represent any condition.
x y z x OR x AND x OR (x OR y)
y OR z y AND z y AND z AND z
True True True True True True True
True True False True False True False
True False True True False True True
True False False True False True False
False True True True False True True
False True False True False False False
False False True True False False False
False False False False False False False
Arithmetic Expressions
To fully understand how an assignment establishes the value of a field as a result of an arithmetic expression, you need to
know how arithmetic expressions work within CA Easytrieve Report Generator. An arithmetic expression allows two or more
numeric quantities to be combined to produce a single value. Arithmetic expressions can be used in assignment statements and
in field relational conditions.
Operators
The arithmetic operators that are used in CA Easytrieve Report Generator are:
Symbol Operation
* multiplication
/ division
+ addition
- subtraction
All fields and literals in an arithmetic expression must be numeric. CA Easytrieve Report Generator follows the standard
mathematical order of operations when computing arithmetic expressions: multiplication and division are performed before
addition and subtraction, in order from left to right.
The following example illustrates how arithmetic expressions are evaluated:
11 + 5 * 8 - 48 / 16 + 4 Step 1
####Ú####
11 + 40 - 48 / 16 + 4 Step 2
#####Ú#####
11 + 40 - 3 + 4 Step 3
#####Ú#######
51 - 3 + 4 Step 4
############Ú#########
48 + 4 Step 5
#########Ú###########
52
Parentheses
You can use parentheses to override the normal order of evaluation. Any level of parenthesis nesting is allowed. Expressions
within parentheses are evaluated first, proceeding from innermost parenthesis level to the outermost.
CA Easytrieve® Report Generator 11.6
The following example illustrates how parentheses found within arithmetic expressions are evaluated:
11 + 5 * ( -40 / 16 + 4) Step 2
############Ú######
11 + 5 * ( -2.5 + 4) Step 3
#################Ú#####
11 + 5 * 1.5 Step 4
############Ú###############
11 + 7.5 Step 5
##########Ú############
18.5
Evaluations
When evaluating an arithmetic expression, at most 30 decimal digits are maintained for each operation. During the calculation
of:
{*}
{= } {/}
field-name-1 { } value-1 { } value-2
{EQ} {+}
{-}
The length and number of decimal places that are maintained during the calculation (intermediate results) are determined for
each operation according to the rules shown in the following table:
If the length of the intermediate result has more than 30 digits, the excess digits must be truncated. For addition, subtraction,
and division, the excess digits are always truncated from the left side of the result.
For multiplication, however, truncation on the right side of the result is attempted. The minimum number of decimal places to
be maintained in the result is the larger of:
• The number of decimal places in field-name-1 plus one
• Four decimal places
If the number of decimal places in the result is less than or equal to this minimum, no digits are truncated from the right side of
the result. Otherwise, the number of digits that are truncated from the right is the smaller of these values:
• The number of excess digits
• The difference between the number of decimal places in the result and the minimum
When truncation occurs on the right, both the length and number of decimal places in the result are reduced by the number of
digits truncated. If there are still excess digits after right truncation, these excess digits are truncated from the left.
For example, assume that value-1 and value-2 both have a length of 18 digits and both have 4 decimal places. Then, according
to the previous rules table, the result has a length of 36 digits and 8 decimal places. In this case, the number of excess digits is
6. Then, for various values of the number of decimal places in field-name-1, the result is truncated as shown in the next table:
(left) (right)
Fewer than 2 60 4
2 51 4
3 42 4
4 33 5
5 24 6
6 15 7
More than 6 06 8
Assignment Statement
The assignment statement establishes a value in a field. The value can be a copy of the data in another field or literal, or it can
be the result of an arithmetic or logical expression evaluation.
The two formats of the assignment statement are:
Format 1 Syntax (Normal Assignment)
{= } {send-field-name }
receive-field-name { } {send-literal }
CA Easytrieve® Report Generator 11.6
{EQ} {arithmetic-expression}
{= } {AND} {bit-mask-field-name}
receive-field-name { } send-field-name {OR } {bit-mask-literal }
{EQ} {XOR} { }
Numeric field Numeric field, Result is padded on left with zeros to fit
the description of receive-field-name. If
literal, the value of the assignment is too large
to be stored in receive-field-name, it is
or arithmetic expression truncated as follows:
For binary numbers (numbers that
are expressed in two's complement
form), the sign and high-order bits are
truncated from left as necessary, and
the remaining left-most bit becomes the
new sign.
For zoned decimal, packed decimal,
and unsigned packed decimal numbers
(numbers that are expressed in sign-
magnitude form), the high-order digits
are truncated from left as necessary. The
result is truncated on right if the number
of decimal places in receive-field-name
is less than the right-hand side.
Declared attribute field Declared attribute field Receive-field name is replaced with the
attributes that are contained in send-
field-name.
Nullable field NULL field Indicator for receive-field-name is set to
1 (indicates NULL).
Not NULL field The assignment works as usual and the
indicator for receive-field-name is set to
0, indicating NOT NULL.
Literal Indicator for receive-field-name is set to
0.
Arithmetic expression with any NULL A runtime error occurs.
operand
Arithmetic expression in which all Indicator for receive-field-name is set to
operands are NOT NULL 0.
Not nullable field NULL field A runtime error occurs.
DBCS field DBCS field Send-field-name is converted into the
DBCS code system of receive-field-
name. The resulting value of receive-
field-name is padded on right with
DBCS spaces or truncated on right as
necessary.
MIXED field Each EBCDIC byte of send-field-name
is converted into its equivalent DBCS
value. Any DBCS data that is identified
by shift codes is converted to the DBCS
code system of receive-field-name.
The shift codes are then removed. The
resulting value of receive-field-name is
padded on right with DBCS spaces or
truncated on right as necessary.
Alphabetic field Each byte of send-field-name is
converted into its equivalent DBCS
value and the resulting value is stored in
receive-field-name. The resulting value
of receive-field-name is padded on right
with DBCS spaces or truncated on right
as necessary.
CA Easytrieve® Report Generator 11.6
Examples
The following examples of Format 1 of the assignment statement illustrate its various rules:
CA Easytrieve® Report Generator 11.6
F1A W 4 A
F2A1 W 1 A VALUE 'A'
F2A2 W 6 A VALUE 'ABCDEF'
F2N1 W 2 N VALUE 12
F2N2 W 3 P 1 VALUE 1234.5
...
Resulting Value:
Note: For an example using varying length alphanumeric fields, see Varying Length Fields in Defining Fields.
Format 1 (Normal Assignment, receive-field-name numeric)
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
DISPLAY SKIP 2 +
'F1N = ((F2N1 / F2N2) * 100) + .5 = ' F1N
STOP
CA Easytrieve® Report Generator 11.6
Results:
Resulting
Value
Example
The following example of Format 2 of the assignment statement illustrates its various rules:
Format 2 (Logical Expression Evaluation) Statements:
CA Easytrieve® Report Generator 11.6
Statements:
Results:
Resulting
Value
F1P = F2P AND X'FFFE' = 123C
MOVE Statement
MOVE transfers characters from one storage location to another. It is used for moving data without conversion and for moving
variable length data strings. The following table illustrates the rules of the MOVE statement regarding nullable fields:
MOVE LIKE moves the contents of fields with identical names from one file to another. Data movement and conversion
follow the rules of the assignment statement.
Table Processing
A table is a collection of uniform data records that presents unique processing opportunities. All tables
have two parts:
A table is a collection of uniform data records that presents unique processing opportunities. All tables have two parts:
• The argument uniquely identifies a table entry.
• The description is the remainder of the table entry.
Some typical examples of table usage include organization structures, parts lists for assembly processes, and accounting chart-
of-accounts.
The search of CA Easytrieve® Report Generator table files is extremely efficient. Therefore, table use is recommended for
applications that need to validate encoded data and retrieve code description.
Contents
Defining Tables
There are two types of tables that you can specify on the FILE statement:
• In-stream (specified by the INSTREAM subparameter on the TABLE parameter) directs CA Easytrieve® Report
Generator to look for table data within the program immediately following the definition of the ARG and DESC fields for
the file. This table is established at the time the program is compiled. Its size is limited only by the amount of available
memory.
• External (INSTREAM is not specified) indicates that the table is located in a file external to the program. This file must be
sequentially accessible. An external table is established just before use.
An external table can be:
• An existing file that is in ascending order by its search argument
• Created by specifying the name of the table as the TO file-name parameter in a SORT activity.
External tables that are also indexed files result in a random read to the file using the search argument as the key. This results
in added efficiency.
All data needed to create small tables (to be processed by the SEARCH statement) can be entered instream along with CA
Easytrieve® Report Generator statements; that is, the table data can immediately follow the library definition statements for
the table. The data is delimited by the ENDTABLE statement in the first eight positions of a record.
In-stream table data is 80 characters per record and is unaffected by the SCANCOL options. All characters between the ARG
and DESC definitions and the ENDTABLE delimiter are treated as data.
Note: An in-stream table can be retrieved from a macro file. However, the macro must contain the entire table definition (FILE
statement through ENDTABLE).
The following illustrates a table-of-days definition:
The only way to modify an instream table is to recompile the program after supplying new table data. However, you can
modify external tables without program change, because CA Easytrieve® Report Generator builds these tables dynamically
prior to each use.
CA Easytrieve® Report Generator 11.6
All tables must be sorted in ascending order by their search argument. No duplicate search arguments are allowed. Table
sequence is validated as the table is created.
The only fields defined for table files are ARG (argument) and DESC (description). ARG defines the field used when
searching the table. DESC defines the field that contains the desired information. The maximum length for an alphanumeric
ARG or DESC field is 254 bytes.
The following illustrates a typical table file description. The resulting table provides descriptions of a hypothetical high school
curriculum:
1011 ENGLISH I }
1012 ENGLISH II } records from
... } CLASSES file
... }
9712 HOME ECONOMICS }
---------------------------------------
FILE CLASSES TABLE (150)...
ARG 1 4 A. DESC 10 40 A |
Searching Tables
The SEARCH statement provides access to table information. You can code SEARCH statements any place within a
PROGRAM, SCREEN, or JOB activity, and issue any number of searches against any number of tables. To test the success of
the SEARCH, use the file presence test: IF [NOT] file-name.
The following illustrates the retrieval of high school class descriptions based upon class identification codes:
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
Result:
CA Easytrieve® Report Generator 11.6
ENGLISH II
Array Processing
An array is a series of consecutive memory locations in one or more dimensions. You can process
identical elements in arrays by using either index manipulation or subscripting.
An array is a series of consecutive memory locations in one or more dimensions. You can process identical elements in arrays
by using either index manipulation or subscripting.
Contents
Bounds Checking
CA Easytrieve® Report Generator automatically checks that indexes and subscripts do not reference data outside the storage
boundary of the field being referenced. If your index or subscript is out of bounds, an execution error occurs. Subscripts are
checked to ensure that they are within the OCCURS value of the field's definition. Indexes are checked to ensure that the
reference is within the largest enclosing data structure. For file fields, this structure is the file buffer. For working storage
fields, this is the defined field, or the base field if the defined field is a redefinition.
Indexing
Any data field definition can contain the INDEX attribute. An index can be used to reference data fields that occur multiple
times. If you do not use an index, you must either use subscripts or assign individual field names to multiple field occurrences.
The data field's starting location is adjusted by the contents of its indexes to determine the desired field occurrence. The
INDEX index-name value is set to:
DEFINE ARRAY-ELEMENT W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
MARCH +
APRIL +
MAY +
JUNE +
JULY +
AUGUST +
SEPTEMBER +
OCTOBER +
NOVEMBER +
DECEMBER '
DEFINE MONTH MONTHS 10 A +
OCCURS (12) INDEX (MONTH-INDEX)
JOB INPUT NULL NAME MYPROG
CA Easytrieve® Report Generator 11.6
ARRAY-ELEMENT = 11
MONTH-INDEX = (ARRAY-ELEMENT - 1) * 10
DISPLAY MONTH
STOP
Results:
NOVEMBER
In both cases, the sum of the indices determines which data occurrence is referenced. Both MONTH and MONTH-CELL
are 10-character fields with two indexes. Both fields also occur twelve times. MONTH-INDEX-1 and ROW-INDEX, and
MONTH-INDEX-2 and COL-INDEX are considered similar indexes.
You can define and access arrays of more than two dimensions by a simple extension of the following examples.
Defining a Field with Multiple Indexes
CA Easytrieve® Report Generator 11.6
Statements:
DEFINE QUARTER-ROW W 2 N
DEFINE MONTH-COL W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
MARCH +
APRIL +
MAY +
JUNE +
JULY +
AUGUST +
SEPTEMBER +
OCTOBER +
NOVEMBER +
DECEMBER '
DEFINE MONTH MONTHS 10 A OCCURS (12) +
INDEX (MONTH-INDEX-1, MONTH-INDEX-2)
JOB INPUT NULL NAME MYPROG
QUARTER-ROW = 4
MONTH-COL = 2
MONTH-INDEX-1 = (QUARTER-ROW - 1) * 30
MONTH-INDEX-2 = (MONTH-COL - 1) * 10
DISPLAY MONTH
STOP
M M M
O O O
N N N
T T T
H H H
- - -
C C C
O O O
L L L
CA Easytrieve® Report Generator 11.6
Result:
NOVEMBER
DEFINE QUARTER-ROW W 2 N
DEFINE MONTH-COL W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
MARCH +
APRIL +
MAY +
JUNE +
JULY +
AUGUST +
SEPTEMBER +
OCTOBER +
NOVEMBER +
DECEMBER '
DEFINE MONTH MONTHS 10 A +
OCCURS (12)
DEFINE MONTH-ROW MONTH 30 A, +
OCCURS 4, INDEX (ROW-INDEX)
DEFINE MONTH-COLS MONTH-ROW 10 A, +
OCCURS 3, INDEX (COL-INDEX)
DEFINE MONTH-CELL MONTH-COLS 10 A
JOB INPUT NULL NAME MYPROG
QUARTER-ROW = 4
MONTH-COL = 2
ROW-INDEX = (QUARTER-ROW - 1) * 30
COL-INDEX = (MONTH-COL - 1) * 10
DISPLAY MONTH-CELL
STOP
M M M
O O O
N N N
T T T
H H H
- - -
C C C
O O O
L L L
S S S
Results:
NOVEMBER
Subscripts
Subscripts are an alternative method available to select an individual element from an array. A subscript is an integer (or a field
containing an integer) that represents the occurrence number of the element within the array to be referenced. CA Easytrieve®
Report Generator computes the index value for you.
You can use subscripts with a field name in the following way:
ELEMENT is VALUE is
MONTH(1) JANUARY
MONTH(2) FEBRUARY
MONTH(3) MARCH
... ...
MONTH(12) DECEMBER
CA Easytrieve® Report Generator 11.6
For this array the maximum value that can be specified for the occurrence number is 12.
Subscripting a Two-Dimensional Array
A two-dimensional array is somewhat more complicated. To define a two-dimensional array, you must define the length and
number of occurrences of each dimension. The following illustrates this:
This illustration defines a two-dimensional array (ELEMENT) with three rows and five columns, each occurrence of which
is an alphabetic field of two characters. The first dimension (ROW) is defined as having three occurrences. The second
dimension (COLUMN) is defined as having five occurrences. The length of the first dimension (ROW) must be the length of
the second dimension (COLUMN) times the number of occurrences of the second dimension (COLUMN).
The following table illustrates the relationship between the array element and the corresponding array element value:
ELEMENT is VALUE is
ELEMENT(1,1) AA
ELEMENT(1,2) BB
ELEMENT(1,3) CC
ELEMENT(1,4) DD
ELEMENT(1,5) EE
ELEMENT(2,1) FF
... ...
ELEMENT(3,5) OO
DEFINE QUARTER-ROW W 2 N
DEFINE MONTH-COL W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
MARCH +
CA Easytrieve® Report Generator 11.6
APRIL +
MAY +
JUNE +
JULY +
AUGUST +
SEPTEMBER +
OCTOBER +
NOVEMBER +
DECEMBER '
DEFINE MONTH-ROW MONTHS 30 A, +
OCCURS 4
DEFINE MONTH-COLS MONTH-ROW 10 A, +
OCCURS 3
DEFINE MONTH-LET MONTH-COLS 1 A, +
OCCURS 10
DEFINE MONTH-CELL MONTH-LET 1 A
JOB INPUT NULL NAME MYPROG
* THIS PROGRAM DISPLAYS THE 3RD
* LETTER OF THE MONTH IN THE 4TH
* ROW, 2ND COLUMN (THE V IN NOVEMBER)
DISPLAY MONTH-CELL (4, 2, 3)
STOP
Results:
Segmented Data
One of the most common data structures is segmented data. Each record contains a fixed portion of data and multiple
occurrences of data segments. The actual number of occurrences is not known until execution time. In COBOL, these
structures are known as variable-length table definitions and are defined with an "occurs depending on" clause.
Defining Segmented Data
The following illustrates the field definitions necessary to describe a personnel record with a fixed area and variable
occurrences of dependent and salary history segments:
Because the starting location for each variable occurring segment is not known, the first position after the fixed portion is used.
Later, to access the data, the lengths of the preceding segments are added to the index to determine the starting location of the
next variable segment. The OCCURS parameter specifies the maximum number of occurrences for each variable portion.
Accessing Segmented Data
The next example illustrates the index manipulation statements necessary to access the data contained in the file:
Data Strings
Evaluating strings of data is another common index process. The following illustrates a technique for taking names from the
input record, reversing them, and then printing them. The results of this program are:
REVERSED-NAME DATA-NAME
GLORIA WIMN WIMN,GLORIA
NANCY BERG BERG,NANCY
GEORGE CORNING CORNING,GEORGE
MARY NAGLE NAGLE,MARY
Inter-Program Linkage
The facilities of provide all of the functions necessary to perform standard input/output, data examination,
and data manipulation.
The facilities of CA Easytrieve® Report Generator provide all of the functions necessary to perform standard input/output,
data examination, and data manipulation.
The LINK and TRANSFER statements can be used to invoke other CA Easytrieve® Report Generator programs. You can also
invoke subprograms written in other programming languages through the CALL, LINK, and TRANSFER statements, and the
EXIT parameter of the FILE statement.
This article contains the following information:
Using the CALL statement or the FILE EXIT parameter to invoke another CA Easytrieve® Report Generator program is not
supported and will yield unpredictable results. Invoking a CA Easytrieve® Report Generator program using a CALL from
a non-CA Easytrieve® Report Generator program is also unsupported and will produce unpredictable results. Control can
be safely transferred from a parent program to a CA Easytrieve program (as the child) using program LINK requests. LINK
request syntax varies depending on the calling program language.
• The FILE EXIT and CALL statements enable you to invoke subprograms written in other programming languages. All
discussions of the CALL statement also apply to FILE EXITs. (FILE EXITs are CALLs that are controlled automatically
by CA Easytrieve® Report Generator.)
• The LINK statement allows you to transfer control from the current program (parent) to another program (child) and then
return control to the parent program.
• The TRANSFER statement allows you to transfer execution to a target program without returning to the invoking program.
CA Easytrieve® Report Generator 11.6
The way that the called program is bound is determined by the following, in order:
1. If the program was declared on a DECLARE statement, the STATIC or DYNAMIC keyword on the DECLARE statement
determines how it is bound.
2. If specified, the CALL parameter on the PARM statement supplies the default for all called programs in your CA
Easytrieve® Report Generator program.
3. The default is determined by the environment. The default on the mainframe is DYNAMIC. The default on UNIX is
STATIC.
In CICS, all dynamic programs are loaded by executing the CICS LOAD command. The LOAD command dynamically places
the program in storage and returns the program's entry point to CA Easytrieve® Report Generator.
Each time the CALL statement is executed, CA Easytrieve® Report Generator determines whether or not the program has
been loaded. If the program has not been loaded, CA Easytrieve® Report Generator executes a CICS LOAD command to load
it. Once loaded, the program remains loaded until it reaches one of the following points:
• The end of the first activity that references the program -- If the current activity (the child activity) was invoked with an
EXECUTE statement from another activity (the parent activity), and if both the child and parent activity reference the
program, the program is not deleted until the parent activity terminates. The termination of the child activity does not cause
the program to be deleted.
• CA Easytrieve® Report Generator performs the next screen input/output operation -- However, if you specified COMMIT
NOTERMINAL on the SCREEN statement or the calling CA Easytrieve® Report Generator program is executing
conversationally, CA Easytrieve® Report Generator does not delete the program.
In MVS, all dynamic programs are loaded by invoking the LOAD function of the operating system, or by invoking the
CEELOAD function when ENVIRONMENT COBOL is used. The LOAD function dynamically places the program in storage
and returns the program's entry point to CA Easytrieve® Report Generator.
CA Easytrieve® Report Generator loads the program as part of the initialization of the first activity that references the
program. If the current activity (the child activity) was invoked with an EXECUTE statement from another activity (the parent
activity), and if both the child and parent activity reference the program, then CA Easytrieve® Report Generator loads the
program during the initialization of the parent activity. In addition, CA Easytrieve® Report Generator does not delete the
program until the termination of the parent activity. Neither the initialization nor the termination of the child activity has any
effect on the program's status.
CA Easytrieve® Report Generator 11.6
Storage Management
In VSE, the author of programs in other languages is responsible for managing required storage. If additional storage is needed
(for example, to LOAD another program), you cannot use DOS COMREG facilities. All storage must be:
• Within the originally loaded program
• Obtained using GETVIS
• Uniquely controlled within the STORMAX area
Linkage (Register Usage) Conventions
When CA Easytrieve® Report Generator invokes a subprogram written in another programming language, it adheres to
standard IBM register management conventions. The called subprogram must honor these conventions:
Register Usage
REGISTER 1 Address of the parameter list
REGISTER 13 Address of an 18 fullword register save area
REGISTER 14 Address of where to return to within CA Easytrieve® Report
Generator
REGISTER 15 Address of the entry point in the subprogram
The subprogram must save the CA Easytrieve® Report Generator registers in the save area addressed by REGISTER 13 and
must restore them prior to returning using REGISTER 14. The 18-fullword register save area provided by CA Easytrieve®
Report Generator must be maintained as illustrated in the following table:
ASMPGM CSECT
STM 14,12,12(13) save registers 14 through 12
LR 11,15 set base register
USING ASMPGM,11 assign base register
LA 14,0(0,13) address of <easy> save area
LA 13,MYSAVE address of subprogram save area
ST 13,8(0,14) chain forward
ST 14,MYSAVE+4 chain backward
LR 10,1 save parameter list address
...
...
...
RETURN L 13,4(0,13) address of <easy> save area
CA Easytrieve® Report Generator 11.6
...
LINKAGE SECTION.
01 PARAMETER-1.
...
01 PARAMETER-2.
...
01 PARAMETER-N.
...
PROCEDURE DIVISION USING PARAMETER-1,
PARAMETER-2,
...
PARAMETER-N.
...
...
GOBACK
...
Easytrieve® Report Generator programs. This option is set into the program at compile time. Changing the option value
will not affect link-edited CA Easytrieve® Report Generator application programs.
• Coding the ENVIRONMENT COBOL parameter of the PROGRAM statement, and that activity invokes the JOB activity.
The COBOL ENVIRONMENT established by the PROGRAM activity will be inherited by the JOB activity.
COBOL ENVIRONMENT Operation
When the ENVIRONMENT COBOL parameter or the ENVIRON=COBOL option is in effect, this alone will not cause the
COBOL ENVIRONMENT to be established. The ENVIRONMENT will not be established unless the activity for which
ENVIRONMENT is specified contains a CALL statement, (in PROGRAM or JOB activities), or an EXECUTE statement,
(in PROGRAM activities). However, if no CALL or EXECUTE is present, the ENVIRONMENT will still be established if
the CA Easytrieve® Report Generator program contains a FILE statement that specifies the EXIT parameter. If none of these
conditions exist (no CALL, EXECUTE, or FILE EXIT), the ENVIRONMENT will not be started even if ENVIRONMENT
COBOL is specified in the program. In that case, no ENVIRONMENT is needed, and that overhead is saved.
When ENVIRONMENT COBOL is in effect for an activity, the ENVIRONMENT is started at the start of the activity, and it is
terminated at the end of the activity.
If a PROGRAM activity starts the COBOL ENVIRONMENT, and then executes a JOB activity, that ENVIRONMENT will
remain active during the execution of the JOB activity. It will not be started and stopped for the JOB activity. Even if the JOB
activity specifies ENVIRONMENT NONE, the ENVIRONMENT started in the PROGRAM activity will remain active during
the JOB activity execution. The COBOL ENVIRONMENT started in the PROGRAM activity will remain active during all
JOB activities EXECUTEd by that PROGRAM activity.
If ENVIRONMENT NONE is specified for the PROGRAM activity, each executed JOB activity for which ENVIRONMENT
COBOL is specified, will get the COBOL ENVIRONMENT started and terminated as the activity starts and terminates, (if the
CALL and FILE EXIT requirements are met).
If no PROGRAM activity is coded, each JOB activity for which ENVIRONMENT COBOL is specified, will get the COBOL
ENVIRONMENT started and terminated as the activity starts and terminates, (if the CALL and FILE EXIT requirements are
met).
When the COBOL ENVIRONMENT is active, the CA Easytrieve® Report Generator runtime becomes the LE Main
routine. Any programs called by the CA Easytrieve® Report Generator application program are LE subprograms. This lets
subprograms act properly as called subroutines without using the ENDJOB compiler option.
COBOL Environment Rules
The rules for using ENVIRONMENT COBOL are as follows:
• The parameter functions for CALLed subprograms, FILE EXITs; it functions in z/OS.
• All COBOL programs in the run unit must be compiled with the RESIDENT and REENTRANT compiler options. This
ensures that all COBOL modules access the same copy of the global data area and optimum performance is obtained.
• FILE EXITs and subprograms can have an AMODE of 24, 31, or ANY and an RMODE of 24 or ANY. If a 24-bit
subprogram is being called from a CA Easytrieve® Report Generator program when ENVIRONMENT(COBOL) is set,
these LE runtime options must also be set: ALL31=(OFF),STACK=(,,BELOW). For information regarding the setting of
LE runtime option overrides for CA Easytrieve® Report Generator, please see Installing.
• When the COBOL subprogram issues a GOBACK statement, control returns to the CA Easytrieve® Report Generator
statement following the CALL statement.
• When the COBOL subprogram executes a STOP RUN statement, the statement causes the current CA Easytrieve® Report
Generator activity to terminate. When an activity terminates due to a STOP RUN, any spooled reports currently being
printed are terminated. Any unprinted spooled reports are purged, therefore, programs that use FORTRAN service routines
cannot be called.
• Support for Language Environment (LE) takes place through the ENVIRONMENT COBOL parameter.
• The RENT Binder option must also be specified for called COBOL programs compiled with the RENT compiler option.
PL/I Subprogram Linkage
CA Easytrieve® Report Generator supports only DYNAMIC calls to PL/I subprograms. Linkage with PL/I is unique due to
its non-standard conventions. It requires the use of the PROC OPTIONS(COBOL) parameter. See the IBM PL/I programming
guide for details on the linkage of PL/I subprograms with other programming languages.
C Subprogram Linkage
CA Easytrieve® Report Generator supports both DYNAMIC and STATIC calls to C subprograms. As with COBOL, C
subprograms may be invoked through the CALL statement and as FILE EXITs, and they may be AMODE 24 or 31. C
subprograms are invoked by CA Easytrieve® Report Generator using the same IBM standard calling conventions used for
invoking COBOL programs.
CA Easytrieve® Report Generator 11.6
The C subprogram coding required to process incoming parameters depends on whether the C subprogram is being invoked as
DYNAMIC or STATIC. The following sections show examples of both.
To Receive Parameters When C Subprogram is DYNAMIC
CA Easytrieve® Report Generator main program:
. . .
DECLARE CPROG PROGRAM STATIC
. . .
CA Easytrieve® Report Generator 11.6
Parameter Lists
The parameter list for both input/output and CALL exits (pointed to by register 1) passes information to the subprogram. Each
entry in this contiguous group of fullwords identifies one parameter. The end of the list is indicated by the high-order bit of the
high-order byte of the last entry being set to a one.
Parameter List Format
Value Function
00000000 input request
00000004 output request
00000008 file close request, or end-of-input (set by input exit
subprogram)
For MODIFY exits (subparameter of the FILE statement), the required two parameters are record area address and work area
address because the exit receives all records after input and before output.
Figure 43: Examples of Input, Output and MODIFY Subprogram Parameter List
• pRecord
Is the pointer to the record buffer. On input operations, your exit places data into this buffer from the file. On output, your
exit writes the data from the buffer to the file.
• pcbRecord
Is the pointer to the length of the record currently in the buffer. On input operations, your exit must place the size of the
record at this location.
• pKey
Is the pointer to the key. This field is valid only for operations that require a key.
• pcbKey
Is the pointer to the length of the key.
• pFCB
Is the pointer to the EXIT_FCB. The EXIT_FCB contains information describing the file. The EXIT_FCB is described
after the description of the parameters.
• pExitArgList
Is the pointer to the array of pointers to the fields in the USING list of the EXIT phrase. The pointers are ordered as the
fields in the USING list are ordered.
• Return Value
The following list of constants enumerate the valid return values and the meanings:
The ANCHOR is a control block that the exit might want to allocate (it is not required). Its purpose is to hold information that
the exit needs from one invocation of the exit to the next. The ANCHOR is chained off the EXIT_FCB (which follows).
Your exit is responsible for the creation, maintenance, and destruction of this area.
The EXIT_FCB is a control block that is passed to the exit each time the exit is called. The same instance of the EXIT_FCB is
passed from the time the file is opened to the time the file is closed for each operation on the file.
Hence, if your exit allocates its own control block (like the ANCHOR, shown below), its address can be placed as the first
item in the EXIT_FCB and retrieved from the same place with each invocation of the exit. Remember to deallocate the control
block when the file is closed.
CA Easytrieve® Report Generator creates, maintains, and destroys this control block. Your exit should restrict itself solely to
changing the pAnchor field.
# define FO_NONE 0 /
* File type not specified */
# define FO_SEQUENTIAL 1 /
* SEQUENTIAL */
# define FO_INDEXED 2 /
* INDEXED */
# define FO_RELATIVE 3 /
* RELATIVE */
unsigned char fMiscFlags0; /
* Miscellaneous flags */
#if defined(LSB)
/* For architectures with the Least Significant Byte First
* such as the INTEL 80x86 chips.
*/
# define FM_DEFER 0x01 /
* DEFER */
# define FM_ASA 0x02 /
* ASA */
# define FM_CREATE 0x04 /
* CREATE */
# define FM_RESET 0x08 /
* CREATE RESET */
# define FM_UPDATE 0x20 /
* UPDATE */
# define FM_NOVERIFY 0x40 /
* NOVERIFY */
# define FM_MODIFY 0x80 /
* EXIT with MODIFY */
#elif defined(MSB)
/* For architectures with the Most Significant Byte First
* such as the HP PA Risc (HP 9000) chips.
*/
# define FM_DEFER 0x80 /
* DEFER */
# define FM_ASA 0x40 /
* ASA */
# define FM_CREATE 0x20 /
* CREATE */
# define FM_RESET 0x10 /
* CREATE RESET */
# define FM_UPDATE 0x04 /
* UPDATE */
# define FM_NOVERIFY 0x02 /
* NOVERIFY */
# define FM_MODIFY 0x01 /
* EXIT with MODIFY */
# endif
unsigned char Reserved1; /
* Reserved for future expansion */
void * pReserved2;
void * pReserved3;
void * pReserved4;
CA Easytrieve® Report Generator 11.6
} EZEXIT_FCB, * P_EZEXIT_FCB;
Note: The Installation Media contains an example of a standard exit program, VRTXTEXT.c. Ask your system administrator
where that program can be found.
MODIFY File Exit
If you code the MODIFY subparameter on the FILE statement, CA Easytrieve® Report Generator performs the I/O. Your
exit should examine the record and convert it into the correct form. On an input operation, CA Easytrieve® Report Generator
reads the record, then passes it to your MODIFY file exit to be reformatted. On an output operation, CA Easytrieve® Report
Generator passes the record to your exit to be reformatted. When your exit finishes, CA Easytrieve® Report Generator writes
the reformatted record to the file.
The prototype for your MODIFY file exit should look like this:
where:
• pRecord
Points to the record buffer. The record to be reformatted is in this buffer.
• pWorkArea
Points to a buffer. The record from pRecord must be reformatted and placed in this buffer.
• cbRecord
This is the length of the record at pRecord.
• pcbWorkArea
Points to the length of pWorkArea's buffer. When your exit has placed the reformatted in the buffer, it must place the length
of the reformatted record at this field.
• pExitArgList
Is the pointer to the array of pointers to the fields in the USING list of the EXIT phrase. The pointers are ordered as the
fields in the USING list are ordered.
• Return Value
This exit uses the same values as were defined for the standard file exit.
Note: The Installation Media contains an example of a MODIFY exit program, YRMDEXIT.c. Ask your system administrator
where that program can be found.
If your exit processes variable length records, the RECORD-LENGTH field of the file should be in the USING list. Your exit
must place the correct value in the USING list.
If your exit handles both input and output operations, you should place a field in the USING list that can tell your exit what
type of operation the exit must perform.
Error Condition Handling
Program errors that occur in subprograms cause the abnormal termination of CA Easytrieve® Report Generator programs.
Because these errors can be difficult to analyze in the complex environment of CA Easytrieve® Report Generator, you should
test subprograms before using them in CA Easytrieve® Report Generator.
LINK Statement
The LINK statement is used to invoke another program and then return execution to the statement following the LINK
statement in the original (invoking) program. The program invoked can be written in any language that is supported by the
operating system in which the program is executing (including CA Easytrieve® Report Generator).
CA Easytrieve® Report Generator 11.6
Note: When linking to an OS/VS COBOL program in TSO or CMS, the COBOL program must be compiled with the NORES
compile option. Also, you cannot LINK and CALL an OS/VS COBOL program in the same activity.
Note: In CICS, the TRANSFER statement is more efficient than the LINK statement. In TSO and CMS, the opposite is true.
Non-mainframe
The GIVING parameter on the LINK and PROGRAM statements is ignored in non-mainframe environments. The data from
the USING parameter must be acceptable in the shell you are running.
CA Easytrieve® Report Generator 11.6
The program being linked to can be any valid shell program or command. For example, you can use LINK 'cls' (in Windows)
or LINK 'clear' (in UNIX) to clear the terminal or console screen for future DISPLAY statements. The following LINK
statement example executes the dir Windows command and redirects the output to a file for future processing:
The LINK statement, combined with the rest of the CA Easytrieve® Report Generator language, provides powerful scripting
possibilities.
TRANSFER Statement
The TRANSFER statement is used to transfer execution to a target program without returning to the invoking program. The
target program can be written in any language that is supported by the operating system in which the program is executing.
The TRANSFER statement completely terminates the current CA Easytrieve® Report Generator program and invokes a target
program using the linkage conventions of the operating system in which the program is executing. The target program inherits
the execution environment of the program issuing the TRANSFER command.
Commands Issued by the Target Program
The target program can issue any command supported by the operating system. In a CICS environment, the program can issue
terminal I/O or display reports in a pseudo-conversational mode only if the program issuing the TRANSFER command can
operate pseudo-conversationally.
Complete termination of the current CA Easytrieve® Report Generator program does not imply the termination of the current
logical unit of work. Although CA Easytrieve® Report Generator attempts to terminate the current program (for example,
close files and complete reports), it does not necessarily terminate all activities performed by the operating system for the CA
Easytrieve® Report Generator program.
Commands issued by a child program, such as SYNCPOINT, and I/O commands can affect the operating environment of the
parent program. CA Easytrieve® Report Generator does not guarantee that applications using TRANSFER execute identically
in all execution environments. If portability between operating systems is required by an application, it is your responsibility to
code the application in such a way that portability is assured.
USING Parameter
A single parameter can be passed to the target program by specifying the USING parameter. The parameter is passed to the
target program by value, that is, the invoking program passes a copy of the value of the field or literal to the target program.
The target program cannot directly modify the value of the field or literal. You specify the field to receive the parameter with
the USING parameter on the PROGRAM statement in the target program.
Operating System Implementations
The TRANSFER statement is implemented as follows:
Note: When running pseudo-conversationally in CICS, you must specify the TRANSID parameter on the PARM statement in
the target program. TRANSID specifies the CICS transaction ID that is invoked when the terminal user presses an attention
key following the program's termination for a pseudo-conversation. The transaction ID of the target program must be defined
in the PCT.
Note: In CICS, the TRANSFER statement is more efficient than the LINK statement. In TSO, CICS, and CMS, the opposite is
true.
Non-mainframe
CA Easytrieve® Report Generator 11.6
If you coded a SHELL environment variable, CA Easytrieve® Report Generator uses that path instead of /bin/sh. The data
from the USING parameter must be acceptable in the shell you are running. The program being transferred to can be any valid
shell program or command. Used in this manner, a program could drive the execution of other programs. The TRANSFER
statement, combined with the rest of the CA Easytrieve® Report Generator language, provides powerful scripting possibilities.
Data Usage
CA Easytrieve® Report Generator normally generates the most efficient code when performing operations on binary fields
(data type B) on the mainframe. CA Easytrieve® Report Generator performs binary or integer arithmetic whenever possible.
When this is impractical due to the size of intermediate results, CA Easytrieve® Report Generator uses packed decimal.
When you code packed decimal fields, if you use 15 or fewer digits, CA Easytrieve® Report Generator generates inline
program code. On the mainframe, if you use more than 15 digits, CA Easytrieve® Report Generator uses runtime library
routines for multiplication and division. The use of runtime library routines results in a longer execution time of your program.
Avoid the use of zoned numeric fields for heavily used computations in your program.
Use indexes, rather than subscripts, in array processing to produce more efficient code. Although subscripts are easier to use,
they must be internally computed into the index displacements.
When you use subscripts to access arrays, use a two-byte binary field on the mainframe instead of a zoned numeric field to
reduce execution time.
CA Easytrieve® Report Generator must convert one of the operands when you perform an operation on fields of different data
types. To limit data conversions, code the fields to be updated or compared as the same type and the same number of decimal
places whenever possible.
In non-mainframe environments, all numeric operations require that the operands be converted to packed. Therefore packed
decimal is the most efficient data type. However, this is subject to change.
Table Processing
Avoid using very large tables, because they take more time to search and require more storage than small tables.
Note: CA Easytrieve® Report Generator automatically converts a SEARCH of an INDEXED table file into a keyed read
when the ARG field is also the file's key. This results in much faster access and reduced storage requirements.
Compiler Site and Program Options
The FASTSRT mainframe site option allows you to specify whether CA Easytrieve® Report Generator instructs the
mainframe sort program to process all of the I/O whenever possible. If the FASTSRT option is specified at your site, ensure
that the sort program can process extended parameter lists.
The STATE site option and PARM statement parameter saves the statement number of the statement currently being executed
for display during an abnormal termination. This option/parameter requires approximately six to eight bytes of additional
storage for each executable source line in your program.
The FLOW site option and PARM statement parameter activates a trace of statements being executed to be printed during an
abnormal termination. This option and this parameter require a subroutine to be invoked once for each executable source line.
After you test your program, deactivate the FLOW trace, if possible, to decrease execution time of your program.
The FLDCHK site option and PARM statement parameter validates all data references during program execution. This option
and this parameter generate additional CA Easytrieve® Report Generator code.
After you test your program, deactivate the FLDCHK validation, if possible, to decrease execution time of your program.
The VFM site option and PARM statement parameter specifies the amount of storage available for the Virtual File Manager
(VFM) buffer pool. Additional storage can decrease execution time.
The ABEXIT site option and PARM statement parameter activates the runtime SPIE exit which gets control in order to
produce debugging information in case of an abend in the CA Easytrieve® Report Generator application program. Activating
the SPIE exit requires additional storage and time resources.
CA Easytrieve® Report Generator 11.6
Set ABEXIT=NO in the site options, and during development, specify PARM ABEXIT(SNAP) in the CA Easytrieve® Report
Generator program. After you test your program, remove the ABEXIT(SNAP) so the production compilation is done with
ABEXIT=NO.
Report Processing
In non-CICS mainframe environments, you can enhance report processing performance by coding the FILE parameter on the
REPORT statement or the WORKFILE parameter of the PARM statement, (or the WORKFILE Option in the Options Table).
Any of these parameters specifies that a dedicated work file is to be used rather than a VFM work file.
• Mainframe FILE statements often get their attributes (record formats and record length) from JCL or from opening an
existing file. You may want to add the attributes to the FILE statement or you may want to get the attributes dynamically
through a file description string. For details, see the Execute a Program section.
• Be aware that the "I" data format is for integers of the native data format of the host environment you are executing on.
Your code should not expect specific hexadecimal values and still be considered portable because integers are not stored
identically on all platforms.
• You may find it useful for your code to test for the underlying code system when writing programs to be portable. A simple
method is to execute the following code that determines if execution is using an EBCDIC based system or not:
You can use this code example to dynamically set a FILE statement SYSNAME value so it can be a DDname on a
mainframe or a pathname on a PC.
Programming Methods
The supported programming methods for processing SQL databases are:
The supported programming methods for processing SQL databases are:
• Use native SQL statements to manually manage the SQL cursor.
• Let CA Easytrieve Report Generator automatically manage the SQL cursor.
Native SQL Statements
CA Easytrieve Report Generator supports most of the SQL statements available for a given DBMS. The exceptions are
those statements that are compiler directives and statements that cannot be dynamically prepared. Using these native SQL
CA Easytrieve® Report Generator 11.6
statements, you can code fully SQL-compliant programs in which you control the SQL cursor operation. All native SQL
statements are prefixed with the SQL keyword. For complete syntax, see the Language Reference section.
For SQL commands, see the following sections:
• Supported SQL Commands
• Unsupported SQL Commands
Automatic Cursor Management
CA Easytrieve Report Generator can automatically manage the SQL cursor in the following ways:
• CA Easytrieve Report Generator files
• Automatic retrieval without a file
CA Easytrieve Report Generator Files
CA Easytrieve Report Generator can automate SQL cursor management when you associate an SQL cursor with a CA
Easytrieve® Report Generator file. The SQL file can then be accessed in two ways:
• JOB INPUT statement -- With each iteration of the JOB statement or activity, another row from the table is automatically
retrieved into the file's data area. Even if you have only a basic knowledge of SQL, you can report on data that is contained
in an SQL database.
• CA Easytrieve Report Generator SQL-like statements -- Use the following statements to read and write SQL data on a
controlled basis:
• CLOSE
• DELETE
• FETCH
• INSERT
• SELECT
• UPDATE
Automatic Retrieval Without a File
In this read-only method, you must code SQL on the JOB statement in place of a file name. You must code a SELECT
statement directly after the JOB statement to specify the columns to be retrieved and the host variables to receive the data.
Each time the JOB activity is iterated, another row of SQL data is retrieved. This is a simple way to retrieve SQL data into
working storage or into an extract file for subsequent output. Automatic retrieval does not require that you define a CA
Easytrieve Report Generator file.
Program Environment
processes SQL statements using the CA Pan/SQL interface on the mainframe and internal interfaces in
non-mainframe environments. A specific implementation exists for each supported database:
CA Easytrieve® Report Generator processes SQL statements using the CA Pan/SQL interface on the mainframe and internal
interfaces in non-mainframe environments. A specific implementation exists for each supported database:
• For mainframe DB2, both a dynamic interface and a static interface are supported.
• For SQL/DS, extended dynamic SQL is supported. SQL statements are dynamically prepared during the compilation of
your CA Easytrieve program and an access module or package is created. At runtime, SQL statements are executed from
the access module or package.
• The CA Datacom/DB SQL interface is similar to the SQL/DS interface. An access plan, from which SQL statements are
executed, is created at compile time.
CA Easytrieve® Report Generator 11.6
• The CA IDMS SQL interface is strictly a dynamic interface for both compilation and execution.
• The non-mainframe Ingres, DB2, ODBC, and Oracle SQL interfaces are strictly dynamic interfaces for both compilation
and execution.
See Unsupported SQL Commands for a list of commands that cannot be coded in CA Easytrieve programs.
Units of Work
Each CA Easytrieve activity is considered a separate SQL unit of work or transaction. If COMMIT TERMINAL is specified
on the activity statement, a commit is automatically executed during terminal I/O. If COMMIT ACTIVITY is specified in the
activity, a commit is also executed following the termination of the activity. If CA Easytrieve detects an error condition or if
you code a STOP EXECUTE statement in your program, a ROLLBACK statement is automatically executed.
You can issue your own COMMIT and ROLLBACK statements to signal the successful or unsuccessful end of the transaction.
These COMMIT and ROLLBACK statements are performed in addition to the ones CA Easytrieve does automatically.
Each time a COMMIT or ROLLBACK statement is executed, all open SQL cursors are closed. Exceptions may exist for
specific databases that maintain cursor positioning across commits or syncpoints.
Support for Multiple SSIDs with CA Pan/SQL Feature
CA Easytrieve invokes a specific DB2 PAN/SQL installation from among multiple installations based on the value that is
specified for PARM SSID in the CA Easytrieve program. With this feature, if you have multiple versions of DB2 installed, you
can have multiple CA PAN/SQL installations for each DB2 within a single library, and select the DB2 you want to access by
using the PARM SSID value in the CA Easytrieve program. This is done by building the CA Easytrieve SSID Table which is
a cross-reference table that assigns a specific PAN/SQL installation with a DB2 SSID. The CBAAJCL member SSIDTBL is
used to build the table. Information about how to create multiple PAN/SQL for DB2 installations in the same load library is
provided with PAN/SQL.
PARM Statement Parameters
The PARM statement parameters set the SQL environment for the program.
SQLSYNTAX
In all environments, use the SQLSYNTAX parameter to specify the level of SQL syntax checking to perform on the SQL
statements in your program. SQLSYNTAX FULL specifies that SQL statements undergo detail-level syntax checking. An
SQL PREPARE statement is executed for those SQL statements that can be dynamically prepared. Your DBMS must be
available to CA Easytrieve. SQLSYNTAX PARTIAL indicates that your SQL statements are checked for valid commands and
secondary keywords. No connection is made to your DBMS unless you have an SQL INCLUDE statement in your program.
Your program does not execute until it has undergone FULL syntax checking.
If you want syntax checking to be performed by the DB2 preprocessor in a batch environment, you can use the SQLSYNTAX
NONE parameter on the PARM statement with a static bind. An option of NONE causes your program to undergo partial
syntax checking. Your program continues execution if no partial-level compile errors are found, a BIND option of STATIC-
ONLY is specified, and no other non-SQL syntax errors are found.
DB2
The SQLID parameter of the PARM statement results in the execution of the SQL SET CURRENT SQLID command by the
SQL Interface at compile time. The SQL SET CURRENT SQLID command is executed at runtime for controlled or automatic
processing. Execution of the SQL SET CURRENT SQLID command is valid for sites that have an external security package
that supports group IDs. The SQLID parameter applies to mainframe only.
The SSID parameter of the PARM statement can be used to specify the desired DB2 subsystem in non-CICS environments.
If the SSID parameter is not coded, the SQL interface gets the DB2 subsystem ID from the DB2 system default module
DSNHDECP. DSNHDECP is made available through the JOBLIB or steplib libraries. In CICS, the currently attached
subsystem is used. In non-mainframe environments, the SSID identifies the database to be connected.
Static SQL is used to improve the performance of an SQL program. In a static SQL program, all SQL statements are known
ahead of time and an optimized plan is created prior to execution time.
Static SQL is specified by two parameters on the PARM statement. PLAN specifies the name of the DB2 static-command-
program and its plan name. The command program can either be linked with the CA Easytrieve program or linked as a
separate load module. A BIND parameter of STATIC-ONLY or ANY causes the static-command-program to be generated.
The PLAN and BIND parameters apply to mainframe only.
To run your program statically, you must run special steps to create and link the static command program and plan. For more
information, see Program Compilation and Link-Editing Using JCL.
CA Easytrieve® Report Generator 11.6
Dynamic SQL is used to process your program when running under the interpreter, regardless of the BIND parameter
specified.
Static SQL and the LINK Statement
When you execute multiple static SQL programs in a given transaction or task, you must bind all of the involved DBRMs into
a single plan. Therefore, specify the same plan name for the PLAN parameter of each application program.
PAN$SQL DD File
You can code a PAN$SQL DD statement to provide a plan name and DB2 for z/OS subsystem to be used at the time of
your execution. The PAN$SQL DD file is processed only when executing statically and if the DB2 for z/OS Call Attach
Facility is used to establish a connection. The PAN$SQL file can also be used to indicate that you want to execute under
the TSO Terminal Monitor Program in background mode. If TSO execution is specified, then the plan name and subsystem
ID parameters are ignored. Valid parameters for the PAN$SQL file are the following:
• PLAN—provide the name of the DB2 for z/OS plan to use for execution.
• SSID—provide the name of the DB2 for z/OS subsystem to use for the DB2 for z/OS Call Attach Facility for a connection.
• TSO—indicates that you want to execute your CA Easytrieve program under the TSO Terminal Monitor Program in
background mode. You must code the correct JCL.
The following is sample JCL for the PAN$SQL statement:
//PAN$SQL DD * PLAN=TESTPLAN,SSID=D810
The ability to specify a plan name for execution enables you to compile and link your CA Easytrieve DB2 for z/OS application
program once. The DBRM can then be bound into any DB2 for z/OS subsystem with any planname.
Execution under TSO resolves the problem of called DB2 for z/OS subroutines that previously had to be linked with
DSNALI, the DB2 for z/OS Call Attach Facility module. This restriction required subroutines to be linked one way for other
applications.
If your CA Easytrieve program contains SQL statements and it also calls COBOL (or other language) subroutines, you can
now share those subroutines with CA Easytrieve applications and other applications.
You can link your COBOL subroutines once with DSNELI and it can be used by all your applications.
Sample JCL for Execution Under TSO:
To eliminate the authorization problems that are encountered with the use of SQLID, use SQLSYNTAX NONE with BIND
STATIC-ONLY. These parameters enable the use of unqualified table names and bypass the dynamic prepare of SQL
statements. Unqualified table names can then be qualified by the BIND process.
SQL/DS
Specify the SQL/DS user ID to be used for compiling the program on the USERID parameter of the PARM statement. At
execution time, a CONNECT is executed by CA Easytrieve for automatic processing only. For controlled processing, you must
code the SQL CONNECT command providing the values for an sqlid and password.
Specify the name of the SQL/DS access module for this program on the PREPNAME parameter of the PARM statement.
When an SQL program is compiled, an access module is created or replaced. To avoid using the default name, use unique
access module names for each application program. In a high volume system, using the default PREPNAME can result in
catalog contention and a -911 SQLCODE resulting from a rollback.
CA Datacom/DB
Use the PLANOPTS parameter on the PARM statement to specify the name of a CA Pan/SQL PLAN options module to
override the default module (DQSMPLN@). For more information about defining your own options module, see the CA Pan/
SQL Interface Getting Started Guide, available from Bookshelves and PDFs.
CA IDMS
Use the USERID parameter to specify the name of the IDMS dictionary to be used for explicit connect (no password is
needed).
If no dictionary name is provided, an implicit connection is attempted when the first SQL statement is processed. The
dictionary name is then obtained from the SYSCTL DD card provided in your JCL.
Ingres
Use the SSID parameter on the PARM statement to specify the name of the database to which this session connects.
Use the USERID parameter on the PARM statement to specify the user identifier under which this session runs. The password
subparameter is ignored.
ORACLE
Use the USERID parameter of the PARM statement to specify the ORACLE user ID for compiling the program. At execution
time, CA Easytrieve executes a CONNECT for automatic processing only. For controlled processing, you must code the SQL
CONNECT command, providing the values for an sqlid and password.
Language Environment is required for Oracle execution. The CA Easytrieve program that accesses an Oracle database must
run as an LE application. Therefore, PARM ENVIRONMENT(COBOL) is unconditionally activated for programs that access
Oracle.
ODBC
Use the SSID parameter on the PARM statement to specify the name of the data source to which this session connects. In
Windows, a connection dialog box is displayed if no SSID is provided.
Use the USERID parameter of the PARM statement to specify a user ID for compiling the program. At execution time,
CA Easytrieve executes a CONNECT for automatic processing only. For controlled processing, you must code the SQL
CONNECT command, providing the values for a data source, user ID, and password.
8I0
INTEGER 4B0 Y Y Y
4I0
SMALL INTEGER 2B0 Y Y Y
2I0
DECIMAL (x,y) xPy Y Y Y
UNSIGNED xPy N N N
DECIMAL (x,y)
CHARACTER (x) xA Y Y Y
VARCHAR (x) x A VARYING Y Y (8.1) Y
(x <= 254)
TEXT (x) x A VARYING N N N
CA Easytrieve® Report Generator 11.6
(x > 254)
VARCHAR2 (x) x A VARYING N N Y
RAW x A VARYING N N N
LONG RAW (x) x A VARYING N N N
NUMERIC (x,y) xNy N Y Y
UNSIGNED xNy N N N
NUMERIC (x,y)
FLOAT 10 P 3 Y Y Y
REAL 10 P 3 Y Y Y
DOUBLE PRECISION 10 P 3 Y Y Y
NUMBER xPy N N N
MONEY 10 P 2 N N N
GRAPHIC (x) xM Y N N
xK
VARGRAPHIC (x) x M VARYING Y N N
x K VARYING
(x <= 254)
LONG VARGRAPHIC x M VARYING Y N N
(x)
x K VARYING
(x > 254)
DATE 10 A *2 Y Y Y
TIME 8A Y Y Y
TIMESTAMP 26 A Y Y Y
BINARY x B y *1 N N N
none xUy - - -
4I0
SMALL INTEGER 2B0 Y Y N
2I0
DECIMAL (x,y) xPy Y N N
UNSIGNED xPy Y N N
DECIMAL (x,y)
CHARACTER (x) xA Y Y Y
VARCHAR (x) x A VARYING Y Y Y
(x <= 254)
TEXT (x) x A VARYING N Y N
CA Easytrieve® Report Generator 11.6
(x > 254)
VARCHAR2 (x) x A VARYING N N Y
RAW (x) x A VARYING N N Y
LONG RAW (x) x A VARYING N N Y
NUMERIC (x,y) xNy Y N N
UNSIGNED xNy Y N N
NUMERIC (x,y)
FLOAT 10 P 3 Y Y Y
REAL 10 P 3 Y N N
DOUBLE PRECISION 10 P 3 Y N N
NUMBER (x,y) x P y *3 N N Y
MONEY 10 P 2 N Y N
GRAPHIC (x) xM Y N N
xK
VARGRAPHIC (x) x M VARYING Y N N
x K VARYING
(x < = 254)
LONG VARGRAPHIC x M VARYING Y N N
(x)
x K VARYING
(x > 254)
DATE 10 A *2 Y Y Y
TIME 8A Y N N
TIMESTAMP 26 A Y N N
BINARY x B y *1 Y N N
none xUy - - -
Note 1: The data type of BINARY is invalid for lengths other than 2, 4, or 8. When processing an SQL INCLUDE statement
on the mainframe, this data type is converted to x A.
Note 2: For Ingres, dates are 11 bytes in length.
Note 3: Maximum length = 10 bytes.
Decimal Data Types
For SQL DECIMAL data types, the scale is the same as the decimal places of a CA Easytrieve field. SQL precision refers to
the total number of digits that can occur in the packed field. A CA Easytrieve length refers to the number of bytes occupied
by the packed field. A CA Easytrieve field that is 5 P 2 is the equivalent of an SQL DECIMAL data type of precision = 9 and
scale = 2. Depending on your SQL release, SQL may not support CA Easytrieve packed fields with lengths > 8.
SQL Syntax Checking
When an SQL statement is passed to SQL for syntax checking, host variables are converted to question marks (?) by the
product. It is possible that when an SQL error is detected, the question mark is identified as the field in error. In this case,
you are responsible for looking up the error message and identifying which host variable is in error. Because host variables
are replaced with question marks, their use in arithmetic expressions may result in compile errors. For DB2 and SQL/DS, an
SQLCODE of -418 can occur.
System-Defined File Fields
CA Easytrieve® Report Generator 11.6
When using a CA Easytrieve Report Generator file to process an SQL database, the following system-defined fields are used:
RECORD-COUNT
RECORD-COUNT contains the number of rows returned to the CA Easytrieve Report Generator program. This is the number
of rows fetched by either automatic or controlled processing.
RECORD-LENGTH
RECORD-LENGTH is the length of the SQL file. The length is the sum of the maximum lengths of all fields in the file.
EOF Processing
When the end of the tables has been reached, either with automatic (JOB) or controlled (FETCH) processing, the file is marked
EOF (end of file). In automatic processing, execution stops, and the FINISH procedure (if present) executes. In controlled
processing, you can code file presence tests (IF EOF file-name) to determine whether an end of file condition exists.
SQL Communications Area Fields
All of the SQL Communication Area fields (SQLCA) are automatically created in S (static) working storage when any of the
following occurs:
• The first SQL-managed file is encountered.
• The first SQL INCLUDE statement is encountered.
• The first native or controlled SQL statement is found.
• The first JOB INPUT SQL statement is found.
The fields generated for SQLCA for the supported SQL database management systems are shown in the following lists.
SQL Communication Area Fields for DB2, SQL/DS, Ingres, ODBC, and ORACLE
SQLCA S 196 A
SQLCA-EYE-CATCH SQLCA 8 A
SQLCAID SQLCA 8 A
SQLCA-LEN SQLCA +8 4 B 0
SQLCABC SQLCA +8 4 B 0
SQLCA-DB-VRS SQLCA +12 2 A
SQLCA-DB-RLS SQLCA +14 2 A
SQLCA-LUWID SQLCA +16 8 A
SQLCODE SQLCA +24 4 B 0
SQLCA-ERROR-INFO SQLCA +28 82 A
SQLCA-ERR-LEN SQLCA +28 2 B 0
SQLCA-ERR-MSG SQLCA +30 80 A
SQLERRM SQLCA +28 72 A
SQLERRML SQLCA +28 2 B 0
SQLERRMC SQLCA +30 70 A
SQLCA-ERROR-PGM SQLCA +110 8 A
SQLERRP SQLCA +110 8 A
SQLCA-FILLER-1 SQLCA +118 2 A
SQLCA-ERROR-DATA SQLCA +120 24 A
SQLCA-DSFCODE SQLCA +120 4 A
SQLCA-INFCODE SQLCA +124 4 B 0
SQLCA-DBCODE SQLCA +128 4 A
SQLCA-DBCODE-EXT SQLCA +128 2 A
SQLCA-DBCODE-INT SQLCA +130 2 B 0
SQLCA-MISC-CODE1 SQLCA +132 4 A
SQLCA-MISC-CODE2 SQLCA +136 4 B 0
SQLCA-MISC-CODE3 SQLCA +140 4 A
SQLCA-WRN-AREA SQLCA +144 8 A
SQLCA-WARNING SQLCA +144 1 A OCCURS 8
SQLWARN SQLCA +144 8 A
SQLWARN0 SQLCA +144 1 A
SQLWARN1 SQLCA +145 1 A
SQLWARN2 SQLCA +146 1 A
SQLWARN3 SQLCA +147 1 A
SQLWARN4 SQLCA +148 1 A
SQLWARN5 SQLCA +149 1 A
SQLWARN6 SQLCA +150 1 A
SQLWARN7 SQLCA +151 1 A
SQLCA-PGM-NAME SQLCA +152 8 A
SQLCA-AUTHID SQLCA +160 18 A
SQLCA-PLAN-NAME SQLCA +178 18 A
SQLCA S 344 A
SQLCAID SQLCA 8 A
CA Easytrieve® Report Generator 11.6
SQLCODE SQLCA +8 4 B 0
SQLCSID SQLCA +12 4 B 0 OCCURS 2
SQLCERC SQLCA +20 4 B 0
SQLCNRP SQLCA +28 4 B 0
SQLCSER SQLCA +36 4 B 0
SQLCLNO SQLCA +44 4 B 0
SQLCMCT SQLCA +48 4 B 0
SQLCOPTS SQLCA +52 4 B 0
SQLCFJB SQLCA +56 4 B 0
SQLCPCID SQLCA +60 4 B 0
SQLCLCID SQLCA +64 4 B 0
SQLCERL SQLCA +68 2 B 0
SQLCERM SQLCA +72 256 A
SQLSTATE SQLCA +328 5 A
Note:
When the CA Easytrieve Report Generator client is using ODBC, only the following SQLCA variables are set.
For all SQL statements:
• SQLCODE
For all SQL statements when an error occurs:
• SQLMESG
• SQLERRM
• SQLERRMC
• SQLERRML
• SQLEXT
• SQLSTATE
Upon successful execution of INSERT, UPDATE, and DELETE statements:
• SQLERRD(3)
Because the ODBC standard does not provide an interface to read SQLCA values, all other SQLCA variables are empty.
For more information about SQLCA, go to https://www.ibm.com/support/knowledgecenter/ and search for SQLCA (SQL
communications area) Db2.
Sample Database
The following two tables are used for all the examples in this section.
TABLE: PERSONNEL
------------------------------------------
COLUMNS: EMPNAME WORKDEPT EMPPHONE
------------------------------------------
DATA: NORIDGE DEBBIE 901 5001
OSMON SAMUEL 901 5004
MILLER JOAN 950 6034
EPERT LINDA 950 null
STRIDE ANN 901 null
ROGERS PAT 921 2231
DEFINE EMPNAME W 20 A
DEFINE WORKDEPT W 2 P 0
DEFINE EMPPHONE W 3 P 0
DEFINE DEPTNAME W 22 A VARYING
DEFINE DEPTNUMBER W 2 P 0
DEFINE NULLPHONE W 2 B 0 .* NULL INDICATOR
DEFINE USERID W 8 A VALUE('SQLDBA') .* SQL/DS USERID
DEFINE PASSWORD W 8 A VALUE('SQLDBAPW') .* SQL/DS PASSWORD
Processing Requirements
To process data from an SQL table using this method, you must code the following items:
• A FILE statement that specifies one or more table names
• If all columns defined in the file are subject to update, specify the UPDATE keyword on the FILE statement.
• One or more field definitions for the columns within the tables that you want to retrieve
You can code these definitions by using the DEFINE statement or by using the SQL INCLUDE statement to automatically
generate the definitions from the SQL catalog. If you want to selectively update only a few columns of those defined within
the file, omit the UPDATE keyword from the FILE statement and specify UPDATE only on the field definitions (columns)
you want to update. Coding UPDATE on the SQL INCLUDE statement causes generated definitions to be subject to
update.
• A SELECT statement that defines the result set for the cursor
CA Easytrieve® Report Generator 11.6
If you do not use a SELECT statement, CA Easytrieve Report Generator generates a default SELECT to retrieve all rows
for the tables. You can override this default by specifying your own file-based SELECT statement as the first statement
following the JOB statement.
Overriding the default SELECT allows you to use SQL techniques to customize the result set for the cursor. For example,
you can:
• Limit the result set to a subset of records (WHERE)
• Organize the data in the table by groups (GROUP BY)
• Limit the groups returned (HAVING)
• Sequence the returning records (ORDER BY)
In addition to overriding the default SELECT, you can code one or more SELECTs anywhere in your JOB activity. This
lets you use conditional logic to dynamically determine which SELECT is executed.
A SELECT statement for an SQL file is similar to opening the file. Selecting a file that is already open first closes the file
and then reopens the file based on the new SELECT statement.
Note:
For more information about SELECT statement usage, see the Language Reference section.
Operation
If you are executing in an SQL/DS, Advantage Ingres, non-mainframe DB2, ODBC, or ORACLE system, CA Easytrieve
Report Generator generates and executes a CONNECT statement. You need not code an SQL CONNECT statement when
using CA Easytrieve Report Generator automatic processing. The user ID and password parameters are taken from those
specified in the USERID parameter of the PARM statement.
CA Easytrieve Report Generator checks the SQLCODE field following each execution of a file-based SQL statement. If the
SQLCODE indicates an error, CA Easytrieve Report Generator issues an error message based on the SQL error and terminates
execution. During automatic processing, an SQLCODE indicating end of data causes CA Easytrieve Report Generator to
initiate end-of-input processing; the FINISH PROC (if any) executes, spooled reports are printed, and the current JOB activity
ends. During controlled processing, an SQLCODE indicating end of data causes CA Easytrieve Report Generator to set the
value of EOF to true.
The SQL cursor that is automatically defined by a SELECT statement is closed following the termination of the activity that
opened it.
Note:
Non-mainframe systems are limited to a maximum of 10 open cursors.
Input Processing
You can access SQL data using a CA Easytrieve Report Generator file either automatically or with controlled processing.
Automatic Processing
If you name the SQL file as the input file on a JOB statement, CA Easytrieve Report Generator automatically accesses your
SQL database. When you specify an SQL file as automatic input, CA Easytrieve Report Generator prepares a default SELECT
statement for the cursor.
The following program displays all records in the table named PERSONNEL:
You can override the default SELECT statement by coding a SELECT statement for the automatic input file as the first
statement in the JOB, as follows:
CA Easytrieve® Report Generator 11.6
This program displays only the records for employees that are assigned to department 901. The SELECT statement provides
the new default selection criteria.
Using DEFER with SELECT
You can use the DEFER parameter on the SQL FILE statement to delay SELECT processing. For example, assume that
you want to select only employee numbers in a particular department and the department number is kept in a card file. The
SELECT statement contains a WHERE clause specifying the host variable in the card file. CA Easytrieve® Report Generator
opens the CARD file at the initiation of the JOB activity but the GET statement is coded in a START procedure. If the file
SELECT is not deferred, the SELECT is performed using an uninitialized host variable. Coding DEFER enables the START
procedure to get the card before the SELECT is performed.
In addition, if DEFER is not specified, the default SELECT is executed before the START procedure. Then the SELECT in the
START procedure is executed. This causes extra processing that is not needed. For example:
Multiple Tables
CA Easytrieve® Report Generator 11.6
The following example illustrates joining two tables, PERSONNEL and DEPARTMENTS, to report on employees and the
departments in which they work:
Both table names are specified on the FILE statement. The default SELECT is overridden because the result set should include
only those DEPARTMENT records that match the department number of the PERSONNEL record.
Controlled Processing
You use the FETCH statement (in conjunction with SELECT and CLOSE statements) to retrieve the records from the file
with controlled processing. You can code these statements within a PROGRAM, SCREEN, or JOB activity, with or without
automatic input. The following rules apply:
• Controlled statements are not permitted in SORT or REPORT procedures.
• The FETCH statement cannot reference an automatic input file within the same JOB activity. You can FETCH from a file
other than the file subject to automatic input.
In a PROGRAM Activity
The following example illustrates controlled input from a default cursor:
The PROGRAM activity fetches each row of the table and displays the fields. The DO statement executes until end-of-file.
In a JOB Activity
The same process used in a JOB activity is coded as follows:
You must execute a STOP statement when end-of-file is reached, because a NULL JOB activity automatically loops.
Random Processing
The following example illustrates a type of random processing in which the SQL file cursor is built using a key that is
contained in a sequential file.
The sequential file is read automatically by the JOB activity. For each record, a SELECT statement is executed to locate the
employee in the PERSONNEL table. If the FETCH statement results in end-of-file, the employee is not found. Otherwise, the
employee name and department are displayed.
Synchronized File Processing
The following example illustrates a way to match a sequential file with an SQL file. This example uses the default SELECT
and then matches the two files based on the employee name in both files:
END-IF
END-IF
The default SELECT could have been overridden by coding a SELECT as the first statement after the JOB statement.
Update Processing
Additional requirements for updating a CA Easytrieve Report Generator SQL file are as follows:
• You can name only one table on the FILE statement for updates, inserts, or deletions.
• You must specify the UPDATE parameter on the FILE statement if all fields defined are subject to update. If you want to
update only certain fields, do not specify UPDATE on the FILE statement, but specify UPDATE on the DEFINE statement
for each field to be updated. You can also use the SQL INCLUDE statement to automatically generate definitions with
UPDATE.
• You must specify UPDATE on the FILE statement to insert or delete rows.
• For updating, you must code a SELECT statement for the file that contains the FOR UPDATE clause. If the FOR
UPDATE clause is omitted, the first UPDATE statement is flagged in error. Default SELECT statements that are created
by CA Easytrieve Report Generator do not contain the FOR UPDATE clause.
• For ORACLE, dynamic UPDATEs and DELETEs must be mimicked by CA Easytrieve Report Generator by selecting the
ROWID of each row, then using that value to identify the current row during the UPDATE or DELETE. For this reason,
you must use a SELECT statement with the FOR UPDATE clause.
• For certain ODBC data sources, UPDATEs and DELETEs WHERE CURRENT OF CURSOR are not supported. In these
cases, you must use native SQL statements.
Controlled Processing
The following example selects a specific row from the table, updates the department to 930, and moves a null data value to the
phone number:
Automatic Processing
The following example changes the department number for all employees in departments 901 through 921:
UPDATE PERSNL
Processing Requirements
To process data from an SQL table using this method, you must provide the following:
• One or more field definitions for the columns within the tables that you want to retrieve
CA Easytrieve® Report Generator 11.6
• These definitions can be coded using the DEFINE statement or by using the SQL INCLUDE statement to automatically
generate the definitions from the SQL catalog. The definitions are usually coded in working storage, but you can define the
fields in an output file for extraction purposes.
• A JOB statement with the INPUT SQL parameter
• SQL signifies that the automatic processing does not involve a CA Easytrieve® Report Generator file.
• A non-file-based SELECT statement that defines the result set for the cursor
• Only one non-file based SELECT statement can be coded in each JOB activity.
This SELECT statement is very different from the file-based SELECT statement used with a CA Easytrieve® Report
Generator SQL file, because it more closely approximates a true SQL SELECT clause. For example, you name the tables
that participate in the result. Also, the SELECT can perform more advanced selections such as UNIONs.
Operation
CA Easytrieve® Report Generator generates and executes a CONNECT statement. You need not code an SQL CONNECT
statement when using CA Easytrieve® Report Generator automatic processing. The user ID and password parameters are taken
from those specified in the USERID parameter of the PARM statement.
CA Easytrieve® Report Generator checks the SQLCODE field following each execution of the SELECT statement. If
the SQLCODE indicates an error, CA Easytrieve® Report Generator issues an error message based on the SQL error and
terminates execution. An SQLCODE indicating end of data causes CA Easytrieve® Report Generator to initiate end-of-input
processing: the FINISH PROC (if any) executes, spooled reports are printed, and the current JOB activity ends.
The SQL cursor that is automatically defined by a non-file-based SELECT statement is closed following the termination of the
JOB activity that opened it.
Retrieving All Columns
The following code retrieves all columns and all rows from the PERSONNEL table. A report is generated showing
WORKDEPT, EMPNAME, and EMPPHONE. CA Easytrieve® Report Generator sorts the report by WORKDEPT. Note the
use of manual null variable indicators.
DEFINE EMPNAME W 20 A
DEFINE WORKDEPT W 2 P 0
DEFINE EMPPHONE W 3 P 0
DEFINE NULLPHONE W 2 B 0 .* NULL INDICATOR
JOB INPUT SQL NAME(SQLEX1)
SELECT * FROM PERSONNEL +
INTO :EMPNAME, :WORKDEPT, :EMPPHONE :NULLPHONE
IF NULLPHONE < 0 .* PHONE PRESENT?
EMPPHONE = 0 .* NO, SET TO 0
END-IF
PRINT PERSNL
REPORT PERSNL LINESIZE 65
SEQUENCE WORKDEPT
LINE WORKDEPT EMPNAME EMPPHONE
Selected Columns
The following code retrieves all rows of selected columns from the PERSONNEL table and generates a report showing
WORKDEPT and EMPNAME. SQL orders the rows by WORKDEPT.
DEFINE EMPNAME W 20 A
DEFINE WORKDEPT W 2 P 0
JOB INPUT SQL NAME(SQLEX2)
SELECT EMPNAME, WORKDEPT +
CA Easytrieve® Report Generator 11.6
FROM PERSONNEL +
ORDER BY WORKDEPT +
INTO :EMPNAME, :WORKDEPT
PRINT PERSNL
REPORT PERSNL LINESIZE 65
LINE WORKDEPT EMPNAME
Multiple Tables
The following code retrieves an employee name and the corresponding department name from the PERSONNEL and
DEPARTMENTS tables. This example shows parameters required for SQL/DS.
Processing Requirements
You must code the SQL DECLARE statement in the Library Definition section of a CA Easytrieve Report Generator program.
You must code all other SQL statements, except SQL INCLUDE, in the Activity Definition section.
You should test the SQLCODE field in the SQLCA to determine whether or not the execution of each controlled processing
statement is successful.
If the SQLCODE field contains a zero (0), you should test the SQLWARN0 field to ensure that no warning conditions were
issued during processing of the SQL statement. To determine acceptable values for SQLWARN0, see the appropriate SQL
reference documentation.
You must code all SQL INCLUDE statements and SQL-managed file definitions before any controlled SQL statements.
CA Easytrieve® Report Generator 11.6
Operation
Coding native SQL statements requires an advanced knowledge of SQL statements and of the database to be processed. You
can code native SQL statements in any PROGRAM or JOB activity. You cannot code them in SORT or REPORT procedures.
Supported SQL Commands
Following is a list of commonly used SQL commands. They must be prefixed by SQL. For a complete list, see the Language
Reference section. For more information, see your SQL vendor reference documentation.
• CLOSE
• COMMIT
• CONNECT
• DECLARE
• DELETE
• FETCH
• INSERT
• OPEN
• PUT
• ROLLBACK
• UPDATE
DB2
All DB2 commands that can be executed using the DYNAMIC execution facilities of DB2 are supported. For more
information, see the SQL reference manual for your current release.
SQL/DS
All SQL/DS commands that are supported through the EXTENDED DYNAMIC facilities of SQL/DS are supported. For more
information, see either of the following manuals:
• SQL/Data System Application Programming for VSE (SH24-5018)
• SQL/Data System Application Programming for VM/SP (SH24-5068)
Advantage Ingres
All Ingres SQL commands that can be executed using the DYNAMIC execution facilities are supported. For more information,
see the Ingres Enterprise Relational Database SQL Reference Guide.
Oracle
All Oracle SQL commands that can be executed using the DYNAMIC execution facilities are supported. For more
information, see the Oracle SQL Reference Guide.
Note: Due to the Oracle restriction against using the CURRENT OF clause with dynamic SQL, CA Easytrieve Report
Generator must mimic the CURRENT OF clause using ROWID. This technique prohibits use of SELECT * in conjunction
with DELETE or UPDATE WHERE CURRENT OF cursor.
Note: Oracle systems are limited to a maximum of 10 cursors.
Unsupported SQL Commands
The following SQL commands cannot be issued using CA Easytrieve Report Generator controlled SQL processing:
• BEGIN DECLARE
• CREATE PROGRAM
• DECLARE STATEMENT
• DECLARE TABLE
• DESCRIBE
• END DECLARE
• EXECUTE
• EXECUTE IMMEDIATE
• PREPARE
• SELECT ... INTO ...
• WHENEVER
CA Easytrieve® Report Generator 11.6
The SELECT ...INTO... command is valid when processing DB2 static-only programs. For more information, see the
SQLSYNTAX parameter for the PARM statement.
Note: The SELECT ... INTO ... command (singleton SELECT) can be simulated using CA Easytrieve Report Generator
automatic cursor management.
Retrieving All Columns
The following example retrieves all columns from the PERSONNEL table.
Reassign Departments
CA Easytrieve® Report Generator 11.6
The following example reassigns all employees in department 901 to department 109 and displays the names of the employees.
The PARM statement parameters are necessary only if you want to access a DB2 or Ingres database subsystem other than the
default.
PARM SSID('DB2B')
DEFINE EMPNAME W 20 A
DEFINE WORKDEPT W 2 P 0
SQL DECLARE CURSOR1 CURSOR FOR +
SELECT EMPNAME +
FROM PERSONNEL +
WHERE WORKDEPT = 901 +
FOR UPDATE OF WORKDEPT
JOB INPUT NULL NAME(SQLEX5)
SQL CONNECT :USERID IDENTIFIED BY :PASSWORD
PERFORM CHECKSQL
SQL OPEN CURSOR1
PERFORM CHECKSQL
DO WHILE SQLCODE NE 100. * 1403 FOR ORACLE
SQL FETCH CURSOR1 +
INTO :EMPNAME
PERFORM CHECKSQL
IF SQLCODE NE 100 . * 1403 FOR ORACLE
PRINT PERSNL
SQL UPDATE PERSONNEL +
SET WORKDEPT = 109 +
WHERE CURRENT OF CURSOR1
PERFORM CHECKSQL
END-IF
END-DO
SQL CLOSE CURSOR1
PERFORM CHECKSQL
STOP
CHECKSQL. PROC
IF SQLCODE NE 0 AND SQLCODE NE 100. * 1403 FOR ORACLE
DISPLAY 'SQLCODE = ' SQLCODE
STOP EXECUTE
END-IF
END-PROC
REPORT PERSNL LINESIZE 65
LINE EMPNAME
PERFORM CHECKSQL
SQL UPDATE PERSONNEL +
SET EMPPHONE = 70000 + EMPPHONE +
WHERE EMPPHONE IS NOT NULL
PERFORM CHECKSQL
STOP
CHECKSQL. PROC
IF SQLCODE NE 0 AND SQLCODE NE 100. * 1403 FOR ORACLE
DISPLAY 'SQLCODE = ' SQLCODE
STOP EXECUTE
END-IF
END-PROC
Processing Overview
The following diagram gives an overview of how CA Easytrieve® Report Generator interacts with a CA IDMS database:
Automatic Input
-------------
| |
RETRIEVE file-name-1 ... ---------------->| <IDMS> |
| |
| |
(<idms> records in <----------| | |
path form for automatic input) | |
... -------------
Controlled Processing
-------------
CA Easytrieve® Report Generator 11.6
| |
IDMS statement ... ---------------------->| <IDMS> |
| |
| |
(<idms> controlled <----------| | |
record processing) | |
... -------------
CA IDMS Functionality
CA Easytrieve® Report Generator portability is constrained by CA IDMS portability. Where differences exist, CA
Easytrieve® Report Generator attempts to resolve the difference while still allowing your program to execute. Therefore, some
parameters may be ignored where they do not function.
CA IDMS Statements
The following statements are used to define CA IDMS database activities:
• IDD statements
Retrieve definitions from the Integrated Data Dictionary
• FILE
Identify a CA IDMS database
• RECORD
Describe database records
• LOGICAL-RECORD
Describe logical records
• ELEMENT-RECORD
Describe the database records that are part of a logical record
• RETRIEVE
Describe automatic (path) processing for database records
• SELECT
Describe automatic (path) processing for logical records
• IDMS statements
Provide controlled retrieval and maintenance for both database and logical records
For complete syntax for these statements, see Language Reference.
CA IDMS Interface
The CA IDMS interface provides complete facilities for information retrieval from, and maintenance of,
CA IDMS databases. To use this interface effectively, you should have a basic knowledge of CA IDMS
and of the databases to be processed.
The CA IDMS interface provides complete facilities for information retrieval from, and maintenance of, CA IDMS databases.
To use this interface effectively, you should have a basic knowledge of CA IDMS and of the databases to be processed.
You can access a CA IDMS database in the following ways:
• Using automatic input
• Using controlled processing, which incorporates statements similar to those used in COBOL
With automatic input (also called path processing), you can sweep an entire area of the database or retrieve records under the
control of a tickler file or integrated indexing.
If the IDD interface is not used to generate definitions, the database administrator should build the FILE, RECORD,
LOGICAL-RECORD, ELEMENT-RECORD, and DEFINE statements to describe the subschemas that are used. The
subschema descriptions can then be stored in a CA Easytrieve Report Generator macro library.
When using the CA IDMS interface, you can define subschemas using the following statements:
Statement Description
FILE Identify the database to be processed.
CA Easytrieve® Report Generator 11.6
See Logical Record Definition in Sample Database and Logical Record for statement examples that can be used by the
database administrator to establish database field definitions. These definitions can then be stored in CA Easytrieve macros for
your access. You can also generate these statements automatically using the IDD interface.
For complete syntax for these statements, see the Language Reference section.
This article includes the following information:
IF first call
IDMS BIND subschema-name from INPUT file +
PROGRAM-NAME parameter from RETRIEVE/SELECT +
DBNAME parameter from RETRIEVE/SELECT +
NODE parameter from RETRIEVE/SELECT +
DICTNAME parameter from RETRIEVE/SELECT +
DICTNODE parameter from RETRIEVE/SELECT
IDMS BIND FILE file-name RECORD record-name (RETRIEVE only)
... (repeated for each record specified)
IDMS READY ALL RETRIEVAL
END-IF
retrieve
next set of information IF no more
information wrap up
reports STOP
END-IF
CA Easytrieve® Report Generator 11.6
The RETRIEVE statement provides for automatic input of CA IDMS databases. Input is accomplished in one of the following
ways:
• By sweeping an entire database area and sequentially processing all occurrences of the root record
• By selectively processing root records through the use of a tickler file or integrated index.
Sweep of an Area
Sweeping an entire database area for all occurrences of the root record provides the default input. OBTAIN NEXT RECORD
WITHIN AREA calls are issued at the root level until the database area has been exhausted. If they are specified, the INDEX,
LIMIT, and WHILE subparameters control the sweep.
Tickler File Control
Optionally, a file of root record keys can control the extent of the database to be processed. The keys are obtained one at a time
from the tickler file. OBTAIN CALC calls are issued for each key in the tickler file. When the tickler file is used, only CALC
records can be the root. The record must have the KEY parameter specified on the RECORD statement.
Input Definition (Paths)
Automatic input of CA IDMS databases depends on the concept of path processing. Each database path, identified by
the SELECT parameter, is processed in a top-to-bottom order. A root record is obtained first, then path access continues
downward through the records coded in the SELECT parameter. When the end of each path is reached, that data is made
available to the program as an input record.
If another path is defined, denoted by a repeated record name or node, that path is then processed until end-of-path. When all
paths for the root have been exhausted, the next root is obtained. Paths can be defined from a member occurrence to its owner
occurrence if owner pointers exist for the set.
If the owner record type is at the higher level, then records at each level of the path below the root are retrieved by using
OBTAIN NEXT RECORD WITHIN SET. If the member record type is specified at the higher level, then OBTAIN OWNER
calls are used. The name of the set to be used must be specified with the SET subparameter of the SELECT parameter entry for
the lower-level record.
Automatic Input of Logical Records
The SELECT statement provides for automatic input of logical records from CA IDMS databases. The input is a sequential
retrieval of all occurrences of a specified logical record that satisfy a user-specified WHERE clause. OBTAIN NEXT
RECORD WHERE calls are issued for the logical record until all records have been retrieved. A logical path is not input if
LR-STATUS is LR-ERROR or LR-NOT-FOUND.
WHERE Clause
To code the Boolean expression required by the WHERE parameter of the SELECT statement, use the syntax required by CA
IDMS for COBOL programs. The only difference is that if the Boolean expression extends over multiple source records, each
record must be continued using the CA Easytrieve conventions. For more information, see the Language Reference section.
Examples
Processing Two Distinct Paths from a Single Root
This example illustrates path processing. The RETRIEVE statement returns all data to the program for processing. Information
about missing data is also available.
ORD-CPO# 8 10 A
RECORD OREMARK 72
ORD-SEQ 1 2 A
ORD-TEXT 3 70 A
RECORD SALES 28
SLS-CUST-NO 1 10 A
JOB INPUT (DBASE) NAME TWO-DISTINCT-PATHS
RETRIEVE DBASE +
SELECT (CUSTOMER AREA 'CUSTOMER-REGION' +
SALES ID 'SA' SET 'CUSTOMER-SALES' +
CUSTOMER +
ORDOR SET 'CUSTOMER-ORDER' +
OREMARK ID 'RE' SET 'ORDER-OREMARK')
IF PATH-ID EQ 'RE'
DISPLAY ORD-TEXT
ELSE
DISPLAY SLS-CUST-NO
END-IF
The first customer record in the area is obtained. The first sales record for the customer is then obtained. If no sales exist, the
order path is processed. If a sale record exists for the customer, the path containing the customer and sales record is returned to
the program. This processing continues until no more sales records exist for the customer. The order path is then processed.
The first order for the root customer is then obtained, and the first remark for the order. This path is then returned to the
program. Next, the second remark for the first order is obtained and the path is returned. The customer and order records
remain unchanged. Only the remark record is affected. When all remarks for the first order are returned, the next order for the
customer is obtained with all its remarks. This processing continues until all orders and all remarks are obtained and returned
to the program. The second customer root is then obtained and processing continues as described above until all customer
records have been processed.
PATH-ID is used to test which path is returned to the program. When PATH-ID = SA, the customer sales path is available.
When PATH-ID = RE, the customer/order/remark path is available. This program does not process paths for customers
without sales or without orders.
Processing Two Paths with Intermediate Records the Same
Like the previous example, the program in this example also processes two paths. The product, sales, customers, and order
records are all processed. Then the first path specifies that the item records for each order are to be returned and then the
remark records for the same order are returned. Each record also has an ID specified.
RECORD PRODUCT 48
PROD-NO 1 8 A
PROD-DESC 9 20 A
RECORD ITEM 3226
ITEM-PROD# 1 8 A
JOB INPUT (DBASE) NAME TWO-PATHS
RETRIEVE DBASE +
SELECT (PRODUCT ID 'PR' AREA
'PRODUCT-REGION' + SALES ID 'SA' SET
'PRODUCT-SALES' + CUSTOMER ID 'CU'
SET 'CUSTOMER-SALES' + ORDOR ID 'OR'
SET 'CUSTOMER-ORDER' + ITEM ID 'IT'
SET 'ORDER-ITEM' + ORDOR
+ OREMARK ID
'RE' SET 'ORDER-OREMARK') IF PATH-ID EQ 'RE'
DISPLAY PROD-DESC
CUST-NAME ORD-TEXT END-IF
IF PATH-ID EQ
'IT' DISPLAY
PROD-DESC CUST-NAME ITEM-PROD# END-IF
In a typical CA IDMS database path, each record can occur multiple times or may not occur at all. Occasionally, you may
want to determine which path is available and which records in the path are available. Based on the previous example, the
information in the following table is provided.
GO TO JOB
END-IF
DISPLAY CUST-NAME
Another reason to limit record retrieval is to inhibit potential redundant calls to CA IDMS. For example, if it is known
that a particular record never occurs more than twice in a path, code LIMIT 2 for that record. This use of LIMIT improves
throughput for database activities.
Conditional Record Retrieval
CA Easytrieve® Report Generator 11.6
You can screen any record to establish the acceptability of the record. CA Easytrieve bypasses record occurrences that fail the
acceptance test for input consideration. Use the WHILE condition to control record acceptance.
Select Statement
The following shows a logical record select statement.
*
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
Controlled Processing
All valid CA IDMS functions can be performed using the controlled processing commands of the IDMS statement. Basically,
each of these commands generates a call to CA IDMS in much the same manner as a COBOL program. For information about
using these commands, see the appropriate DML Reference section in the CA IDMS Reference. The first parameter of the
IDMS statement identifies the command to be issued. These commands are:
• ACCEPT
• BIND
• COMMIT
• CONNECT
• DISCONNECT
• ERASE
• FIND or OBTAIN
• FINISH
• GET
• IF
• KEEP
• MODIFY
• READY
• RETURN
• ROLLBACK
• STORE
You should test the IDMSSTATUS field in the CA IDMS Communications Block to determine whether the execution of each
controlled processing statement is successful.
CA Easytrieve® Report Generator 11.6
IDMS Statement
The IDMS statement provides controlled input/output of a CA IDMS database. You can use the commands of the CA IDMS
statement either with or without the automatic input associated with RETRIEVE or SELECT.
Warning: To ensure that currency is maintained for automatic input, take care when combining automatic input and
controlled processing.
You can code these statements at any place in a JOB where an I/O statement for any other file can be coded. For complete
syntax for all IDMS statements, see the Language Reference section.
Controlled Processing Examples
The following examples use the CA IDMS test database supplied with your CA IDMS system.
Area Sweep for Record Type
STATUS-CHECK. PROC
* IF STATUS NOT OK, TERMINATE
PROCESSING IF IDMSSTATUS NE '0000'
DISPLAY NEWPAGE, 'IDMS STATUS IS ', IDMSSTATUS
IDMS FINISH
STOP
END-IF
END-PROC
*
REPORT AREA-SWEEP LINESIZE(72)
CA Easytrieve® Report Generator 11.6
CUST-NO CUST-NAME *
IDMS READY
PERFORM STATUS-CHECK
END-PROC
*
SIGN-OFF. PROC
IDMS FINISH
PERFORM STATUS-CHECK
END-PROC
*
STATUS-CHECK. PROC
IF IDMSSTATUS NE '0000'
DISPLAY 'IDMS STATUS ' IDMSSTATUS
DISPLAY 'ERROR DATA: AREA ' IDMSEAREA +
' SET ' IDMSESET ' RECORD ' IDMSEREC
STOP
END-IF
END-PROC *
LR-STATUS-CHECK. PROC
IF LR-STATUS EQ 'LR-ERROR'
DISPLAY 'LR STATUS ' LR-STATUS ' NAME ' LRNAME +
' VERB ' LRVERB
PERFORM STATUS-CHECK END-
IF END-PROC
IDD Interface
The interface between ezt and the CA IDMS Integrated Data Dictionary (IDD) is accomplished by the use
of IDD statements.
The interface between CA Easytrieve Report Generator and the CA IDMS Integrated Data Dictionary (IDD) is accomplished
by the use of IDD statements.
This article includes the following information:
IDD Statements
To give you the fullest control over this access, the following IDD statements are provided:
• IDD NAMEControl which dictionary is accessed.
• IDD VERSION
Specify which version of the information is to be retrieved.
• IDD SUBSCHEMA
Retrieve definitions of IDMS files (subschemas).
• IDD FILE
Retrieve definitions of non-IDMS files.
• IDD RECORD
Retrieve definitions of records.
IDD statements generate CA Easytrieve Report Generator library definitions based on the parameters that are coded on the
statement. IDD statement parameters direct the retrieval of data definition information from the IDD and insert definitions for
files, database records, logical records, element records, and fields directly into the product's internal tables.
The actual FILE, RECORD, LOGICAL-RECORD, ELEMENT-RECORD, and DEFINE statements are not generated as
visible source code, and do not appear in the output listing. Instead, the IDD NAME statement simulates the presence of these
statements by storing the information that is obtained from the IDD in the same manner that the statements would. The DMAP
parameter of the PARM statement can be used to obtain a description of the information stored.
CA Easytrieve® Report Generator 11.6
Note:
Syntax for the previous statements is in the Language Reference section.
Program Name
If a subschema has restricted authorization, a properly-registered program name must be supplied to the product. This
program name can be specified on the IDD NAME statement. If the IDD NAME statement is not coded, a default name of
EASYPLUS is used. The default program name would have to have been previously stored in the IDD definition for the
restricted subschema.
Conform IDD Item Descriptions to CA Easytrieve Report Generator Standards
To ensure the correct translation of certain IDD record constructs into CA Easytrieve Report Generator formats, the following
adaptations have been made:
• For an item that occurs multiple times in a record and is supplied with an index, the index name is used as the CA
Easytrieve Report Generator INDEX name. If the index is not supplied in the IDD, the product generates an INDEX name
is by concatenating the item name with the string +INDEX.
• If the item being defined is part of a group item, the relationship between the defined item and its containing group item is
preserved. The group item is defined as a segmented data item. If the group item occurs multiple times, then the defined
item also occurs multiple times.
• Data types that do not conform to the rules of the product are treated as alphanumeric (A) fields.
Handle Group Item Definition
When the IDD interface creates a definition of a group item and its component items, it is possible that an ambiguity might
occur, making the definition unusable by your CA Easytrieve Report Generator program. This ambiguity is created when a
component of the group item and another item within the same database record have identical names. The component item
name, either alone or with the record name as a qualifier, is not sufficient to distinguish between the two items. To resolve this
ambiguity, you can use the group item's name as a qualifier for any item it contains.
Because the group item itself might be part of a larger group item, it is possible for an item that is defined with the IDD
interface to use many levels of qualification. The only limit on the number of levels is the number of levels the IDD allows you
to define for the record definition in the dictionary.
As a result, the syntax of a reference to an item defined with the IDD interface is as follows:
• For an item defined in a database record:
Examples
Defining a Subschema
STOP
CUSTOMER-ORDER ORDER-
OREMARK
NPO MA NP MA LAST
ASC ORD-DATE-
PROM
CUSTOMER-
SALES DL
NPO MA
ASC SLS-PROD-
NUMBER
SALES ORDER-
ITEM
-------------- N MA NEXT
640|F|28|
VIA
--------------
CUST-
SALES
--------------
CUSTOMER-
REGION
PRODUCT-
SALES
NPO MA
ASC SLS-CUST-
NUMBER
PRODUCT ITEM
-------------- --------------
631|F|48|CALC 621|V|3226|
VIA
-------------- --------------
PROD-NUMBER|DN ORDER-
ITEM
-------------- --------------
PRODUCT-REGION ORDER-
REGION
PRODUCT-
ITEM
NPO OA
ASC ITEM-LOG-
NUMBER DF
Field Definitions
CA Easytrieve® Report Generator 11.6
The following field definitions describe the sample database that is shown in the previous diagram. These definitions are
established by the database administrator and stored in a CA Easytrieve Report Generator macro.
SELECT
OBTAIN EACH CUSTOMER WITHIN CUSTOMER-
REGION
OBTAIN EACH SALES WITHIN CUSTOMER-
SALES
OBTAIN EACH PRODUCT WITHIN PRODUCT-
REGION
SELECT
MODIFY SALES.
SELECT
ERASE SALES.
SELECT
STORE SALES.
The field definitions that follow describe the sample logical record. These definitions are established by the database
administrator and stored in a CA Easytrieve Report Generator macro.
*
IDD NAME DBNAME 'TSTDICT'
*
FILE DEMOSSLR IDMS (DEMOSSLR)
LOGICAL-RECORD CUST-SALES-
LR
ELEMENT-
RECORD CUSTOMER
CUST-
NUMBER 1 10 A
CUST-
NAME 11 20 A
ELEMENT-
RECORD SALES
SLS-CUST-
NO 1 10 A
ELEMENT-
RECORD PRODUCT
PROD-
NUMBER 1 8 A
PROD-
DESC 9 20 A
*
JOB INPUT NULL
STOP
The Automatic Input article describes how automatic input uses the RETRIEVE statement in these ways:
• Sweep of a database
• Tickler file control
• Input definition (paths)
Test Database
The source statement samples that follow show database definition statements (DBD) and program
specification block (PSB) statements that describe the database that is referenced throughout this section.
The database is a portion of the PARTS test database that is provided by IBM with the IMS system. For
more information about the database, see the IBM IMS/VS Installation Guide. For information about the
test database for DLI DOS/VS, see the IBM Guide for New Users. This section uses only the OS/IMS test
database that is shown in the diagram in Test Database Structure.
The source statement samples that follow show database definition statements (DBD) and program specification block (PSB)
statements that describe the database that is referenced throughout this section. The database is a portion of the PARTS
test database that is provided by IBM with the IMS system. For more information about the database, see the IBM IMS/VS
Installation Guide. For information about the test database for DLI DOS/VS, see the IBM Guide for New Users. This section
uses only the OS/IMS test database that is shown in the diagram in the Test Database Structure section.
This article includes the following information:
DBD NAME=DI21PART,ACCESS=(HISAM,ISAM)
DATASET DD1=DI21PART,DEVICE=3330,OVFLW=DI21PARO
SEGM NAME=PARTROOT,PARENT=0,BYTES=50,FREQ=250
FIELD NAME=(PARTKEY,SEQ),TYPE=C,BYTES=17,START=1
SEGM NAME=STANINFO,PARENT=PARTROOT,BYTES=85,FREQ=1
FIELD NAME=(STANKEY,SEQ),TYPE=C,BYTES=2,START=1
SEGM NAME=STOKSTAT,PARENT=PARTROOT,BYTES=160,FREQ=2
FIELD NAME=(STOCKEY,SEQ),TYPE=C,BYTES=16,START=1
SEGM NAME=CYCCOUNT,PARENT=STOKSTAT,BYTES=25,FREQ=1
FIELD NAME=(CYCLKEY,SEQ),TYPE=C,BYTES=2,START=1
SEGM NAME=BACKORDR,PARENT=STOKSTAT,BYTES=75,FREQ=0
FIELD NAME=(BACKKEY,SEQ),TYPE=C,BYTES=10,START=1
DBDGEN
PCB TYPE=DB,DBDNAME=DI21PART,PROCOPT=A,KEYLEN=43
SENSEG PARTROOT
SENSEG STANINFO,PARTROOT
SENSEG STOKSTAT,PARTROOT
SENSEG CYCCOUNT,STOKSTAT
SENSEG BACKORDR,STOKSTAT
PSBGEN LANG=ASSEM,PSBNAME=EZTPPSBA
Automatic Input
Automatic input is a facility whereby ezt retrieves records from the database and makes them available
to the program. For a description of automatic input as it applies to conventional files, see Controlled
Processing and Automatic Processing.
Automatic input is a facility whereby CA Easytrieve Report Generator retrieves records from the database and makes them
available to the program. For a description of automatic input as it applies to conventional files, see Controlled Processing and
Automatic Processing.
This article contains the following information:
Automatic Input
To indicate that automatic input is to occur for the IMS/DLI database, you must perform certain steps.
Follow these steps:
1. Code the INPUT parameter on the JOB statement for each activity that will require automatic input from the database. The
INPUT parameter must specify the file name from the FILE statement that defines the IMS/DLI file. This must be the only
file name specified. CA Easytrieve Report Generator does not support synchronized file processing for IMS/DLI database
files.
2. Code a RETRIEVE statement following the JOB statement. Only one RETRIEVE statement must be coded.
The RETRIEVE statement with SELECT parameters describes the particular portion of the database to be retrieved. CA
Easytrieve Report Generator performs all the DLI calls needed to retrieve the records described by the automatic input
statements. Automatic input is either a sweep of the entire database or a selection of root statements through the use of a tickler
file.
Sweeping the Database
Sweeping the entire database provides the default input. A get next (GN) call is issued at the root level until the database has
been exhausted. LIMIT, SSA, or WHILE parameters, if specified, control the sweep.
Tickler File Control
Optionally, a file of root segment keys can control the extent of the database to be processed. Root segment keys are obtained
one at a time from the tickler file. Get unique (GU) calls are issued for each key on the tickler file. The KEY parameter must
be specified on the RECORD statement for the root segments retrieved by the tickler file option.
Input Definition (Paths)
Automatic input of IMS/DLI databases depends upon the concept of path processing. Each database path identified with the
SELECT parameter is processed in a top-to-bottom, front-to-back, and left-to-right order. A root segment is accessed first,
with path accessing continuing downward to the left until the end of the path. When the end of each path is reached, that data is
made available to the program as an input record. The following diagram illustrates the paths in a portion of the test database.
Path-id is enclosed in parentheses ( ) above the field-name:
CA Easytrieve® Report Generator 11.6
CA Easytrieve® Report Generator exhausts each path before proceeding to the next path. When it exhausts the last path, it
retrieves the next root and processing begins again with the leftmost path.
Typical Path Examples
The following series of path processing examples illustrates the functions of the various statements and parameters associated
with automatic database input. The examples are based upon the Test Database Structure in this section. Each example also
relies upon the following data definition:
STATUS-
CODE 11 2 A
PROC-
OPTIONS 13 4 A
RESERVE-
DL1 17 4 B
SEG-NAME-
FB 21 8 A
LENGTH-FB-
KEY 29 4 B
NUMB-SENS-
SEGS 33 4 B
KEY-FB-
AREA 37 43 A
*
RECORD PARTROOT 50 KEY(PARTKEY 1 17)
PARTKEY 1 17 A
PART-
NUMBER 1 17 A
PART-
DESC 27 24 A
*
RECORD STANINFO 85 PARTROOT KEY(STANKEY 1 2)
STANKEY 1 2 A
STAN-MAKE-
DEPT 48 6 A
STAN-MAKE-
TIME 62 3 A
*
RECORD STOKSTAT 160 PARTROOT KEY(STOCKEY 1 16)
STOKKEY 1 16 A
STOK-ON-
ORDER 106 8 N
STOK-IN-
STOCK 114 8 N
*
RECORD CYCCOUNT 25 STOKSTAT
CYCLKEY 1 2 A
*
RECORD BACKORDR 75 STOKSTAT
BACKKEY 1 2 A
BACK-
Q1 11 13 A
PARTKEY 1 17 A
PART-
NUMBER 1 17 A
PART-
DESC 27 24 A
FILE KEYS
KEY 1 17 A
JOB INPUT (DLIFILE) NAME MYPROG
RETRIEVE DLIFILE +
KEYFILE KEYS, +
KEYVALUE KEY, +
SELECT PARTROOT
IF PATH-
ID EQ 'NF'
DISPLAY 'ROOT NOT FOUND FOR ' KEY
ELSE
DISPLAY PART-NUMBER PART-
DESC
END-
IF
...
RETRIEVE DLIFILE ... +
SELECT (PARTROOT)
...
...
...
RETRIEVE DLIFILE ... +
SELECT (PARTROOT +
STANINFO +
STOKSTAT)
...
paths are: 1 - PARTROOT AND STANINFO
2 - PARTROOT AND STOKSTAT
CA Easytrieve® Report Generator 11.6
...
RETRIEVE DLIFILE ... +
SELECT (PARTROOT ID 'A' +
STOKSTAT ID 'AC' +
CYCCOUNT ID 'CE' +
BACKORDR ID 'CF')
...
paths are: 1 - PARTROOT AND STOKSTAT AND CYCCOUNT
2 - PARTROOT AND STOKSTAT AND BACKORDR
STOKSTAT +
BACKORDR ID 'CF')
IF PATH-
ID NE 'CF'
GO TO JOB
END-
IF
DISPLAY PART-NUMBER PART-DESC BACK-
Q1
INITPSB. PROC
DLI PCB 'EZTPPSBA'
END-
PROC.
TERMPSB. PROC
DLI TERM
END-
PROC
Note: The DLI PCB and DLI TERM statements are required only in CICS environments. They are ignored in non-CICS
environments.
Limiting Segment Retrieval
You can use the LIMIT subparameter of SELECT to limit segment occurrence retrieval. The following example describes
an area sweep where the number of root segments retrieved is limited to five for program testing purposes. When the limit is
reached, input processing is terminated.
Another example of limiting segment retrieval is its use to inhibit potential redundant calls to IMS/DLI. For example, if it
is known that a particular segment never occurs more than two times in a path, code LIMIT 2 for that segment. This use of
LIMIT improves performance for database activities.
Root Segment Qualification Input Control
You can qualify root segments for retrieval by using the SSA subparameter of SELECT. The value supplied with SSA is
enclosed within parentheses and concatenated with the segment-name to produce the root segment's SSA. The following
example illustrates the control of input through root segment qualification. Processing terminates when IMS/DLI returns a
status-code indicating that the qualification cannot be satisfied.
PART-
NUMBER 1 17 A
PART-
DESC 27 24 A
JOB INPUT (DLIFILE) NAME MYPROG
RETRIEVE DLIFILE +
SELECT (PARTROOT SSA 'PARTKEY = 02N51P3003F000 ')
DISPLAY PARTKEY PART-NUMBER PART-
DESC
at the start of the database. Using the START procedure on the JOB statement means that DLI statements can be issued to
reposition the database at its beginning.
END-
PROC
TERMPSB. PROC
DLI TERM
END-
PROC.
SSA-
PART W 37 A VALUE 'PARTROOT(PARTKEY = XXXXXXXXXXXXXXXXX)'
SSA-PART-DATA SSA-
PART +19 17 A
SSA-
STOK W 36 A VALUE 'STOKSTAT(STOCKEY = XXXXXXXXXXXXXXXX)'
SSA-STOK-DATA SSA-
STOK +19 16 A
...
JOB INPUT (NULL)
DLI DLIFILE PARTROOT 'GN'
IF FILE-
STATUS EQ 'GE', 'GB'
STOP
END-
IF
IF FILE-
STATUS NOT SPACE
DISPLAY 'JOB TERMINATED, CODE = ' FILE-
STATUS
STOP
END-
IF
NEXT-
STOK
SSA-PART-
DATA = PARTKEY
DLI DLIFILE STOKSTAT 'GNP ' SSA (SSA-
PART, +
'STOKSTAT ')
IF FILE-
STATUS EQ 'GE'
GO TO JOB
END-
IF
IF FILE-
STATUS NOT SPACE
DISPLAY 'JOB ...'
CA Easytrieve® Report Generator 11.6
STOP
END-
IF
NEXT-
BACK
SSA-STOK-DATA = STOK-
KEY
DLI DLIFILE BACKORDR 'GNP ' SSA (SSA-
PART, +
SSA-
STOK, +
'BACKORDR ')
IF FILE-
STATUS EQ 'GE'
GO TO NEXT-STOK
END-
IF
IF FILE-
STATUS NOT SPACE
DISPLAY 'JOB ... '
STOP
END-IF
...
process data base path
...
GO TO NEXT-BACK
Database Maintenance
You can perform complete database maintenance using the DLI statement. One of the programming techniques used in
association with database maintenance is usually the dynamic construction and use of SSAs.
Creation of IMS/DLI Calls
This example depicts some of the basic programming necessary to dynamically create IMS/DLI calls.
...
SSA-
COUNT W 4 B
FUNCTION W 4 A
*
SSA-
ROOT W 37 A VALUE 'PARTROOT(PARTKEY = XXXXXXXXXXXXXXXXX)'
SSA-ROOT-QUAL SSA-
ROOT +8 1 A
SSA-ROOT-DATA SSA-
ROOT +19 17 A
*
SSA-
LVL2 W 23 A VALUE 'STANINFO(STANKEY = XX)'
SSA-LVL2-SEG SSA-
LVL2 8 A
CA Easytrieve® Report Generator 11.6
SSA-LVL2-QUAL SSA-
LVL2 +8 1 A
SSA-LVL2-KEY SSA-
LVL2 +9 8 A
SSA-LVL2-DATA SSA-
LVL2 +19 2 A
...
JOB ...
...
SSA-
COUNT = 1
SSA-ROOT-
QUAL = ' '
FUNCTION = 'GN '
DLI DLIFILE PARTROOT FUNCTION SSANO SSA-COUNT SSA(SSA-
ROOT)
PERFORM TEST-
STATUS
SSA-ROOT-
QUAL = '('
SSA-ROOT-
DATA = PARTKEY
FUNCTION = 'GNP '
SSA-LVL2-
SEG = 'STANINFO'
SSA-LVL2-
QUAL = ' '
SSA-
COUNT = 2
PERFORM DLI-
CALL
IF FILE-
STATUS ...
...
ELSE
PERFORM TEST-
STATUS
END-
IF
...
DLI-
CALL. PROC
DLI DLIFILE STANINFO FUNCTION +
SSANO SSA-
COUNT +
SSA (SSA-
ROOT, +
SSA-
LVL2, +
...)
CA Easytrieve® Report Generator 11.6
END-
PROC
TEST-
STATUS. PROC
IF FILE-
STATUS ...
...
END-
IF
END-
PROC.
...
...
...
... ...
DLI DLIFILE PARTROOT 'GHN '
IF FILE-
STATUS EQ 'GE'
STOP
ELSE
PERFORM TEST-
STATUS
END-
IF
IF PARTKEY ...
DLI DLIFILE PARTROOT 'DLET'
PERFORM TEST-
STATUS
END-
IF
IF FILE-
STATUS SPACES
PRINT
END-
IF
...
TEST-
STATUS. PROC
IF FILE-
STATUS NOT SPACE
DISPLAY ...
...
STOP
END-
IF
CA Easytrieve® Report Generator 11.6
END-
PROC
...
...
The ETDTCM routine communicates with a driver routine named ETDRVR (supplied by CA Technologies). You must link-
edit ETDRVR with the User Requirement Tables produced by your database administrator. The installation instructions for
this interface are discussed in the Installing section.
Access Macros
The CA Datacom/DB interface option uses a series of macros that access CA Datacom/DB and eliminate
the need for much of the user coding. These macros fall into two categories:
The CA Datacom/DB interface option uses a series of macros that access CA Datacom/DB and eliminate the need for much of
the user coding. These macros fall into two categories:
• Macros that generate parameter areas that CA Datacom/DB requires.
• Macros that generate the appropriate calls to CA Datacom/DB.
Note:
For more information about CA Datacom/DB, see the Programming section in the CA Datacom/DB documentation.
This article includes the following information:
The %DBRA macro statement defines the Request Area (RA) within your CA Easytrieve Report Generator program. This
286-byte, required Request Area, is used to specify requests made to CA Datacom/DB and to test the results. CA Datacom/DB
uses the Request Area to save control information between related requests. A program must have an active Request Area for
each CA Datacom/DB table you access. The program can also use multiple Request Areas for the same table. Use this macro
for either automatic or controlled processing.
See the Programming section in the CA Datacom/DB documentation for more information about the full definition and uses of
the Request Area.
Syntax
The prfx, tbl-nm, and ky-nm parameters are required. The db-id-no parameter is optional.
• prfx
Specifies the prefix for the CA Datacom/DB access set you are using to access the CA Datacom/DB table. This unique
prefix enables multiple access paths into the same CA Datacom/DB table and must match the prefix that you use for the
%DBEL and %DBWA macros.
Because the interface uses prfx to generate other field names, prfx must follow CA Easytrieve Report Generator naming
conventions and be no longer than 30 characters when you use controlled processing. When you use this macro with
automatic input, prfx can only be eight characters long for z/OS and seven characters long for VSE. This is because
the prfx is also used as a filename.
The %DBRA macro loads prfx into the variable prfx-PREFIX to aid the interface in identifying the RA. Prfx-PREFIX is
located outside the normal bounds of the RA, as defined by CA Datacom/DB. Therefore, prfx-PREFIX causes no problems
for any of the CA Datacom/DB requirements.
• tbl-rm
Specifies the three-character table name that you assign in CA Datacom/DB to the set of records you are accessing. The tbl-
nm parameter must match a valid table name in the CA Datacom/DB data dictionary. If not, all requests that use the
Request Area fail.
• ky-nm
Specifies the five-character name of the key you use to traverse the table. The ky-nm parameter must match a valid name in
the CA Datacom/DB data dictionary.
• dh-id-no
Optional binary value for a specific database ID. When you use the SYNONYM=YES parameter in your URT, you must
code the db-id-no parameter to address the correct database.
%DBEL Define Element List
The %DBEL macro statement defines the Element List (EL) for communication with CA Datacom/DB. This optional area
controls the data elements that you reference. Use this macro for either automatic or controlled processing.
Syntax
• prfx
Specifies the prefix for the CA Datacom/DB access set. It must match the prefix that you use for the %DBRA and
%DBWA macros. Prfx must follow CA Easytrieve Report Generator naming conventions and be no longer than 30
characters when you use controlled processing. When you use this macro with automatic input, prfx can only be eight
characters long for z/OS. This is because the prfx is also used as a filename.
• elmt-nm
Specifies the data element that you retrieve, update, or add to the database. The format of the elmt-nm parameter is:
EEEEES
CA Easytrieve® Report Generator 11.6
Where EEEEE is the element name as defined in the data dictionary, and S is the security code that is defined for that
element.
• If the element name does not have a security code, you do not have to enter it.
• If the element name is fewer than five characters long, and there is a security code, you must enter the element name in
quotes with filling blanks. For example:
ABC 'D'
In this example, ABC is the element name and D is the security code.
Because the element name is three characters long, there are two blanks between C and D.
You must enter at least one element name when you use this macro. You can enter as many as 16 element names,
depending on the needs of your program.
%DBWA Define Work Area
The %DBWA macro statement defines the Work Area (WA) for communication with CA Datacom/DB. You can use the
optional Work Area to provide a local working storage area in which to manipulate the data elements that are listed in the
matching Element List. Use the %DBWA macro for controlled processing requests only.
Syntax
You must provide working storage definitions to redefine the Work Area with the appropriate field definitions. The field
definitions describe the data elements that your CA Easytrieve Report Generator program manipulates. See Controlled
Processing Examples for a working storage definition with the %DBWA macro.
%DBFILE Generate FILE Statement
The %DBFILE macro statement generates the FILE statement that you use during automatic processing. Use this macro for
automatic processing only.
Syntax
• prfx
Specifies the prefix that is associated with the Request Area and Element List. Prfx must follow CA Easytrieve Report
Generator naming conventions. Prfx can only be eight characters long for z/OS and seven characters long for VSE. This is
because the prfx is also used as a filename.
The interface uses prfx to tailor the generated code which in turn establishes the appropriate CA Datacom/DB parameter
list. The %DBUIB, %DBRA, and %DBEL macros generate the required data areas that communicate with CA Datacom/
DB.
• wrk-area-sz
Specifies the length of the Work Area that you define to contain the elements that are listed in the Element List. The size
of this work area must be large enough to fit the combined lengths of all the elements that are listed. If the size is too small,
retrieval commands overlay whatever follows the Work Area in storage, such as CA Easytrieve Report Generator code.
• strt-val
Optional value that you can use for skip sequential processing. When you omit strt-val, the table is processed beginning
with the first key value found. When you supply strt-val, the table is processed beginning with the first key value found that
is equal to or greater than the value supplied. If the strt-val contains embedded blanks, you must enclose it in triple quotes.
For example:
In this example, there are three blanks between Smith and 91700. Therefore, you must place triple quotes around them (you
have to place the triple quotes, even if there is one blank). If you do not, processing stops at the blank after Smith.
Usage Notes
The %DBFILE macro generates the following statements:
CA Datacom/DB needs the WORK-AREA defined after the FILE statement for data transfer. It is defined here as a file field to
make it possible to use automatic processing. See the Programming section in the CA Datacom/DB documentation for more
information about the full definition and uses of the Work Area.
You must provide FILE field definitions to redefine the WORK-AREA with the appropriate field definitions that describe the
data elements that your CA Easytrieve Report Generator program manipulates. See Examples for a working storage definition
following the %DBFILE macro.
%DBOPEN Open Tables
The %DBOPEN macro statement opens the CA Datacom/DB tables for further processing. You must code this macro in the
activity section of the CA Easytrieve Report Generator program (before any other CA Datacom/DB commands). Use this
macro for controlled processing only.
Syntax
%DBOPEN
Usage Notes
CA Easytrieve® Report Generator 11.6
You must invoke the %DBOPEN macro (that generates the DBOPEN PROCedure) once in each CA Easytrieve Report
Generator program that uses controlled processing. Automatic processing does not require the %DBOPEN macro, because the
FILE EXIT routine automatically opens the tables.
If the %DBOPEN macro is invoked, a %DBCLOSE macro must be invoked before the CA Easytrieve Report
Generator program has ended to close the database. If the %DBCLOSE is not done, the database is left in an open condition,
and a system abend may occur at termination.
%DBCLOSE Close Tables
The %DBCLOSE macro statement closes all open CA Datacom/DB tables. The %DBCLOSE macro has no parameters. Use
this macro for controlled processing only.
Syntax
%DBCLOSE
Usage Notes
You must invoke the %DBCLOSE macro (that generates the DBCLOSE PROCedure) once at the end of each CA Easytrieve
Report Generator program that uses controlled processing. The DBCLOSE PROCedure closes all open CA Datacom/DB
tables.
%DBLREQ Direct Request (Long List)
The %DBLREQ (long parameter list) macro statement provides the direct request interface to CA Datacom/DB using all four
CA Datacom/DB parameters areas (UIB, RA, EL, WA). Use %DBLREQ only for controlled processing requests into CA
Datacom/DB.
The DBLREQ macro uses the internal macros DBREQ2 and DBREQ3.
Syntax
The first two parameters are required for this macro. The el-prfx and wa-prfx parameters are optional.
• prfx
Specifies the prefix that was previously associated with a set of RA, EL, and WA areas. Prfx must follow CA Easytrieve
Report Generator naming conventions and can be no longer than 30 characters. The prefix tailors the generated code that
accesses the appropriate CA Datacom/DB parameter areas for the request.
• cmnd-cd
Specifies a valid five-character CA Datacom/DB command code. Use cmnd-cd to specify the operation to be performed.
See the Programming section in the CA Datacom/DB documentation for a list of valid command codes.
• el-prfx
Optionally points to an element list other than the one you specify in prfx. When you specify this parameter, CA Datacom/
DB accesses the element list that el-prfx points to and ignores the value in prfx. If you do not enter a value for el-prfx, then
the el-prfx defaults to the value in prfx. The el-prfx parameter enables you to communicate with CA Datacom/DB using the
exact data areas that provide you with the optimum access path.
• wa-prfx
Optionally points to a work area other than the one you specify in prfx. When you specify this parameter, CA Datacom/
DB accesses the work area that wa-prfx points to and ignores the value in prfx. If you do not enter a value for wa-prfx, then
the wa-prfx defaults to the value in prfx. The wa-prfx parameter enables you to communicate with CA Datacom/DB using
the exact data areas that provide you with the optimum access path.
Usage Notes
After the call, the result of the operation is found in prfx-RET-CD.
%DBSREQ Direct Request (Short List)
The %DBSREQ (short parameter list) macro statement provides the direct request interface into CA Datacom/DB using the
UIB and RA parameter areas only. This macro saves programming time because it eliminates the need to code the WA and
CA Easytrieve® Report Generator 11.6
EL areas. Use this macro with only those commands that require the UIB and WA areas (such as in LOCATE, DELETE, and
RELEASE). See the Programming section in the CA Datacom/DB documentation for a complete list of these commands.
Use the %DBSREQ macro only for controlled processing requests into CA Datacom/DB.
Syntax
Line 1 defines the standard User Information Block (UIB) parameter area for CA Datacom/DB calls. Only one of these is
required in any program.
Lines 2 and 3 define two other standard parameter areas: the Request Area (RA) and the Element List (EL).
Line 4 defines the Work Area (WA) size, sets up the automatic processing file, and defines the starting value for the
sequential scan (LOW-VALUES is the default).
The %DBFILE macro automatically generates the FILE statement and EXIT parameter, causing the CA Datacom/DB files to
be properly opened, accessed, and closed.
CA Easytrieve® Report Generator 11.6
Note: The RA, EL, and WA are matched together by the prefix ABC.
Lines 5-9 define the field structure of the WA.
Lines 11-15 are the typical statements that are required to produce a sequential report.
Macro Generated Statements
The example of automatic processing is now shown with all statements that the macros generate. The statements that are
generated by the macros are identified with an asterisk in the left column:
' *
DEFINE ABC-ELM14 ABC-ELEM-LIST +78 7 A VALUE
' ' * DEFINE ABC-ELM15 ABC-ELEM-LIST +84 7 A
VALUE ' ' * DEFINE ABC-ELM16 ABC-ELEM-LIST +90 7
A VALUE ' ' %DBFILE ABC 20
* DEFINE ABC-KEY-VAL2 ABC-REQ-AREA +76 180
A VALUE '00000000' * FILE ABC
+ * WORKAREA(20)
+ * EXIT (ETDTCM USING (USER-INFO
+ * ABC-REQ-STRT
+ * ABC-ELEM-
LIST) * WORK-AREA 1 1 A
OCCURS 20 PO 1 5 A
LI 6 3
A VENDR
9 3 A
TPVAL 12 8 N MASK 'ZZZ,ZZ9.99'
LATE 20 1 A
JOB NAME ACCESS-ALL-ROWS INPUT ABC
PRINT ABC-RPT
REPORT ABC-RPT LINESIZE 80
LINE PO VENDR TPVAL LATE
Line 1 defines the standard User Information Block (UIB) parameter area for CA Datacom/DB calls. Only one of these is
required in any program.
Lines 2 and 3 define two other standard parameter areas: the Request Area (RA) and the Element List (EL).
CA Easytrieve® Report Generator 11.6
Line 4 defines the Work Area (WA) size, sets up the automatic processing file, and defines the starting value for the
sequential scan ('01000').
The %DBFILE macro automatically generates the FILE statement and EXIT parameter causing the CA Datacom/DB files to
be properly opened, accessed, and closed.
Note: The RA, EL, and WA are matched together by the prefix DEF.
Lines 5-9 define the field structure of the WA.
Lines 11-18 are the typical statements that are required to produce a report for the desired range of records.
Controlled Processing
The following program is an example of controlled processing. Like the first example program, it prints a report of all records
in the purchase order header (POH) table. This program duplicates the results of the first example under Automatic Processing.
17 STARTUP.
18 PROC . * Procedure for start-up
processing 19 PERFORM DBOPEN . * Open
the CA-Datacom/DB file 20 GHI-KEY-VAL
= X'0000000000' . * Set the first key value 21
%DBSREQ GHI LOCKY . * Locate key => start value
22 IF GHI-RET-CD = '14' . * Did we not find one?
23 STOP . * Then we
must not have any records 24 END-IF
25
%DBLREQ GHI REDLE . * Read the located record
26 END-PROC
27 %DBOPEN
28 %DBCLOSE
29 *
Line 1 defines the standard User Information Block (UIB) parameter area for CA Datacom/DB calls. Only one of these is
required in any program.
Lines 2-4 define the other three standard parameter areas - the Request Area (RA), the Element List (EL), and the Work Area
(WA).
Note: The RA, EL, and WA are matched together by the prefix GHI.
Lines 5-9 define the field structure of the WA.
Line 11 is a JOB statement which specifies the initializing and terminating procedures that you use. You must always code
these procedures to point to the %DBOPEN or %DBCLOSE macros or to PROCedures that invoke them.
Lines 12-16 contain the logic to print the current record and read the next record in the table, checking for end of file.
Lines 17-26 perform the required initializing operations. This operation calls the DBOPEN PROCedure, sets the initial key
value, and reads a record.
Line 27 contains the %DBOPEN macro that opens the required CA Datacom/DB tables.
Line 28 contains the %DBCLOSE macro that closes the required CA Datacom/DB tables.
Lines 30-31 contain the typical statements needed to produce a report.
Macro Generated Statements
The example of controlled processing is now shown with all statements that the macros generate. The statements generated by
the macros are identified with an asterisk in the left column:
Line 1 defines the standard User Information Block (UIB) parameter area for CA Datacom/DB calls. Only one of these is
required in any program.
Lines 2-18 define the other three standard parameter areas: the Request Area (RA), the Element List (EL), and the Work Area
(WA). These lines also define the particular field structure of each WA for each of the access paths you need into the database.
In lines 2-4, the RA, EL, and WA are matched together by the prefix JKL.
In lines 8-10, the RA, EL, and WA are matched together by the prefix MNO.
In lines 14-16, the RA, EL, and WA are matched together by the prefix PQR.
Line 20 is a JOB statement which specifies the initializing and terminating procedures that you use. You must always code
these procedures to point to the %DBOPEN or %DBCLOSE macros or to PROCedures that invoke them.
Lines 21-26 define your position in the POL file and read any line items that are to be printed.
CA Easytrieve® Report Generator 11.6
Lines 27-32 contain a loop that reads the part name record for the current line item, prints the line, and reads the next line
item. This process continues until the line items for the current purchase order are exhausted.
Lines 33-37 contain the logic to read the next purchase order and check for end of file.
Lines 38-47 contain the logic to perform the required initializing operations, such as invoking the DBOPEN procedure, setting
the initial key value, and reading that record.
Line 48 contains the %DBOPEN macro that opens the required CA Datacom/DB tables.
Line 49 contains the %DBCLOSE macro that closes the required CA Datacom/DB tables.
Lines 51-52 are the typical statements that are required to produce a report.
File Processing
Prior:
Prior:
If you did not specify WORKAREA on the FILE statement for the input files, CA Easytrieve® Report Generator processed the
record in Locate Mode. When the record was read into memory, it remained in the system-allocated record buffer.
release 11.x:
If you do not specify WORKAREA on the FILE statement for the input files, CA Easytrieve® Report Generator processes the
record in Move Mode. When the record is read, it is moved from the system-allocated record buffer to the buffer created in
program storage.
What this change means to your CA Easytrieve® Report Generator program:
When you are reading an input file where you do not know the record lengths (as with variable-length files), use the
RECORD-LENGTH field. After each record is read, the RECORD-LENGTH field contains the length of that record. Structure
your program logic to reference only fields that are not defined to extend beyond the length specified in the RECORD-
LENGTH field.
Because release 6.4 used Locate Mode processing, your invalid references can refer to data beyond the actual record and into
the following record in the buffer. When you use Move Mode processing, the reference is always within the program storage.
However, if you do not use RECORD-LENGTH you can unintentionally refer to the data for a previous record.
The following example processes two records, with the second record shorter than the first. The example writes the records to
a file, then reads them and displays a field that is defined beyond the length of the record:
CHAR X
ZONE E000000000
NUMR 7000000000
1...5...10
CHAR ABC
ZONE CCC4444444
NUMR 1230000000
1...5...10
CHAR XBC
ZONE ECC4444444
NUMR 7230000000
1...5...10
The release 6.4 results display data outside of the first record and also a portion of the second record in the system buffer. The
release 11 results display the program storage buffer, but the second record still contains the ‘BC’ characters from the first
record. Only refer to data that is constrained by RECORD-LENGTH. CA Easytrieve® Report Generator does not initialize the
buffer between input operations.
The following example reads the file and correctly displays the variable portion of the record (VFLD2):
If you write records from a variable-length input file to a variable-length output file, you must set the RECORD-LENGTH
field for each output record. The RECORD-LENGTH field of the output file must be set to the RECORD-LENGTH value of
the input file before the PUT to the output file. See the following example:
VFLD2 * 10 A
FILE VFILEOUT VB(20 200)
JOB INPUT VFILE
VFILEOUT:RECORD-LENGTH = VFILE:RECORD-LENGTH
PUT VFILEOUT FROM VFILE
(none) GET
CA Easytrieve® Report Generator 11.6
UPDATE All
Sequential Files
supports the access of all sequential files that the operating environment in which is running also
supports.
CA Easytrieve® Report Generator supports the access of all sequential files that the operating environment in which CA
Easytrieve® Report Generator is running also supports.
Contents
Sequential Files
When also supported by the operating environment, CA Easytrieve® Report Generator supports all of the following sequential
access methods:
• Queued Sequential Access Method (QSAM)
• Virtual Storage Access Method Entry Sequenced Data Set (VSAM ESDS)
• CARD and PUNCH files (not valid in CICS)
• CA Easytrieve® Report Generator's Virtual File Manager
• Non-mainframe variable-length text files and fixed-length record files (including standard devices: stdin, stdout)
Sequential File Processing Rules
CA Easytrieve® Report Generator 11.6
CA Easytrieve® Report Generator processes sequential files according to the following rules:
• When you do not code a file type on the FILE statement, SEQUENTIAL is the default. CARD, PUNCH, and VIRTUAL
files imply a SEQUENTIAL file type.
Note: When SEQUENTIAL is not specified for a sequential file, the FILE-STATUS field is not available for the file.
• You cannot process the same sequential file as both an input and an output file within the same activity.
• You can create sequential files in one activity and process them in subsequent activities.
• CA Easytrieve® Report Generator permits only one CARD file in a program.
Sequential Input
CA Easytrieve® Report Generator provides both automatic and controlled processing of sequential files.
Automatic Processing
The following example shows sequential processing with automatic control:
Controlled Processing
The next example shows sequential processing with programmer control:
CARD Input
In TSO or CMS, you can process one of the input files through the system input stream (SYSIN) by defining the file with a
device type of CARD.
In non-mainframe environments, the device type of CARD is equal to stdin. The file is treated as a variable-length text file.
Note: Unless redirected, stdin reads input from the terminal device.
Sequential Output
You can create output files using controlled processing with the PUT statement.
Fixed-Length File Creation
The following example shows fixed-length sequential file creation:
FILE INFILE
FIELD 1 5 A
FILE OUTFILE FB(100 500)
FIELD 1 5 A
JOB INPUT INFILE NAME MYPROG
PUT OUTFILE FROM INFILE
FILE INFILE
FIELD 1 5 A
FILE OUTFILE VB(100 504)
FIELD 1 5 A
JOB INPUT INFILE NAME MYPROG
OUTFILE:RECORD-LENGTH = 5
PUT OUTFILE FROM INFILE
END-IF
Note: When using multiple files, you should qualify FILE-STATUS, as illustrated above (ESDS:FILE-STATUS).
PUNCH Files
Except for the PUNCH parameter, CA Easytrieve® Report Generator treats PUNCH files the same as any other 80-byte
sequential file. The next example illustrates PUNCH file output:
FILE INFILE
FIELD 1 5 A
FILE OUTFILE PUNCH
FIELD 1 5 A
JOB INPUT INFILE NAME MYPROG
PUT OUTFILE FROM INFILE
In MVS, the PUNCH parameter is not required, due to its device independence. Simply define an output sequential file as
fixed-length 80 characters and assign it to the proper SYSOUT class via the DD card. If you code the PUNCH parameter,
MVS routes the output to the DD, SYSPUNCH.
Indexed Files
supports both sequential and random (direct) processing of indexed files. Indexed files use a key that
is contained in each record. Sequential processing retrieves records sequenced by the key. When also
supported by the operating environment, supports the following index access methods:
CA Easytrieve® Report Generator supports both sequential and random (direct) processing of indexed files. Indexed files use a
key that is contained in each record. Sequential processing retrieves records sequenced by the key. When also supported by the
operating environment, CA Easytrieve® Report Generator supports the following index access methods:
• Virtual Storage Access Method Keyed Sequenced Data Set (VSAM KSDS)
• C-ISAM files (fixed or variable-length format, unique single keys only)
• Windows Indexed files (fixed or variable-length format, unique single keys only)
Contents
Skip-Sequential Processing
Random Input
The READ statement can read indexed files randomly (direct access mode). This example illustrates reading an indexed file
(PERSNL) using keys contained in a sequential file (INKEYS):
WHO * 5 N
PHONE * 10 N
JOB INPUT INKEYS NAME MYPROG
MOVE WHO TO EMP#
MOVE PHONE TO TELEPHONE
WRITE PERSNL ADD STATUS
IF PERSNL:FILE-STATUS NE 0
DISPLAY 'BAD KEY=' WHO ' STATUS=' PERSNL:FILE-STATUS
GOTO JOB
END-IF
File Creation
The FILE statement and the PUT statement are used to create (load) indexed files. You can reference a newly created file
in subsequent activities by coding another FILE statement with a different file name, but with JCL that points to the same
physical file. The following example illustrates reloading an indexed file. To use the RESET option on the FILE statement,
you must define the data set as reusable.
Deleting a Record
CA Easytrieve® Report Generator 11.6
You can use the WRITE statement to delete individual records from an indexed file. The deleted record is the file's current
input record.
Updating a Record
You can modify and rewrite the current input record by using the WRITE statement.
Relative Files
supports both sequential and random (direct file access) processing of relative files. Relative files use a
four-byte binary key that contains an integer value that specifies the relative record number. Sequential
processing retrieves records sequenced by the relative sequence number. When also supported by the
operating environment, supports the following relative access methods:
CA Easytrieve® Report Generator 11.6
CA Easytrieve® Report Generator supports both sequential and random (direct file access) processing of relative files.
Relative files use a four-byte binary key that contains an integer value that specifies the relative record number. Sequential
processing retrieves records sequenced by the relative sequence number. When also supported by the operating environment,
CA Easytrieve® Report Generator supports the following relative access methods:
• Virtual Storage Access Method Relative Record Data Set (VSAM:RRDS)
• Non-mainframe fixed-length relative (random-access) files
• C-ISAM files (fixed or variable-length format)
Contents
Skip-Sequential Processing
This example shows RELATIVE skip-sequential processing:
Random Input
The READ statement can read relative files randomly (direct access mode). The example below illustrates reading a relative
file, PERSNL, using keys contained in a sequential file, INKEYS:
File Creation
CA Easytrieve® Report Generator 11.6
You can use the FILE statement and the PUT statement to create (load) relative files. You can reference a newly created file
in subsequent activities by coding another FILE statement with a different file name, but with JCL that points to the same
physical file. The following example illustrates reloading a relative file. To use the RESET option on the FILE statement, you
must define the data set as reusable.
Deleting a Record
You can use the WRITE statement to delete individual records from a RELATIVE file. The deleted record is the file's current
input record. For example:
Updating a Record
You can use the WRITE statement to modify and rewrite the current input record. For example:
Sorting Files
You can use the SORT statement to sort files. ezt can sort any file that can be processed sequentially.
You can use the SORT statement to sort files. CA Easytrieve Report Generator can sort any file that can be processed
sequentially.
Note:
Sorting files during CA Easytrieve Report Generator program execution significantly increases CPU overhead. See Usage
Best Practices for information about reducing CPU overhead.
This article includes the following information:
Sorting Files
The following illustrates the position of a SORT activity within a CA Easytrieve® Report Generator program:
Environment ...
Library
...
Activities
...
... SORT
sort procedure ... ...
...
Your installation's sort program performs the actual sort process, except in CICS and in non-mainframe environments,
where CA Easytrieve® Report Generator supplies its own sort program. CA Easytrieve® Report Generator normally utilizes
conventional sort interface techniques. For example, on a mainframe CA Easytrieve® Report Generator invokes the sort
program's E15 (input) and E35 (output) exits.
You can set a site option to use versions of sort in which the sort processes all input and output. For more information about
the available options for sort program utilization, see your installation's sort program manual.
Note: In CICS and in non-mainframe environments, CA Easytrieve® Report Generator provides a sort program.
See Sequenced Reports for information about sorting report output.
SORT Activity Example
CA Easytrieve® Report Generator 11.6
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:
Sort Procedures
CA Easytrieve® Report Generator normally sorts all input records and outputs them to the file you specify. The output file
usually has the same format and length as the input file. However, sometimes you may want to sort only certain records or
modify the contents. To do this, you can write a sort procedure, which must immediately follow the SORT statement.
You can code any valid CA Easytrieve® Report Generator statement in a sort procedure, but you cannot code statements that
generate input/output. Invalid statements are:
• COMMIT
• DELETE
• DISPLAY
• FETCH
• GET
• IDMS
• INSERT
• POINT
• PRINT
• PUT
• READ
• RETRIEVE (IDMS)
• ROLLBACK
• SELECT (SQL)
• SELECT (IDMS)
• SQL
• UPDATE
• WRITE
Note: For debugging purposes, you can DISPLAY to the system output device (SYSPRINT/SYSLST).
The only valid field references within a sort procedure are:
• Any field of the input file
• Any working storage field
• System-defined fields such as SYSDATE and RECORD-LENGTH
Sorting a Selected Portion of a File
CA Easytrieve® Report Generator supplies input records to your sort procedure one at a time. If you code a BEFORE
procedure, a SELECT statement must be executed for each record that you want to sort.
CA Easytrieve® Report Generator 11.6
The following example illustrates how to code an output file that will contain only a reordered subset of the input file. The
output file contains only those records for which the SELECT statement is executed:
The INPUT parameter of the JOB statement designates files and their keys for synchronized file input. The following example
illustrates various synchronized file and key combinations:
Record Availability
Records from files in CA Easytrieve Report Generator synchronized file input are made available for processing based on the
relationship of the files' keys. Records with the lowest keys are made available first, and the match is hierarchical based on the
order of the files that are specified on the JOB statement.
The following three input files show an example of synchronized file input:
9 7 8 B
The key is the single numeric digit and the letter indicates duplicates for illustrative purposes. The JOB statement to process
the three files for the match/merge operation is:
Duplicate key values affect record availability differently, based on which file contains the duplicates. Remember, the
matching algorithm is hierarchical, so the key is exhausted on the lowest level before another record is processed from the next
higher-level file.
Match/Merge Operation Output
The following example illustrates the match/merge output from the synchronized file input process. The output shows the
result of each iteration (loop) through the JOB activity. N/A under a file indicates that a record from the file is not available
and no fields from this file can be referenced during the associated iteration.
Note: CA Easytrieve Report Generator provides special IF statements to help you determine record availability. See Special
IF Statements for more information.
Look at iterations 3 trough 5 in this output. FILE1 and FILE2 both contain two records with a key value of 3. FILE3 contains
only one record of key 3. CA Easytrieve Report Generator processes these records as follows:
• Iteration 3 -- The first record 3 from FILE1 and FILE2 and the only record with key 3 from FILE3 are available.
• Iteration 4 -- Because the next record on FILE3 is a key 4 record and there are still key 3 records to process in the other
files, FILE3's record is not available. CA Easytrieve Report Generator goes back to FILE2 and gets the next key 3 record.
The original key 3 record from FILE1 and the second key 3 record from FILE2 are available.
• Iteration 5 -- Because the next record on FILE2 is a key 4 record and there is still a key 3 record on FILE1 to process,
FILE2 is now unavailable. CA Easytrieve Report Generator returns to FILE1 and retrieves the next record. This time the
only record available is the second key 3 record from FILE1.
Special IF Statements
CA Easytrieve® Report Generator 11.6
CA Easytrieve Report Generator provides a simple way of determining the contents of current synchronized file input with
special conditional expressions.
MATCHED
Use the MATCHED test to determine the relationship between the current record of one file and the current record of one or
more other files:
Using the table of automatic synchronized file input in the Match/Merge Operation Output section if this article, the
MATCHED test provides the following conclusions:
• IF MATCHED is true for JOB iteration 3.
• IF MATCHED FILE1, FILE3 is true for JOB iterations 1, 3, 11, and 12.
• IF MATCHED FILE2, FILE3 is true for JOB iterations 3, 6, and 10.
File Existence
To determine the presence of data from a particular file, use the following special conditional expressions:
IF [NOT] file-name
IF [NOT] EOF file-name
When the IF file-name condition is true, a record from that file is present and available for processing. The IF NOT file-name
condition is true when the file does not contain a record with a current key. When this condition is true, no fields from the file
can be referenced in the activity. If you reference a field in an unavailable file, CA Easytrieve® Report Generator issues a
runtime error.
Using the table of automatic synchronized file input in the Match/Merge Operation Output section of this article, the special
conditional expressions provide the following conclusions:
• IF FILE1 is true for JOB iterations 1 through 5 and 11 through 14.
• IF NOT FILE2 is true for JOB iterations 1, 5, 8, and 11 through 14.
• IF EOF FILE2 is true for JOB iterations 11 through 14.
DUPLICATE, FIRSTDUP, and LASTDUP
The DUPLICATE, FIRST-DUP, and LAST-DUP tests determine the relationship of the current record of a file to the
preceding and following records in the same file:
{DUPLICATE}
IF [NOT] {FIRST-DUP} file-name
{LAST-DUP }
Using the table of automatic synchronized file input in the Match/Merge Operation Output section of this article, the record
relationship tests provide the following conclusions:
• IF DUPLICATE FILE1 is true for JOB iterations 3 through 5 and 11 through 13.
• IF FIRST-DUP FILE2 is true for JOB iterations 3 and 6.
• IF LAST-DUP FILE3 is true for JOB iteration 12.
The FIRST-DUP and LAST-DUP conditions are also DUPLICATE conditions. A record that satisfies the IF LAST-DUP or IF
FIRST-DUP condition also satisfies the IF DUPLICATE condition.
CA Easytrieve® Report Generator 11.6
For more detailed examples of conditional expressions, see the Language Reference section.
Updating a Master File
The next example illustrates updating a master file based on matching transaction file records. The program assumes:
• A new master record is written when a match exists between the master file and the transaction file.
• There should be no duplicate transactions for a given master record. If this occurs, the first duplicate is processed but
subsequent duplicates are bypassed.
• No transaction records should exist without a matching master record. If this occurs, the record is displayed on an error
report and processing is bypassed.
Using Synchronized File Processing on a single file allows you to compare the contents of a key field or fields from one record
to the next and use IF tests to group records according to the key fields. The file name is coded on the JOB INPUT statement
as follows:
Using single file input lets you determine the start of a new key value and the end of the current key value using IF tests.
The following IF statement determines the start of a new key:
PRINTER Files
enables you to create files with a device type of PRINTER to write printed output with the REPORT and/
or DISPLAY statements. See for information about output creation. A PRINTER file can be directed to
one of the following destinations:
CA Easytrieve® Report Generator enables you to create files with a device type of PRINTER to write printed output with the
REPORT and/or DISPLAY statements. See Routing Printer Output for information about output creation. A PRINTER file can
be directed to one of the following destinations:
• The user's terminal
• Any other terminal (only in CICS)
• Your operating system's spooling subsystem
• An external data set
The FILE statement for the PRINTER file determines the destination.
Contents
SYSPRINT
SYSPRINT is a system-defined PRINTER file where printed output is sent unless otherwise specified. You can override this
default by specifying the name of your PRINTER file on the REPORT or DISPLAY statement. SYSPRINT is routed to the
destination specified in your site options. This may cause the output to be sent to one of the above destinations. For more
information, see your system administrator.
Non-Mainframe Files
The following guidelines apply when you code the FILE statement in non-mainframe environments.
The following guidelines apply when you code the FILE statement in non-mainframe environments.
Contents
File Type
The FILE statement for each file specifies the type of CA Easytrieve® Report Generator access. CA Easytrieve® Report
Generator supports SEQUENTIAL, INDEXED, and RELATIVE file types. SEQUENTIAL is the default if not specified.
INDEXED files can be processed using various access methods. See Execute a Program in Using.
Record Format
Sequential files can have fixed or variable format records. Variable format records are line-feed (newline) delimited. Only text
files where the delimiter cannot occur in data can be variable. Binary data cannot be stored in a sequential variable file because
of the delimiter. You should set your record length to the length of the longest text. CA Easytrieve® Report Generator reads
the file for record-length-plus-one characters, or up to a newline character, whichever comes first. If no newline character is
present, CA Easytrieve® Report Generator issues an I/O error.
Fixed format records are fixed in length. The record length of the file determines where each record in the file begins. For
example, if a file has a record length of 20, bytes 0 to 19 make up the first record, bytes 20 to 39 make up the second record,
and so on. You can store binary data in fixed format files. Because fixed format records are not line-feed delimited, you can get
unpredictable results viewing or editing them.
Logical Record Length
You should specify the logical record length for each file. The defaults CA Easytrieve® Report Generator may assume most
likely are wrong.
• If you set the record length of a variable file too short, an error occurs.
• If you set the record length of a fixed file incorrectly, any record after the first appears to have fields shifted out of place.
Often, this causes data errors.
Generally, CA Easytrieve® Report Generator computes the default record length to be the greater of the following items:
• The highest location of a field defined in the file
• The WORKAREA parameter of the FILE statement
• The logical record length specified on the FILE statement
CISAM
Creating C-ISAM files requires that CA Easytrieve® Report Generator know what field represents the key of the record. CA
Easytrieve® Report Generator receives key information from C-ISAM after the files are created. Currently, CA Easytrieve®
Report Generator supports only unique single-keyed C-ISAM files and only as INDEXED files.
CA Easytrieve® Report Generator does not directly support all C-ISAM data types. The following table shows the C-ISAM
data types and their CA Easytrieve® Report Generator equivalents:
• These C-ISAM numeric data types are not directly usable within CA Easytrieve® Report Generator. C-ISAM provides
functions to convert between their machine-independent data representation and the internal representation required by
CA Easytrieve® Report Generator when it executes. You can call these routines from a FILE MODIFY exit to reformat
data into any of the various CA Easytrieve® Report Generator numeric data types. A sample exit is supplied with CA
Easytrieve® Report Generator as CISAMXIT.c.
• C-ISAM execution requires special execution setup. For more information about executing your C-ISAM program,
see Using.
Windows Indexed Files
Creating Windows Indexed files requires that CA Easytrieve® Report Generator know what field represents the key of the
record. CA Easytrieve® Report Generator receives key information from the files after the files are created. Currently, CA
Easytrieve® Report Generator supports only unique single-keyed indexed files and only as INDEXED files.
Report Processing
A major function of many ezt programs is to produce printed reports. The non-procedural nature of ezt
report syntax is readily adaptable to the production of basic and extremely complex reports, both with
minimum programming effort. Two statements generate printed output:
A major function of many CA Easytrieve Report Generator programs is to produce printed reports. The non-procedural nature
of CA Easytrieve Report Generator report syntax is readily adaptable to the production of basic and extremely complex
reports, both with minimum programming effort. Two statements generate printed output:
• The PRINT statement initiates the basic declarative report facility.
• The DISPLAY statement produces single print lines on print files.
PRINT is the preferred method because of its many automatic facilities. This section primarily discusses report processing
using the PRINT statement. Using the DISPLAY statement to mix single print lines within a report is discussed with report
procedures.
Basic Report Structure
The CA Easytrieve Report Generator report facility is basically declarative; you need only define the format and content
of the report and the product creates the necessary instructions to produce the report. The following exhibit illustrates the
basic structure of a CA Easytrieve Report Generator job with report processing. You can define one or more reports for each
activity.
You can use the CA Easytrieve/Online Report Painter to automate the coding of a report declaration. For more information,
see Design and Run a Report.
Report Formats
Standard Report
The CA Easytrieve® Report Generator default report format is the standard format illustrated below:
CA Easytrieve® Report Generator 11.6
Top Margin
The top margin is the space between the physical top of the form and the point to which the printer positions when a top-of-
form order is issued to the printer. The size of the top margin is controlled by the printer carriage tape or forms control buffer.
Title Area
The optional title area consists of 1 to 99 title lines plus a title margin between the last title line and the first heading line.
Heading Area
The optional heading area consists of 1 to 99 heading lines plus a heading margin between the last heading line and the report
body.
Report Body
The report body consists of one or more occurrences of a line group. Each occurrence of a line group is 1 to 99 lines plus,
optionally, one or more blank lines between occurrences.
Bottom Margin
The bottom margin is the area remaining between the bottom of the report body and the physical bottom of the page.
Label Report
The second report format is used to print labels. The following exhibit illustrates the basic label report page format:
CA Easytrieve® Report Generator 11.6
Report Generation
You define a report in ezt by coding a REPORT statement followed by a series of report definition
statements. You must code the REPORT statement first in a report declarative. The REPORT statement
establishes the type and characteristics of the report. Although you can specify many REPORT statement
parameters, you probably will produce most reports using default parameter values. REPORT statement
parameters provide a simple way to define tailored reports. For complete explanations of REPORT
statement parameters, see the section.
You define a report in CA Easytrieve Report Generator by coding a REPORT statement followed by a series of report
definition statements. You must code the REPORT statement first in a report declarative. The REPORT statement establishes
the type and characteristics of the report. Although you can specify many REPORT statement parameters, you probably will
produce most reports using default parameter values. REPORT statement parameters provide a simple way to define tailored
reports. For complete explanations of REPORT statement parameters, see the Language Reference section.
This article contains the following information:
...
JOB ...
...
PRINT ...
...
REPORT
CA Easytrieve® Report Generator 11.6
{ SEQUENCE
{ CONTROL
Report { SUM
Definition { TITLE { REPORT-
INPUT
Statements { HEADING { BEFORE-
LINE
{ LINE { AFTER-
LINE
{ special-name procedures { BEFORE-
BREAK
{ AFTER-
BREAK
{ ENDPAGE
{ TERMINATION
You can code report procedures in any order and can define any number of reports for each JOB activity.
Report Definition Statements
The REPORT statement and its parameters define the physical attributes of your report. Code the following statements to
define the content of your report:
• SEQUENCE -- Optionally specifies the order of the report based on the content of one or more fields.
• CONTROL -- Identifies control fields that are used for a control report. A control break occurs whenever the value of any
control field changes or end-of-report occurs.
• SUM -- Specifies the quantitative fields which are totaled for a control report.
• TITLE -- Defines optional report title items and their position on the title line.
• HEADING -- Optionally defines an alternate heading for a field.
• LINE -- Defines the content of a report line.
For the complete syntax of these statements, see the Language Reference section.
System-Defined Fields
CA Easytrieve Report Generator automatically provides the special data fields that follow for your reports. These fields are
stored as part of working storage and are read-only.
• LINE-COUNT
Indicates the number of lines that are printed on the page.
• LINE-NUMBER
Indicates the number of the line being printed within the line group. See Standard Reports for information about line
groups.
• PAGE-COUNT
Indicates the number of pages printed.
• PAGE-NUMBER
Indicates the number of the page being printed.
• TALLY
Indicates the number of detail records in a control break. See Control Reports for more information.
• LEVEL
Indicates the control break level. See Control Reports for more information.
• BREAK-LEVEL
Indicates the highest field in the break. See Control Reports for more information.
Standard Reports
The report facility in includes all of the functions necessary to produce most reports very easily. Using
report options, you can produce a report in almost any format. Most reports, however, are variations of a
standard report.
CA Easytrieve® Report Generator 11.6
The report facility in CA Easytrieve® Report Generator includes all of the functions necessary to produce most reports very
easily. Using CA Easytrieve® Report Generator report options, you can produce a report in almost any format. Most reports,
however, are variations of a CA Easytrieve® Report Generator standard report.
Contents:
Titles
The title is the first item printed on each report page. You can specify the report title with up to 99 TITLE statements. The
following diagram illustrates the title area of a report:
Results:
IN DEPARTMENT 903
Overriding Defaults
You can override the automatic (default) functions associated with title contents and spacing to produce any required report
title. This may be necessary to produce reports that use preprinted forms as the output medium. You can use the following
parameters to produce nonstandard title content and spacing:
• NOADJUST -- Causes each title line to be left-justified on the page. NOADJUST may cause line items to overlay the tags
printed for SUMCTL TAG. COL positioning is necessary for tag to appear.
• NODATE and NOPAGE -- Inhibit current date and page count information from being placed on the first title line.
• COL -- Use the COL positioning parameter to position items in specific print columns. COL can be used with ADJUST or
NODADJUST.
Note: If you specify NOADJUST, the date overlays the leftmost positions of TITLE 1. To avoid this problem, do one of the
following:
• Use NODATE.
• Reserve an area for SYSDATE by specifying COL 10 for SHORTDATE or COL 12 for LONGDATE before the first item
on the TITLE statement.
Examples
The following examples of title statements use title content and space adjustment parameters. The report title that results from
the statements is also illustrated.
Statements:
Results:
column column
0 2
1 0
025-30-5228
11/19/09 WIMN GLORIA
430 M ST SW 107
BOSTON , MA 02005
Report Headings
A report heading is normally printed for line items that are specified on LINE 01. Each heading is centered over its associated
line item. The following rules control the heading; the order in which they are listed indicates the hierarchy of override.
1. The NOHEADING parameter of the REPORT statement inhibits the printing of any headings.
2. The HEADING statement sets the item heading content.
3. The HEADING parameter of the DEFINE statement sets the item heading content.
4. The field-name of the DEFINE statement sets the item heading content.
5. Line items that are literals do not have headings.
6. Only LINE 01 items have headings.
The following diagram illustrates the positioning of headings in a typical report. Line items might not always have the same
number of heading entries. In this case, the corresponding heading line area is blank for those items with no headings.
T I T L E A R E A
TITLESKIP space
HEADING
HEADING
Heading HEADING HEADING
area HEADING HEADING HEADING
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
SOCIAL
SECURITY NET
NAME NUMBER PAY
Line Group
Lines compose the body of a report. The lines of a report are output in groups for each PRINT statement issued. All of the
LINE statements of the report make up a line group, which is also called a logical report line:
LINE ... }
LINE 02 ...} line or logical report
LINE 03 ...} group line
...
1 5 10 15 1 5 10 1 4
............... ........... ....
SOCIAL
SECURITY SEX heading
EMPLOYEE NAME NUMBER CODE
Special Positioning
Sometimes the standard positioning of line items on a report is unsuitable for producing the desired result, as in the case of
aligning numeric fields on LINE 02 with the decimal point of corresponding fields on LINE 01. The POS line item adjusting
parameter left-justifies the corresponding fields, but when the LINE 02 field is not as long as the LINE 01 field, the two fields
are unaligned. If that happens, use the +offset or -offset line item adjustment parameter after the POS parameter to adjust the
position of the data.
The next example illustrates poor and good decimal alignment. The first occurrence of FLD2 on LINE 02 is not decimal-
aligned with FLD1 on LINE 01. To align the second occurrence correctly, an additional offset of 3 spaces (+3) is specified.
Statements:
CA Easytrieve® Report Generator 11.6
Results:
poor good
column column
1 5 10 15 1 5 10 15
............... ...............
FLD1 FLD1
SPREAD Parameter
The SPREAD parameter of the REPORT statement offers a unique way to space line items. When you use reports as
work sheets, it is often desirable to space line items as far apart as possible. SPREAD overrides the SPACE parameter of
the REPORT statement and creates report lines with the maximum number of spaces between each item, as this example
illustrates:
Statements:
Results:
................................................................. .
Label Reports
You can use the label report capability of to print mailing labels and other applications that require
inserting variable data in a repetitious format. A label report is different from a standard report in the
following ways:
CA Easytrieve® Report Generator 11.6
You can use the label report capability of CA Easytrieve® Report Generator to print mailing labels and other applications that
require inserting variable data in a repetitious format. A label report is different from a standard report in the following ways:
• Label reports do not have titles and headings.
• Multiple labels can be printed side-by-side.
• Controlled label reports allow for control breaks, but do not automatically total quantitative fields. Totals, however, can be
specified on a SUM statement and processed in BEFORE-BREAK and AFTER-BREAK procedures.
You can use the label report function whenever a complete logical print page is to be produced by each PRINT statement.
Consider the W-2 form-printing example; print time could be substantially reduced by having 2-up forms. You can then
modify report declaration statements as shown in the following code. A sample result follows the code.
CONTROL Statement
You can use the CONTROL statement with label reports to truncate a group of labels. Truncating makes it easy to separate
labels after they are printed. The following example demonstrates how a new label page starts when the control field changes.
Statements:
Results:
xxx
xxx
xxx
yyy yyy
...
Any labels remaining on a line are left unused. The optional NEWPAGE parameter causes a top-of-page for the next print line.
XML Reports
You can use the XML report capability of to create a file formatted in Extensible Markup Language
(XML). A hierarchically-structured XML file is built according to the field relationships defined by the
REPORT, CONTROL, and LINE statements. The CONTROL fields become group (or parent) elements,
and the LINE statement fields become the lowest level child elements. The REPORT name (from the
REPORT statement) becomes the lowest-level group element that contains (or wraps) all the fields
specified on the LINE statement.
You can use the XML report capability of CA Easytrieve® Report Generator to create a file formatted in Extensible Markup
Language (XML). A hierarchically-structured XML file is built according to the field relationships defined by the REPORT,
CONTROL, and LINE statements. The CONTROL fields become group (or parent) elements, and the LINE statement fields
become the lowest level child elements. The REPORT name (from the REPORT statement) becomes the lowest-level group
element that contains (or wraps) all the fields specified on the LINE statement.
Just as with a non-XML report, the statements used to write records to an XML file are PRINT and DISPLAY. With each
PRINT executed, all LINE statement fields are formatted as XML and then written to the printer file. DISPLAY statement
output records are not formatted as XML data. The data is written exactly as a DISPLAY would write data to a non-XML
report file. Just as with non-XML reports, the location of the DISPLAY statement records in the XML file depends on whether
the XML report is spooled.
For an XML report, no printed output is generated. There are no control totals or summary data lines printed or written to any
file.
When using an XML report keep the following items in mind:
• For an XML report, all spacing or positioning parameters (such as NOADJUST, COL, SKIP, and Font-Numbers) are
ignored. This is because an XML file contains only field names (or HEADING values) and data values.
• The reporting SEQUENCE statement functions in an XML report as it does with non-XML. You can use it to build the
XML output file in the required order.
• The reporting TITLE statement is ignored for XML reports, because the concept of page and column headings does not
apply to XML data.
• Report procedures are still invoked as they are in non-XML reports. However, BEFORE-PAGE and AFTER-PAGE are
ignored, because there is no page concept in an XML report.
• If a PRINTER FILE is specified on the REPORT statement in an XML report, and if a MODIFY EXIT is defined for that
file, each physical record being written to the printer file is passed to the exit. This is the same as for non-XML reports.
• A SUMFILE can be produced from an XML report just as it is from a non-XML report.
CA Easytrieve® Report Generator 11.6
• The XML element tag is built from the HEADING value or the Fieldname. Since CA Easytrieve® Report Generator does
not force XML-compliant characters for HEADINGs or Fieldnames, you must be sure the characters used are valid as
XML tags. For example, because a space character is not valid in an XML tag name, a HEADING of 'EMP NAME' must
be changed to something like 'EMP_NAME'.
The following example demonstrates how an XML file is created:
Statements:
Results:
<REPORT1_REPORT>
<REGION REGION="1">
<BRANCH BRANCH="01">
<REPORT1>
<DEPT>100</DEPT>
<EMPLOYEE_NUMBER>12345</EMPLOYEE_NUMBER>
<EMPLOYEE_NAME>JOHNNY BGOOD </EMPLOYEE_NAME>
</REPORT1>
<REPORT1>
<DEPT>100</DEPT>
<EMPLOYEE_NUMBER>12346</EMPLOYEE_NUMBER>
<EMPLOYEE_NAME>CHUCK ROCKS </EMPLOYEE_NAME>
</REPORT1>
</BRANCH>
<BRANCH BRANCH="02">
<REPORT1>
<DEPT>100</DEPT>
<EMPLOYEE_NUMBER>99999</EMPLOYEE_NUMBER>
<EMPLOYEE_NAME>JAMES DEAN </EMPLOYEE_NAME>
</REPORT1>
</BRANCH>
</REGION>
<REGION REGION="2">
<BRANCH BRANCH="01">
<REPORT1>
<DEPT>150</DEPT>
<EMPLOYEE_NUMBER>11111</EMPLOYEE_NUMBER>
<EMPLOYEE_NAME>JIM SHOE </EMPLOYEE_NAME>
</REPORT1>
</BRANCH>
CA Easytrieve® Report Generator 11.6
</REGION>
</REPORT1_REPORT>
Sequenced Reports
Report sequence is controlled either by the order in which PRINT statements were issued or by the
SEQUENCE statement. You can print both standard reports and label reports in any sequence.
Report sequence is controlled either by the order in which PRINT statements were issued or by the SEQUENCE statement.
You can print both standard reports and label reports in any sequence.
Report definitions that contain SEQUENCE statements cause the report data to be spooled to a temporary work file upon
execution of a PRINT statement. Work file usage is transparent.
The SEQUENCE function is performed by invoking your installation's sort program or, in CICS or UNIX, the sort provided
with CA Easytrieve® Report Generator. The temporary work file is input to the sort program. When the sort is complete, the
work file data is retrieved and the report is produced.
Only those data items used in the report are sorted. The sorted output is directly printed from the sort. These attributes combine
to make the SEQUENCE facility of CA Easytrieve® Report Generator extremely efficient.
CONTROL Reports
The CONTROL statement specifies that a report automatically accumulates and prints totals of
quantitative report information. The report accumulates information according to the hierarchy indicated
on the CONTROL statement.
The CONTROL statement specifies that a report automatically accumulates and prints totals of quantitative report information.
The report accumulates information according to the hierarchy indicated on the CONTROL statement.
Contents
Terminology
The following terms are used throughout the discussion on control reports:
• A control field is any field named on a CONTROL statement to establish the hierarchy of a control report.
• A control break occurs whenever any field of the control hierarchy changes value.
• A total line is a logical line group in a report body that contains control totals. These control totals can contain subtotal or
final values. Total lines are normally annotated with the value of control fields according to the SUMCTL parameter of the
REPORT statement. To do this, list the control fields first on the LINE statement.
• A detail line is the same line data as in a standard body line (not a total line). Control fields on detail lines are printed
according to the DTLCTL parameter of the REPORT statement. The SUMMARY parameter of the REPORT statement
inhibits the printing of detail lines on a control report.
• Accumulators are system-created fields that contain totals. Accumulators are created for:
• All fields designated on the SUM statement
• All active file or W storage quantitative fields designated on the line group (LINE nn) statements, if a SUM statement is
not specified. (Quantitative fields are numeric fields with a decimal point designation of 0 through 18.)
• SUMFILE data is the contents of control fields and accumulators at each minor control break.
Data Reference
In general, report statements and procedures can reference any field of an active file or working storage. (Some report
procedures have minor restrictions, which are described with the associated procedure.)
Statements and procedures can directly reference data for detail lines in noncontrol reports. When control or total fields are
referenced, CA Easytrieve® Report Generator automatically adjusts so that SUMFILE data is used. This assures access to
the field actually used in the report. SUMFILE data includes all control fields and 10-byte (18-digit) packed fields for all
accumulators. See Summary File for more information.
TALLY
TALLY is a system-defined field for control reports. TALLY contains the number of detail records that comprise a control
break. You can use TALLY on a LINE statement or you can use it in calculations within report procedures. TALLY is
commonly used to determine averages for a control break.
CA Easytrieve® Report Generator 11.6
TALLY is a 10-byte packed decimal field with zero decimal places. This definition is used for calculations contained within
report procedures. REPORT TALLYSIZE defines the number of digits that are printed for TALLY. A TALLY accumulator is
created for each control break level.
LEVEL
LEVEL is a system-defined field provided for control reports. The field is defined as a two-byte binary field. The value of
LEVEL indicates the control break level and varies from 0 to n + 1, where:
• LEVEL = 0 when processing detail lines
• LEVEL = n for total line processing at each control level
• LEVEL = n + 1, when processing FINAL totals
The LEVEL values for fields on the CONTROL statement are as follows:
REPORT
SEQUENCE REGION BRANCH
CONTROL REGION BRANCH
LEVEL = 1
LEVEL = 2
LEVEL = 3 (FINAL)
The following diagram illustrates the relationship between control fields, accumulators, and LEVEL:
SUMFILE data
TALLY ... 2
...
TALLY ... n
SUM SUM
FINAL TALLY field-1 ... field-n n + 1
REPORT RPT
SEQUENCE REGION BRANCH
CONTROL REGION BRANCH
LINE REGION BRANCH NAME PAY-GROSS
BEFORE-BREAK. PROC
IF LEVEL = 1 . * processing lowest break
IF BREAK-LEVEL = 1 . * only branch is breaking
DISPLAY '*** BRANCH TOTALS'
ELSE-IF BREAK-LEVEL = 2. * region is breaking too
DISPLAY '*** BRANCH AND REGION TOTALS'
ELSE-IF BREAK-LEVEL = 3. * final report totals
DISPLAY '*** BRANCH, REGION, AND FINAL TOTALS'
END-IF
END-IF
END-PROC
CA Easytrieve® Report Generator invokes the BEFORE-BREAK procedure before printing summary lines. See Report
Procedures for more information.
In the above example, LEVEL and BREAK-LEVEL fields are used to determine the appropriate message to be displayed
before the summary lines are printed. Testing for LEVEL 1 tells us that CA Easytrieve® Report Generator is going to print the
first summary line next (BRANCH totals). When BREAK-LEVEL is 1, only the BRANCH field is breaking. Therefore, we
want to display a message stating this. When BREAK-LEVEL is 2, the REGION field is breaking. This causes both BRANCH
and REGION summary lines to print. When BREAK-LEVEL is 3, CA Easytrieve® Report Generator prints BRANCH,
REGION, and final summary lines.
Note: (Mainframe and UNIX only) An alternative to testing LEVEL and BREAK-LEVEL is to use IF field-name BREAK and
IF field-name HIGHEST-BREAK processing. Using the previous example, you can code the following for the same result:
REPORT RPT
SEQUENCE REGION BRANCH
CONTROL REGION BRANCH
LINE REGION BRANCH NAME PAY-GROSS
BEFORE-BREAK. PROC
IF BRANCH BREAK . * processing lowest break
IF BRANCH HIGHEST-BREAK . * only branch is breaking
DISPLAY '*** BRANCH TOTALS ***'
ELSE-IF REGION HIGHEST-BREAK . * region is breaking also
DISPLAY '*** BRANCH AND REGION TOTALS ***'
ELSE-IF BREAK-LEVEL = 3 . * final report totals
DISPLAY '*** BRANCH, REGION AND FINAL TOTALS ***'
END-IF
END-IF
END-PROC
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
SEQUENCE STATE ZIP LAST-
NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-
NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
Line
Description Control Fields Accumulator
The same report without the detail lines is a SUMMARY report. For example:
Statements:
FILE FILE1
LAST-NAME 1 20 A
STATE 21 2 A
ZIP 23 5 N
PAY-NET 28 5 N 2
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 SUMMARY +
DTLCTL NONE
SEQUENCE STATE ZIP
CONTROL STATE ZIP
LINE 01 STATE ZIP PAY-NET
Data:
BROWN IL6007612345
BROWN IL6007667890
JONES IL6007709876
JONES IL6007754321
SMITH TX7521811111
SMITH TX7521866666
Results:
Line
CA Easytrieve® Report Generator 11.6
This report contains only control totals because SUMMARY was specified on the REPORT statement.
DTLCTL
The REPORT statement DTLCTL parameter establishes the method for printing control field values on detail lines by using
the subparameters EVERY, FIRST, and NONE. The following is an example program using DTLCTL options:
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 +
DTLCTL option (* with option being EVERY, FIRST, or NONE *)
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
The next three examples show the results of using each of the DTLCTL options:
EVERY
CA Easytrieve® Report Generator 11.6
Line
Description Control Fields Accumulator
FIRST
FIRST prints all control fields on the first detail line at top-of-page and after each break.
Line
Description Control Fields Accumulator
NONE
NONE prints no control fields on detail lines.
Line
Description Control Fields Accumulator
SUMCTL
The SUMCTL parameter of the REPORT statement establishes the method for printing control field values on total lines
of a control report by using the subparameters ALL, HIAR, NONE, and TAG. (The DTLCOPY subparameter controls all
noncontrol nontotal values on total lines.) The following shows an example program using these parameters:
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
CA Easytrieve® Report Generator 11.6
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMCTL option
(* with option being ALL, HIAR, NONE, or TAG *)
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
The next three examples illustrate the results of using All, HIAR, and NONE.
ALL
ALL prints all control fields on every total line.
Line
Description Control Fields Accumulator
HIAR
HIAR prints control fields in hierarchical order on total lines.
Line
Description Control Fields Accumulator
NONE
NONE prints no control fields on total lines.
Line
Description Control Fields Accumulator
TAG
Use the TAG subparameter of SUMCTL to annotate the total line with a description of the total values being printed. The TAG
subparameter of SUMCTL creates a line area on the left side of the total line. This LINE 01 item is governed by the following
rules:
• The length of the area is the length of the longest control-field-name plus seven.
• TOTAL preceded by the control-field-name is the annotation for control break totals.
• FINAL TOTAL is the annotation for the final totals line.
• The line item area is positioned at the left margin of the report.
The following example illustrates how tags appear on a report.
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 +
SUMCTL TAG
SEQUENCE STATE ZIP LAST-
NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-
NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
CA Easytrieve® Report Generator 11.6
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
DTLCOPY
When printing control reports (particularly a summary report) you may want to include detail information in total lines
(normally, CA Easytrieve® Report Generator prints only control field values and associated totals on total lines). The
DTLCOPY subparameter of SUMCTL causes detail field contents (values just prior to the break) to be printed on total lines
for LEVEL 1 breaks. The following example illustrates the use of DTLCOPY to print the contents of the LAST-NAME detail
field on the lowest level total line (ZIP).
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
*
CA Easytrieve® Report Generator 11.6
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
2222.09
DTLCOPYALL
DTLCOPYALL has the same effect as DTLCOPY, except that the detail fields are printed for all control break totals. The
following example illustrates the use of DTLCOPYALL to print LAST-NAME on all total lines.
Statements:
FILE FILE1
LAST-
NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-
NET 13 5 N 2
CA Easytrieve® Report Generator 11.6
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
SMITH TX 2222.09
FILE FILE1
CA Easytrieve® Report Generator 11.6
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
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
2222.09
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 SUMSPACE 0 +
SUMCTL HIAR LINESIZE 65
SEQUENCE STATE ZIP LAST-
NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 444.32*
TX 777.77
222.09*
Controlling Overflow
You can control overflow using two methods, as illustrated by the following examples:
• Line item expansion -- Ensure that the detail field being totaled is large enough to absorb the totals. This example
illustrates how overflow can be prevented by effectively expanding the line item to six-digit positions.
• Statements:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
T-PAY-NET W 6 N 2 HEADING ('PAY-NET')
*
JOB INPUT FILE1 NAME MYPROG
T-PAY-NET = PAY-NET
PRINT REPORT1
*
REPORT REPORT1 SUMSPACE 0 +
SUMCTL HIAR LINESIZE 65
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
CA Easytrieve® Report Generator 11.6
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 1,444.32
TX 777.77
2,222.09
• Item area expansion -- Expand the item area by using the SUMSPACE parameter of the REPORT statement. The value of
SUMSPACE is added to the length of detail fields to determine an adjusted line item length for the total field. The resulting
line item expansion is illustrated in the next example as a print edit mask.
• Statements:
CA Easytrieve® Report Generator 11.6
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2 .* (999.99- mask without SUMSPACE specified)
*
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 SUMSPACE 1 +
SUMCTL HIAR LINESIZE 65
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
SMITH 111.11
TX 75218 777.77
TX 777.77
Summary File
A summary file, which contains all the control and summed field values at each minor break, can be optionally generated
during processing of a control report. JOB activities in your program can subsequently process the summary file to provide
reports not otherwise available using the standard report facilities of CA Easytrieve® Report Generator.
You can produce a summary file by defining the file in the library and then referencing it with the REPORT SUMFILE
parameter.
The FILE statement must contain the file name, record format, logical record length, and block size. When you just want to
retain the file for the duration of the program, you can specify the file as an unblocked VIRTUAL file. The record format can
be any standard format. The record length must be large enough to contain the output data. Block size should be appropriate
for the specified format and record length.
The summary file record contains three parts:
1. Control field area -- A concatenation of the control fields specified on the CONTROL statement. The sum of the lengths
of the control fields defines the length of the control field area.
2. TALLY -- A 10-byte field.
3. Summed field area -- A concatenation of summed fields to form the remaining segment of the summary file record. Each
summed field is a 10-byte packed field with the same decimal specification as the source field.
Therefore, the summary file record length is the sum of the control field area length, plus 10 bytes for TALLY, plus 10 times
the number of summed fields.
SUMFILE Example
The following example illustrates the use of SUMFILE data. The values of SFILE are listed in order of ascending magnitude
within SFILE-STATE, without reprocessing the original data.
Statements:
FILE FILE1
LAST-
NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-
NET 13 5 N 2
FILE SFILE F(30)
SFILE-
STATE 1 2 A
SFILE-
ZIP 3 5 N
SFILE-
TALLY 8 10 P 0
SFILE-PAY-
NET 18 10 P 2
JOB INPUT FILE1 NAME MYPROG
CA Easytrieve® Report Generator 11.6
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMFILE SFILE 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
*
JOB INPUT SFILE NAME MYPROG2
PRINT REPORT2
*
REPORT REPORT2 NOADJUST
SEQUENCE SFILE-STATE SFILE-PAY-
NET
LINE 01 SFILE-STATE SFILE-
ZIP +
SFILE-TALLY SFILE-PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 60077 2 641.97
IL 60076 2 802.35
TX 75218 2 777.77
Report Procedures
Although REPORT statements meet most report requirements, some reports depend upon special data
manipulation. Report procedures are routines provided by to satisfy this requirement.
Although REPORT statements meet most report requirements, some reports depend upon special data manipulation. Report
procedures are routines provided by CA Easytrieve® Report Generator to satisfy this requirement.
CA Easytrieve® Report Generator 11.6
Code report procedures at the end of their associated report. The report processor invokes special-name procedures (such as
BEFORE-LINE or AFTER-BREAK) as required.
Contents:
(REPORT-
INPUT - caused by the first PRINT statement)
(BEFORE-
LINE)
detail IL 60076 678.90
(AFTER-
LINE)
(REPORT-
INPUT - caused by the second PRINT statement)
(BEFORE-LINE)
detail IL 60076 123.45
(AFTER-
LINE)
(REPORT-
INPUT - caused by the third PRINT statement)
(BEFORE-BREAK)
total IL 60076 802.35
(AFTER-
BREAK
(BEFORE-LINE)
detail IL 60077 543.21
CA Easytrieve® Report Generator 11.6
(AFTER-
LINE)
(REPORT-
INPUT - caused by the fourth PRINT statement)
(BEFORE-LINE)
detail IL 60077 98.76
(AFTER-
LINE)
(REPORT-
INPUT - caused by the fifth PRINT statement)
(BEFORE-BREAK)
total IL 60077 641.97
(AFTER-
BREAK)
(BEFORE-BREAK)
total IL 1444.32
(AFTER-
BREAK)
...
...
(ENDPAGE)
Coding Techniques
Coding report procedures is the same as coding procedures within JOB activities, with the following exceptions:
You cannot use the following input/output generating statements:
• DELETE
• FETCH
• GET
• INSERT
• POINT
• PRINT
• PUT
• READ
• SELECT (SQL)
• SQL
• UPDATE
• WRITE
You cannot use the STOP, TRANSFER, or GOTO JOB statements.
You cannot PERFORM other procedures from within report procedures.
Use the DISPLAY statement to perform special report annotations. Using DISPLAY requires the following extra
considerations:
• You cannot code the DISPLAY statement's display-file-name parameter. DISPLAY is only to the associated report.
• You cannot code the HEX parameter of DISPLAY.
• DISPLAY lines are counted and included in the end-of-page determination. DISPLAY statements cause page breaks only
when the line count exceeds the display-page-size REPORT parameter or DISPLAY TITLE or NOTITLE is used.
• With display-page-size specified, using DISPLAY in a BEFORE-LINE procedure could result in a page overflow by one
line.
Field Reference
CA Easytrieve® Report Generator 11.6
In report procedures, you can reference any field contained in an active file or in working storage. When control or total fields
are referenced, CA Easytrieve® Report Generator automatically adjusts so that SUMFILE data is used. This assures access to
the field actually used in the report.
Static Working Storage
Fields contained in S storage exhibit unique properties during report processing. S fields are stored in a static working storage
area and are not copied onto report work files. All references to S fields occur at the time the report is formatted and printed.
The format and print operation can occur at one of the following times:
• Immediately at execution of the PRINT statement
• After the processing of work files
Use S storage fields for the following purposes:
• Temporary work fields for report procedures
• Line annotations controlled from report procedures
• Grand total values from which you can calculate percentages
Example: Use of S Fields and W Fields in a Report
The following example illustrates the use of S fields versus W fields in a spooled report:
Statements:
*******************************************************
**** NOTE: ***
**** W FIELDS CONTAIN THEIR VALUE AT TIME OF ***
**** PRINT STATEMENT. ***
**** S FIELDS CONTAIN THE LAST VALUE PLACED ***
**** IN THE FIELD . ***
*******************************************************
FILE FILEA
INPUT-FIELD 1 5 A
SFLD-RECORD-COUNT S 2 N
WFLD-RECORD-COUNT W 2 N
JOB INPUT FILEA
SFLD-RECORD-COUNT = RECORD-COUNT
WFLD-RECORD-COUNT = RECORD-COUNT
PRINT RPT
REPORT RPT NOADJUST
SEQUENCE INPUT-FIELD
LINE INPUT-FIELD SFLD-RECORD-COUNT WFLD-RECORD-COUNT
Data:
TESTA
TESTB
TESTC
CA Easytrieve® Report Generator 11.6
Results:
Based on the SEQUENCE statement, the report information is copied to the report work file when the PRINT statement is
executed. The format and print operation is performed when the JOB activity completes. All references to S fields occur
when the actual print and format takes place. Thus, the value of SFLD-RECORD-COUNT on the report is always 3. WFLD-
RECORD-COUNT is taken from the report work record and maintains the value that it had at the execution of the PRINT
statement.
The same program with the SEQUENCE statement removed produces different results as illustrated below in the non-spooled
report:
In this example, no report work file is needed. The format and print operation occur upon execution of the PRINT statement
and the value of SFLD-RECORD-COUNT is captured with each execution of the PRINT statement.
In non-spooled reports, little difference exists between S fields and W fields. The difference lies in how and when spooled
reports reference the fields. It is important to understand when to use S fields and when to use W fields. Though the report
you may be writing is a non-spooled report today, a future change to your program might cause the report to become spooled.
For example, if you add another report before this report or you add a SEQUENCE statement to this report, your non-spooled
report becomes a spooled report. If you do not define your working storage fields properly, your program may produce
incorrect output in the future.
REPORT-INPUT
A REPORT-INPUT procedure selects and modifies report input data. This procedure is performed for each PRINT statement
(report input). In order to cause the data to continue into report processing, you must execute a SELECT statement for the
associated input data. In other words, input that is not selected is bypassed for continued processing.
When the report data has been spooled (because the report was 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 implies that if the report is sequenced, the
REPORT-INPUT procedure is invoked after the sort program returns the sorted spool record.
Although you can code the logic within the JOB activity itself, it is occasionally desirable to place the logic in a REPORT-
INPUT procedure. The next example illustrates use of the REPORT-INPUT procedure in final report input selection. Only the
first record within each ZIP code is selected.
Statements:
FILE FILE1
LAST-
NAME 1 5 A
STATE 6 2 A
CA Easytrieve® Report Generator 11.6
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 LAST-
NAME
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:
IL 1222.11
1888.77
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 +
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
CA Easytrieve® Report Generator 11.6
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 1444.32
TX 777.77
2222.09
BEFORE-BREAK
You can use a BEFORE-BREAK procedure to calculate percentages and average totals. These values must be calculated
immediately before printing.
The grand-total for percentage and average calculations is often maintained in S storage. TALLY is typically used as the
number of items when calculating averages. You can use the value of LEVEL (a system-defined field) to determine which
control break is being processed. You can use the value of BREAK-LEVEL to determine the highest level to break.
Consider the percentage calculation in the following example, paying special attention to when and how PERCENT is
calculated:
Statements:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
*
PERCENT W 2 N 2
CA Easytrieve® Report Generator 11.6
TOTAL-NET S 8 N 2
*
JOB INPUT FILE1 NAME MYPROG
*
TOTAL-NET = TOTAL-NET + PAY-NET
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 80 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET PERCENT
*
BEFORE-BREAK. PROC
PERCENT = PAY-NET * 100 / TOTAL-NET + .005
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
2222.09 100.00
AFTER-BREAK
You can use an AFTER-BREAK procedure to produce special annotation on control reports. You can use the value of LEVEL
(a system-defined field) to determine which control break is being processed. You can use the value of BREAK-LEVEL to
determine the highest level to break.
In this example, the total line for the control field STATE receives special annotation:
CA Easytrieve® Report Generator 11.6
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
Results:
ENDPAGE
You can use an ENDPAGE procedure to produce page footing information. It is invoked whenever end-of-page is detected. It
is typically used to produce page totals or other annotations, as in the following example of page footer 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 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
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
...
* CONFIDENTIAL - FOR INTERNAL USE ONLY *
..................................................
CA Easytrieve® Report Generator 11.6
...
TERMINATION
A TERMINATION procedure is invoked at the end of the report. You can use this procedure to print report footing
information, including control totals and distribution information. The following is an example of report footing:
Statements:
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 NOTITLE
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
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
CA Easytrieve® Report Generator 11.6
SMITHTX7521866666
Results:
...
..................................................
2222.09 IS THE Y-T-
D COMPANY NET PAY
• Non-spooled reports are displayed in the order in which they were defined. These reports are displayed at the time
the activity actually terminates. DISPLAY statement output that is not associated with a REPORT is displayed,
along with non-spooled report output to the same printer file.
• Spooled reports are displayed in the order in which they were defined. These reports are displayed at the time they
are despooled.
For more information, see Report Display Facility.
If you instruct CA Easytrieve Report Generator to write output to the terminal and no terminal is associated with the task, the
output is routed directly to the device specified by your system administrator as the standard print device.
Syntax
You specify extended reporting by using a special FILE statement, the PRINTER parameter on the REPORT statement, and,
optionally, TITLE, HEADING, and LINE statements to identify special fonts.
You use the EXTENDED parameter on a FILE statement to identify the file that is associated with the printer you want to use,
and to specify the type of the predefined printer:
You use the PRINTER parameter on the REPORT statement to again specify the name of the file that you specified on the
FILE statement. The syntax of the relevant portion of the REPORT statement is:
TITLE #n 'title-1'
HEADING field-1 #n 'heading-1'
LINE #n field-1
Note: You can also use the DISPLAY statement to route data to an extended printer by specifying the name of the file you
specified on the FILE statement. The syntax is:
Example
The following program uses extended reporting to create a report that is formatted with HTML. Note the bold characters that
highlight the code that is used for extended reporting.
FILE PERSNL
REGION 1 1 N
NAME 17 16 A
GROSS 94 4 P 2
FILE PRINTFIL01 EXTENDED HTML
The FILE statement identifies the extended reporting file (PRINTFIL01) and specifies that the file is associated with an HTML
printer. The REPORT statement directs report output to PRINTFIL01. The TITLE and LINE statements use font indexes to
identify special fonts. In this case, the title literal prints using font 5, the field REGION prints using font 13, and the field
GROSS prints using font 23. The NAME field prints using the default font.
Note:
You could change this example to produce an RTF formatted report simply by using the keyword RTF instead of HTML, and
by specifying an appropriate print file.
Release 11 Reporting Environment
On Release 11 platforms, CA Easytrieve Report Generator uses an integrated reporting environment that lets you produce
reports that are formatted for line mode printers only. This provides support for many formats including HyperText Markup
Language (HTML) and Rich Text Format (RTF) as well as printer devices.
See Extended Reporting Concepts and Report Layout Processing for detailed information about Extended Reporting in Release
11.
Use the CA Easytrieve Report Generator Configuration Manager to define and customize your printer definitions. For more
information, see Configuration Manager.
To support both types of reports, the Reporting Environment introduces a set of concepts that support the generic definition of
print lines in a report.
This article introduces these concepts and in particular, it will establish the meaning and usage of each of the following terms
used by the Reporting Environment:
• Print Elements
CA Easytrieve® Report Generator 11.6
• Print Items
• Print Groups
Sample Report
To introduce the key concepts of reporting with the Reporting Environment, a sample report has been produced that includes
interdependencies between the print lines in the report.
The following sample report illustrates one page.
Note: The numbers on the left side of the diagram are not part of the report, but are included here so that print lines can be
directly referenced.
20 01 1,043.75 7.67
21 640.73
22
23
32 02 834.75 8.00
33 548.56
CA Easytrieve® Report Generator 11.6
34
35
WfbOffset defines the offset into a write fields buffer that will contain the print data to be output for the print element.
The reporting write service requires a WfbOffset in order to locate the print data for the print element when writing the
print element's print line.
• Value
Value is required for a static print element.
Value defines the print data that is to be printed for the print element.
Print Items
A Print Item defines a set of one or more print elements where:
• Each print element occurs on a different print line
• The position of each print element on a print line is regulated so that all the print elements are positioned under each other
on the report.
The following diagram re-displays the heading print lines and first instance of the detail print lines from the sample report.
Figure 55: Heading Print Lines and First Instance of Detail Print Lines
The illustrated set of print lines include seven print items:
• Print Item #1 -- occupies six characters across the report, as set by the number of characters in the widest print element in
the print item, the print element on the third heading print line (line number 06). The value of the branch that is output by
the print element on the detail print line 08 is then centered in the six characters assigned to this print item.
• Print Item #2 -- occupies eleven characters across the report, as set by the number of characters in the widest print element
in the print item, the print element that occurs on the detail print line (line number 08). The three print elements that occur
on the heading print lines are then centered in the eleven characters assigned to this print item.
• Print Item #3 -- occupies six characters across the report, as set by the number of characters in the widest print element in
the print item, the print element on the third heading print line (line number 06). The print element on the second heading
print line 05 and the print element on the detail print line 08 are then centered in the six characters assigned to this print
item.
• Print Item #4 -- occupies twenty characters across a report, as set by the number of characters in the widest print element
in the print item, the print elements on the second and third detail print lines (line numbers 09 and 10). The print element
on the third heading print line 06 and the print element on the first detail print line 08 are then centered in the twenty
characters assigned to this print item.
• Print Item #5 -- occupies eleven characters across a report, as set by the number of characters in the widest print element in
the print item, the print element on the first heading print line (line number 04). The print element on the third heading print
line 06 and the print elements on the detail print lines 08 and 09 are then centered in the eleven characters assigned to this
print item.
CA Easytrieve® Report Generator 11.6
• Print Item #6 -- occupies seven characters across a report, as set by the number of characters in the widest print element
in the print item, the print element on the first detail print line (line number 08). The print elements on the first and third
heading print lines 04 and 06 are then centered in the seven characters assigned to this print item.
• Print Item #7 -- occupies nine characters across a report, as set by the number of characters in the widest print element in
the print item, the print element on the third heading print line (line number 06). The print element on the first heading print
line 04 and the print elements on the first and second detail print lines 08 and 09 are then centered in the nine characters
assigned to this print item.
Print Groups
A Print Group defines a set of one or more print lines where:
• Print items can be positioned relative to each other across the report
• Print elements can be assigned to a print line in the print group
• Print elements can be assigned to print items in the print group.
The sample report includes three print groups. A detailed description of each print group is discussed next.
Print Group #1
The following diagram redisplays the first print line of the title print lines.
The definition of print group #3 to the Reporting Environment included the following characteristics:
• Print lines 04, 05, 06 were defined in print group #3.
• Print lines 08, 09, 10 were defined in print group #3.
• Print lines 20, 21, 22 were defined in print group #3.
• Print items #1 through #7 were defined in print group #3.
• The following print elements were defined in print item #1:
• Print element #1, to appear on print line 06.
• Print element #2, to appear on print line 08.
• Print element #3, to appear on print line 20.
• The following print elements were defined in print item #2:
• Print element #4, to appear on print line 04.
• Print element #5, to appear on print line 05.
• Print element #6, to appear on print line 06.
• Print element #7, to appear on print line 08.
• The following Print elements were defined in print item #3:
• Print element #8, to appear on print line 05.
• Print element #9, to appear on print line 06.
• Print element #10, to appear on print line 08.
• The following print elements were defined in print item #4:
• Print element #11, to appear on print line 06.
• Print element #12, to appear on print line 08.
• Print element #13, to appear on print line 09.
• Print element #14, to appear on Print Line 10.
• The following print elements were defined in print item #5:
• Print element #15, to appear on print line 04.
• Print element #16, to appear on print line 06.
• Print element #17, to appear on print line 08.
• Print element #18, to appear on print line 09.
CA Easytrieve® Report Generator 11.6
The following diagram illustrates the same unjustified set of four print items with a spacing value of three.
Justification
Justification controls how the Reporting Environment distributes the print items in a print group across the print lines of a print
group.
The justification operation supports five settings:
• Left Justification
Left Justification starts the left-most print item in a print group at the first print position in the print group and distributes
the other print items to the right, inserting the appropriate spacing between each print item.
The following diagram illustrates left justification with a spacing value of three:
CA Easytrieve® Report Generator 11.6
• Right Justification
Right Justification ends the right-most print item in a print group at the last print position in the print group and distributes
the other print items to the left, inserting the appropriate spacing between each print item.
The following diagram illustrates right justification with a spacing value of three:
• Centering
Centering positions a set of print items in a print group in the middle of the print group's print lines. The Reporting
Environment achieves this justification by:
• Calculating the width of each print item in the print group, as set by the number of characters in the widest print element
in the print item.
• Calculating the width of the print group by totaling the width of each print item in the print group. The spacing between
the print items in the print group is also included in the width of the print group.
• Centering the width of the print group in the width of the print lines in the print group, thus giving an evenly distributed
left and right margin. The width of the print lines in a panel group is defined by the line size value assigned to the panel
group.
• The left-most print item in a print group is assigned a start print position after the left margin and the additional print
items are distributed to the right, inserting the appropriate spacing between each print item.
The following diagram illustrates centering with a spacing value of three:
• Spreading
Spreading positions the print items in a print group such that the print items are evenly distributed across the print lines of a
print group. The Reporting Environment achieves this justification by:
CA Easytrieve® Report Generator 11.6
• Calculating the width of each print item in the print group, as set by the number of characters in the widest print element
in the print item.
• Calculating the width of the print group by totaling the width of each print item in the print group. The spacing between
the print items in the print group is also included in the width of the print group.
• Determining the number of free spaces on the print group's print lines by subtracting the width of the print group from
the width of print lines in the print group. The width of print lines in a print group is defined by the line size value
assigned to the print group.
• The number of free spaces on the print group's print lines is then evenly distributed between the print items, including
the left and right margins. This value defines the spread spacing that is added to the original spacing, giving the total
spacing between the print items.
• The left-most print item in a print group is assigned a start print position after allocating spread spacing for the left
margin. The additional print items are then distributed to the right, inserting the total spacing (original spacing plus
spread spacing) between each print item.
The following diagram illustrates spreading with a spacing value of three:
• Indentation
Indentation controls the creation of a right or left margin (or both) in which the reporting justification operations are
performed.
The definition of a left or right margin (or both) using Indentation effectively reduces the line size of a print group's print
lines by requiring that the Reporting Environment preallocate the spaces for the margins.
The following diagram illustrates a left indentation of five with left justification and spacing value of three:
The following diagram illustrates a left indentation of eight with a justification of centering and spacing value of three:
CA Easytrieve® Report Generator 11.6
where the width of the largest element defines the size of the item's window.
This process can result in some change to the format of a CA Easytrieve® Report Generator report when the print item has
heading and detail elements that use fonts of different width. This situation impacts the process CA Easytrieve® Report
Generator uses to determine the appropriate window for the print item. When you are using fonts of different widths for the
elements of any item coded on the LINE 01 statement, CA Easytrieve® Report Generator must determine a window for
the item. This window includes any adjustments necessary to ensure that all the elements of the item fit within the window
after each element has been positioned on its applicable print record. This means that the window may be larger than CA
Easytrieve® Report Generator originally determined.
The five diagrams that follow illustrate the effect of mixing fonts of different sizes in a report.
The following diagram illustrates CA Easytrieve® Report Generator syntax that uses multiple fonts.
CA Easytrieve Syntax:
CA Easytrieve® Report Generator 11.6
DEFINE TEST-FIELD-1 1 8 A +
HEADING (#1 'THE FIRST LINE' 'THE SECOND LINE')
DEFINE TEST-FIELD-2 9 10 A +
HEADING (#2 'SECOND FIELD HEADING')
.
.
JOB INPUT
.
.
LINE 1 #1 TEST-FIELD-1 TEST-FIELD-2
The following diagram describes the fonts that the previous example references.
default 10
#1 8
#2 7.2
To create a print line, CA Easytrieve® Report Generator must analyze the heading lines and the detail lines (the contents
of TEST-FIELD-1 and TEST-FIELD-2) taking into account the size of the fonts. CA Easytrieve® Report Generator then
calculates a window that is large enough to encompass each of the elements of the print item that is to be output to the print
line.
The following diagram illustrates the windows that CA Easytrieve® Report Generator would create using the syntax in the
first diagram in this section.
CA Easytrieve® Report Generator 11.6
This output consideration was introduced by the discussion regarding the Print Overprint technique for combining multiple
print records on the one print line. The Overprint Gap results from the printer imaging each print record independent of
other print records that may appear on the same line. Once the printer images the records, the printer combines the records to
form the print line that is output to the page. As a result of imaging each line separately (as opposed to the Merge Overprint
technique which does not suffer from this limitation), the ability to position print items of different fonts (thus different print
records) adjacent to each other is restricted. The diagram that follows illustrates the reasons.
Assume that three characters of different fonts had to be printed adjacent to each other. The first character was to be output
using a 9 point font, the second output with a 12 point font, and the third output with a 7 point font. As a result three print
records would be built; each with their own font indicator after the Carriage Control.
The following diagram illustrates these three records. Notice that the second print record cannot have the 12 point character in
the first byte of the print record or it would print over the character output by the first print record. Therefore, CA Easytrieve®
Report Generator must insert one space byte into the 12 point print record before the actual character. This space prints at
12 points, thereby positioning the 12 point character to the right of the 9 point character. In doing this, the position of the 12
point character is not adjacent to the 9 point character. The 12 point space was 3 points too large but nothing can be done to
overcome this -- it is the Overprint Gap.
Figure 63: Print Item placed on the Right Side of the Assigned Location
Screen Processing
The product provides all the facilities necessary to display and receive information from an online
terminal. As with other features, the non-procedural nature of the product provides relief from having to
deal with many of the complexities of transaction programming.
The product provides all the facilities necessary to display and receive information from an online terminal. As with other
features, the non-procedural nature of the product provides relief from having to deal with many of the complexities of
transaction programming.
Note: Screen processing activities are available only in CA Easytrieve/Online.
Basic Structure
You use a SCREEN activity to describe and process a screen display. The screen processing facility is basically declarative;
you only need to define the format and content of the screen and the product creates the necessary instructions to send and
receive the screen. There are two sections in a SCREEN activity:
• The screen declaration statements that define the contents of the screen
• The optional screen procedures that let you code procedural logic to perform file I/O or complex editing of fields displayed
on the screen
The following exhibit illustrates the basic structure of screen processing in a program. You can define one or more screens for
each program.
<easy> Program
FILE
(library section)
CA Easytrieve® Report Generator 11.6
Note: You can automate the screen declaration process by using the CA Easytrieve/Online Screen Painter.
Screen Format
This article describes the online screen format.
This article describes the online screen format.
The size of the screen defaults to the values specified in your site options. These values can be overridden by the LINESIZE
and ROWCOUNT parameters of the SCREEN statement.
LINESIZE
Title Area
R
O
W
Work Area C
O
U
N
T
Message Area
Function Key Area
• Title Area
The title area is an optional area that consists of screen rows designated as titles by TITLE statements in the screen
declaration. Titles normally identify the screen to the user and are automatically centered at the top of the screen. The title
area cannot be updated by the terminal user.
• Work Area
The work area contains the items to be displayed to or received from the terminal user. Use ROW statements in the screen
declaration to specify the items. Use the REPEAT and END-REPEAT statements to specify repeating groups of rows.
• Message Area
The message area is used to display system and programmer-issued messages to the terminal user. The default location of
the message area is the line just above the function key display area at the bottom of the screen. You can issue your own
messages by using the MESSAGE or SET statement.
• Function Key Area
The optional function key area is used to tell the terminal user which function keys are active and the action they perform.
This area, if used, is always located on the last lines at the bottom of the screen. You use the KEY statement in the screen
declaration to define the function key area.
• Screen Borders
CA Easytrieve® Report Generator 11.6
Specifying the BORDER parameter on a SCREEN statement reduces the size of available screen areas to allow space for
the border characters. A border reduces the total screen area by two rows and four columns. For example, if you define a
screen with a border and LINESIZE(80) ROWCOUNT(24), available rows are from 1 to 22, and available columns are
from 1 to 76. ROW 1, COLUMN 1 always refers to the first usable display position on the screen.
Screen Example
The following example illustrates the type of screen that you can create with the online product:
Option ===> W
V View employee
E Edit employee
D Delete employee
X Exit
Please type V, E, D, or X
F1=Help F3=Exit F12=Cancel
The screen declaration that is used to create the example screen follows:
• DEFAULT
(Optional) overrides system-defined screen attributes and message locations.
• KEY
Defines valid terminal keys for a screen, specifies descriptive text, and assigns functions to terminal keys.
• TITLE
Defines optional screen title items, their attributes, and their position on the title row.
• ROW
Defines the contents of a screen row. Item attributes and positioning are optionally specified.
• REPEAT
Displays arrays on a screen.
For the complete syntax of these statements, see the Language Reference section.
Screen Items
Screen items include the fields and literals that you want to display to or receive from the terminal user. Basic rules regarding
items on a screen include the following:
• Unless directed otherwise, items for the same screen row are placed one space apart. You can optionally add to this space
or locate an item at a specific column number.
• The space preceding each item contains system information describing the screen attributes for the item. The attributes
contain information that controls the display of screen items such as color and brightness. The space preceding each screen
item is used for attributes.
Note: The space preceding an item located in the first column of any screen row is actually located in the last column of
the previous screen row. The space preceding an item located in the first column of the first screen row is located in the last
column of the last screen row.
• You can override the automatic placement of items by using the COL parameter. You use COL to specify an explicit screen
column number where the item is placed. The COL parameter specifies the column number where the data that is contained
in the item is placed.
Use an offset (+n) to add to the minimum single space used between items (+1 is the default). The offset applies to the data
to be displayed. To add more space, use an offset greater than +1. There must always be at least one space between each
item on the screen. Items cannot overlap each other.
• You can specify screen attributes for each item on the screen. If you do not specify attributes for each item, default
attributes apply. The following hierarchy is used to determine screen attributes:
CA Easytrieve® Report Generator 11.6
• If attributes are not specified for an item (ATTR parameter on the ROW or TITLE statement), the product uses default
attributes that are specified on the DEFAULT statement at the beginning of the SCREEN declaration.
• If a DEFAULT statement is not coded in the SCREEN activity, the product uses attributes set in the site options.
Attributes can be specified as one or more keywords or by using a declared screen attribute. Using declared attributes lets
you define and name a set of attribute keywords. See Declarations for more information. Also see DECLARE Statement in
the Language Reference section. You can also change screen attributes dynamically during program execution by using the
SET statement. See SET Statement for more information.
• You must ensure that fields that are used on a screen are in available storage. This requires that you code WORKAREA
on FILE statements for fields that are used on the screen where you do not execute an input statement to fill the fields with
data prior to displaying the screen.
Note: You must know the record length to reserve a WORKAREA. The product does not initialize WORKAREAs.
Results are unpredictable if an uninitialized WORKAREA is displayed.
System-Defined Fields
Special data fields for screens are automatically provided. These fields are stored as part of working storage and are read-only.
• KEY-PRESSED
KEY-PRESSED is a two-byte binary field that contains a value representing the most recent terminal key that is pressed by
the terminal user.
The product automatically defines symbolic names that correspond to values for the most common keys. Only keys with
symbolic names can be used on a KEY statement.
• TERM-COLUMNS
TERM-COLUMNS is a 2-byte binary field containing the maximum number of columns the screen supports. You can test
TERM-COLUMNS to execute a SCREEN activity designed specifically for the terminal being used.
• TERM-ROWS
TERM-ROWS is a 2-byte binary field containing the maximum number of rows the screen supports. You can test TERM-
ROWS to execute a SCREEN activity designed specifically for the terminal being used.
• TERM-NAME
TERM-NAME is a 16-byte alphanumeric field containing the terminal identification. This field is set only in CICS
environments.
• SYSUSERID
SYSUSERID is a 16-byte alphanumeric field identifying the terminal user. In CICS, SYSUSERID is copied from the EIB.
CA Easytrieve® Report Generator 11.6
Item Location
The following rules apply to the location of items in the screen work area:
• You can specify the screen row number in the ROW statement. If you do not specify a row number, the next screen row
number is assigned. The next row number is one higher than the row number for the previous ROW or TITLE statement. If
no TITLE or ROW statement is previously coded, the row is assigned to the first line at the top of the screen.
• All title rows must precede rows that are associated with the screen work area. This does not mean that you must code all
TITLEs before ROWs. Instead, a row number explicitly or implicitly defined for a title cannot be greater than any row
number defined for a work area row.
• You need not code ROW statements for empty rows between rows with data. You can code ROW statements as
placeholders for other ROWs defined without row-numbers. An empty row is coded with a ROW statement without any
items.
• Multiple items on a row are automatically separated from each other by one space. This space contains the screen attributes
for the second of the two items. You can optionally add to this space or locate an item at a specific column number.
• You can override the automatic placement of items using the COL parameter. Use the COL parameter to specify an explicit
screen column number where the item is placed. The COL parameter specifies the column number where the data that is
contained in the item is placed.
Use an offset (+n) to add to the minimum single space used between items (+1 is the default). The offset applies to the data
to be displayed. To add more space, use an offset greater than +1. There must always be at least one space between each
item on the screen. Items cannot overlap each other.
CA Easytrieve® Report Generator 11.6
• You can repeat a ROW statement or group of ROW statements within the REPEAT and END-REPEAT statements to
display an array on a screen.
• You can specify the screen attributes for each item on a work area row. If you do not specify attributes for each item,
default attributes apply as follows:
• If attributes are not specified for a field (ATTR parameter on the ROW statement), default attributes that are specified
on the DEFAULT FIELD statement are used, if they are coded at the beginning of the SCREEN declaration.
• If attributes are not specified for a literal (ATTR parameter), default attributes specified on the DEFAULT LITERAL
statement are used, if coded.
• If DEFAULT statements are not coded in the SCREEN activity, attributes set in site options are used.
Because literals and read-only fields are not updatable, the following attributes are flagged as warnings when compiled and
ignored when used:
• ALARM
• CURSOR
• INVISIBLE
• MUSTENTER
• MUSTFILL
• NUMERIC
• TRIGGER
• Field attributes can be changed during program execution with the SET statement. For more information, see SET
Statement in the Language Reference section.
Location Examples
The following example illustrates various ROW statements and their resulting screen displays.
Name . . . . BERG
Dept . . . . 943
Attribute Examples
CA Easytrieve® Report Generator 11.6
The following example illustrates various ROW statements coded with specific attributes. The default attribute for fields is
changed to protect the data. The screen attribute for GROSS-PAY is then specified to unprotect data entry in the field. The
cursor is automatically placed in the first unprotected field on the screen.
Name . . . . BERG
Dept . . . . 943
Note: When you override the default attribute setting, you must supply all the attributes for the item. Attributes are not
merged. For example, if the default attribute is BLUE PROTECT and you specify ATTR TURQ, the field is left unprotected
because you did not also specify PROTECT in the override.
The following example illustrates filling a data entry field with underscores to show the terminal user how much data can be
entered. Any remaining underscores are removed when the screen is received.
Name . . . . BERG________________
Name . . . . BRG
The user can then insert characters into the field to change it to the correct name, BERG.
Justifying Field Contents
Data is typically displayed exactly as it exists in the field, which is determined by its definition.
The JUSTIFY RIGHT parameter shifts the data in the display field to the right. Trailing spaces and nulls are deleted and
leading spaces are inserted. The JUSTIFY LEFT parameter shifts the data in the display field to the left. Leading spaces and
nulls are deleted and trailing spaces are inserted. The following example illustrates these two parameters.
CA Easytrieve® Report Generator 11.6
Name . . . . BERG
Name . . . . BERG
Mask Examples
Mask Examples
Name . . . . C2C5D9C740404040404040404040404040404040
Gross Pay . . 0075920C
You can use the SET statement to edit input data. For more information, see SET Statement.
This article contains the following information:
UPPERCASE
You can specify UPPERCASE for fields that are coded on a ROW statement. When UPPERCASE is coded, data that is
entered on the screen is converted to uppercase characters as it is received from the terminal. To convert all fields on the screen
to uppercase, code UPPERCASE on the SCREEN statement.
PATTERN
PATTERN lets each input character be edited according to the pattern specified. A pattern is a sequence of characters
describing the format of the data in the field. You can use a PATTERN to edit complex combinations of data types and
character sequences.
Note:
A MASK is used only for numeric data. If you use arithmetic on the data, you probably do not want to use a PATTERN.
You typically use a PATTERN to edit a field that contains a mixture of alphabetic and numeric characters in a specific
sequence.
For example, to specify a part identification that is a five-character alphanumeric field where the first and last characters must
be uppercase alphabetic (U) and the middle three characters must be numeric digits (D), code:
This pattern allows acceptance of entries such as A123C and rejection of entries such as 1A23C.
Valid PATTERN Characters
The valid pattern characters and their meanings are listed in the following table:
Character Meaning
A Represents an uppercase or a lowercase 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.
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 the sequence
of characters that are 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 between alternatives.
CA Easytrieve® Report Generator 11.6
You have a field that represents a first name. You define the following rules for the field that are based on the How to Build a
Pattern steps:
1. Analyze your requirements:
• All blanks are acceptable.
• If a name is keyed, the first character must be uppercase and the remaining characters must be lowercase.
• If a name is keyed, there can be no leading blanks.
• If a name is keyed, trailing blanks are acceptable.
• If only an initial is keyed, it must be uppercase and it must be followed by a period. The remainder of the field must be
blank.
• If an initial is keyed, there can be no leading blanks.
2. There are three possible orders for how the characters for this field can be keyed:
• The first order is all blanks (requirement 1).
• The second order is an uppercase character followed by one or more lowercase characters followed by 0 or more blanks
(requirements 2, 3, and 4).
• The third order is an uppercase character followed by a period followed by blanks (requirements 5 and 6).
3. The part of the pattern that corresponds to the first order is a repetition of B, because B represents blanks.
If the field is ten characters long, one way to specify this order is B(10) or BBBBBBBBBB. A better way to specify this
order is B*. B* means that an infinite number of blanks can be accepted. Because the field is only 10 bytes long, there can
be at most ten blanks to accept. The B* generates a much smaller internal representation, and also adapts better to changes
in the size of the field.
4. The part of the pattern that corresponds to the second order is:
• A U for the uppercase character
• A repetition of Ls for the lowercase characters
• A repetition of Bs for the trailing blanks
• If the field is ten characters long, there can be 1 through 9 lowercase letters. One way to specify the repetition is L(1..9),
but a better way is to use L(1..*), because the length of the field enforces a practical limit. For the repetition of blanks,
use B* instead of B(0..8). The part of the pattern for the second order is UL(1..*) B*. Blanks that are embedded in
patterns are ignored.
5. The part of the pattern that corresponds to the third order is:
• A U for the uppercase character
• A "." for the period
• A repetition of Bs for the blanks
Although there is always the same number of blanks, use B* to describe the trailing blanks in the order. B(*) produces a
much smaller internal representation and is also more flexible. The part of the pattern for the third order is U "." B*.
Combining the parts into a single pattern results in:
Character Sets
A pattern represents the order of character sets in which you accept the data from the screen for a particular field. The letters
A, B, E, D, L, N, U, and X represent predefined character sets. A single letter that is enclosed in double quotes represents a
character set consisting of one character. A sequence of letters that is enclosed in double quotes represents a series of character
sets.
A character set indicates which characters are acceptable. For example, the letter U (when not enclosed in double quotes)
indicates that any uppercase letter is acceptable.
Occasionally, you may prefer to identify characters that do not fit into one of the predefined character sets. In these cases, you
can build a character set that identifies exactly the characters you require. The + and the - operators enable you to add sets
together or to obtain the set difference. Parentheses ( ) let you control the precedence of the operations.
A frequent use for set difference is constructing a set of all characters except a specific set of characters. For example, a pattern
to specify all characters except blanks is X-B.
CA Easytrieve® Report Generator 11.6
A frequent use for set addition is constructing a set of characters consisting of one of the predefined sets plus a few additional
characters. For example, a pattern to specify uppercase letters plus blanks is U+B.
Both U+B and U|B recognize the same data. The internal form of U+B is marginally better than U|B because U+B describes a
character set; U|B does not. As a character set, the action operator # can be appended to the set. The set can be combined with
another set using - or + to form a different set.
Note: If you need to specify a pattern for predefined character sets in another language, contact CA Support.
Advanced Numeric Patterns
You can use a PATTERN to provide advanced editing of numeric data. For example, you can use a MASK to provide basic
display and edit criteria for a nine-digit ZIP Code:
The mask, when used alone, allows the user to simply type zero. To require the user to enter all nine digits with or without the
hyphen, add the following PATTERN:
The pattern specifies that there should be exactly five digits that are entered, followed by 0 to 1 hyphens followed by exactly
four digits.
A similar example of a PATTERN for a social security number follows:
The PATTERN specifies that exactly three digits should be entered, followed by 0 to 1 hyphens, followed by exactly two
digits, followed by 0 to 1 hyphens, followed by exactly four digits, followed by any number of spaces.
Advanced Editing of Names
You can use a PATTERN to ensure that the terminal operator enters valid data in a name field:
The PATTERN specifies that only a single name of at least one uppercase-only character, followed by any number of spaces,
is valid.
To allow a single uppercase letter followed by only uppercase, or only lowercase letters followed by any number of spaces,
use:
To enable one or more names in uppercase with separation by only one space:
X-B signifies that all characters except blanks are allowed. To allow an all-blank field:
This pattern allows data that consists of a single string of non-blank characters with or without leading and trailing blanks, or
an all-blank field.
The body of the table indicates what is done when in a given state with given input. If the entry indicates a state, the product
goes to that state. If the entry indicates accept, the data is valid. If the entry is error, the data is rejected.
If you change the pattern to remove any leading blanks, the pattern becomes:
In the process of converting the pattern to the state table, all of the possible paths through the pattern are considered. If the first
entry is a blank, the product does not know whether to remove the character or not (does it match the B#* or the B*?). This
pattern generates an error message when compiled.
To correct this pattern and achieve the same results, use:
This pattern removes leading and trailing blanks. When the first character is a blank, it does not matter if it is a leading or a
trailing blank because both are removed. The loss of trailing blanks is not damaging. After the data has been accepted, The
data is moved into the corresponding field in the library section. If the field is alphanumeric, it is padded with blanks. If it is
a VARYING alphanumeric field, the length of the field reflects the data, less the trailing blanks. If the field is numeric, the
conversion to the correct data format ignores the blanks.
Second Extension -- Limited Repetition
The second extension is the range repetition with a fixed upper bound, (m..n). This type of repetition is called a limited
repetition. The restrictions on its use are:
1. Limited repetitions cannot be nested within other repetitions (except (m)).
2. When a character from the input data is examined, there can be no ambiguity as to which is the next state and how to count
the character.
Rule 1 is the result of the nature of state tables. All actions are done at the transition from one state to the next. The counting
and checking required by a limited repetition are done at a transition. It is impossible, in all cases, to assign an action to one or
more transitions that reset the counters.
To illustrate Rule 2, consider the following pattern:
If the first character in the input data is a digit, does it match the first D(0..2) or the second? If the product could look ahead to
see the rest of the input, it could decide which one it was. But, as stated earlier, patterns examine only one character at a time.
Therefore, this pattern generates an error message when compiled.
CA Easytrieve® Report Generator 11.6
Note: The pattern 'D(0..2) ("."|E) D(0..2)' does not appear to have any practical application.
Additional Considerations
Consider the following pattern:
'B* X'
If the first character to be examined by the pattern is a blank, does the blank match the B* or the X? If it matches the B* there
can be more data. If it matches the X, there can be no more input. Therefore, this pattern generates an error message when
compiled.
When the product receives data from the screen, the data is almost always padded with trailing blanks unless the user filled the
entire field with data. The EOF key on the 3270 terminal may set the rest of the field on the screen to nulls, but by the time the
pattern sees the data, the nulls have been converted to blanks. You may want to allow for trailing blanks in your patterns.
Note: Trailing blanks in displayed VARYING alphanumeric fields are converted to nulls when received.
MASK
Data that is entered in a numeric field is automatically edited according to an edit mask (default or override):
• Allow and accept digits, a leading or trailing sign (but not both), and a single decimal point. Leading signs are + or -.
Trailing signs are +, -, or the trailing string in the mask (for example, CR). Leading and trailing blanks are accepted and
discarded.
• Align the decimal point when the data is received from the screen.
For example, if you code the following field:
VALUE
Input data is automatically edited against the values that are specified in the VALUE parameter for the field on the ROW
statement. You can automatically edit the data against a single value, a range of values, or a series of values. The VALUE
parameter works similar to an IF statement.
When an alphanumeric field is edited:
• The values must be alphanumeric literals that are enclosed in quotes.
• The comparison is based on the greater of the length of the value and the length of the field. The shorter item is padded
with blanks out to the length of the longer item. This rule is subject to the exception that follows.
• When a fixed-length field is compared with a longer fixed-length value, the comparison is based on the length of the field.
The value is truncated to match the length of the field. A warning message is generated by the compiler.
• The comparison is logical (bit-by-bit).
When a numeric field is edited:
• The values must be numeric literals.
• Comparison is arithmetic.
The following ROW statements illustrate automatic value editing:
DEFINE ALPHA-FIELD W 1 A
DEFINE NUMERIC FIELD W 3 N 0
ROW 'Alpha Test . . .' ALPHA-FIELD VALUE ('A', 'D', 'U')
ROW 'Numeric Test . .' NUMERIC-FIELD VALUE (1, 101 THRU 500, 999)
Cursor Placement
You can specify the placement of the cursor on the screen in the following ways:
You can specify the placement of the cursor on the screen in the following ways:
• Use the CURSOR attribute in the ATTR parameter for the field on the ROW statement. You can also specify the CURSOR
attribute for a field that is flagged in error using the ERROR ATTR parameter for the field on the ROW statement.
• Execute a CURSOR statement in a screen procedure to specify the field on the screen that receives the cursor upon the next
display of the screen.
Cursor Placement Hierarchy
When more than one way is used to place the cursor in a specific location, the following hierarchy determines how the cursor
is placed. The priority is listed from highest to lowest:
CA Easytrieve® Report Generator 11.6
1. If the screen is redisplayed using a RESHOW action, the cursor is placed in the same position as when the screen was
received, regardless of any other method used.
2. If the field is detected in error by the automatic editing process or a SET statement, the first field containing the CURSOR
attribute on the ERROR ATTR parameter of the ROW statement receives the cursor. First is defined as left-to-right, top-to-
bottom.
3. If not a RESHOW or error condition, a CURSOR statement that is executed in a screen procedure names the field to
receive the cursor. If the CURSOR statement is executed more than once before the screen is displayed, the last CURSOR
statement that was executed determines cursor placement.
4. If a CURSOR statement is not executed, the first field on the screen with the CURSOR attribute receives the cursor.
5. If no field on the screen contains the CURSOR attribute, the first modifiable field on the screen receives the cursor.
6. If there are no modifiable fields on the screen, the first item on the screen receives the cursor.
Policies
32894671
65274902
76642915
Two-Dimensional Arrays
As shown in the previous example, you can code a subscript on each element of an array within a REPEAT group. If these
fields are elements of a two-dimensional array, you can also add a second subscript. A second subscript is not automatically
incremented. You must specify the second subscript as a literal or as a static field, as shown in the following example:
...
WS-EMPLOYEE W 33 A OCCURS 3 . * 2-
dimensional table of
WS-NAME WS-
EMPLOYEE 30 A . * 3 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 3 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
List of Employees
Name Statuses
WIMN, GLORIA F G O
BERG, NANCY C
CORNING, GEORGE I T
CA Easytrieve® Report Generator 11.6
Action Effect
REFRESH Restore the initial condition of the screen
EXIT Terminate the SCREEN activity
Screen Procedures
The execution of a SCREEN activity is actually a collection of procedures that the product performs in a
certain sequence. Points in which special-named procedures are invoked in a SCREEN activity are:
The execution of a SCREEN activity is actually a collection of procedures that the product performs in a certain sequence.
Points in which special-named procedures are invoked in a SCREEN activity are:
You can code these special-named procedures to perform customized actions specific to your application. For more
information about these screen procedures, see Branch Actions.
You are not required to code these procedures. If they are not coded, the program proceeds to the next step in the activity.
The following steps illustrate the SCREEN activity process that the product performs and when the special-named procedures,
if coded, are executed:
1. Reset working storage and then perform the INITIATION procedure, processing any branch actions.
2. Reset working storage and then perform the BEFORE-SCREEN procedure, processing any branch actions.
3. Build the screen using program fields, pending messages, and pending cursor placement. Clear the internal pending
message buffer.
4. Send the screen to the terminal. Terminate and resume the program (if pseudo-conversational). Receive the screen from
the terminal.
5. If KEY-PRESSED is an IMMEDIATE key, go to step 7.
6. If KEY-PRESSED is not an IMMEDIATE key, edit input data. If there are any errors, go to step 4. If there are no errors,
move the data into the program fields.
7. If KEY-PRESSED has an associated branch action, perform the action.
8. Perform the AFTER-SCREEN procedure, processing any branch actions.
9. Go to Step 2.
10. When EXIT is requested, reset working storage, and then perform the TERMINATION procedure, processing any branch
actions.
INITIATION
CA Easytrieve® Report Generator 11.6
The INITIATION procedure is performed once during the initiation of the activity. Use INITIATION to perform actions that
can be executed only once. For example, setting a field to an initial value or positioning a file at a specific starting location.
Work fields with the RESET parameter specified are automatically initialized before the INITIATION procedure is invoked.
The REFRESH and RESHOW branch actions are invalid in an INITIATION procedure.
BEFORE-SCREEN
The BEFORE-SCREEN procedure is invoked during each iteration of the SCREEN activity and precedes building the
screen and the terminal I/O process. Typically, BEFORE-SCREEN is used to perform file I/O, initialize fields, or set the
cursor position. Work fields with the RESET parameter specified are automatically initialized before the BEFORE-SCREEN
procedure is invoked.
GOTO SCREEN, REFRESH, and RESHOW are invalid in a BEFORE-SCREEN procedure.
AFTER-SCREEN
The AFTER-SCREEN procedure is performed during each iteration of the activity after the terminal I/O processes. The
procedure is not executed if the key pressed is assigned to execute a branch action. An AFTER-SCREEN procedure can be
used to perform complex editing and to update files with data that is entered on the screen.
All branch actions are valid in the AFTER-SCREEN procedure.
TERMINATION
The TERMINATION procedure is performed when an EXIT action is executed, either from a key pressed or from another
screen procedure. The procedure is used to perform actions that are to be executed only at the end of the activity. Work fields
with the RESET parameter specified are automatically initialized before the TERMINATION procedure is invoked.
If GOTO SCREEN or EXIT is executed in a TERMINATION procedure, the activity is terminated. REFRESH and RESHOW
are invalid in a TERMINATION procedure.
Programmer-Defined Procedures
You can code your own procedures in a SCREEN activity and perform them from the special-named
screen procedures. Procedures that you code are local to the screen activity and cannot be performed from
other activities.
You can code your own procedures in a SCREEN activity and perform them from the special-named screen procedures.
Procedures that you code are local to the screen activity and cannot be performed from other activities.
Branch Actions
This article describes the four actions that cause program execution to branch to specific steps in the
SCREEN activity process:
This article describes the four actions that cause program execution to branch to specific steps in the SCREEN activity process:
GOTO SCREEN
You can use the GOTO SCREEN statement to repeat the activity process. The default action of a SCREEN activity is to repeat
the process until an EXIT action is executed. If the bottom of the process (the end of the AFTER-SCREEN procedure) is
reached, the activity simply repeats, starting with the BEFORE-SCREEN procedure. (The INITIATION procedure is a one-
time-only procedure).
You can code the GOTO SCREEN statement to cause an immediate branch to the top of the activity. This is similar to how
GOTO JOB branches to the top of a JOB activity.
REFRESH
CA Easytrieve® Report Generator 11.6
REFRESH causes the screen to be restored to its initial condition or updated to reflect the current status of information. The
screen is rebuilt using the current value of the fields specified on the screen.
When REFRESH is coded on an IMMEDIATE key, the product ignores data that is entered on the screen and refreshes the
screen as it was originally sent to the user. When REFRESH is coded on a non-IMMEDIATE key, it causes entered data to be
edited and moved into the program field areas, but no special-named procedure is invoked. This enables you to assign a key
solely to allow the user to edit data. The entered data is edited against the automatic edits that you code and no additional code
is required in the AFTER-SCREEN procedure. When the user wants to update the file with the data, they can press another key
to invoke the AFTER-SCREEN procedure. This is illustrated in the following example.
When the user presses F5, data currently on the screen is ignored and the screen is rebuilt from the original field contents.
When the user presses F6, the data that was entered is edited as specified on the ROW statements. Pressing F10 also edits the
data but then performs an AFTER-SCREEN procedure that updates the file.
You can also use REFRESH to update the screen contents with the current data available. For example, a user enters a quantity
and a price and wants to see the extended price (price times quantity). You can use a REFRESH coded in an AFTER-SCREEN
procedure to compute the extended price as shown in this example:
When the user types the quantity and price and presses F9, the quantity and price are received, and the extended price is
computed. The REFRESH then redisplays the screen using the current value of the program fields, and the newly computed
extended price is displayed.
RESHOW
CA Easytrieve® Report Generator 11.6
You can use RESHOW in an AFTER-SCREEN procedure to redisplay the screen after the screen has been received. A copy of
the received screen image is saved. You can then EXECUTE another SCREEN activity. When the program returns to the first
activity, use RESHOW to redisplay the saved image of the first screen.
When associated indirectly with an IMMEDIATE key, you can ignore any data that is entered on the screen, display a second
screen, and then RESHOW the first screen intact. For example, you can permit the user to view a help screen, then return to the
screen on which the user requested help.
When associated indirectly with a non-IMMEDIATE key, you can permit the user to display a selection list, accept and
process the user selections, and then redisplay the original screen.
EXIT
EXIT terminates the SCREEN activity and returns control to the activity from which it was executed. If the current SCREEN
activity was not executed from another activity, EXIT terminates the program. Associating EXIT with an IMMEDIATE key
is equivalent to a cancel function. Any data on the screen is ignored and the activity terminates. Associating EXIT with a non-
IMMEDIATE key saves the data into the program fields after editing it.
Note: It is your responsibility to save the data to a file if your application requires it. Data saved into the program fields is lost
when the program terminates, unless written to a file.
Send Messages
An internal message area is maintained for each message area that is defined on your screen. The
MESSAGE statement can be executed anywhere in your program to update the pending message area.
When the next screen is displayed, the screen message area is built from the pending message. The
pending message area is then cleared.
An internal message area is maintained for each message area that is defined on your screen. The MESSAGE statement can
be executed anywhere in your program to update the pending message area. When the next screen is displayed, the screen
message area is built from the pending message. The pending message area is then cleared.
You can use these pending messages across activities to prepare messages in one activity for display on a screen in another
activity. The following example shows how to code messages in a SCREEN activity:
Employee Number . . _
Employee Name . . .
...
An introductory message (message level INFORMATION) is issued to the terminal user from an INITIATION procedure.
After the user enters an employee number and presses Enter, the AFTER-SCREEN procedure is performed and issues
an appropriate message describing the results of the file I/O. If the record is found, the user receives an INFORMATION
message. If the record is not found, an ACTION message is issued, flagging an error condition that must be corrected before
the process can continue.
Message Levels
The product lets you automatically manage different levels of messages. For example, you can issue INFORMATION or
WARNING messages in your program, but discover later in the process that a severe error condition that requires an ACTION
message could arise. If the message areas for the different message levels are located on the same screen row, coding the
ACTION message overlays any previous or subsequent INFORMATION or WARNING messages because of the severity
hierarchy of the message levels. When you issue multiple messages of the same level, the last one issued for the highest level
is displayed.
You can determine the position of the cursor when the screen is received by using the special IF CURSOR statement in a
screen procedure. Use the IF CURSOR statement to test whether the cursor is present within a specified field. The following
example illustrates the IF CURSOR statement testing for cursor placement on any of four subscripted array elements on the
screen:
_ View employee
Edit employee
Delete employee
Add employee
...
F2=Select F3=Exit
• The test for modification determines whether the value of the field actually changed. If the user types the same value in the
field as was originally displayed, the modification test is false.
• The results of the IF MODIFIED test are set at the time the screen is received. If the value of the input data is not equal to
the value of the program field, the field was modified. If the input data is equal to the program field, the field is considered
not modified.
• The IF MODIFIED comparison is performed logically for both alphanumeric fields and numeric fields.
• If the screen is received as the result of an IMMEDIATE key, PA key, or CLEAR key, the IF MODIFIED test is always
false.
Using the IF MODIFIED test can help you write more efficient programs. For example, you may not want to perform complex
editing on a field unless the user has changed it. The following is an example of the IF MODIFIED test:
The IF MODIFIED test of the JOB-CATEGORY field determines whether to look up the field in a table and update the record.
If the user does not modify the screen contents, these I/O operations are not performed.
Setting Errors
When you can determine the validity of user input with a simple IF statement, such as IF DEPT = 901
THRU 999, the VALUE parameter on the ROW statement provides easy automatic error handling. Often,
however, you must provide more complex logic to determine the validity of a value. For example, you
may need to perform cross-field editing where the value of one field on the screen determines acceptable
values for another field on the screen, or you may have to perform a table lookup or other advanced
processing to determine validity.
When you can determine the validity of user input with a simple IF statement, such as IF DEPT = 901 THRU 999, the VALUE
parameter on the ROW statement provides easy automatic error handling. Often, however, you must provide more complex
logic to determine the validity of a value. For example, you may need to perform cross-field editing where the value of one
field on the screen determines acceptable values for another field on the screen, or you may have to perform a table lookup or
other advanced processing to determine validity.
CA Easytrieve® Report Generator 11.6
You can use the SET statement to extend automatic error handling in screen procedures. When you execute a SET statement
for a field, the SET information is used the next time that the screen is displayed. You can simply change the screen attributes
for the field. However, the screen process treats the field as if automatic editing detected the error if you code the ERROR
parameter. The error attributes and error message for the field are used by default, but you can even override these with a SET
statement. For more information, see SET Statement.
Commit Processing
You can use commit processing in screen activities to provide file integrity during update operations.
See Units of Work and Commit Processing for information about instructing the product to use either
automatic or controlled commit processing during program execution. See Hold/Release Processing for
information about how requests are processed to update records during file processing.
You can use commit processing in screen activities to provide file integrity during update operations. See Units of Work and
Commit Processing for information about instructing the product to use either automatic or controlled commit processing
during program execution. See File Processing Modes for information about how requests are processed to update records
during file processing.
This article contains the following information:
Concurrent Updates
When many users concurrently update the same file in a pseudo-conversational environment, your program must handle
certain conditions. During the time the terminal user is thinking about modifying a record, the record could be deleted or
updated by another user. For example, when a user is shown the quantity of an item in inventory, by the time they deducts the
order quantity, another user may have depleted the stock. If you do not reevaluate the quantity when you read the record again
for update, the user could sell stock they do not really have.
There are several coding conventions to handle these conditions. Two of the more common coding conventions are:
• Set a flag in the record that is under consideration for update. All programs accessing the file must test the flag before
allowing any update access.
• Save a copy of the data that is displayed to the user. Before updating it, compare the current data to the saved copy. If any
changes are detected, display the current data and warn the user that there was a concurrent change to the record.
The next example contains the previous program in which code has been added to handle concurrent updates. A copy of the
social security number that is displayed to the user is saved in the working storage field, SAVE-SSN. Code has been added to
detect if another user deletes the record. When the read is successful, the social security number in the record is compared to
the number that was originally displayed to the user. If it is not the same, the user is warned that another user already changed
the number, and is asked to process the change again.
10X
25X
30X
...
ENDTABLE
SCREEN NAME EDIT-EMPLOYEE LINESIZE 80 ROWCOUNT 24
KEY ENTER
KEY F3 NAME 'Exit' EXIT
TITLE 1 'Employee Edit Utility'
ROW 3 'Enter the employee number and new job category.'
ROW 5 'Employee number . .' EMP#
ROW 7 'Job Category . . . .' JOB-CATEGORY
...
AFTER-SCREEN. PROC
IF JOB-CATEGORY MODIFIED
PERFORM SEARCH-JOB-CATEGORY-TABLE
IF NOT JOBTABLE
SET JOB-CATEGORY ERROR +
'Job category is invalid. Please reenter.'
ELSE
PERFORM UPDATE-EMPLOYEE
MESSAGE 'Job category updated.' LEVEL INFORMATION
MOVE ZERO TO EMP# JOB-CATEGORY
END-IF
ELSE
MESSAGE 'Job category not modified.' LEVEL WARNING
JOB-CATEGORY = 0
END-IF
END-PROC
SEARCH-JOB-CATEGORY-TABLE. PROC
DEFINE WCAT W 1 A
SEARCH JOBTABLE WITH JOB-CATEGORY GIVING WCAT
END-PROC
...
DECLARE TEXT-
ATTR ATTR (GREEN ASKIP)
DECLARE FIELD-
ATTR ATTR (TURQ)
DECLARE NORMAL-TEXT-
ATTR ATTR (GREEN ASKIP)
DECLARE ERROR-TEXT-
ATTR ATTR (YELLOW INTENSE REVERSE ASKIP ALARM)
CA Easytrieve® Report Generator 11.6
DECLARE NORMAL-FIELD-
ATTR ATTR (TURQ)
DECLARE ERROR-FIELD-ATTR ATTR (YELLOW INTENSE REVERSE ALARM)
SCREEN NAME EDIT-
EMPLOYEE
KEY ENTER
KEY F3 NAME 'Exit' EXIT
TITLE 1 'Employee Edit Utility'
ROW 3 'Enter the employee number and new job category.'
ROW 5 'Employee number . .' EMP#
ROW 7 'Job Category . . . .' ATTR TEXT-
ATTR +
JOB-CATEGORY ATTR FIELD-ATTR
INITIATION. PROC
EMP# = 0
JOB-CATEGORY = 0
END-PROC
AFTER-
SCREEN. PROC
IF JOB-
CATEGORY MODIFIED
PERFORM SEARCH-JOB-CATEGORY-
TABLE
IF NOT JOBTABLE
MESSAGE 'Job category is invalid. Please reenter.'
TEXT-ATTR = ERROR-TEXT-
ATTR
FIELD-ATTR = ERROR-FIELD-ATTR
ELSE
PERFORM UPDATE-
EMPLOYEE
MESSAGE 'Job category updated.' LEVEL INFORMATION
MOVE ZERO TO EMP# JOB-
CATEGORY
TEXT-ATTR = NORMAL-TEXT-
ATTR
FIELD-ATTR = NORMAL-FIELD-
ATTR
END-IF
ELSE
MESSAGE 'Job category not modified.' LEVEL WARNING
JOB-
CATEGORY = 0
TEXT-ATTR = NORMAL-TEXT-
ATTR
FIELD-ATTR = NORMAL-FIELD-
ATTR
END-
IF
END-
PROC
CA Easytrieve® Report Generator 11.6
...
Using a Menu
You can implement a menu application by coding multiple SCREEN activities within one program. This example shows how
you can create a menu that executes other SCREEN activities as child screens. When the child screen terminates due to an
EXIT, the parent screen executes until the next EXIT. This example also demonstrates the ability for the child screen to send a
message to be displayed on the parent screen:
KEY ENTER
KEY F3 NAME 'Exit' EXIT
TITLE 'Employee Edit Utility'
ROW 3 'Number . .' EMP#
ROW 'Name . . .' EMPNAME
ROW 'SSN . . .' SSN
ROW 'Dept . . .' DEPT
ROW 'Phone . .' TELEPHONE
BEFORE-SCREEN. PROC
READ PERSNL KEY EMP# STATUS
IF NOT PERSNL
MESSAGE 'Employee number not found. Please re-enter.'
EXIT
END-IF
END-PROC
AFTER-SCREEN. PROC
WRITE PERSNL UPDATE
MESSAGE 'Employee updated successfully.' LEVEL INFORMATION
END-PROC
...
SCREEN NAME MENU UPPERCASE
KEY ENTER
KEY F1 NAME 'Help' IMMEDIATE
KEY F3 NAME 'Exit' EXIT
TITLE 1 'Employee System Main Menu'
ROW 3 'Type an option and an employee number, then press Enter.'
ROW 5 'Option . . . . . .' OPTION VALUE ('V', 'E', 'X') +
ERROR 'Please type V, E, or X.'
ROW 7 COL 25 'V View employee'
ROW COL 25 'E Edit employee'
ROW 11 'Employee Number . .' EMP# ATTR MUSTENTER +
ERROR 'Please enter an employee name.'
AFTER-SCREEN. PROC
IF KEY-PRESSED = F1
CA Easytrieve® Report Generator 11.6
EXECUTE MENU-HELP
RESHOW
END-IF
CASE OPTION
...
END-PROC
SCREEN NAME MENU-HELP
KEY F3 NAME 'Exit' EXIT
TITLE 'Employee Menu Help'
ROW 3 COL 10 'The Employee System Menu provides the ability to view'
ROW COL 10 'or edit an employee''s name, social security number,'
ROW COL 10 'department, or telephone number.'
ROW 7 COL 10 'Type V to view the employee data.'
ROW 9 COL 10 'Type E to edit the employee data.'
ROW 11 COL 10 'You must also type the employee''s number.'
F3=Exit
Field-specific Help
You can easily implement field-specific help screens by using code similar to the previous example combined with the IF
CURSOR test:
• The terminal user could press a function key while the cursor is in the field for which they want help.
• Test each field on your screen to determine the position of the cursor in an AFTER-SCREEN procedure.
• EXECUTE a specific SCREEN activity that displays help for the specific field.
Code the AFTER-SCREEN procedure as follows:
CA Easytrieve® Report Generator 11.6
AFTER-
SCREEN. PROC
IF KEY-
PRESSED = F1
IF EMP# CURSOR
EXECUTE EMP#-
HELP
ELSE-
IF NAME CURSOR
EXECUTE NAME-
HELP
ELSE-
IF SSN CURSOR
EXECUTE SSN-
HELP
ELSE-
IF TELEPHONE CURSOR
EXECUTE TELEPHONE-
HELP
END-
IF
RESHOW
END-
IF
Windowed Screens
You can code pop-up windows or dialog boxes in your screen declarations. Windows are easily coded by executing one screen
activity from another in which the second screen is smaller than the first. The following example illustrates a pop-up window
in which the terminal user is asked to confirm an update request before the update is actually performed:
...
SCREEN NAME EMPLOYEE-UPDATE LINESIZE 80 ROWCOUNT 24
KEY F3 NAME 'Exit' EXIT
KEY F6 NAME 'Update'
TITLE 1 'EMPLOYEE RECORD'
ROW 3 'EMPLOYEE NUMBER' COL 24 EMP#
ROW 6 'SOCIAL SECURITY NUMBER' SSN
ROW 8 'LAST NAME' COL 24 NAME-LAST
ROW 10 'FIRST NAME' COL 24 NAME-FIRST
...
AFTER-SCREEN. PROC
EXECUTE CONFIRM-WINDOW
END-PROC
SCREEN NAME CONFIRM-WINDOW LINESIZE 40 ROWCOUNT 10 ROW 12 COL 20 +
BORDER (SINGLE)
KEY F6 NAME 'Update'
KEY F12 NAME 'Cancel' EXIT IMMEDIATE
TITLE 1 'Confirm Update'
ROW 3 'Are you sure?'
CA Easytrieve® Report Generator 11.6
The first screen is defined as 24 rows by 80 columns. When the user presses F6 to update the record, a second SCREEN
activity, CONFIRM-WINDOW, is executed. CONFIRM-ACTIVITY is defined as 10 rows by 40 columns and the upper-left
corner is located in row 12 column 20. This second screen overlays the first and waits for the user to confirm the request before
updating the record. The screen appears as follows:
EMPLOYEE RECORD
Confirm Update
F6=Update F12=Cancel
F3=Exit F6=Update
EMPLOYEE RECORD
CA Easytrieve® Report Generator 11.6
Options
+---------------
+
...
When the user presses F10, the following pull-down menu is displayed:
EMPLOYEE RECORD
Options
+---------------
+
| Find>> |
| Print | 00370
| | BER 256-52-8737
| |
| F3=Exit | NAGLE
+---------------
+
...
Macro Facility
The Macro Facility lets you easily duplicate often-repeated source statements in any program. This lets
you tailor the product to the programming standards of your installation.
The Macro Facility lets you easily duplicate often-repeated source statements in any program. This lets you tailor the product
to the programming standards of your installation.
This article contains the following information:
CA Easytrieve® Report Generator 11.6
Even the most inexperienced programmer can effectively use CA Easytrieve Report Generator macros. The macro library
allows you to store the data definition statements of frequently used files using standardized data-naming conventions.
This section first discusses how to invoke macros by using the macro invocation statement. Next, it discusses the two parts of a
macro:
• The macro prototype statement
• The macro body
This section concludes with a description of Process Macros.
Macro Invocation Statement
The macro invocation statement consists of a macro name that is preceded by a percent (%) sign.
Syntax:
%macro-name [positional-parameters]...[keyword-parameters]
Parameters:
• %macro-name Supply the name of a previously stored macro that you want to invoke.
• positional-parameter Supply values of positional parameters in the macro. You must supply positional parameters before
any keyword parameters.
• keyword-parameter Supply both the keyword and its value in the macro.
Macro Library
Mainframe macro statements are stored and maintained in a macro library.
For the CA Easytrieve/Online environment, each macro library is connected by your system administrator. You can
enable or disable the libraries as required. Various file-types are supported for macro libraries. For more information, see
the Configuring section.
For CA Easytrieve Report Generator, only a PDS file-type is supported for macro libraries. For more information about
compiling using batch JCL, see the Using section.
Macro Library Security
You can protect your macro statements using an ACCESS record. For both CA Panvalet and VSAM macro storage access
methods, the ACCESS record can appear anywhere in the 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 Report
Generator does not print the ACCESS record. For detailed information about creating and maintaining macro libraries for use
with CA Easytrieve/Online, see the CA Easytrieve/Online Administrator Guide, available from Bookshelves and PDFs.
CA Panvalet
In addition to having the maintenance and backup capabilities that are provided by CA Panvalet, the product gives you the
ability to secure the macro against unauthorized access. Do this by using a security access code that can be applied to a CA
Panvalet member.
A security access code applies to an individual CA Panvalet library member. You must supply the security access code on an
ACCESS record before CA Easytrieve Report Generator can retrieve a secured member. The syntax is:
VSAM
CA Easytrieve® Report Generator 11.6
VSAM lets you protect the macro library by using VSAM password protection. Before CA Easytrieve Report Generator can
retrieve a macro from a secured library, you must supply the library password on an ACCESS record prior to the first macro
call. The syntax is:
Macro Files
Non-mainframe macro statements are stored as files. Each macro is stored in a file that is named xxxxxxxx.mac
where xxxxxxxx is the macro name. For more information, see the Using section.
Invoke a Macro
To invoke a macro, code a macro invocation statement anywhere within the source program. Macro
invocation statements cause a series of statements to be retrieved from the macro library and included as
source statements in the program. The series of statements can be modified by parameters supplied on the
macro invocation statement.
To invoke a macro, code a macro invocation statement anywhere within the CA Easytrieve® Report Generator source
program. Macro invocation statements cause a series of statements to be retrieved from the macro library and included as
source statements in the CA Easytrieve® Report Generator program. The series of statements can be modified by parameters
supplied on the macro invocation statement.
macro-1
..
macro-1 invocation series of
... macro-1
macro-2 invocation statements
...
...
macro-2
series of
macro-2
statements
...
Produces
<easy> input
...
macro-1
expanded
statements
...
macro-2
expanded
statements
...
CA Easytrieve® Report Generator 11.6
Define Macros
A macro consists of three parts:
A macro consists of three parts:
1. The macro prototype, which defines the parameters of the macro.
2. The macro body, which contains the CA Easytrieve Report Generator statements to be generated by a macro invocation
statement.
3. The optional macro termination command.
A macro name is the same as the member name in the macro storage library. A macro name is 1-8 characters in length. The
following code illustrates the parts of a macro:
PROTOTYPE
STATEMENT MACRO 2 NUMBER RESULT
**********************************************************
* *
* NAME: MACRO EXAMPLE *
* CALCULATE THE CUBE OF A NUMBER *
* *
BODY * FUNCTION: THIS MACRO CALCULATES THE CUBE OF A NUMBER.*
* *
**********************************************************
DEFINE CUBE_NUMBER_ S 6 N VALUE 000000
CUBE_NUMBER_ = &NUMBER * &NUMBER * &NUMBER
&RESULT = CUBE_NUMBER_
Optional
Termination MEND
Command
Following are examples of macro prototype statements. The first example shows a macro with no substitution parameters:
MACRO
...
...
Macro Body
The macro body consists of a series of model and actual CA Easytrieve Report Generator statements. The model statements
contain one or more parameters that are replaced by the values of corresponding parameters on the prototype statement.
Macro Termination Command
The optional macro termination command is used at the end of a macro. Its syntax is:
MEND
CA Easytrieve® Report Generator 11.6
Process Macros
Macros are processed whenever a macro invocation statement appears in a program. To designate a
macro invocation, prefix a percent sign (%) to the macro name. Each macro invocation retrieves a copy of
the macro from the library and, if necessary, replaces parameters with their corresponding values from the
macro invocation statement or the prototype statement.
Macros are processed whenever a macro invocation statement appears in a CA Easytrieve® Report Generator program. To
designate a macro invocation, prefix a percent sign (%) to the macro name. Each macro invocation retrieves a copy of the
macro from the library and, if necessary, replaces parameters with their corresponding values from the macro invocation
statement or the prototype statement.
Contents:
Parameter Substitution
The rules for substituting macro parameters are the basic rules of syntax and the following:
• You must specify positional parameter values on the macro invocation statement in the same order as they appear on the
prototype statement.
• CA Easytrieve® Report Generator gives the value of a null string to unsupplied positional parameter values. The parameter
is treated as nonexistent.
• You can specify keyword parameter values in any order on the macro invocation statement.
• CA Easytrieve® Report Generator gives unsupplied keyword parameter values the default value from the prototype
statement.
• Within the body of a macro, the ampersand (&) is the prefix concatenated to parameter substitution words. You must spell
parameter substitution words exactly the same their counterparts on the macro prototype, except for the leading ampersand.
• Delimit parameter substitution words with a space or a period (.). Use a period when the substituted value is to be
concatenated with another word. CA Easytrieve® Report Generator deletes the period when the parameter is replaced by its
value.
• When you want to use an ampersand in the body of the macro, you must code two consecutive ampersands (&&).
• If you need to pass a hexadecimal literal as a parameter, you must pass it first as an alphanumeric literal ('X''xx''').
CA Easytrieve® Report Generator treats a macro invocation statement within the body of a macro (nested) as if it were outside
of the macro. You can use any number of nesting levels.
Examples
The following example illustrates positional parameter substitution. The second parameter value (' ') is supplied only to
maintain correct positioning for the third parameter ('FB (150 1800)').
Produces:
...
FILE TESTIN FB (150 1800)
...
The next example illustrates keyword parameter substitution. The default value of a space for the second keyword entry
(TYPE) is an efficient way to code parameters that are used infrequently.
CA Easytrieve® Report Generator 11.6
Produces:
...
FILE TESTIN VIRTUAL V (1000)
...
Produces:
...
FILE TESTIN
NEW-SSN 1 9 N
NEW-MAIL 10 75 A, +
HEADING 'NAME & ADDRESS'
...
In-stream Macros
You can also include macro statements in the source input to . This capability is particularly useful for
testing new macros prior to storing them in the macro library. When an in-stream macro has the same
name as a macro in the library, the in-stream macro is used.
You can also include macro statements in the source input to CA Easytrieve® Report Generator. This capability is particularly
useful for testing new macros prior to storing them in the macro library. When an in-stream macro has the same name as a
macro in the library, the in-stream macro is used.
In-stream macros are placed at the beginning of the source input prior to any other statements. Use an MSTART and an
MEND statement to bound each in-stream macro. The format of these statements is:
MSTART macro-
name
MACRO 2 NUMBER RESULT
CA Easytrieve® Report Generator 11.6
****************************************************************
* *
* NAME: MACRO EXAMPLE *
* CALCULATE THE CUBE OF A NUMBER *
* *
* FUNCTION: THIS MACRO CALCULATES THE CUBE OF A NUMBER. *
* *
****************************************************************
DEFINE CUBE_NUMBER_ S 6 N VALUE 00000
CUBE_NUMBER_ = &NUMBER * &NUMBER * &NUMBER
&RESULT = CUBE_NUMBER_
MEND
Macro-name is the name of the macro. It can be from one to eight characters long. The first character must be alphabetic.
Examples
This example illustrates the use of in-stream macros:
Statements:
MSTART EXMACRO
MACRO 2 NUMBER RESULT
PUSH
SKIP 1
SKIP 1
LIST OFF
*****************************************************************
* *
* NAME: MACRO EXAMPLE *
* CALCULATE THE CUBE OF A NUMBER *
* *
* FUNCTION: THIS MACRO CALCULATES THE CUBE OF A NUMBER. *
* *
*****************************************************************
POP
SKIP 1
DEFINE CUBE_NUMBER_ S 6 N VALUE 000000
SKIP 1
CUBE_NUMBER_ = &NUMBER * &NUMBER * &NUMBER
&RESULT = CUBE_NUMBER_
SKIP 1
MEND
*
DEFINE CUBED_RESULT W 6 N VALUE 000000 MASK (J 'ZZZZZ9')
JOB INPUT NULL NAME MACROI
%EXMACRO 3 CUBED_RESULT
DISPLAY CUBED_RESULT
STOP
Produce:
CA Easytrieve® Report Generator 11.6
27
Error Handling
The interface automatically generates the appropriate error-handling logic when preprocessing each SUPRA function call.
Also, you can issue the SUPRA ON ERROR statement to control error handling by yourself.
Error handling occurs as follows:
• For a SIGN-ON or SIGN-OFF statement:
• If the SUPRA Function Status Indicator (FSI) is an asterisk (*), the generated code recognizes the statement as
successfully executed.
• If the FSI is not an asterisk and SUPRA ON ERROR SYSTEM (the default) is in effect, the program displays an error
message and TIS-MESSAGE, performs a SUPRA RESET, and terminates the execution.
• For a Get statement:
• If the FSI is an asterisk (*) or an N, the program recognizes the statement as successfully executed. An N indicates that
an occurrence was not found.
• If the FSI is not an asterisk or an N and if SUPRA ON ERROR SYSTEM (the default) is in effect, the program displays
an error message and TIS-MESSAGE, performs a RESET, and terminates the execution.
Note: Because error handling does not occur when a "not found" (TIS-FSI="N") condition happens, it is your
responsibility to test for this condition and to specify the logic to follow when the condition occurs.
The generated code performs the error handling logic when you specify SYSTEM on a SUPRA ON ERROR statement.
However, you can specify your own procedure instead of SYSTEM. When this is the case, the preprocessor automatically
generates a CA Easytrieve Report Generator PERFORM of that procedure.
When you specify your own error handling procedure, it is your responsibility to handle the error conditions:
• From that point on in the source program, or
• Until you reset the error handling logic with a SUPRA ON ERROR SYSTEM statement
The advantages to specifying your own error handling procedures are that you can include error diagnosis and issue
customized error messages.
Example Program
The code that follows shows how SUPRA statements are incorporated into a CA Easytrieve Report Generator program.
CA Easytrieve® Report Generator 11.6
This program accesses the logical records that are defined as CUSTOMER:
As the example displays, relatively few statements are required to create a report of the data that is contained in a SUPRA
database. The SUPRA statements in this program are explained in the articles that follow.
Usage Rules
When coding SUPRA statements, follow these rules:
• In a single record, do not combine one SUPRA statement with another or with a CA Easytrieve Report Generator statement
or comment.
• Do not code SUPRA statements in a CA Easytrieve Report Generator macro.
• Code SUPRA statements only in the established statement area. This area is set during installation of the interface. The
default statement area is columns 1 through 72.
• Continue SUPRA statements with a plus (+) symbol.
• Code SUPRA INCLUDEs before any other SUPRA or CA Easytrieve Report Generator statement that references the view
or fields in the view. Generally, code SUPRA INCLUDEs in the program library section.
• When continuing CA Easytrieve Report Generator statements, do not break lines in such a way that the first word in a
source record is SUPRA. The preprocessor assumes that if the first word of the source record is SUPRA, the record is a
SUPRA statement and should be processed as such. This means that a line that begins with SUPRA that is not a SUPRA
statement causes an error during preprocessing.
For example, the preprocessor misinterprets the second record in the following TITLE statement:
The preprocessor tries to interpret the second record as a SUPRA statement. But, because SUPRA PROGRAM is not a
valid SUPRA statement, the preprocessor flags the line as an error.
To prevent this from happening, break continued statements in such a way that SUPRA is not the first word in a source
record. Using the previous example, you could break the first line after the word IS, instead of after A. Thus, the first word
of the second record is A instead of SUPRA.
SUPRA GET
Contents
Contents
CA Easytrieve® Report Generator 11.6
The SUPRA GET statement retrieves the logical record from the logical view.
Syntax
[ {field-name...) }]
SUPRA GET [ NEXT ] view [ USING { }]
[ LAST ] [ { (literal... ) }]
[ SAME ]
[ FIRST ]
[ PRIOR ]
Parameters
[ NEXT ]
[ LAST ]
[ SAME ]
[ FIRST ]
[ PRIOR ]
This parameter indicates the order in which the logical records are retrieved from the database.
The default is NEXT.
view
View is the name of the logical view accessed. This name must be the same as the logical view name in the SUPRA
INCLUDE statement. If, however, you specify a user view name in the SUPRA INCLUDE statement, view must be the same
as that user view name.
[ { (field-name...) } ]
[ USING { } ]
[ { (literal...) } ]
Field-name or literal identifies the key values that access the logical view. The interface generates assignment statements that
place these values in the key fields defined in the SUPRA access set. The value order must correspond to the key declaration
order in the view's access set.
You can specify up to nine values. However, the number of values must be less than or equal to the number of keys in the
access set.
If you do not specify USING, the default is sequential (rather than random) access of the view.
SUPRA INCLUDE
The SUPRA INCLUDE statement generates the DEFINE statements and the associated record and status
data areas for a logical view. You can include a maximum of ten views in a program.
CA Easytrieve® Report Generator 11.6
The SUPRA INCLUDE statement generates the CA Easytrieve® Report Generator DEFINE statements and the associated
record and status data areas for a logical view. You can include a maximum of ten views in a CA Easytrieve® Report
Generator program.
With this statement, you identify the view name as it is known by the Relational Data Manager (RDM). Also, you can specify
an alternate view name in the program to simplify the coding of unusually long view names.
Contents
Parameters
logical-view-name
Logical-view-name specifies the name by which the SUPRA directory knows the logical view.
• [PREFIX]
Prefixes the view's attribute names with the view name. You need only to include this parameter when several views
contain an attribute with the same name, or when a view and an attribute have the same name. When you do prefix the field
name, the field is qualified in the view.
Default: Generate a field-name that is the same as the SUPRA attribute name.
• [NAME user-view-name]
The user view name is a shorter or more meaningful name you can assign to the view. If you specify it, also use the user
view name in all of the view's SUPRA GET statements. If you specify it with PREFIX rather than the logical view name,
the preprocessor uses this name as the prefix for all generated DEFINE statements.
The logical view name is the default for field-name generation and for all references to the view.
• [SELECT (user-field...)]
With the optional SELECT parameter, you indicate which logical view fields the preprocessor generates. If you do not
specify the parameter, all fields for the view are generated.
User-field is the attribute name in the access set for the view. Enclose multiple fields in parentheses and separate each with
a blank. You can specify a maximum of 50 user fields.
By default, the preprocessor generates all attributes found in the view.
Generated Statements
TIS-CONTROL Statements
When the preprocessor encounters the first SUPRA INCLUDE statement, it defines a SUPRA communications area in S
working storage. This communications area, TIS-CONTROL, contains information about the operation and the status of
attempts to access the logical views.
The preprocessor generates the following DEFINE statements in the TIS-CONTROL communications area:
• Use the SUPRA Function Status Indicator (TIS-FSI) to test if a SUPRA GET function call was completed successfully.
• Use the Validity Status Indicator (TIS-VSI) to test the validity of the user view returned by a SUPRA GET.
• Use TIS-MESSAGE to display diagnostic information.
Consult your SUPRA RDM COBOL or PL/I Programmer's Guide for details regarding the use of TIS-CONTROL.
The preprocessor also generates fields to contain the date and time the preprocessor generated the CA Easytrieve® Report
Generator view definitions. The RDM uses these fields to detect any changes to the views after preprocessing.
The following date and time fields are generated:
DEFINE TIS-VER-DATA S 14 A
DEFINE TIS-DATE-STAMP TIS-VER-DATA 14 A
DEFINE TIS-DATE TIS-DATE-STAMP 8 A
DEFINE TIS-TIME TIS-DATE-STAMP +8 6 A
Name Description
DEFINE LUV-view (1,2) Defines the entire view.
DEFINE view (1,2) Defines the view's data area.
DEFINE fieldname (1) Defines a field in the view.
In the table above, view is the logical view name you specify in the SUPRA INCLUDE statement, unless you override it with a
user view name. Fieldname is the attribute name found in the view access set.
You can test Attribute Status Indicators for the status of each field in the view. Consult your SUPRA RDM COBOL or PL/I
Programmer's Guide for complete details regarding the use of ASIs.
The preprocessor generates CA Easytrieve® Report Generator definitions based on the length, format, and number of decimal
places of the field's director entry. When possible, the definition matches the SUPRA definition.
CA Easytrieve® Report Generator 11.6
ASI-CUSTOMER-ORDER-VIEW-CUSTOMER-PHONE-NO
ASI-CO-CUSTOMER-PHONE-NO
When you have a 30-character field name, the addition of the four character ASI- prefix leaves only five characters for a view
name (six including the hyphen):
ASI-view-fieldname
or
SUPRA ON ERROR
The SUPRA ON ERROR statement specifies how the program handles error conditions set by the
Relational Data Manager (RDM).
The SUPRA ON ERROR statement specifies how the program handles error conditions set by the Relational Data Manager
(RDM).
To control error handling yourself, identify a CA Easytrieve® Report Generator procedure name to perform when an
unexpected RDM error is encountered.
A SUPRA ON ERROR PERFORM statement overrides error handling (whether automatic or the result of previous SUPRA
ON ERROR statements) on all SUPRA function calls generated from that point on.
A SUPRA ON ERROR SYSTEM statement resets automatic error handling.
Contents
Syntax
{ PERFORM procedure-name }
SUPRA ON ERROR { }
{ SYSTEM }
Parameters
{ PERFORM procedure-name }
• {}
• { SYSTEM }
With procedure-name, you can specify the CA Easytrieve® Report Generator procedure to perform when an unexpected
error occurs. With SYSTEM, you specify that error handling is handled automatically.
If SUPRA ON ERROR is never specified, the default is automatic error handling (SYSTEM).
SUPRA RESET
The SUPRA RESET statement restarts a task.
The SUPRA RESET statement restarts a task.
See your SUPRA RDM COBOL or PL/I Programmer's Guide for details of the RESET function.
Syntax
SUPRA RESET
CA Easytrieve® Report Generator 11.6
SUPRA SIGN-OFF
The SUPRA SIGN-OFF statement informs the RDM that the user no longer wants access to the system.
The SUPRA SIGN-OFF statement informs the RDM that the user no longer wants access to the system.
Syntax
SUPRA SIGN-OFF
SUPRA SIGN-ON
The SUPRA SIGN-ON statement identifies a user to the RDM.
The SUPRA SIGN-ON statement identifies a user to the RDM.
Contents
Syntax
Parameters
user-name
User name is the user's name as defined in the directory. The user name can be an alphanumeric literal (enclosed in
apostrophes) or the name of a CA Easytrieve® Report Generator field that contains the user's name.
[password]
Password is the user's password as defined in the directory. This parameter is not required if the user was not assigned a
password. A password can be an alphanumeric literal (enclosed in apostrophes) or the name of a CA Easytrieve® Report
Generator field containing the password.
If you do not specify a password, a password is created that is composed of blanks.
For security reasons, you can accept a password from a JCL parameter rather than keep it in the CA Easytrieve® Report
Generator source.
Execution JCL
The following examples are of the JCL needed to execute the SUPRA preprocessor and the resulting CA Easytrieve Report
Generator program. The actual JCL you use depends on the way the two products were installed on your system. Review your
product and SUPRA documentation to determine the actual JCL to use.
z/OS JCL
This example is of the z/OS JCL required to execute a CA Easytrieve Report Generator program to access SUPRA.
Variable Description
ezt.library Name of the CA Easytrieve Report Generator load library.
CA Easytrieve® Report Generator 11.6
The first step, EZTPSPRA, is the SUPRA preprocessor. The CA Easytrieve Report Generator source statements, with the
SUPRA commands, are read from SYSIN.
The output file, PROGOUT, contains the non-SUPRA CA Easytrieve Report Generator statements and all statements
generated by the preprocessor as directed by SUPRA commands.
The system output file, SYSPRINT, contains a listing of the input file, and the status and error messages.
The second step, EZTPLUS, demonstrates how the output file from the preprocessor, PROGOUT, is used as input to the
execution of CA Easytrieve Report Generator. Due to the COND parameter of the EXEC statement, this step does not execute
if the preprocessor encounters any errors. If the input to the first step contains a PARM LINK statement, you could link edit
the object resulting from this second step for later execution.
Overriding the Default Directory Schema
If you use multiple schemas, you can override the default directory schema (specified during the interface installation process).
You can only do this, however, if the OVERRIDE parameter in the EZTPSPRA installation routine is set to YES. For more
information on the OVERRIDE parameter in the EZTPSPRA installation, see Activate the SUPRA Interface Option.
CA Easytrieve® Report Generator 11.6
To override the default directory schema, simply use a PARM during the execution of the preprocessor, as shown below:
SUPRA Statements
The examples that follow show how to use SUPRA statements to perform these tasks:
• Rename a Logical View
• Access a Logical View by Key
• Supply Password from JCL PARM
• Control Error Handling
• Retrieve Multiple Views
• Extract Data from a View
Rename a Logical View
This example shows how to use the user view name parameter when coding SUPRA statements. With a user view name, you
can rename the logical view for the purposes of your program. The user view name can be more descriptive or easier to code
than the logical view name. With a user view name, you can also create names that can otherwise be too long.
In this example the logical view name, CUSTOMER-ORDER-VIEW, is assigned the user view name, CUSTVIEW:
Once you define the user view name in the INCLUDE statement, code the other SUPRA statements so they refer to the user
view name, not to the logical view name.
Access a Logical View by Key
his example shows how to access a logical view by its key. Here, the STOCK view has two keys, STOCK-BRANCH and
STOCK-PRODUCT. This program reads the view, using the keys supplied in a card file.
Note: The START and FINISH PROCedures control the SIGN-ON and SIGN-OFF:
NULL START SIGNON FINISH SIGNOFF SUPRA GET CUSTOMER DO WHILE TIS-
FSI = '*' DISPLAY 'BRANCH=' CUSTOMER-BRANCH SUPRA GET CUSTOMER
END-DOSTOP*SIGNON. PROC IF PARM-DATA = SPACES . * PASSWORD WAS NOT
SUPPLIED DISPLAY '****** PASSWORD MISSING' ELSE PASSWORD =
PARM-DATA END-IFEND-PROC*SIGNOFF. PROC SUPRA SIGN-OFFEND-PROC
This program reads one logical record from the view. If errors occur, special error handling procedures are performed. These
procedures can refer to fields in TIS-CONTROL to help diagnose the error.
Note:
When you use a SUPRA ON ERROR PERFORM statement, no further automatic error handling is performed until you reset it
with the SYSTEM parameter.
Also, when you specify a procedure name, it remains in effect until you specify another. For example, if you do not code a
SUPRA ON ERROR statement before the SUPRA SIGN-OFF, ERROR-ON-GET is performed during a SIGN-OFF error.
In the previous example:
• If an error occurs during the SIGN-ON, the ERROR-ON-SIGN-ON procedure is performed.
• If an error occurs during the GET, the ERROR-ON-GET procedure is performed.
• If an error occurs during the SIGN-OFF, automatic error handling is performed. because the SYSTEM parameter is
included in the SUPRA ON ERROR statement.
Retrieve Multiple Views
This example shows how you can access multiple views in one CA Easytrieve Report Generator job activity. For each
INVOICE view record, the INVOICE-CUSTOMER field is used as the key to retrieve the CUSTOMER view record. If the
CUSTOMER record is found, a report is printed of the invoice and the customer's name and address:
When each CUSTOMER record is retrieved, the view's data area, defined as CUSTOMER, is moved and written to the
sequential output file, CUSTFILE.
See Generated Statements in SUPRA INCLUDE for details regarding the naming convention to use when you define the
various portions of the INCLUDEd view.
Note: When you use a SUPRA ON ERROR PERFORM statement, no further automatic error handling is performed until you
reset it with the SYSTEM parameter.
Installation
The installation procedures for the TOTAL Interface Option are described in the Installing section.
Communications Area
%TOTALCOM
The %TOTALCOM macro statement defines common data areas necessary for communication with TOTAL. Each of the
other macros reference one or more of the areas that are defined here.
Syntax
REALM literal-3
• literal-1
Literal-1 sets the value of an eight-character field (TOTALTASK) used by %SINON and %SINOF. The default is
EASYPLUS.
• literal-2
Literal-2 sets the value for the list delimiter (TOTALEND). Acceptable values are END and RLSE. The default is RLSE.
• literal-3
Literal-3 sets the size of the REALM= parameter (TOTALREALM) used by %OPENX and %CLOSX. The value of
literal-3 is established by the formula:
10 + (#files x 12)
where #files is the maximum number of files opened or closed on any single %OPENX or %CLOSX statement. The default
is 130 (for a maximum of 10 files).
The fields that are defined by %TOTALCOM are:
TOTALCMND = 'OPENX'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALREALM, +
TOTALEND)
REALMINDEX = 0
CA Easytrieve® Report Generator 11.6
If any of the files that are named in TOTALREALM fail to open properly, the name and status of the files are printed and
execution of the job is stopped.
TOTAL Macro Facility
The macros described in the articles that follow facilitate the generation of the appropriate calls to TOTAL.
• literal-1
Four-character name of the file to which the record is added.
• field-1
Name of the field containing the record's control key.
• field-2
Name of the field containing the data list of elements to add.
• field-3
Name of the field containing the data record to add to the file.
%ADDM Macro-Generated Statements
The generated statements are:
TOTALCMND = 'ADD-M'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTAL CMND, +
TOTALSTATUS, +
TOTAL FILE, +
field-1, +
CA Easytrieve® Report Generator 11.6
field-2, +
field-3, +
TOTALEND)
• literal-1
Determines the specific type of variable record addition. Valid values for literal-1 are:
• literal-2
Four-character name of the file to which the record is added.
• field-1
Name of a field containing the four-character reference, for example, LK01.
• literal-3
Eight-character linkpath, that is, ABCDLK01.
• field-2
Name of the field containing the record's control key.
• field-3
Name of the field containing the data list of elements to add.
• field-4
Name of the field containing the data record to add to the file.
%ADDV Macro-Generated Statements
The generated statements are:
TOTALCMND = 'literal-1'
TOTALFILE = 'literal-2'
TOTALREF = field-1
TOTALLINK = 'literal-3'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
CA Easytrieve® Report Generator 11.6
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%CBLCNVRT
Converts COBOL data definitions to their equivalent.
Converts COBOL data definitions to their CA Easytrieve® Report Generator equivalent.
The following are used internally by the CBLCNVRT macro: CBLDI122, CBLDI212, CBLDI320, CBLDI341, CBLDII,
CBLDII12, CBLDII13, CBLDMPII, CBLDMPVS, CBLDVS, CBLII122, CBLII212, CBLII320, CBLII341, CBLIII,
CBLIII12, CBLIII13, CBLINTII, CBLINTVS, CBLIVS, CBLSI122, CBLSI212, CBLSI320, CBLSI341, CBLSII, CBLSII12,
CBLSII13, CBLSRCII, CBLSRCVS, and CBLSVS.
Note:
For more information about using this macro, see the CBLCNVRD member in hlq.CBAAMAC. For releases before Release
11.6, see the CBLCNVRD member in hlq.CAIMAC.
%CLOSX
TOTALREALMM = 'COMP'
TOTALCMND = 'CLOSX'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALREALM, +
TOTALEND)
%CONCAT
Contents
Contents
Takes two fields and concatenates them into one, with variable spacing between the fields. The result is placed in the first field.
CA Easytrieve® Report Generator 11.6
Syntax
• field-1
Name of the original field and where the concatenated result will be returned.
• space
Amount of blank space desired between field-1 and field-2.
• field-2
Field to be concatenated to field-1.
%CONVAE
Contents
Contents
Converts ASCII alphanumeric characters to their EBCDIC equivalent. CONVAE is an inline routine that you can use with
other CA Easytrieve® Report Generator routines. The inline design of CONVAE reduces execution time and reduces
requirements for temporary or permanent storage space. You can also use CONVAE to create a permanent file of converted
data.
CONVAE and CONVEA use the CV and CVDBNAME macros internally.
Syntax
• [DBFILE]
Specify this optional parameter only for database use of CONVAE. Specify only the literal DBFILE, not the name of the
active input file.
• [STARTPOS identifier]
This optional parameter specifies the starting position for the conversion process. The identifier must be a previously
defined field.
Conversion takes place in the active input file starting at the position defined by STARTPOS and continuing for the length
specified by the length parameter.
The default value for STARTPOS is the first byte of the active input file. This means that when using the default value the
conversion begins with the first byte of the active input file.
The requirements for specifying STARTPOS are different when you use CONVAE in a database application. In this case
the STARTPOS parameter is no longer optional.it is a required parameter.
• [LENGTH value]
This optional parameter specifies the length, or number of bytes, that you want to convert. The conversion starts at the
position that STARTPOS defines and continues for the length that the LENGTH parameter specifies. The default value is
the record length of the current record. A valid value is an actual numeric value or the name of a field containing a numeric
value. The value that you specify for LENGTH plus the numeric value of STARTPOS must be less than or equal to the
length of the current record.
%CONVEA
Contents
Contents
The CONVEA macro converts EBCDIC alphanumeric characters to their ASCII equivalent. CONVEA is an inline routine
that you can use with other CA Easytrieve® Report Generator routines. The inline design of CONVEA reduces execution time
and reduces requirements for temporary or permanent storage space. You can also use CONVEA to create a permanent file of
converted data.
CA Easytrieve® Report Generator 11.6
• [DBFILE]
Specify this optional parameter only for database use of CONVEA. Specify only the literal DBFILE, not the name of the
active input file.
• [STARTPOS identifier]
This optional parameter specifies the starting position for the conversion process. The identifier must be a previously
defined field.
Conversion takes place in the active input file starting at the position defined by STARTPOS and continuing for the length
specified by the length parameter means that when using the default value the conversion begins with the first byte of the
active input file.
The requirements for specifying STARTPOS are different when you use CONVEA in a database application. In this case
the STARTPOS parameter is no longer optional, it is a required parameter.
• [LENGTH value]
This optional parameter specifies the length, or number of bytes, that you want to convert. The conversion starts at the
position that STARTPOS defines and continues for the length that the LENGTH parameter specifies. The default value is
the record length of the current record. A valid value is an actual numeric value or the name of a field containing a numeric
value. The value that you specify for LENGTH plus the numeric value of STARTPOS must be less than or equal to the
length of the current record.
%DATECALC
Contents
Contents
The DATECALC macro adds or subtracts a given number of days from the date specified in a field and writes the resulting
date to a second field.
Syntax
• [date-1]
Specify the name of the field containing the date to which a given number of days are to be added or subtracted. The date in
this field must be in the format specified by format1. A valid name is any previously defined field.
• [format-1]
Specify the format of the date1 field. This is a literal description of pairs of letters. The letters indicate positions as follows:
MM = month
DD = day
YY = year
CC = century
The value of date1 is not checked for a valid date with format1. However, CC always maintains the value specified in
accordance with the THRESHOLD parameter. If you want date validation, use the DATEVAL routine before using
DATECALC. The only valid Julian format is YYDDD. The following are some, but not all, of the valid formats:
MMDDYY
MMDDCCYY
YYMMDD
YYDDD (Julian)
• [PLUS|MINUS]
Specify whether the value of the days parameter is added to (PLUS) or subtracted from (MINUS) date1.
CA Easytrieve® Report Generator 11.6
Note: DATECALC performs an arithmetic calculation. If you specify the PLUS keyword, and the value of the days is
negative, the value is subtracted.Conversely, if you specify MINUS, and days is negative, the value is added.
• [days]
Specify a numeric literal or a field that contains the value to be added or subtracted.
• [date-2]
Specify the name of the field to which the resulting date is written. The date is written using the format specified by the
format2 parameter. A valid name is any previously defined field.
• [format-2]
Specify the format for date2.
• [THRESHOLD]
Supplied in the century format (CC) in the date. Specify a value that establishes the upper end of a one-hundred-year range
in the 20th and 21st centuries used to control the CC portion of generated dates.
General rules for specifying THRESHOLD values are:
• The THRESHOLD value is ignored if you provide a century value (CC).
• If the dates to be generated do not exceed the year 2000, specify the THRESHOLD default value of 0. This causes all
dates to have a range of 1901 through 2000.
• If the dates exceed the year 2000, choose a THRESHOLD high enough to generate correct dates in the 21st century, but
not so high as to convert dates from the 20th century to the 21st century.
• When dates to be generated do not involve calculations for century, specify the THRESHOLD default value of 0.
• Valid values for THRESHOLD are 0 through 99.
For example, if THRESHOLD is 40, the upper boundary of the range is set to 2040, and the lower boundary is 1941. When
converting YY to CCYY, each year is assigned a two-position century based on the range established by THRESHOLD. In
this example, if year is 52, century is 19; if year is 21, century is 20.
It is important that the THRESHOLD value be correct for the range of dates to be generated. For example, if DATECALC
is invoked to process dates between the years 1949 and 1952, and THRESHOLD is 50, the years 1949 and 1950 become
2049 and 2050, while the years 1951 and 1952 remain 1951 and 1952. In this respect, the YY (year) portion of the date
controls the CC (century) portion in accordance with the THRESHOLD value.
%DATECONV
Contents
Contents
The DATECONV macro converts a date in one format to any other date format. For example, you can convert month-day-year
to year-month-day, Julian to Gregorian, and similar date conversions. Using non-numeric data or a zero for date fields results
in an error.
Syntax
• [date-1]
Specify the name of the field containing the date to be converted. The date in this field must be in the format specified by
format1. The name of any previously defined numeric field is valid.
• [format-1]
Specify the format of the date1 field. Format1 is a literal description of pairs of letters. The letters indicate positions as
follows:
MM = month
DD = day
YY = year
CC = century
The value of date1 is not checked for a valid date with the specified format. However, CC always maintains the value
specified in accordance with the THRESHOLD parameter. If you want date validation, use the DATEVAL routine before
using DATECONV.
The following are some, but not all, of the valid formats:
MMDDYY
CA Easytrieve® Report Generator 11.6
MMDDCCYY
YYMMDD
YYDDD (Julian)
Note: For non-Julian dates, format1 must include the values MM, DD, and YY (in any order). The only valid Julian format
is YYDDD.
• [date-2]
Specify the name of the field to which the converted date will be written. The date is written in the format specified by
format2. A valid name is any previously defined field.
• [format-2]
Specify the format for the date-2 field.
• [THRESHOLD]
The THRESHOLD parameter is used to determine the century value if it is not supplied in the century format (CC) in
the date. Specify a value that establishes the upper end of a one-hundred-year range in the 20th and 21st centuries used to
control the CC portion of generated dates.
General rules for specifying THRESHOLD values are:
• The THRESHOLD value is ignored if you provide a century value (CC).
• If the dates to be generated do not exceed the year 2000, specify the THRESHOLD default value of 0. This causes all
dates to have a range of 1901 through 2000.
• If the dates exceed the year 2000, choose a THRESHOLD high enough to generate correct dates in the 21st century, but
not so high as to convert dates from the 20th century to the 21st century.
• When dates to be generated do not involve calculations for century, specify the THRESHOLD default value of 0.
• Valid values for THRESHOLD are 0 through 99.
For example, if THRESHOLD is 40, the upper boundary of the range is set to 2040, and the lower boundary is 1941. When
converting YY to CCYY, each year is assigned a two-position century based on the range established by THRESHOLD. In
this example, if year is 52, century is 19; if year is 21, century is 20.
It is important that the THRESHOLD value be correct for the range of dates to be generated. For example, if DATECONV
is invoked to process dates between the years 1949 and 1952, and THRESHOLD is 50, the years 1949 and 1950 become
2049 and 2050, while the years 1951 and 1952 remain 1951 and 1952. In this respect, the YY (year) portion of the date
controls the CC (century) portion in accordance with the THRESHOLD value.
%DATEVAL
Contents
Contents
The DATEVAL macro examines the content of a specified date field for a valid date in accordance with a specified date
format. If the date field contains a valid date, the field DATEVAL-FLAG is set to the value YES. If the date field is invalid,
the DATEVAL-FLAG is set to the value NO.
Syntax
• [field]
Specify the name of the field that contains the date being validated. Valid names include any previously defined numeric
field.
• [format]
The format for the comparison is a literal description of pairs of letters. The letters indicate positions as follows:
MM = month
DD = day
YY = year
CC = century
You can specify the letter pairs in any order. YY must be specified whenever you specify CC. The only valid Julian format
is YYDDD. The following are some, but not all, of the valid formats:
MMDDYY
MMDDCCYY
YYMMDD
CA Easytrieve® Report Generator 11.6
YYDDD (Julian)
• [THRESHOLD]
The THRESHOLD parameter is used to determine the century value if it is not supplied in the century format (CC) in
the date. Specify a value that establishes the upper end of a one-hundred-year range in the 20th and 21st centuries used to
control the CC portion of generated dates.
General rules for specifying THRESHOLD values are:
• The THRESHOLD value is ignored if you provide a century value (CC).
• If the dates to be generated do not exceed the year 2000, specify the THRESHOLD default value of 0. This causes all
dates to have a range of 1901 through 2000.
• If the dates exceed the year 2000, choose a THRESHOLD high enough to generate correct dates in the 21st century, but
not so high as to convert dates from the 20th century to the 21st century.
• When dates to be generated do not involve calculations for century, specify the THRESHOLD default value of 0.
• Valid values for THRESHOLD are 0 through 99.
For example, if THRESHOLD is 40, the upper boundary of the range is set to 2040, and the lower boundary is 1941. When
converting YY to CCYY, each year is assigned a two-position century based on the range established by THRESHOLD. In
this example, if year is 52, century is 19; if year is 21, century is 20.
It is important that the THRESHOLD value be correct for the range of dates to be generated. For example, if DATEVAL is
invoked to process dates between the years 1949 and 1952, and THRESHOLD is 50, the years 1949 and 1950 become 2049
and 2050, while the years 1951 and 1952 remain 1951 and 1952. In this respect, the YY (year) portion of the date controls
the CC (century) portion in accordance with the THRESHOLD value.
%DELM
Contents
Contents
Use the %DELM macro to logically delete the master record which is identified by the control key.
Syntax
• literal-1
Four-character name of the file from which the record is deleted.
• field-1
Name of the field containing the record's control key.
• field-2
Name of the field containing the data list of elements to delete.
• field-3
Name of the field containing the file's data.
%DELM Macro-Generated Statements
The generated statements are:
TOTALCMND = 'DEL-M'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
CA Easytrieve® Report Generator 11.6
field-3, +
TOTALEND)
%DELVD
Contents
Contents
Use the %DELVD macro to logically delete the variable record identified by its reference point.
Syntax
• literal-1
Four-character name of the file from which the record is deleted.
• field-1
Name of a field containing the four-character reference point.
• literal-2
Eight-character linkpath.
• field-2
Name of the field containing the record's control key.
• field-3
Name of the field containing the data list of elements to delete.
• field-4
Name of the field containing the file's data.
%DELVD Macro-Generated Statements
The generated statements are:
TOTALCMND = 'DELVD'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
CA Easytrieve® Report Generator 11.6
%DFNTOTF
Contents
Contents
Use the %DFNTOTF macro to initialize the REALM= (TOTALREALM) values.
Syntax
• literal-1
Four-character name of the file.
• literal-2
File's mode.
%DFNTOTF Macro-Generated Statements
The generated statements are:
TOTALREALMF = 'literal-1'
TOTALREALMM = 'literal-2'
TOTALREALMS = '****'
REALMINDEX = REALMINDEX + 12
TOTALREALMK = TOTALENDP
%EZSSID
Contents
Contents
An Assembler macro which generates:
• A table used to map an SSID to a PAN/SQL module to invoke for that SSID.
• An Assembler DSECT of the above table.
Syntax
%EZSSID SSID='ssid' PSMOD='psmod' DSECT={YES|NO}
• [ssid]
This is the DB2 SSID used to identify the correct PAN/SQL load module. It must be a value whose length is less-than-or-
equal 8.
• [psmod]
This is the 1-character suffux of PAN/SQL load modules to invoke for the above SSID. It must be set to either a '2', '3', '4',
or '5'.
• [dsect]
If YES is specified for this parm, the macro generates just the DSECT of the SSID-PAN/SQL Table that is built when
DSECT is NOT specified. The intended user of the DSECT parm is the Easytreive runtime.
%EZTINI
Contents
CA Easytrieve® Report Generator 11.6
Contents
An Assembler macro which generates the Assembler constants that are assembled into the EZTINI load module. Also generate
a DSECT of the EZTINI contents.
Syntax
%EZTINI EZOPTBL='ezoptbl' DSECT={YES|NO}
• [ezoptbl]
DSN of CA Easytrieve® Report Generator options table. This indicates that the macro should generate the EZOPTBL entry
in the EZTINI file.
• [DSECT]
Indicates whether or not to generate the EZTINI DSECT.
%FINDX
Contents
Contents
Use the %FINDX macro to search a file and retrieve records that satisfy the search argument.
Syntax
• literal-1
Four-character name of the file to search.
• field-1
Name of the field containing the position controlling qualifier data.
• field-2
Name of the field containing the argument list.
• field-3
Name of the field containing the data list of elements to retrieve.
• field-4
Name of the field into which the data is to retrieve.
%FINDX Macro-Generated Statements
The generated statements are:
TOTALCMND = 'FINDX'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
field-4, +
CA Easytrieve® Report Generator 11.6
TOTALEND)
%GETCALEN
Contents
Contents
Converts an integer into a date in the format CCYYMMDD.
Syntax
• [date-in]
Integer value that represents a Julian day number.
• [date-out]
Returned date in the format CCYYMMDD.
%GETJULI
Contents
Contents
Converts a date in the format CCYYMMDD to an integer representing a Julian day number.
Syntax
• [date-in]
Calendar date in the format CCYYMMDD.
• [date-out]
Returned integer value that represents a Julian day number.
%RDNXT
Contents
Contents
The %RDNXT macro serially retrieves either master or variable file records.
Syntax
• literal-1
Four-character name of the file to read.
• field-1
Name of the field containing the position controlling qualifier data.
• field-2
CA Easytrieve® Report Generator 11.6
TOTALCMND = 'RDNXT'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
%OPENX
Contents
Contents
Use the %OPENX macro to open one or more files. Field TOTALREALM must be set with the correct realm value before the
execution of %OPENX.
Syntax
%OPENX
%READD
Contents
Contents
Use the %READD macro to directly retrieve the record identified by the reference point.
Syntax
• literal-1
Four-character name of the file from which the record is retrieved.
• field-1
Name of a field containing the four-character reference point.
• literal-2
Eight-character linkpath.
CA Easytrieve® Report Generator 11.6
• field-2
Name of the field containing the record's control key.
• field-3
Name of the field containing the data list of elements to retrieve.
• field-4
Name of the field to receive the data.
%READD Macro-Generated Statements
The generated statements are:
TOTALCMND = 'READD'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%READM
Contents
Contents
Use the %READM macro to retrieve the master record identified by the control key.
Syntax
• literal-1
Four-character name of the file from which the record is retrieved.
• field-1
Name of the field containing the record's control key.
• field-2
Name of the field containing the data list of elements to retrieve.
• field-3
Name of the field containing the file's data.
%READM Macro-Generated Statements
CA Easytrieve® Report Generator 11.6
TOTALCMND = 'READM'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
%READR
Contents
Contents
Use the %READR macro to retrieve records by following the chain of back pointers.
Syntax
• literal-1
Four-character name of the file from which the record is retrieved.
• field-1
Name of a field containing the four-character reference point.
• literal-2
Eight-character linkpath.
• field-2
Name of the field containing the record's control key.
• field-3
Name of the field containing the data list of elements to retrieve.
• field-4
Name of the field to receive the data.
%READR Macro-Generated Statements
The generated statements are:
TOTALCMND = 'READR'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
CA Easytrieve® Report Generator 11.6
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%READV
Contents
Contents
Use the %READV macro to retrieve variable file records by following the chain of forward pointers.
Syntax
• literal-1
Four-character name of the file from which the record is retrieved.
• field-1
Name of a field containing the four-character reference point.
• literal-2
Eight-character linkpath.
• field-2
Name of the field containing the record's control key.
• field-3
Name of the field containing the data list of elements to retrieve.
• field-4
Name of the field to receive the data.
%READV Macro-Generated Statements
The generated statements are:
TOTALCMND = 'READV'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
CA Easytrieve® Report Generator 11.6
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%RGHTJUST
Contents
Contents
Right justify a field's contents.
Syntax
• [field-name]
The name of the field to be right-justified.
• [length]
The length of the field to be right-justified.
%SINOF
Contents
Contents
Use the %SINOF macro to terminate task activities.
Syntax
%SINOF
TOTALCMND = 'SINOF'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALTASK, +
TOTALEND)
%SINON
Contents
Contents
Use the %SINON macro to initialize task activities.
CA Easytrieve® Report Generator 11.6
Syntax
• literal-1
Access function. Valid values are RDONLY and UPDATE.
• literal-2
Eight-character DBMOD name.
• field-1
Name of the field containing the logging options.
%SINON Generated Statements
The generated statements are:
TOTALCMND = 'SINON'
TOTALDBMOD = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
'literal-1', +
TOTALDBMOD, +
TOTALTASK, +
field-1, +
TOTALEND)
IF TOTALSTATUS NE '****'
DISPLAY 'SIGN-ON ERROR', TOTALSTATUS
STOP
END-IF
TOTALREALM = 'REALM = '
REALMINDEX = 0
%VERNUMP
Contents
Contents
Validates user supplied parameters for valid numeric data.
Syntax
%VERNUMP [param]
• [param]
The parameter field to be verified.
%WRITM
Contents
CA Easytrieve® Report Generator 11.6
Contents
Use the %WRITM macro to update master file records identified by the control key.
Syntax
• literal-1
Four-character name of the file to update.
• field-1
Name of the field containing the record's control key.
• field-2
Name of the field containing the data list of elements to update.
• field-3
Name of the field containing the file's data.
%WRITM Macro-Generated Statements
The generated statements are:
TOTALCMND = 'WRITM'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
%WRITV
Contents
Contents
Use the %WRITV macro to update variable file records.
Syntax
• literal-1
Literal-1 is the four-character name of the file to update.
• field-1
Field-1 is the name of a field containing the four-character reference point.
CA Easytrieve® Report Generator 11.6
• literal-2
Literal-2 is the eight-character link path.
• field-2
Field-2 is the name of the field containing the record's control key.
• field-3
Field-3 is the name of the field containing the data list of elements to update.
• field-4
Field-4 is the name of the field containing the data.
%WRITV Macro-Generated Statements
The generated statements are:
TOTALCMND = 'WRITV'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
*
%TOTALCOM
*
FILE KEYS, CARD
CARD-KEY 1 7 A
*
*
DEFINE INVN-AREA W 100 A
DEFINE INVN-KEY INVN-AREA 7 A
DEFINE INVN-NAME INVN-AREA +7 20 A
DEFINE INVN-CODE INVN-AREA +27 1 A
*
DEFINE BVIT-AREA W 100 A
DEFINE BVIT-COST BVIT-AREA 4 P 2
DEFINE BVIT-AMT BVIT-AREA +4 4 P 0
DEFINE BVIT-RATE BVIT-AREA +8 4 P 2
CA Easytrieve® Report Generator 11.6
*
DEFINE INVN-ELEM W 20 A, VALUE 'INVNCTRL+
INVNDATA+
END.'
*
DEFINE MY-REF W 4 A
*
DEFINE BVIT-ELEM W 12 A, VALUE 'BVIDATA+
END.'
*
DEFINE SINON-OPTIONS W 20 A, VALUE 'LOGOPTS=N,+
END.'
*
JOB INPUT(KEYS), START(SIGN-ON), FINISH(SIGN-OFF)
*
INVN-KEY = CARD-KEY. * CONTROL KEY
%READM INVN, INVN-KEY, INVN-ELEM, INVN-AREA. * READ MASTER
PERFORM STATUS-CHECK. * ERROR TEST
READ-VAR. * READ VARIABLE
MY-REF = 'LK01'
%READV BVIT, MY-REF, 'INVNLK01' , INVN-KEY, +
BVIT-ELEM, BVIT-AREA
PERFORM STATUS-CHECK. * ERROR TEST
IF TOTALREF NE TOTALENDP
GOTO READ-VAR
END-IF
*
PRINT
*
STATUS-CHECK. PROC. * TEST FOR SUCCESSFUL CALL
IF TOTALSTATUS NE '****'. * IF NOT SUCCESSFUL
DISPLAY 'UNSUCCESSFUL TOTAL COMMAND=', TOTALCMND. +
' ON FILE=', TOTALFILE, +
' STATUS=', TOTALSTATUS
STOP. * ABORT THE JOB
END-IF
*
SIGN-ON. PROC. * INITIAL CALL TO TOTAL
%SINON RDONLY, BASE127, SINON-OPTIONS
%DFNTOTF INVN, READ
%DFNTOTF BVIT, READ
%OPENX
END-PROC
*
SIGN-OFF. PROC. * WRAP-UP
%CLOSX
%SINOF. * FINAL CALL TO TOTAL
END-PROC
*
CA Easytrieve® Report Generator 11.6
REPORT
SEQUENCE INVN-KEY
CONTROL INVN-KEY
TITLE 'INVENTORY CONTROL LISTING'
LINE INVN-KEY, INVN-NAME, INVN-CODE, +
BVIT-COST, BVIT-AMT, BVIT-RATE
8 Language Reference
Language reference for developers.
This section includes information about CA Easytrieve Report Generator character sets, statements, symbols and reserved
words, and converting from older versions to the current version.
Documentation Conventions
The following conventions are used throughout this section 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® Report
Generator keyword, or within text descriptions, indicate a
name or field used in a program example.
lowercase italics Lowercase italics represent variable information in statement
syntax.
Syntax Rules
The free form English language structure of CA Easytrieve® Report Generator makes it easy for you to develop an efficient,
flexible programming style. To avoid programming errors, follow the simple syntax rules described for each statement in this
section.
Character Sets
ezt supports both single-byte character sets (SBCS) and double byte character sets (DBCS). MIXED
format is data that contains both SBCS and DBCS formatted data. SBCS data is limited to either EBCDIC
or ASCII depending on the platform. DBCS data is currently supported only in z/OS.
CA Easytrieve Report Generator supports both single-byte character sets (SBCS) and double byte character sets (DBCS).
MIXED format is data that contains both SBCS and DBCS formatted data. SBCS data is limited to either EBCDIC or ASCII
depending on the platform. DBCS data is currently supported only in z/OS.
Note: Report processing is limited to EBCDIC and ASCII data format for standard reports and to any data format for extended
reports. Identifiers (for example, field names or labels) can contain DBCS and MIXED data as part of the name. MIXED data
format is supported only to the extent that such data is allowed. The product provides no additional formatting based on the
alignment of the DBCS portion of the data. DBCS data is not supported in the UNIX or Windows environments.
EBCDIC and DBCS
CA Easytrieve® Report Generator 11.6
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 Report Generator supports both character sets, based on
the following assumptions and rules:
• All the syntax rules that are described in the Statement Overview section apply to EBCDIC data only. DBCS data in the
program statement area is not processed for such things as continuation characters, delimiters, words, and identifiers.
• Unless otherwise noted, source statements are expected to contain character data. Hexadecimal codes embedded into
statements are not supported as they may cause problems reading and printing the source program.
• A DBCS character occupies two bytes in storage. If not identified as DBCS characters, these same two bytes would be
processed as a pair of single-byte EBCDIC characters. To distinguish EBCDIC data from DBCS data, CA Easytrieve uses
a shift code system. This system, called the wrapping shift code system, takes the form of two codes -- one code preceding
and the second following the DBCS data. These codes wrap or enclose the DBCS data, thereby identifying the beginning
and end of DBCS data. The term that is associated with the code that precedes the DBCS data is a shift-out code (shift-out
of EBCDIC). The code that delimits (separates) the DBCS data is called a shift-in code (shift-in to EBCDIC). These codes
can be one or two bytes in length.
The following diagram illustrates the use of the wrapping shift code system:
• A shift code is a special one- or two-byte character that is contained in the program statement area. Shift code values are
defined in the DBCS Options module. For more information about the Options module, see the Using section. Each shift
code value uniquely identifies the DBCS code system of the data. If the system cannot be uniquely identified, a default is
assumed. You can alter this default at compile time by using the PARM statement. For more information, see the PARM
Statement.
• In the statement area, shift codes are required to distinguish DBCS data from EBCDIC data. When a CA Easytrieve Report
Generator word has been identified, the word is known to be of EBCDIC, DBCS, or MIXED data format. Shift codes
are maintained for MIXED words only. The compiler identifies the statement containing the word and, when necessary,
performs the required processing to remove the shift codes and convert EBCDIC data.
• Once a shift-out code is found in a word, the data that follows is processed as DBCS data if any one of the following
actions occurs:
• The end statement area is reached before the related shift-in code is found.
• The shift-in code is found but it is not on a double byte boundary.
CA Easytrieve® Report Generator 11.6
Statements
This article contains an alphabetical list of ezt statements and a summary of the statements, categorized
by function.
This article contains an alphabetical list of CA Easytrieve Report Generator statements and a summary of the statements,
categorized by function.
Alphabetical Summary of Statements
The following table describes the statements that you can use in CA Easytrieve Report Generator programs.
Statement Description
% (percent) Invoke a macro
* (asterisk) 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.
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 an 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.
CA Easytrieve® Report Generator 11.6
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.
PROC Initiate a CA Easytrieve Report Generator procedure.
• READ
• RELEASE
• ROLLBACK
• SELECT (File-based SQL)
• SELECT (Non-file SQL)
• SELECT (Sort selection)
• SORT
• UPDATE
• WRITE
Screen Processing
Note:
Screen processing commands are supported only with Online versions of the product.
• AFTER-SCREEN
• BEFORE-SCREEN
• CURSOR
• DEFAULT
• EXIT
• INITIATION
• KEY
• MESSAGE
• REFRESH
• REPEAT
• RESHOW
• ROW
• SCREEN
• SET
• TERMINATION
• TITLE
Report Processing
• AFTER-BREAK
• AFTER-LINE
• BEFORE-BREAK
• BEFORE-LINE
• CONTROL
• ENDPAGE
• HEADING
• LINE
• PRINT
• REPORT
• REPORT-INPUT
• SELECT
• SEQUENCE
• SUM
• TERMINATION
• TITLE
Generalized Programming
• PARM
• PROGRAM
Inter-Program Execution
• CALL
• LINK
• TRANSFER
CA Easytrieve® Report Generator 11.6
• IDMS FIND
• IDMS FINISH
• IDMS GET
• IDMS IF
• IDMS KEEP
• IDMS MODIFY
• IDMS OBTAIN
• IDMS READY
• IDMS ROLLBACK
• IDMS STORE
• LOGICAL-RECORD
• RECORD
• RETRIEVE
• SELECT (CA IDMS)
IMS/DLI Database Processing
• DLI
Statement Overview
This article includes the following information about statements for ezt programs:
This article includes the following information about statements for CA Easytrieve Report Generator programs:
Statement Area
All source statements are records of 80 characters each. A system installation option establishes a statement area within the 80
available positions. The default statement area is in columns 1 to 72.
For example, although positions 1 to 80 are available, ‘SCANCOLS 7, SCANCOLE 72’ establishes the statement area as
positions 7 to 72. This allows for optional data (for example, sequence numbers and program identifiers) to be entered on the
record, but still be ignored by CA Easytrieve Report Generator. The complete record is always printed on the statement listing.
7 7 8
1....6 7......................................2 3......0
001000 PRGMNAME
Multiple Statements
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 statements are on one record:
Comments
When the first non-blank character of a statement is an asterisk (*), the remainder of that record is a comment statement that
is ignored by the CA Easytrieve compiler. You can use comment statements at any place within a program, except within a
continued statement. A statement containing all blanks is treated as a comment.
CA Easytrieve® Report Generator 11.6
To place a comment on the same line as a statement, code a period (.), one or more spaces, an asterisk (*), and then the
comment:
Continuations
The last non-blank character of a statement terminates the statement, unless that character is a - (minus) or a + (plus). The -
indicates that the statement continues at the start of the next statement area. The + indicates that the statement continues with
the first non-blank character in the next statement area. The difference between - and + is important only when continuing
words. Continuation between words is the same for both. The following continued statements produce identical results:
FIELD-
NAME W 6 A + VALUE
----------------------------
FIELD-
NAME W 6 A - VALUE
+ 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 '[DBD
Delimiter Description
space The basic delimiter within each statement.
' single quote Encloses literals that are alphanumeric.
. period followed Terminates a statement.
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.
= equal sign Used as a delimiter for assignment and comparison
statements.
CA Easytrieve® Report Generator 11.6
Note:
At least one space must follow all delimiters except for the '(' (left parenthesis), and the ':' (colon). Additionally, the equal sign
'=' can be coded with or without surrounding spaces.
Examples of the words RECORD-COUNT and NUM with various delimiters:
RECORD-COUNT=10
IF RECORD-COUNT=10
NUM = 20
IF NUM = 20
Keywords
Keywords are words that have specific meaning to CA Easytrieve. Some keywords are reserved words. You can use non-
reserved keywords in the appropriate context as field names, whereas reserved words cannot be used as field names. For more
information about keywords and reserved words, see Symbols and Reserved Words.
Multiple Parameters
You must enclose multiple parameters within parentheses to indicate group relationships. If parentheses are not used, only one
parameter is assumed. The following example is a CA Easytrieve statement with multiple parameters:
Field Names
Field names are composed of a combination of not more than 128 characters as follows:
• Alphabetic characters, A to Z, lowercase, and uppercase
• Decimal digits 0 through 9
• All special characters, except delimiters
The first character of a field name must be an alphabetic character, a decimal digit, or a national character (#, @, $). In
addition, a field name must contain at least one alphabetic or special character to distinguish the field name from a number.
All working storage field names must be unique, and so must 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:
Labels
CA Easytrieve® Report Generator 11.6
Labels identify specific PROGRAMs, JOBs, PROCedures, REPORTs, SCREENs, and statements. Labels can be 128
characters long, can contain any character other than a delimiter, and can begin with A to Z, 0 through 9, or a national
character (#, @, $); they cannot consist of all numeric characters. Labels can contain DBCS characters.
Identifiers
Identifiers are words that name things (for example, field names or statement labels) in CA Easytrieve. Identifiers cannot
contain these delimiters:
• comma {,}
• single quote {'}
• left parenthesis {(}
• right parenthesis {)}
• colon {:}
Arithmetic Operators
CA Easytrieve arithmetic expressions use the following arithmetic operators:
• multiplication (*)
• division (/)
• addition (+)
• subtraction (-)
The arithmetic operator must lie between two spaces.
Numeric Literals
Numeric literals can contain 18-numeric digits (characters 0 through 9). You can indicate the algebraic sign of a numeric literal
by attaching a + (plus) or a - (minus) prefix to the numeral. Also, you can use a single decimal point to indicate a maximum
precision of up to 18 decimal positions. The following examples are valid numeric literals:
123+123-123.4321
Alphanumeric Literals
Alphanumeric literals are words that are enclosed within single quotes, and can be 254 characters long. For more information,
see Literal and Data Formatting Rules.
Font Numbers
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
%macro-name positional-parameters...keyword-parameters
• %macro-name
Specifies a previously stored macro that you want to invoke. Macro names are limited to eight characters.
Note:
For CA Panvalet and CA Endevor libraries the macro name can be from 1 to 10 characters in length.
• positional-parameters
Specifies values of positional parameters in the macro. You must supply positional parameters before any keyword
parameters.
• keyword-parameters
Specifies both the keyword and values of keyword parameters in the macro.
* (Comment) Statement
The * (comment) statement lets you document comments in a program. When the first non-blank
character of a statement is an asterisk (*), the remainder of that record is a comment statement. 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.
The * (comment) statement lets you document comments in a program. When the first non-blank character of a statement
is an asterisk (*), the remainder of that record is a comment statement. 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.
If you code comment statements within a SCREEN declaration and maintain the screen with the CA Easytrieve® Report
Generator Online Report Generator Screen Painter, all comment statements are moved to the top of the declaration.
This statement has the following format:
* comment-text
• comment-text
Specifies the text that you want to enter as comment in the program.
ACCESS Statement
The ACCESS statement lets you access a macro secured against unauthorized access in CA Panvalet or
VSAM.
The ACCESS statement lets you access a macro secured against unauthorized access in CA Panvalet or VSAM.
For both CA Panvalet and VSAM macro storage access methods, the ACCESS record can appear anywhere in the CA
Easytrieve® Report Generator 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® Report Generator does not print the
ACCESS record.
This statement has the following format:
CA Panvalet:
VSAM:
• 'eight-byte code'
Specifies a security access code that applies to an individual CA Panvalet library member. You must supply the security
access code on an ACCESS record before CA Easytrieve® Report Generator can retrieve a secured member.
• 'eight-byte password'
Specifies a VSAM password. VSAM provides the capability of protecting the macro library by using this password. Before
CA Easytrieve® Report Generator can retrieve a macro from a secured library, you must supply the library password on an
ACCESS record prior to the first macro call.
AFTER-BREAK. PROC
• AFTER-BREAK. PROC
Specifies a REPORT procedure that is invoked following the printing of summary lines for a control break.
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 +
CA Easytrieve® Report Generator 11.6
AFTER-BREAK. PROC
IF LEVEL EQ 2
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
2222.09
AFTER-LINE. PROC
Example
The following example shows how an AFTER-LINE procedure can cause information to be printed following a detail line of a
report:
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 +
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
END-IF
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
IL 1444.32
TX 777.77
CA Easytrieve® Report Generator 11.6
2222.09
AFTER-SCREEN. PROC
Example
AFTER-SCREEN. PROC
GET PERSNL
IF EOF PERSNL
EXIT
END-IF
END-PROC
Assignment Statement
The assignment statement establishes a value in a field. The value can be a copy of the data in another
field or literal, or it can be the result of an arithmetic or logical expression evaluation.
The assignment statement establishes a value in a field. The value can be a copy of the data in another field or literal, or it can
be the result of an arithmetic or logical expression evaluation.
CA Easytrieve® Report Generator 11.6
The assignment statement has a normal assignment format and a logical expression format.
The normal assignment format sets the value of receive-field-name equal to the value of send-field-name, send-literal, or the
arithmetic expression. For complete rules of the assignment statement and rules for converting from EBCDIC to DBCS, see
the Programming section.
The logical expression format sets the value of receive-field-name equal to the result of evaluating a logical expression. The
value of send-field-name is logically acted upon by the value of bit-mask-field-name or bit-mask-literal. The lengths of all
values must be the same and bit-mask-literal must be hexadecimal.
Note:
If receive-field-name is nullable, then its indicator is set to zero, indicating NOT NULL. If any operands on the right-hand side
contain nulls, a runtime error occurs.
The normal assignment format is as follows:
[ROUNDED ] {= } {send-field-name }
• receive-field-name
Specify the field name to which a value is to be assigned.
• INTEGER
Specify INTEGER to ignore the fractional portion of the value being assigned. INTEGER causes only the numerics to the
left of the decimal point to be transferred during the assignment.
• ROUNDED or TRUNCATED
Specify ROUNDED or TRUNCATED when the receiving field (receive-field-name) is too small to handle the fractional
result of the assignment. TRUNCATED is the default.
Specify ROUNDED to round off the fractional result of the assignment statement. The least significant digit of the result
(receiving field) has its value increased by one when the most significant digit of the excess decimal digits is greater than
or equal to five. For example, if 10.75 is the value of the sending field and the receiving field has one decimal place,
ROUNDED causes the receiving field to be 10.8.
Specify TRUNCATED to truncate the result of the assignment statement. Low order digits are truncated on the right as
necessary when the result is moved to the receiving field.
If INTEGER is used with ROUNDED, the result is rounded to the nearest integer before the INTEGER function is
performed. If INTEGER is used with TRUNCATED (the default), then only the INTEGER function is performed.
Note:
INTEGER, ROUNDED, and TRUNCATED are valid only with numeric fields.
• "= " or EQ
Use EQ or = to indicate equivalency.
• send-field-name or send-literal or arithmetic-expression
Send-field-name names the field that is copied to receive-field-name.
Send-literal contains the literal that is copied to receive-field-name.
Arithmetic-expression contains numeric values separated by arithmetic operators (+, -, *, /). The result of the arithmetic-
expression is placed in receive-field-name.
The logical expression format is as follows:
{= } {AND} {bit-mask-field-name}
• receive-field-name
Specify the field name to which a value is to be assigned.
• "= " or EQ
Use EQ or = to indicate equivalency.
• send-field-name
send-field-name names the field that is copied to receive-field-name.
• AND or OR or XOR
Specify AND, OR, or XOR:
• AND—Zero bits in bit-mask-field-name or bit-mask-literal are carried forward to send-field-name and the result is
placed in receive-field-name.
• OR—One bits in bit-mask-field-name or bit-mask-literal are carried forward to send-field-name and the result is placed
in receive-field-name.
• XOR—Corresponding bits of bit-mask-field-name or bit-mask-literal, and send-field-name must be opposite (zero and
one) to result in a one bit in receive-field-name.
• bit-mask-field-name or bit-mask-literal
Bit-mask-field-name is the name of a field that is logically combined with send-field-name, the result of which is carried
forward to receive-field-name.
Bit-mask-literal is a literal bit mask that is logically combined with send-field-name, the result of which is carried forward
to receive-field-name.
Examples
The following examples of the assignment statement illustrate its various rules.
Example 1
The first example shows assignment format 1 when the receive-field-name is alphanumeric:
Format 1 (Normal Assignment)
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 Programming.
Example 2
This example shows assignment format 1 when the receive-field-name is numeric:
CA Easytrieve® Report Generator 11.6
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
DISPLAY SKIP 2 +
'F1N = ((F2N1 / F2N2) * 100) + .5 = ' F1N
STOP
Results:
Resulting
Value
(50 + .5)
Example 3
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:
Results:
Resulting
Value
ATTR Parameter
Use the ATTR parameter to assign screen attributes to a field or literal. You can specify a declared
screen attribute name or a list of attribute keywords. You can use the ATTR parameter in the following
statements:
Use the ATTR parameter to assign screen attributes to a field or literal. You can specify a declared screen attribute name or a
list of attribute keywords. You can use the ATTR parameter in the following statements:
• DECLARE
• DEFAULT
• ROW
• TITLE
When used in these statements, the ATTR parameter completely overrides any site or screen default attributes. For information
about how to set default screen attributes that override site attributes, see DEFAULT Statement.
The ATTR parameter can be specified without an attribute-name or an attribute-list only on the DECLARE statement. This
lets a named attribute be declared and then assigned later in the program. A runtime error occurs if a named attribute is used
without any attributes assigned to it. The DEFAULT, ROW, and TITLE statements require an attribute-name or an attribute-
list after the ATTR keyword.
This parameter has the following format:
ATTR [attribute-name ]
[(attribute-list)]
attribute-list
[SENDONLY] +
[CURSOR] +
CA Easytrieve® Report Generator 11.6
[ASKIP ] +
[PROTECT]
[NUMERIC] +
[INTENSE ] +
[INVISIBLE]
[GREEN ]
[RED ]
[BLUE ]
[TURQ|TURQUOISE] +
[PINK ]
[YELLOW ]
[BLACK ]
[WHITE ]
[MUSTFILL] +
[MUSTENTER] +
[TRIGGER]
+
[BLINK ]
[REVERSE ] +
[UNDERLINE]
[ALARM] +
[BOX ]
[LEFT ]
[RIGHT]
[UNDER]
[OVER ]
• attribute-name
Specify a declared screen attribute name. For more information, see DECLARE Statement.
• SENDONLY
The SENDONLY parameter specifies that the field is not to be received. The field is ignored if entered. SENDONLY is
implied for literals.
• 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.
CURSOR is ignored for literals.
Note: The cursor cannot be moved into a field that also contains the ASKIP, PROTECT, or SENDONLY attributes.
• [ASKIP ] or [PROTECT]
ASKIP specifies that the field is an auto-skip field. PROTECT specifies that the field is protected and not auto-skipped. If
neither is specified, the field is unprotected.
ASKIP is implied for literals.
• [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] or [INVISIBLE]
CA Easytrieve® Report Generator 11.6
INTENSE specifies that the field displays brightly. INVISIBLE specifies that the field is present on the screen but is not
displayed. INVISIBLE is ignored for literals.
On 3270 extended attribute terminals, INTENSE is ignored if a color attribute is also specified.
• [GREEN], [RED], [BLUE], [TURQ|TURQUOISE], [PINK], [YELLOW], or [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.
• [MUSTFILL]
Specify MUSTFILL to require that all spaces have a non-blank character typed into them. MUSTFILL is ignored for
literals and on terminals that do not support a mandatory-fill attribute.
• [MUSTENTER]
Specify MUSTENTER to send an error message to the terminal if the field was not changed. MUSTENTER is ignored for
literals and on terminals that do not support a mandatory-enter attribute. MUSTENTER is ignored for literals.
• [TRIGGER]
TRIGGER causes the screen to be received as soon as the terminal operator has modified the field and tries to move the
cursor out of the field. TRIGGER is ignored for literals and on terminals that do not support a trigger attribute.
• [BLINK] or [REVERSE] or [UNDERLINE]
BLINK displays the item blinking. REVERSE displays the item in reverse video. UNDERLINE displays the item
underlined.
• [ALARM]
ALARM causes the terminal alarm to sound. ALARM is ignored for literals.
• [BOX], [LEFT], [RIGHT], [UNDER], or [OVER]
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.
UNDER specifies that field outlining displays a horizontal line below a field.
OVER specifies that field outlining displays a horizontal line above a field.
Note: BOX, LEFT, RIGHT, UNDER, and OVER are ignored on terminals that do not support outlining attributes.
BEFORE-BREAK. PROC
Example
Consider the following percentage calculation, paying special attention to when and how PERCENT is calculated:
CA Easytrieve® Report Generator 11.6
Statements:
Data:
BROWNIL6007612345 BROWN
Results:
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.
BEFORE-LINE. PROC
BEFORE-SCREEN. PROC
Example
SCREEN NAME SCRN1 KEY F3 NAME 'Exit' EXIT KEY F8 NAME 'Forward'. . .
BEFORE-SCREEN.
PROC
GET
PERSNL
IF EOF
PERSNL
EXIT
END-
IF
END-PROC
CALL Statement
The CALL statement provides a means to dynamically or statically invoke subprograms written in other
programming languages.
The CALL statement provides a means to dynamically or statically invoke subprograms written in other programming
languages.
The program being called can be either statically or dynamically bound with your CA Easytrieve® Report Generator program.
The way that the called program is bound is determined by the following, in order:
CA Easytrieve® Report Generator 11.6
1. If the program was declared on a DECLARE statement, the STATIC or DYNAMIC keyword on the DECLARE statement
determines how it is bound.
2. If specified, the CALL parameter on the PARM statement supplies the default for all called programs in your CA
Easytrieve program.
3. The default is determined by the environment. The default on the mainframe and Windows is DYNAMIC. The default on
Unix platforms is STATIC.
COBOL programs cannot be called by CA Easytrieve programs in the CICS environment. For more information, see the IBM
CICS Programmer's Reference Manual.
Any mainframe program being called in a CICS environment must execute in conversational mode. The task must not be
terminated by a called program.
For more information about subprogram linkage, see Inter-Program Linkage.
This statement has the following format:
[ {field-name} ] CALL pr
• program-name
Program-name is the name of the subprogram that you want invoked. It is loaded into storage as part of an activity
initiation.
• USING {field-name} or USING {'literal'}
USING specifies the parameter list passed to the subprogram.
Field-name must identify a system-defined field, a working storage field, or a field defined in an accessible file.
'Literal' can be any alphanumeric literal that is passed to the program.
Note:
The field-name for the USING parameter includes only the data. It does not include the leading two-byte length value as in
the field-name for the USING parameter used with the PROGRAM statement.
• [RETURNS return-field]
RETURNS identifies a numeric field that will contain the return code passed back by a called subprogram. If the program
is calling a COBOL subprogram, the return code is the value in the COBOL RETURN-CODE field. If the program is
calling an Assembler subprogram, the return code is the value contained in register 15 on the mainframe. If you are coding
a C subprogram, the return code is the value returned from the function.
Return-field is a numeric CA Easytrieve field that contains the returned value. The field can be a user-defined field or you
can use the system-defined field, RETURN-CODE, to pass the return code to the operating system.
Examples
The first example shows a CALL statement without parameters; the second shows one with parameters:
CALL ASMPGM
CALL ASMPGM USING ('USERFIL', USERFLD)
CASE field-name
CASE
• field-name
Field-name specifies a field that contains a value that is compared to the values represented by compare-literal [THRU
range-literal].
Field-name can be a field of any type. If field-name is numeric, it must have zero or no decimal places.
• 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.
• compare-literal [THRU range-literal]
Compare-literal is the value to be compared with field-name. You can specify a single literal, a series of literals, or a range
of literals. A range is represented by compare-literal THRU range-literal. A range is satisfied when field-name is greater
than or equal to the lesser of compare-literal and range-literal and is less than or equal to the greater of compare-literal and
range-literal.
When field-name is alphanumeric, compare-literal and range-literal must also be alphanumeric. The comparison is based
on the greater of the length of field-name and compare-literal or range-literal. The shorter field is padded with spaces to
equal the length of the longer field.
When field-name is numeric, compare-literal and range-literal must also be numeric and must not have any decimal
places.
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 to statement-n
Statement-1 and statement-n represent any number of CA Easytrieve® Report Generator statements executed when the
WHEN comparison is satisfied. Whenever one or more of these statements is a CASE statement, the CASE statements are
considered to be nested.
• OTHERWISE
OTHERWISE is an optional statement that specifies a group of statements to be executed if no WHEN comparison was
satisfied. If OTHERWISE is not specified and field-name does not equal any of the specified WHEN conditions, execution
continues with the statement following END-CASE.
• statement-n+1
Statement-n+1 represents any number of CA Easytrieve® Report Generator statements executed when no WHEN
comparisons are equal. Whenever one or more of these statements is a CASE statement, the CASE statements are
considered to be nested.
• END-CASE
END-CASE terminates the body of the CASE statement. END-CASE must be specified after each CASE statement and its
associated statements.
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'.
CLOSE Statement
The CLOSE statement closes a file.
The CLOSE statement closes a file.
At the termination of each activity, all files that were opened during the activity are automatically closed. You can use the
CLOSE statement to close the file before the activity terminates. The next I/O statement using the file reopens the file.
CA Easytrieve® Report Generator 11.6
You can also close an SQL file with the CLOSE statement so that a new cursor can be created. For more information, see SQL
Database Processing.
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.
This statement has the following format:
CLOSE file-name
• file-name
File-name specifies the file to be closed.
Example
CLOSE FILEA
COMMIT Statement
The COMMIT statement causes a logical unit of work to be established.
The COMMIT statement causes a logical unit of work to be established.
The COMMIT statement establishes the end of the current logical unit of work and the beginning of the next.
The COMMIT statement establishes a recovery point for updates. The ROLLBACK statement can then be used to recover any
recoverable actions since the last COMMIT. (The operating environment determines which actions are recoverable. For more
information, see Control Program Flow.)
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.
This statement has the following format:
COMMIT
Example
Conditional Expressions
Conditional expressions used as parameters of IF and DO statements offer an alternative to the normal
top-to-bottom execution of statements.
Conditional expressions used as parameters of IF and DO statements offer an alternative to the normal top-to-bottom execution
of CA Easytrieve® Report Generator statements.
CA Easytrieve® Report Generator 11.6
CA Easytrieve® Report Generator accepts seven different conditions: Field Relational, Field Series, Field Class, Field Bits,
File Presence, File Relational, Record Relational.
This statement has the following format:
Examples
The following are skeletal examples of each type of conditional expression used in an IF statement:
Type Example
Field Relational IF field-1 = field-2
Field Series IF field-1 = field-2, field-3, field-4
Field Class IF field-1 ALPHABETIC
Field Bits IF field-1 ON X'0F4000
File Presence IF EOF file-name
File Relational IF MATCHED file-1, file-2, file-3
Record Relational IF DUPLICATE file-name
Relational
• Subject
Field-name-1 is the subject of the comparison. It can be any field type. The NOT parameter indicates the condition test is
reversed.
• Relational Operator
The relational operators ON and OFF test for bit values of one or zero respectively.
• Object
Field-name-2 or a literal identifies the bit mask to be tested. CA Easytrieve® Report Generator tests only those bits that
correspond to one (1) bits in the mask. The length of the object must equal the length of the subject. When you code a
literal as the object, it must be a hexadecimal literal. Indicate a hexadecimal literal by preceding it with an X and enclosing
it in single quotes.
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.
Example
This example illustrates the use of the field bits condition:
IF FIELD-1 ON PATTERN-8
Subject Object
BREAK} {IF } {MODIFIED
VALUES } {LOW-VALUES }
• Subject
Field-name is the subject of the comparison. Each byte of the field must pass the test before the test is true. The NOT
parameter indicates that the condition test is reversed.
Field-name can be indexed or subscripted.
• Object
The object determines the class of data to be tested for.
• {ALPHABETIC}
ALPHABETIC tests for the upper-case characters A to Z or a blank space in each byte of the subject field.
• {BREAK}
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 be used only in screen activity
procedures.
If CURSOR is used, the condition must refer to a field on a ROW statement within the screen declaration.
Note:
Results are unpredictable if:
• Field-name contains the ASKIP, PROTECT, or SENDONLY attributes.
• Field-name occurs more than once in a screen.
• Two screen fields redefine the same storage area and one of the fields is used in an IF test.
• The subject is indexed or subscripted and the value of the index or subscript has changed since the screen was received.
• The test is performed after the user presses CLEAR, PA1, PA2, or PA3.
CA Easytrieve® Report Generator 11.6
• {HIGHEST-BREAK}
HIGHEST-BREAK tests whether this field caused the CONTROL break on a report. The HIGHEST-BREAK test is
an alternative to testing the field-name BREAK-LEVEL for a specific numeric value. Field-name must be defined on a
CONTROL statement or it must be the reserved word FINAL.
• {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.
MODIFIED can be used only in screen activity procedures.
If MODIFIED is used, the condition must refer to a field on a ROW statement within the screen declaration.
Note: Results are unpredictable if:
IF
IF EMPNAME
ALPHABETIC
TOTAL-ALPHABETIC = TOTAL-
ALPHABETIC + 1 END-
IF *
FINISH-
PROC. PROC DISPLAY T
NUMERIC DISPLAY TOTAL-
NON-
ZEROS DISPLAY TOTAL-
ALPHABETIC END-PROC
Relational
= } {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|Ø< }
• Subject
Field-name-1 is the subject of the comparison.
• Relational Operator
Code any of the relational operators to control the condition's evaluation process.
• Object Code
Code field-name-2, a literal, or an arithmetic-expression designates the object of the comparison.
Note: Alphanumeric literals must be enclosed within single quotes.
For information about how CA Easytrieve Report Generator evaluates arithmetic expressions, see Assignments and Moves
in the Programming section.
Alphanumeric Subjects
When the condition subject is an alphanumeric field, the following evaluation rules apply:
• The object must be either a field or an alphanumeric literal.
• If necessary, numeric field objects are converted to zoned decimal. Comparison of VARYING alphanumeric fields with
numeric fields is not permitted.
• The comparison is based on the greater of the length of the subject and the length of the object. The shorter item is
padded with spaces to the length of the longer item. For downward compatibility with existing CA Easytrieve Report
Generator programs, this rule is subject to the following exception:
• When a fixed length subject is compared with a longer fixed length object, the comparison is based on the length of the
subject.
• The object is truncated to match the length of the subject. The compiler then generates a warning message.
CA Easytrieve® Report Generator 11.6
FIRST-
NAME W 3 N VALUE 0 MALE
JOB INPUT PERSNL NAME MYPROG FINISH FINISH-
PROC
IF EMP# GT
10000
TOTAL-EMP# = TOTAL-
EMP# + 1 END-
IF
IF SEX NE
MALE
TOTAL-SEX = TOTAL-
SEX + 1 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 T
EMP# DISPLAY TOTAL-
SEX DISPLAY TOTAL-
PAY DISPLAY TOTAL-
FIRST-NAME END-
PROC
Relational
IF } {EQ | = } { }
CA Easytrieve® Report Generator 11.6
• Subject
Field-name-1 is the subject of the comparison.
• Relational Operator
Equal and not equal are the only valid relational operators for field series conditions.
• Object
Code field-name-2 or a literal-1 as often as you need to indicate the series of comparison objects. Field-name-2 THRU
field-name-3, field-name-2 THRU literal-2, literal-1 THRU field-name-3, or literal-1 THRU literal-2 designate a value
range.
Note: Alphanumeric literals must be enclosed within single quotes.
Example
This example illustrates the field series condition:
TOTAL-REGION = TOTAL-
REGION + 1 END-
IF
IF BRANCH NE 01, WORK-REGION
TOTAL-BRANCH = TOTAL-
BRANCH + 1 END-
IF
IF DEPT EQ 940 THRU 950
TOTAL-DEPT = TOTAL-
DEPT + 1 END-
IF
IF MARITAL-STAT NE 'M', 'S'
TOTAL-MARITAL = TOTAL-
MARITAL + 1 END-
IF *
FINISH-
PROC. PROC DISPLAY T
REGION DISPLAY TOTAL-
BRANCH DISPLAY TOTAL-
DEPT DISPLAY TOTAL-
MARITAL END-
PROC
CA Easytrieve® Report Generator 11.6
Subject
• Subject
File-name designates the subject of the test.
Example 1
This example illustrates the use of the file presence condition:
Example 2
This example illustrates the use of the file presence condition in synchronized file processing:
STATE END-
IF
IF NOT SECONDARY
Subject
• Subject
The optional file-name, PRIMARY, and SECONDARY parameters identify the files to be tested. If you do not code this
parameter, the condition is true only if all input files have matching records.
The optional NOT parameter reverses the condition test.
Example
This example illustrates the use of the file relational condition:
COUNT-1 = COUNT-1 + 1 EN
IF *
CA Easytrieve® Report Generator 11.6
Subject
DUP} {PRIMARY } {LAST-
DUP } {SECONDARY}
• {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.
• Subject
The file-name, PRIMARY, and SECONDARY parameters identify the file to be tested.
The optional NOT parameter reverses the condition.
Example
This example illustrates the use of the record relational condition:
COUNT-1 = COUNT-1 + 1 EN
IF
IF DUPLICATE SORT2
COUNT-2 = COUNT-2 + 1 EN
IF *
PROC. PROC DISPLAY C
PROC
CA Easytrieve® Report Generator 11.6
CONTROL Statement
The CONTROL statement identifies control fields used for a 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.
The CONTROL statement identifies control fields used for a 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.
You can specify one or more control breaks. If you do not specify any control breaks, a FINAL break is implied.
A break level is assigned to each control field. The system-defined field LEVEL contains the break level used in the BEFORE-
BREAK and AFTER-BREAK report procedures. LEVEL can have the following values:
• 1 when processing the minor field break
• The number of control fields (n) when processing the major field break
• The number of control fields plus one (n+1) when processing the FINAL control break
The system-defined field BREAK-LEVEL contains the break level of the highest field to break.
An alternative to testing the LEVEL and BREAK-LEVEL fields is to use the IF BREAK and IF HIGHEST-BREAK tests.
Coding IF BREAK field-name is equivalent to coding IF LEVEL = x, where x is the break level assigned to field-name. IF
HIGHEST-BREAK performs the same function against the BREAK-LEVEL field. IF BREAK and IF HIGHEST-BREAK
have the advantage of dynamically changing the LEVEL value if fields are added to or removed from the CONTROL
statement. For examples using LEVEL, BREAK-LEVEL, IF BREAK, and IF HIGHEST-BREAK, see the Programming
Guide.
Control fields are compared logically, rather than bit-by-bit. For example, packed fields containing zero with a C sign are
logically equal to zero with an F sign.
In an XML-formatted report, the CONTROL fields represent the hierarchy in the XML output file and all other CONTROL
statement parameters are ignored.
For detailed examples of the CONTROL statement, see Report Processing.
This statement has the following format:
[field-name] [NEWPAGE]
CONTROL [ ] [ ] [NOPRINT]...
[FINAL ] [RENUM ]
• [field-name] or [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 non-quantitative field located in an active file or in a W-type working storage field.
Specify control fields in major to minor order.
Note:
Varying length, K (DBCS/Kanji), and M (MIXED) fields cannot be specified on a CONTROL statement.
The following three options alter normal processing of a control break:
• [NEWPAGE]
NEWPAGE causes a skip to top-of-page after control break processing is complete for the specified field.
• [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.
CA Easytrieve® Report Generator 11.6
Example
COPY Statement
The COPY statement duplicates the field definitions of a named file.
The COPY statement duplicates the field definitions of a named file.
You can code an unlimited number of COPY statements for any one file. CA Easytrieve® Report Generator duplicates the
fields as if they were coded at the place where CA Easytrieve® Report Generator 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).
This statement has the following format:
{file-name } COPY
• file-name
File-name is the name of a previously-defined file whose fields you want to duplicate.
• [database-file-name]:record-name
Record-name is the name of a previously-defined database record whose fields you want to duplicate. Optionally, code
database-file-name for qualification.
Example 1
The following is a COPY statement example:
Example 2
This example shows a COPY with IDMS:
CURSOR Statement
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.
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.
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.
Note:
Results are unpredictable if:
• Field-name contains the ASKIP, PROTECT, or SENDONLY attributes
• Field-name occurs more than once in a screen
• Two screen fields redefine the same storage area and one is used in the CURSOR statement
Field-name can be subscripted or indexed. However, if the value of the subscript or index changes between the time the
CURSOR statement is executed and the time the screen is actually displayed, the CURSOR positioning is ignored. The
CURSOR statement:
• Overrides cursor placement if a screen field contains the CURSOR attribute.
• Can be executed any number of times before displaying the screen. The last CURSOR statement executed determines the
cursor placement.
• Cannot be moved into an auto-skip (ASKIP) field.
For information about cursor placement hierarchy, see the Programming section.
This statement has the following format:
CURSOR AT field-name
• field-name
Field-name refers to a field on a ROW statement within the screen declaration.
Example
DECLARE Statement
The DECLARE statement lets you declare named screen attributes and input edit patterns, and to specify
how a subprogram is to be linked. Using declared attributes lets you dynamically change screen attributes
CA Easytrieve® Report Generator 11.6
during program execution. Using declared attributes and edit patterns saves you coding time when the set
of attributes or edit patterns are used many times.
The DECLARE statement lets you declare named screen attributes and input edit patterns, and to specify how a subprogram is
to be linked. Using declared attributes lets you dynamically change screen attributes during program execution. Using declared
attributes and edit patterns saves you coding time when the set of attributes or edit patterns are used many times.
An attribute field can be assigned to another attribute field. Patterns and programs cannot be assigned.
Other than the assignment, declared screen attributes can be used only on DEFAULT, TITLE, and ROW statements.
Attributes can also be dynamically changed using the SET statement.
This statement has the following format:
• name
Specify a name up to 128 characters for the set of declared screen attributes or set of declared pattern characters.
• ATTR [(attribute-list)]
Specify a list of attribute values. The attribute list must be enclosed in parentheses. For a list and explanations of valid
attributes, see ATTR Parameter.
• PATTERN 'pattern'
PATTERN lets you specify a sequence of characters that describe the format of the data in the field. The character string
must be enclosed in single quotes.
Note: Use PATTERN to edit complex combinations of data types and character sequences. Use the MASK parameter to
edit numeric data.
The valid pattern characters and their meanings are listed in the following table:
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.
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).
CA Easytrieve® Report Generator 11.6
(m) or (m..n) or (m..*) or (*) or * Represents the repetition of the preceding pattern 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.
# 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 backtrack. For more information, see the CA Easytrieve®
Report Generator Programming Guide.
• PROGRAM {STATIC|DYNAMIC}
PROGRAM lets you specify how you want to link a subprogram. Specify STATIC to indicate that you want the
subprogram to be linked with your CA Easytrieve® Report Generator program. Specify DYNAMIC to indicate that you
want the subprogram to be dynamically loaded. The default is taken from the PARM CALL statement.
Example
DEFAULT Statement
The DEFAULT statement lets you specify screen-level overrides of system-defined attributes (Format 1)
and message attributes and locations (Format 2).
The DEFAULT statement lets you specify screen-level overrides of system-defined attributes (Format 1) and message
attributes and locations (Format 2).
If used, DEFAULT statements must be the first statements coded in a screen activity.
CA Easytrieve® Report Generator 11.6
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
If coded, CA Easytrieve® Report Generator issues a warning message during compilation. All of the above attributes are also
ignored for MESSAGE, except for ALARM.
This statement has the following format:
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 }
• 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 TITLE Statement.
• LITERAL
Use LITERAL to override attributes for all row literals in a screen activity.
Note: You can also override attributes at a screen item level. See 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 ROW Statement.
• KEY
Use KEY to override attributes for a function key display area in a screen activity.
• ATTR {attribute-name} or ATTR {(attribute-list)}
Specify either a declared screen attribute name or one or more attribute keywords. For a list of attributes, see ATTR
Parameter. For information about how to declare screen attributes, see DECLARE Statement.
• MESSAGE
CA Easytrieve® Report Generator 11.6
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. For more information,
see KEY Statement.
Examples
Note the following examples of the message statement.
Example 1
You can use MESSAGE to display INFORMATION level messages in yellow and all other levels of messages in red:
Example 2
You can override the placement of messages on a screen using the ROW parameter:
DEFINE Statement
The DEFINE statement specifies data fields within a file or within working storage.
The DEFINE statement specifies data fields within a file or within working storage.
You can generate DEFINE statements automatically by using the SQL INCLUDE or IDD statements.
This article contains the following information:
Note: In CICS, the maximum total field length (field-length multiplied by maximum-occurrences) is 32,759.
Format
The DEFINE statement has the following format:
DEFINE +
[file-qualifier:] field-name +
} Field Name
{start-location
} } {*
[+offset-value] } }
{W } +
} Location{S
} } {[file-qualifier:] overlay-field-name
[+offset-value]} } {field-length {A|M|K|N|
P|B|U|I} [decimal-positions] [EVEN]} } {
} + }
Attributes {[VARYING] [file-qualifier:] model-field-name
} }
[UPDATE] +
}
} [HEADING
([#font-number] 'heading-literal' ...)] + }
} [INDEX (index-field-name)] +
}
} [MASK ({[mask-identifier][BWZ]['mask-literal']|HEX})] +
} Characteristics
} [OCCURS maximum-occurrences]
+ }
}
[VALUE initial-value] +
}
} [RESET]
}
Keyword
• DEFINE
The DEFINE keyword must precede each field definition for definitions outside the library section.
You can omit the DEFINE keyword for fields defined after the associated FILE statement or for working storage fields
defined after any FILE statement.
Field Name
• [file-qualifier:] field-name
File-qualifier identifies the appropriate file, record, or working storage for the field you are defining.
Field-name is the name of the field that you are defining. The field-name:
• Can be from 1 through 128 alphanumeric characters in length
CA Easytrieve® Report Generator 11.6
• B (binary) -- Use B when the field contains binary data. In a quantitative binary field (a field with zero or more
decimal places specified), the high order bit is the sign bit. In a non-quantitative binary field (a field with no decimal
place specification), the high order bit is a binary digit.
Note:
Information about signed (quantitative) and unsigned (non-quantitative) fields follows. For rules about working with
signed and unsigned fields, see Programming.
For example, in a one-byte quantitative binary field the following is true:
The following table shows the length equivalent and maximum possible values for quantitative binary fields:
The following table shows the length equivalent and maximum possible values for non-quantitative binary fields:
• U (unsigned packed decimal) -- Use U for packed data where a sign is not needed. For example, a two-byte unsigned
packed field containing 123 looks like X'0123'.
• I (integer) -- The field contains integer-formatted data in the native format of the host environment. The length of an
Integer (I) field must be two, four, or eight bytes. Decimal places must be blank or zero.
Numeric field capacities for signed I fields (quantitative) are:
2 32,767 -32,768
4 2,147,483,647 -2,147,483,648
8 9,223,372,036,854,775,807 -9,223,372,036,854,775,808
• {[decimal-positions]}
Decimal-positions is an option that specifies the desired number of decimal positions for field-name. Decimal-
positions must be specified as an unsigned integer. If decimal-positions is specified (even if 0), the field is considered
to be quantitative. Otherwise, the field is considered non-quantitative. Quantitative fields are automatically summed on
reports. Decimal-positions cannot be specified for data type A.
• [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'.
Note: EVEN is valid only for P fields.
• [VARYING]
Use VARYING to indicate that field-name is a varying length field. This means that the length of the data in this field, for
each occurrence in separate records, is unique. Varying length fields are alphanumeric and consist of a two-byte length
value followed by the data. VARYING fields typically are used for SQL VARCHAR columns.
Note: The VARYING parameter is not supported for M or K fields.
You can specify VARYING on type A fields. When VARYING is specified, the length attribute (field-length) is the total
number of bytes that 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.
When referencing a VARYING field in your program, you can use field-name alone or suffixed as shown below.
Assume field-name is FLDA:
• FLDA references the entire field (both length and data) as a variable length field
• FLDA:LENGTH references only the length (first two bytes) as a two-byte binary field
• FLDA:DATA references the data portion of the field (from byte three on) as an alphanumeric field
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.
Length restrictions for varying length fields are as follows:
The default value for a varying field is a string of zero length. However, if the VALUE option is coded, its value and length
become the default for the field.
• {[file-qualifier:] model-field-name}
Optionally, you can specify a field name to use as a model for the field you are defining (field-name). The attributes used
in model-field-name are duplicated for field-name. If model-field-name is in a different file or record, specify the name of
that file. If you use this option, you need not specify attributes for field-name.
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.
Note: Only SQL fields specified as UPDATE can be modified by the UPDATE statement.
If UPDATE is specified on the FILE statement, UPDATE is used for all fields defined in the file.
CA Easytrieve® Report Generator 11.6
Note: You must have UPDATE authorization for the column in the SQL table that this file references.
• [HEADING ([#font-number] 'heading-literal'...)]
The HEADING option specifies an alternative report heading for field-name (the default is the actual field-name).
Note: HEADING can be used in the CA Easytrieve Online Screen Painter as a default prompt for field-name.
• [INDEX (index-field-name ...)]
The INDEX option establishes indexes for field-name. You can specify multiple indexes by coding a list of index names
(index-field-name) enclosed in parentheses.
CA Easytrieve automatically allocates a four-byte quantitative binary field for each index. Any references you make to a
field with the INDEX option cause that field's location to be adjusted by the amount contained in index-field-name. For
more information, see the Programming section.
• [MASK ({[mask-identifier][BWZ]['mask-literal']|HEX})]
The optional MASK parameter is used to format field-name for display.
You can use any letter from A to Y as an optional mask-identifier. You can use the letter to identify a new mask or
to retrieve a mask that was previously defined either in the Options Table or by a mask parameter on a previous field
definition. If the new mask that you identify does not already exist, CA Easytrieve retains the mask for future reference.
If you subsequently reference field-name for display, CA Easytrieve automatically uses the associated letter identifier to
determine the edit mask. Do not use the same identifier to establish more than one 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.
• 'mask-literal'
Defines an edit mask and must be enclosed within single quotes. The actual edit mask is coded according to the rules
specified under the MASK Parameter. For more information, see MASK Parameter.
• HEX
Specifies a special edit mask that instructs CA Easytrieve to display the contents of field-name in double-digit
hexadecimal format. You can display fields of up to 50 bytes with the HEX mask.
Note:
HEX edit masks are not allowed for VARYING fields.
• [OCCURS maximum-occurrences]
The OCCURS option establishes an array for field-name.
Maximum-occurrences specifies the number of elements in the array (the number of occurrences of field-name). Maximum-
occurrences must be specified as an unsigned integer. The maximum value is 32,767. The total size of the field (length *
occurrences) is limited by the FLDMAX option in the options table. For more information on FLDMAX, see Updating
the Table. You can reference the elements of this array by manipulating the INDEX defined for field-name or by using
subscripts. For more information, see the Programming section.
• [VALUE initial-value]
The VALUE option initializes the contents of a field in working storage.
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.
If the initial-value does not match the length of field-name, it is truncated or padded according to assignment rules.
• [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.
Note:
When W working fields are referenced in report processing, a RESET is not performed during the printing of spooled
reports.
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.
CA Easytrieve® Report Generator 11.6
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.
Record Description
The examples below illustrate two ways of describing a record from a personnel file. The first method uses an asterisk (*)
to define the starting location of the fields. The second method uses absolute starting positions. In this case, both methods
result in the same description. The DEFINE keyword is not needed when the field definitions immediately follow the FILE
statement.
Method 1
FILE PERSNL FB(150 1800)
REGION * 1 N
CA Easytrieve® Report Generator 11.6
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 EMP#
9 5 N JOB
INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1
LINE EMP# REGION BRANCH
To reinitialize the field each time a JOB, SORT, or SCREEN activity is executed, add the RESET parameter.
Varying Length Fields
The VARYING parameter on the DEFINE statement designates varying length fields. An example of a varying length field
definition is as follows:
Because VARYING is used, this W type work field has two parts that are internally defined as follows:
Edit Masks
To add an edit mask to a telephone number, use the MASK parameter:
Arrays
The following example defines an array. There are 10 occurrences of the 2-byte numeric field, ELEMENT, in the array. When
the array field is used to define the entire array, ARRAY can be used to refer to the entire storage area.
DELETE Statement
Use the DELETE statement to delete a specific row from a SQL file.
Use the DELETE statement to delete a specific row from a CA Easytrieve® Report Generator SQL file.
DELETE performs a DELETE WHERE CURRENT OF cursor. The file must be defined with the UPDATE parameter. For
more information about SQL database processing, see the Programming Guide.
Note: DELETE WHERE CURRENT OF cursor cannot be dynamically processed by the SQL interface for CA IDMS. To
perform SQL deletes, you must code native SQL statements using a searched delete statement.
This statement has the following format:
• [FROM]
Optionally, code FROM for statement readability.
• [file-name]
File-name must be the name of a CA Easytrieve® Report Generator SQL file.
Example
The following example selects a specific row from the table, and then deletes it:
DISPLAY Statement
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.
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.
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.
When you use DISPLAY in REPORT procedures, output is always in the appropriate place in the report. However, when you
use DISPLAY in a JOB activity, the output can be interspersed with the first unsequenced report if no file-name is specified.
Data displayed to an output file is in an edited format. DISPLAY is not valid for nullable fields, but DISPLAY HEX is valid.
This statement has the following format:
Format 1
[display-file-name] [{TITLE|
NOTITLE} ] DISPLAY [ ] [SKIP skip-in
Format 2
[display-file-name] [{TITLE|
NOTITLE} ] DISPLAY [ ] [SKIP skip-in
Format 3
[display-file-name] [ ] DISPL
Format 1
• [display-file-name] or [SYSPRINT]
When you specify display-file-name, CA Easytrieve® Report Generator prints data to the named file. The named file
should be designated as a PRINTER file or unpredictable results can occur. If you do not specify display-file-name, the
default is SYSPRINT. SYSPRINT implies the system output device. The actual destination of SYSPRINT is determined by
the environment or a site option. For more information, see your system administrator.
• [{TITLE|NOTITLE}]
The TITLE option specifies that a skip to a new page occurs before the data is printed. It also produces any titles and
headings if coded in a report procedure. If not coded in a report procedure, no titles are produced.
NOTITLE specifies that a skip to a new page occurs but titles and headings are not produced.
• [SKIP skip-integer]
The SKIP skip-integer option specifies the number of lines skipped before printing data. When skip-integer is zero, the
current line being displayed overlays the previous line output to display-file-name.
• [CONTROL 'carriage-control-character']
The CONTROL 'carriage-control-character' option sets the print carriage control character for the print line. Valid
alphanumeric values for 'carriage-control-character' are 0 to 9, +, -, A, B, or C. Depending on the make and model
CA Easytrieve® Report Generator 11.6
of impact printer used, these characters select a precoded channel on a carriage control tape that determines print line
positions associated with the form to be printed.
When display-file-name is associated with an extended reporting printer, the printer must support ANSI or machine
carriage controls. For more information, see the User Guide.
Note: This parameter is not valid for use in REPORT procedures.
• [#font-number]
#font-number identifies the font that CA Easytrieve® Report Generator uses for the next display item. You can specify this
option only if display-file-name has been associated with an extended reporting printer. #font-number identifies the number
of a font defined for the extended reporting printer assigned to receive the print output. If you do not code the font index,
then the next display item uses the default font for the assigned extended reporting printer.
• [field-name] or ['literal']
Code field-name or 'literal' in the order you want them to appear on the printed line.
Note: K fields are not valid on a DISPLAY statement.
• [+offset] or [-offset]
Use the space adjustment options to add (+offset ) or subtract (-offset) horizontal line spaces preceding the next display
item.
Note: ±offset does not extend space beyond the left and right margin set points.
• [COL column-number]
The COL column-number option specifies the absolute print column number on which CA Easytrieve® Report Generator
begins to print the next display item. Column-number can be any value that does not extend beyond the line margins.
Note: When using an extended reporting printer, an error occurs if two or more fields or literals overlap. For more
information, see the Programming Guide.
• [POS position-number]
The POS position-number option coded in a DISPLAY statement within report procedures causes the next display item to
be left-justified under the corresponding position-number item in the LINE 01 statement.
Note: When using an extended reporting printer, an error occurs if two or more fields or literals overlap. For more
information, see the Programming Guide.
Format 2
• HEX {file-name} or HEX {field-name} or HEX {record-name}
CA Easytrieve® Report Generator produces a hexadecimal and character dump of the current file-name or field-name,
whichever you specify. For CA IDMS files, record-name refers to any record (segment); file-name refers to all records
(segments).
Note: HEX file-name cannot be used in REPORT procedures.
Format 3
You can use this format of the DISPLAY statement only 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. For more information about extended
reporting, see the Programming Guide.
• [CONTROL 'control-literal']
You can use the CONTROL parameter to output printer control records. 'Control-literal' can be an alphanumeric or
hexadecimal literal that CA Easytrieve® Report Generator outputs to the print file without paper control information.
These control cards contain instructions to extended reporting printers. Print control records for some printing systems
define the specification of the font sets that CA Easytrieve® Report Generator uses for a particular report. These control
cards can be output to the print data set before a report that uses the loaded font sets.
Examples
Format 1
The following example illustrates the use of Format 1 of the DISPLAY statement:
When executed, the statements in this example produce the following output:
Format 2
The following example illustrates the use of Format 2 of the DISPLAY statement:
When executed, the statements in this example produce the following output:
CHAR 104 G 01963 7ARNOLD LINDA 1569 COLONIAL TERR ANEW YORK NY1
DLI Statement
The DLI statement provides controlled input/output of an IMS/DLI database. You can use the DLI
statement in conjunction with (or independently of) the automatic input associated with RETRIEVE. You
can code the DLI statement at any place in a JOB activity that an input/output statement for any other file
can be coded. This statement provides complete control over the creation and maintenance of a database.
The DLI statement provides controlled input/output of an IMS/DLI database. You can use the DLI statement in conjunction
with (or independently of) the automatic input associated with RETRIEVE. You can code the DLI statement at any place in a
JOB activity that an input/output statement for any other file can be coded. This statement provides complete control over the
creation and maintenance of a database.
There are six different formats for the DLI statement:
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' } ]
CA Easytrieve® Report Generator 11.6
[ { } 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
This section describes the parameters for each of the six formats of the DLI statement.
Format 1
• file-name
File-name identifies the database being processed. File-name is the same as the name coded on the FILE file-
name statement that identifies the DBD to be processed.
• {io-record-name} or {io-field-name}
Io-record-name or io-field-name identifies the input/output area that is to receive the data. Io-record-name must be the
same as a corresponding segment-name coded on a RECORD statement. Io-field-name can only be a working storage field.
In either case, the area specified must be large enough to contain the longest segment retrieved from the database.
• {'function-literal'} or {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.
• [SSANO ssa-number] or [SSA {'search-value-literal'}] or [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
CA Easytrieve® Report Generator 11.6
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.
Note: Multiple search value literals or search value field names must be enclosed in parentheses.
Format 2
Use Format 2 of the DLI statement to perform a symbolic checkpoint/restart. 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/restart processing. Test CHKP-STATUS to determine the results of the call. For more information about CHKP-
STATUS, see the chapter "File Processing" in the Programming Guide. For more information about symbolic checkpoint/
restart, see IBM's IMS/DL/I Application Programming publications.
• {CHKP} or {XRST}
Code CHKP to perform symbolic checkpoint or XRST to perform a symbolic restart.
• {'seg-len-literal'} or {seg-len-field-name}
'Seg-len-literal' or seg-len-field-name specifies the length of the longest segment (or path of segments) in the PSB. 'Seg-len-
literal' must be a four-byte binary field.
• [id-field-name]
Id-field-name must identify a 12-byte area in working storage. The first eight bytes of this area contain the checkpoint ID.
You should set the 12-byte area to spaces before performing the DLI XRST operation, then test it after performing the
operation. If your program is being started normally, the area will still contain spaces. If your program is being restarted
from a checkpoint, the area will contain the checkpoint ID that you supplied during the DLI CHKP operation and in the
restart JCL.
Optionally, you can also specify up to seven checkpoint areas in working storage that are saved during each checkpoint and
restored during a restart.
• {'checkpoint-len-literal' } or {checkpoint-len-field-name}
'Checkpoint-len-literal' or checkpoint-len-field-name specifies the length of the checkpoint area defined by checkpoint-
field-name. Checkpoint-len-field-name must be a four-byte binary field.
• [checkpoint-field-name]
Checkpoint-field-name must identify a field in working storage. The length of this checkpoint area is specified
by checkpoint-len-field-name or 'checkpoint-len-literal'.
A checkpoint can be taken on a maximum of seven areas.
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
chapter "File Processing" in the Programming Guide. For more information about basic checkpoints, see IBM's IMS/DL/I
Application Programming publications.
• CHKP
CHKP causes a basic checkpoint to be performed.
• id-field-name
Id-field-name must identify an 8-byte area in working storage. This area contains the checkpoint ID.
Format 4
Use Format 4 of the DLI statement when you are calling a subprogram (such as a COBOL program) that accesses DL/I
records. Coding this statement before referencing DLI fields causes the fields to become available for processing.
• DLI file-name FOR ACCESS
File-name refers to a CA Easytrieve® Report Generator file definition containing the appropriate PCB field, record, and
record field definitions.
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
• Execution of the DLI TERM statement (see Format 6)
Test the UIBFCTR and UIBDLTR system-defined fields to determine the results of the operation. For more information about
scheduling PSBs and the values of UIBFCTR and UIBDLTR, see IBM's IMS/DL/I Application Programming publications.
CA Easytrieve® Report Generator 11.6
• {'psb-name-literal'} or {sb-name-field-name}
'Psb-name-literal' or psb-name-field-name specifies the PSB to be scheduled. The maximum length of a PSB name is eight
bytes.
Format 6
Use Format 6 to terminate a PSB. Format 6 is used only for CICS execution. In other environments, it is ignored. Test
the UIBFCTR and UIBDLTR system-defined fields to determine the results of the operation. For more information about
scheduling PSBs and the values of UIBFCTR and UIBDLTR, see IBM's IMS/DL/I Application Programming publications.
{WHILE} DO { } conditional-expression
{UNTIL} statement-1 ... statem
END-DO
• {WHILE} or {UNTIL}
A WHILE loop evaluates the condition at the top of a group of statements. An UNTIL loop evaluates the condition at the
bottom of a group of statements.
• conditional-expression
Specify the condition that is the basis for the continuing execution of the loop. For conditional expression syntax, see
Conditional Expressions in the chapter "Statements A - C."
• 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.
CA Easytrieve® Report Generator 11.6
Examples
DO UNTIL statement example:
ENDPAGE. PROC
Example
ENDPAGE is typically used to produce page totals or other annotations, as in the following example of page footer annotation:
END-PROC Statement
The END-PROC statement delimits the statements in a procedure. A procedure is a group of user-written
statements designed to accomplish a particular objective.
The END-PROC statement delimits the statements in a procedure. A procedure is a group of user-written CA Easytrieve®
Report Generator statements designed to accomplish a particular objective.
CA Easytrieve® Report Generator 11.6
For more information, see PROC Statement in the chapter "Statements N - R."
This statement has the following format:
END-PROC
ENDTABLE Statement
ENDTABLE is used to delimit instream data used to create small tables. ENDTABLE must be coded in
the first eight positions of the source statement. The ninth position must be blank.
ENDTABLE is used to delimit instream data used to create small tables. ENDTABLE must be coded in the first eight
positions of the source statement. The ninth position must be blank.
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 to the
ENDTABLE statement.
This statement has the following format:
ENDTABLE
Example
EXECUTE Statement
The EXECUTE statement invokes a JOB, SORT, or SCREEN activity from either a PROGRAM or
SCREEN activity.
The EXECUTE statement invokes a JOB, SORT, or SCREEN activity from either a PROGRAM or SCREEN activity.
The EXECUTE statement transfers control to an activity. After the activity is executed, control returns to the next executable
statement following the EXECUTE. You cannot invoke a JOB, SORT, or SCREEN activity in a JOB or SORT activity.
EXECUTE statements in a SCREEN activity can invoke other activities. This is called activity nesting. However, recursion is
not permitted. That is, activity A can EXECUTE activity B, but activity B cannot then EXECUTE activity A.
Note: Recursion cannot be detected in the program. If it is attempted, unpredictable results can occur.
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.
This statement has the following format:
EXECUTE {job-name|sort-name|screen-name}
• {job-name|sort-name|screen-name}
CA Easytrieve® Report Generator 11.6
EXIT Statement
The EXIT statement terminates a SCREEN activity.
The EXIT statement terminates a SCREEN activity.
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.
If a SCREEN activity was invoked by an implied PROGRAM activity, EXIT terminates the program.
EXIT is a branch action that can be invoked directly by pressing a particular attention key. For more information, see KEY
Statement in the chapter "Statements G - M."
This statement has the following format:
EXIT
Example
FETCH Statement
The FETCH statement is used to retrieve rows from an SQL file.
The FETCH statement is used to retrieve rows from an SQL file.
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.
You cannot use controlled statements (SELECT, FETCH, CLOSE) in a SORT or REPORT procedure.
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.
This statement has the following format:
• [FROM]
Optionally, code FROM for statement readability.
• file-name
File-name is the name of a CA Easytrieve® Report Generator SQL file.
Example
Following is an example of a PROGRAM activity that uses a default cursor:
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 Statement
FILE statements must describe all files that your program references. You can also access SQL, CA
IDMS, and IMS/DL/I databases using ezt 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.
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 Report Generator 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.
Code the optional parameters and subparameters of the FILE statement in any order following the file name. As shown, you
must code multiple subparameters within parentheses. The complete syntax of the FILE statement is shown below.
To maintain compatibility of programs using VSAM files that were written in prior versions of the product, CA Easytrieve
Report Generator supports FILE statements containing VS and its related keywords (as follows):
For more information about using the FILE statement, see the Programming section.
This statement has the following format:
FILE filename +
[SEQUENTIAL
[CREATE [RESET]] ] [INDEXED }
[UPDATE }] ] +[RELATIVE
] } [SQL
([owner-name.] table-name [correlation-name]{,}...) ] }
File [IDMS (subschema-name [RESET]) ]
} Type [ {relative-position }
] } [DLI ({ }[RESET])
] } [ {dbd-name[relative-occurrence]}
] }
[
CA Easytrieve® Report Generator 11.6
{'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 ] ] ] }
[WORKAREAarea-length] +
[ [INSTREAM ] ]
[TABLE [
] ] + [
[max-table-entries] ]
[BUFNObuffers] +
[DEFER] +
[ASA] +
[EXTENDEDxrpt-printer] +
CA Easytrieve® Report Generator 11.6
[CODE {EBCDIC|ASCII|dbcs-code-name}] +
[KEYkey-field-name]
+ [
{'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} ] ] }
SEQUENTIAL designates a QSAM or VSAM Entry Sequenced Data Set (ESDS) on a mainframe. On other platforms, the
file can be a fixed length or a variable length (new-line delimited) file. SEQUENTIAL is the default file type if a file type
is not specified.
Note: When SEQUENTIAL is specified, FILE-STATUS (a system-defined field) is available for the file.
• [INDEXED] (return to top)
INDEXED designates a VSAM Key Sequenced Data Set (KSDS) or an ISAM file on a non-mainframe platform.
• [RELATIVE] (return to top)
RELATIVE designates a mainframe VSAM Relative Record Data Set (RRDS), or a relative file on non-mainframe
platforms.
• [SQL] ([owner-name.] table-name [correlation-name] {,} ...) (return to top)
The SQL parameter designates an SQL file. This parameter enables the product to manage the SQL cursor.
Note:
• Only UPDATE, DEFER, and CODE are valid FILE statement parameters for an SQL file.
Table-name is the name of the SQL table to be accessed. Optionally, qualify the table with owner-name. Table-
name must be enclosed in parentheses.
Correlation-name is the name used to clarify or simplify the table to which a column belongs. If you specify owner-
name and your DBMS does not permit more than one level of qualification (CA IDMS, Ingres, or Oracle), you should
code a correlation-name for each table.
• The comma is a required separator.
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.
• [IDMS (subschema-name [RESET]) (return to top)
IDMS designates the file as a CA IDMS database file.
Subschema-name is a one- to eight-character name that specifies the subschema to be processed.
The optional RESET subparameter requests that all records under control of RETRIEVE be reset to binary zero
immediately prior to retrieving each root record.
When the first IDMS FILE statement is encountered, a CA IDMS Communications Block is created in working storage.
For more information about CA IDMS processing, see the CA IDMS Database Processing section.
Note: Fields cannot be defined in association with the IDMS FILE statement. Fields are defined following the RECORD or
ELEMENT-RECORD statement.
• DLI ({relative-position} [RESET]) or DLI ({dbd-name[relative-occurrence]} [RESET]) (return to top)
(Mainframe only) DLI designates the file as an IMS/DL/I database file.
Relative-position is a positive numeric literal that identifies the relative position of the PCB within the PSB to be processed.
Dbd-name specifies the name of the DBD. Relative-occurrence is the relative occurrence of like-name DBDs in the PSB. It
is required only if two or more DBDs have the same name.
The optional RESET subparameter requests that all records under control of RETRIEVE be reset to binary zero
immediately prior to retrieving each root record.
For more information, see IMS/DL/I Database Processing.
• [CREATE [RESET]] (return to top)
Use CREATE to load the associated file.
(Mainframe only) If you specify RESET, CA Easytrieve® Report Generator overwrites an existing data set with the
REUSE attribute. If RESET is not specified, or if RESET is specified and the associated VSAM data set does not have the
REUSE attribute, then CA Easytrieve® Report Generator receives an error condition when the OPEN is executed.
Note: In CICS, the use of RESET results in an execution error.
(Non-mainframe platforms only) If you specify RESET, CA Easytrieve® Report Generator deletes an existing data set
before creation or instructs the access method to overwrite the file. If RESET is not specified, new records are appended.
• [UPDATE] (return to top)
Use UPDATE to permit the file to be updated.
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 {'password-literal'}] or [PASSWORD {password-field-name}] (return to top)
'Password-literal' is the optional password for the file. You can specify the password as an alphabetic literal or a
hexadecimal quoted literal.
Password-field-name is a field you define that contains the password for the file. CA Easytrieve® Report
Generator accesses the value in password-field-name when the file is opened. Any valid password is accepted.
• [NOVERIFY] (return to top)
CA Easytrieve® Report Generator 11.6
Code NOVERIFY to ignore a VSAM open error code of 116(X'74'). This error indicates that a previous job terminated
without properly closing the associated VSAM data set. It could also indicate that a job executing on another CPU is using
the associated VSAM data set.
Warning: Indiscriminate use of NOVERIFY can cause loss of data records.
• [EXIT]
EXIT invokes a user-written program for each CA Easytrieve® Report Generator operation on the file. EXIT is not valid
for VFM, SQL, DL/I, or CA IDMS.
• program-name
Specify the name of the user program.
• [USING {parm-literal}] or [USING {parm-field-name}]
USING appends the associated parameters (parm-literal or parm-field-name) to the standard parameter list passed to the
exit program. Field names must be working storage or system-defined fields and must be defined in the library section.
There is a limit of 62 fields that can be passed to the exit program.
• [MODIFY]
MODIFY specifies that CA Easytrieve® Report Generator provides input or output services, but that the exit can
inspect and modify each record after input and before output.
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] (return to top)
(TSO and CMS usage) The CARD option retrieves the file data from the system input stream (SYSIN). Only one file in
a CA Easytrieve® Report Generator 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 your program interpretively.
(Non-mainframe platform usage) 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] (return to top)
(TSO and CMS only) The PUNCH option indicates punched card output. Files created with this option are 80-character
unblocked records.
• [PRINTER] (return to top)
PRINTER indicates that the file receives printed output routed to a file, an online printer, a terminal, or 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.
• [PAGESIZE (line-page-size [display-page-size])
Specify PAGESIZE to define the logical print length of a printed page. For complete rules for specifying PAGESIZE,
see REPORT - Statement.
• [LINESIZE line-length]
Code the LINESIZE parameter to specify the maximum number of data characters that can be printed on a line. Line-
length must be an unsigned integer from 1 to 32767.
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.
There are additional control characters (forms control information) that also must be stored in a logical record. If one
of the record format parameters is specified, it must be large enough to hold both the forms control information and the
data characters. The value of line-length must be less than or equal to the maximum record length minus the size of the
forms control information.
Easytrieve® Report Generator always obtains the record format from z/OS. The record format and length are required for VSE
and non-mainframe FILE statements.
[F [record-length] ][
][V [record-length] ][
][U [block-length]
][ [FULLTRK ] ][
][FB [ (record-length [block-length] ) ] ][ [
[FULLTRK ] ] ][
][VB [ (record-length [block-length] ) ] ][ [
[FULLTRK ] ] ][ ][VBS
[ (record-length [block-length] ) ] ][ [ [FULLTRK
] ] ]
CA Easytrieve® Report Generator supports fixed (F), variable (V), and undefined (U) formats. Fixed and variable length
records can be blocked (FB,VB), though the blocking factor is ignored on non-mainframe platforms.
• [VBS] (return to top)
(z/OS only) z/OS systems can process Variable Block Spanned (VBS) records using BFTEK=A processing.
• [record-length] (return to top)
Record-length specifies the maximum record length.
• [block-length] (return to top)
Block-length specifies the file's maximum block length.
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).
Note:
To obtain an MVS/DFP system determined block size within CA Easytrieve® Report Generator on the mainframe, do one
of the following:
• 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® Report Generator gets control in OPEN processing. This is applicable
for disk data sets only.
• Define a value of zero for the block length value. If you want CA Easytrieve® Report Generator 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® Report Generator to pick up the LRECL from the JCL and to utilize the block size set by SMS.
This tells CA Easytrieve® Report Generator to pick up the LRECL from this definition and to utilize the block size set by
SMS.
This tells CA Easytrieve® Report Generator to pick up this definition and ignore both the JCL and the SMS-determined
block size.
Note: If you code a zero block size within CA Easytrieve® Report Generator or in your JCL, and your data set is not SMS
managed, your program will abend with a 013 open problem.
• [FULLTRK] (return to top)
A block length designation of FULLTRK establishes an output block size that equals the maximum track capacity of the
direct access device, or the next lower multiple of record size for FB files.
• [WORKAREA area-length] (return to top)
The WORKAREA option establishes the number of bytes to be allocated as a work area for the file. WORKAREA cannot
be coded if the CARD parameter is specified. Area-length specifies the number of bytes to be allocated and must be large
enough to contain the longest record processed.
WORKAREA allows you to reference the fields in a file prior to the normal allocation of a file's data buffer. For more
information, see File Processing.
Note: WORKAREAs are not initialized by CA Easytrieve® Report Generator.
• [TABLE] (return to top)
The TABLE option declares the file as the source for a SEARCH statement to access a table.
Note:
VARYING length fields cannot be used for TABLE files.
• [INSTREAM] or [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] (return to top)
BUFNO establishes the number of buffers allocated for the file. Buffers can be 1 to 255 for MVS programs. The default
value is obtained from the Site Options Table.
• [DEFER] (return to top)
• Coding the DEFER option instructs CA Easytrieve® Report Generator to delay the opening of the file until the first input
or output operation for the file occurs. The default opens all referenced files at the beginning of each CA Easytrieve®
Report Generator activity.
• [ASA] (return to top)
For MVS, the optional ASA parameter sets the DCB A option for RECFM.
For non-mainframe platforms, the optional ASA parameter causes output records to be written using the set of mainframe
ASA characters in column one. Without ASA, all records are formatted using ASCII printer control characters.
• [EXTENDED xrpt-printer] (return to top)
The EXTENDED parameter indicates that the file is to be associated with an extended reporting printer. This means
that input/output statements (GET, PUT, READ, WRITE) cannot reference these printer files. However, the DISPLAY
statement and REPORT statements can reference these printer files. Unless you code them, record length and block size
default to those defined for the printer in the printer set definition module.
Xrpt-printer identifies the extended reporting printer whose characteristics are to be associated with this file. You must
define the xrpt-printer in the printer set definition module.
For more information, see Extended Reporting and the Programming section.
• [CODE {EBCDIC|ASCII|dbcs-code-name}] (Mainframe only) (return to top)
Use CODE dbcs-code-name to define the DBCS code system to be used for all K and M fields for this file. If this is not
specified, the default is taken from the CODE parameter on the PARM statement for this program. If the CODE parameter
is 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] (return to top)
Use the KEY parameter to specify the key field for your non-mainframe ISAM file. CA Easytrieve® Report Generator 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.
Data Set Types
• SYSNAME {'file-identifier'} or SYSNAME {file-identifier-field-name} (return to top)
Code SYSNAME to associate a CA Easytrieve® Report Generator file with an external data set.
• file-identifier
Must be an alphanumeric string.
• file-identifier-field-name
CA Easytrieve® Report Generator 11.6
Code NOFORMFEED to indicate that the form feed character cannot be used to start a new page. If NOFORMFEED is
not specified, then CA Easytrieve® Report Generator can use the form feed character to start a new page.
• NEWPAGE [BEFORE] or NEWPAGE [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.
If NEWPAGE is not specified, CA Easytrieve® Report Generator does nothing to position the page.
• [SPOOL] (return to top)
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 in non-mainframe platforms.
A device type of PRINTER is implied.
• CLASS {'spool-class-literal'} or CLASS {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.
The default is CLASS A.
• NODE {'destination-literal'} or NODE {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.
NODE can be specified as a literal or as a field name. Any valid node is accepted.
Note: If NODE is not specified, the destination for the file is not passed to the operating system spooling subsystem.
• USERID {'user-id-literal'} or USERID {user-id-field-name}
Code USERID to specify the user of the printed output. The NODE subparameter must also be specified and must
contain a network node name.
USERID can be specified as a literal or as a field name. Any valid user ID is accepted.
Note: If the USERID subparameter is not specified, the user ID is not passed to the operating system spooling
subsystem.
For mainframe tape files, if no BLKSIZE is explicitly specified on the FILE statement or in the JCL, the SAM Large Block
Interface (LBI) is used. This allows block sizes larger than 32760 for tape files.
Examples
The following examples illustrate FILE statements for various files.
Sequential (SAM) Files in z/OS
To define a sequential (SAM) file in z/OS, use:
FILE SEQFILE
GET Statement
GET places the next or previous sequential record of the named file into the file's record buffer.
GET places the next or previous sequential record of the named file into the file's record buffer.
To ensure record availability when using the GET statement, you must test for end-of-file (EOF) or file presence (IF file-
name). If you specify 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 issue a GET PRIOR statement following a POINT statement, or a GET statement following a POINT PRIOR
statement. For more information, see POINT Statement in the chapter "Statements N - R."
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.
This statement has the following format:
• file-name
File-name identifies the input file defined in the library section. File-name can be any file type except SQL.
• [PRIOR]
Specify PRIOR to place the previous sequential record of the named file into the file's record buffer. If you specify PRIOR
and the position in the file is not established, the last record in the file is placed in the file's record buffer.
Note: If the access method of the operating system does not support retrieval of previous records, an execution error
occurs.
• [HOLD] or [NOHOLD]
Except in CICS, CA Easytrieve® Report Generator automatically issues a hold request for records when UPDATE is
specified on the FILE statement. Use NOHOLD to override this process. In CICS, NOHOLD is the default.
Specify HOLD to hold a record for update. 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 in the file. 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.
NOHOLD specifies that a record is not to be held for update.
Note: In CICS, if you specify HOLD, you cannot browse (GET) a file; an execution error occurs. When you want to
update a record, use the READ statement.
• [STATUS]
Specify STATUS whenever the possibility exists for an unsatisfactory completion of the input/output request.
STATUS checks input/output processing to see if it was performed properly. STATUS causes the file's FILE-STATUS
field to be set with the appropriate return code. For information about how to determine the meaning of the contents of
FILE-STATUS, see the appendix "System-Defined Fields." Normally, a zero or non-zero test is sufficient.
CA Easytrieve® Report Generator 11.6
Note: FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
If you do not code STATUS and the operating system returns a non-zero status, CA Easytrieve® Report Generator issues
an appropriate diagnostic message.
Examples
The following code illustrates the use of the GET statement:
The following code illustrates testing for EOF when using the GET statement:
FILE MASTER...
GET
MASTER
IF EOF MASTER STOP END-IF...
GOTO Statement
The GOTO statement allows you to modify the natural top to bottom logic flow of statement execution.
The GOTO statement allows you to modify the natural top to bottom logic flow of statement execution.
This statement has the following format:
• {label}
Specify label to immediately transfer execution control to the first statement following the associated label. Processing then
continues in a top-to-bottom sequence. The label must be contained in the same activity or procedure. A label:
• Can be up to 128 alphanumeric characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters.
A statement label is a complete CA Easytrieve® Report Generator statement that you can code before the following
statements:
• Assignment
• CASE
• COMMIT
• DELETE
• DLI
• END-DO
• END-PROC
• EXIT
CA Easytrieve® Report Generator 11.6
• GET
• IDMS
• INSERT
• MOVE
• PERFORM
• PRINT
• READ
• RELEASE
• ROLLBACK
• SELECT (except non-file SQL)
• SQL
• STOP
• UPDATE
• CALL
• CLOSE
• CURSOR
• DISPLAY
• DO
• END-IF
• EXECUTE
• FETCH
• GOTO
• IF
• MESSAGE
• MOVE LIKE
• POINT
• PUT
• REFRESH
• RESHOW
• SEARCH
• SET
• Statement label
• TRANSFER
• 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.
• {SCREEN}
GOTO SCREEN branches immediately to the top of the current SCREEN activity, including execution of the BEFORE-
SCREEN procedure. It does not include execution of the INITIATION procedure. When used in an INITIATION
procedure, GOTO SCREEN terminates the INITIATION procedure.
GOTO SCREEN cannot be coded in a BEFORE-SCREEN procedure. If GOTO SCREEN is coded in a TERMINATION
procedure, GOTO SCREEN terminates the screen activity.
Example
The following example illustrates the use of GOTO in a program. The arrows indicate that control is passed to the first
executable statement following the label or job statement.
CA Easytrieve® Report Generator 11.6
HEADING Statement
The HEADING statement optionally defines an alternative heading for a field. When defining a field, you
specify the default heading. Using the HEADING statement in a report allows you to override the default
field headings for that report.
The HEADING statement optionally defines an alternative heading for a field. When defining a field, you specify the default
heading. Using the HEADING statement in a report allows you to override the default field headings for that report.
The HEADING statement overrides default field headings defined in the library section. The HEADING statement also
provides alternative heading capabilities for system-defined fields such as TALLY and LEVEL.
This statement has the following format:
• field-name
For reports, field-name specifies a field in your program. The heading you define is used for fields identified on LINE 01 of
your report declaration.
• [#font-number]
#Font-number defines the number of a font that CA Easytrieve® Report Generator uses to format 'heading-literal' in the
heading area of a report. You can only specify #font-number if you direct the report to an extended reporting printer. If
you direct the report to a normal printer, a syntax error occurs when you code #font-number. You can specify a unique font
index 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 index assigned uses the default font for the assigned extended reporting printer.
• 'heading-literal'
'Heading-literal' can be up to 128 characters in length.
For reports, a single line of alphanumeric text replaces the default header and prints as a header over a column or field.
Multiple literals, each enclosed within single quotes ('') and separated by one or more blanks within the parentheses, are
stacked vertically over the column or field when printed.
Examples
CA Easytrieve® Report Generator 11.6
Results:
SOCIAL SECURITY
WIMN GLORIA 025-30-5228 * NO OVERTIME * 251.65 BERG NAN
[ {HIGHEST}] IDD FI
• file-name
File-name is the one to 32-character name that specifies the IDD file. File-name becomes the name of the FILE created by
the IDD FILE statement. To override this name, see the FILENAME parameter.
• [VERSION {HIGHEST}] or [VERSION {LOWEST}] or [VERSION {nnnn}]
Specify HIGHEST, LOWEST, or nnnn (a positive integer) as the version of the file.
• [SELECT (record-name ...)]
Record-name is a 1- to 32-character name that identifies a record of the file-name defined. Repeat the record-name to
identify as many records as needed. If you want to define all the field definitions for the file-name, omit the SELECT
clause.
• [FILENAME new-file-name]
New-file-name is a 1- to 128-character name specifying the name of the file created by the IDD FILE statement.
• [PROGRAM-NAME 'program-literal']
'Program-literal' identifies the program name used to access an authorized subschema. 'Program-literal' must be
alphanumeric and is padded to the right (if necessary) to create an eight-byte value.
• [DBNAME 'db-name-table-literal']
'Db-name-table-literal' identifies the DB Name Table of the data dictionary that contains definitions of schema, subschema,
records, and fields. 'Db-name-table-literal' must be alphanumeric and is padded to the right (if necessary) to create an
eight-byte value.
• [NODE 'node-literal']
'Node-literal' specifies the CA IDMS Central Version Node that will process CA Easytrieve® Report Generator IDD
requests. 'Node-literal' must be alphanumeric and is padded to the right (if necessary) to create an eight-byte value.
• [DICTNAME 'dictionary-literal']
'Dictionary-literal' identifies the Secondary Load Area dictionary name. 'Dictionary-literal' must be alphanumeric and is
padded to the right (if necessary) to create an eight-byte value.
• [DICTNODE 'dictionary-node-literal']
'Dictionary-node-literal' identifies the Secondary Load Area dictionary node. 'Dictionary-node-literal' must be
alphanumeric and is padded to the right (if necessary) to create an eight-byte value.
[ {HIGHEST}] IDD RE
• record-name
The record-name is the 1- to 32-character name that specifies the IDD logical record or the IDD standard record.
• [VERSION {HIGHEST}] or [VERSION {LOWEST}] or [VERSION {nnnn}]
Specify HIGHEST, LOWEST, or nnnn (a positive integer) as the version of the file.
• [LOCATION]
Use this optional parameter to specify the location at which the field definitions will be generated. If you do not specify
LOCATION, W (a W-type working storage field) is the default.
• {start-position}
Start-position specifies the starting position relative to position one of the record.
• {* [+offset]}
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.
• {W or S}
Coding W or S establishes a working storage field. W fields are spooled to report (work) files; S fields are not. W is the
default location if the LOCATION parameter is not coded.
CA Easytrieve® Report Generator 11.6
• subschema-name
Subschema-name is a 1- to 8-character name specifying the SUBSCHEMA that contains the record and field definitions
to be retrieved. Subschema-name becomes the name of the FILE created by the IDD SUBSCHEMA statement. For
information about how to override this name, see FILENAME Parameter.
• [SCHEMA schema-name [VERSION {HIGHEST} or {LOWEST} or {nnnn}]]
Schema-name is the one to eight-character name that specifies the schema that owns the subschema (when a subschema can
be owned by multiple schemas). The optional VERSION parameter specifies the version of the schema.
• [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.
• [SELECT (record-name ...)]
The optional SELECT clause identifies specific subschema records. Record-name is a one to 32-character name that
identifies a record for which the definition is accessed. Repeat record-name to specifically identify all the records you
need. To access all the database records (but not logical records) defined for the subschema, you can omit the SELECT
parameter.
• [FILENAME file-name]
File-name is a 1- to 128-character name specifying the name of the file created by the IDD SUBSCHEMA statement.
[ {HIGHEST}] IDD
CA Easytrieve® Report Generator 11.6
Format 2
Format 1
• receive-field-name
Receive-field-name identifies the four-byte binary field to receive the specified database key.
• {RECORD} or {AREA} or {SET}
Specify RECORD, SET, or AREA.
• {currency-field-name} or {'currency-literal'}
Currency-field-name or 'currency-literal' identifies the currency for the desired key. Currency-field-name must be a 16-
byte alphanumeric field. 'Currency-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-
byte value. The default is the current record of the run-unit.
Format 2
• receive-field-name
Receive-field-name identifies the four-byte binary field to receive the specified database key.
• {NEXT} or {PRIOR} or {OWNER}
Specify NEXT, PRIOR, or OWNER.
• {set-field-name} or {'set-literal'}
Set-field-name or 'set-literal' identifies the name of the desired set. Set-field-name must be a 16-byte alphanumeric field.
'Set-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
{ } {currency-field-name} IDMS
INFO receive-field-name {RECORD} { }
• receive-field-name
Receive-field-name identifies the four-byte binary field to receive the page information.
• {currency-field-name} or {'currency-literal'}
Currency-field-name or 'currency-literal' identifies the record name for the desired key. Currency-field-name must be a 16-
byte alphanumeric field. 'Currency-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-
byte value.
{proc-field-name} IDMS A
• {proc-field-name} or {'proc-literal'}
Proc-field-name or 'proc-literal' identifies the name of a DBA-written database procedure. Proc-field-name must be an
eight-byte alphanumeric field. 'Proc-literal' must be alphanumeric and is padded to the right (if necessary) to create an
eight-byte value.
• TO apib-field-name
Apib-field-name is a 256-byte alphanumeric area of storage to which the APIB is copied.
• stat-field-name
Stat-field-name identifies a 100-byte field that you must define in working storage to receive the current system runtime
statistical information.
{subschema-name } IDMS BI
NAME { }] + [ {'
• {subschema-name} or {'subschema-literal'}
Subschema-name identifies the subschema to be processed with CA IDMS. Subschema-name must be an eight-byte
alphanumeric field. 'Subschema-literal' must be alphanumeric and is padded to the right (if necessary) to create an eight-
byte value.
• [PROGRAM-NAME {program-name}] or [PROGRAM-NAME {'program-literal'}]
Program-name or 'program-literal' specifies the name used to identify the program to CA IDMS during execution.
Program-name must be an eight-byte alphanumeric field. 'Program-literal' must be alphanumeric and is padded to the right
(if necessary) to create an eight-byte value.
• [DBNAME {db-name-table-name}] or [DBNAME {'db-name-table-literal'}]
Db-name-table-name or 'db-name-table-literal' specifies a DB Name Table. Data retrieved during execution of the user's
program will be from the named database. Db-name-table-name must be an eight-byte alphanumeric field. 'Db-name-table-
literal' must be alphanumeric and is padded to the right (if necessary) to create an eight-byte value.
• [NODE {node-name}] or [NODE {'node-literal'}]
Node-name or 'node-literal' specifies the Central Version Node that will host the CA IDMS activity generated by the user's
program. Node-name must be an eight-byte alphanumeric field. 'Node-literal' must be alphanumeric and is padded to the
right (if necessary) to create an eight-byte value.
• [DICTNAME {dictionary-name}] or [DICTNAME {'dictionary-literal'}]
Dictionary-name or 'dictionary-literal' specifies the dictionary name of a secondary load area. Dictionary-name must be an
eight-byte alphanumeric field. 'Dictionary-literal' must be alphanumeric and is padded to the right (if necessary) to create
an eight-byte value.
• [DICTNODE {dictionary-node-name}] or [DICTNODE {'dictionary-node-literal'}]
Dictionary-node-name or 'dictionary-node-literal' specifies the dictionary node of a secondary load area. Dictionary-node-
name must be an eight-byte alphanumeric field. 'Dictionary-node-literal' must be alphanumeric and is padded to the right
(if necessary) to create an eight-byte value.
• file-name
File-name identifies the file where the record-area is to be allocated.
• RECORD record-name
Record-name identifies the record to be bound with CA IDMS.
{proc-field-name} IDMS B
• {proc-field-name} or {'proc-literal'}
Proc-field-name or 'proc-literal' identifies the name of a DBA-written database procedure. Proc-field-name must be an
eight-byte alphanumeric field. 'Proc-literal' must be alphanumeric and is padded to the right (if necessary) to create an
eight-byte value.
• TO receive-field-name
Receive-field-name must be a 256-byte alphanumeric field. The contents of receive-field-name are copied to the APIB as
part of the execution of the IDMS BIND PROCEDURE statement.
• [ALL]
This optional parameter controls which locks are released. The default is ALL EXCEPT THOSE HELD.
• {record-field-name} or {'record-literal'}
Record-field-name or 'record-literal' identifies the record to be connected. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• {set-field-name} or {'set-literal'}
Set-field-name or 'set-literal' specifies the set to which the record is to be connected. Set-field-name must be a 16-byte
alphanumeric field. 'Set-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
[MEMBERS ]
Format 2
IDMS E
Format 1
• RECORD {record-field-name} or RECORD {'record-literal'}
Record-field-name or 'record-literal' identifies the record to be erased. Record-field-name must be a 16-byte alphanumeric
field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• [MEMBERS] or [PERMANENT] or [SELECTIVE] or [ALL]
This optional parameter controls the type of erasure. The default is MEMBERS.
Format 2
• RECORD logical-record-name
Logical-record-name is a one to 16-character name that identifies the logical record to be erased. Logical-record-name
must be the name of a logical record defined by a LOGICAL-RECORD statement.
• [WHERE (boolean-expression)]
Code the optional WHERE clause to provide a Boolean expression CA IDMS uses to select the logical records to be
erased.
[ {record-field-name}]
SHR ] IDMS { } DBKEY { } [
EXC] [ PAGE-
INFO { }] [ {'
Format 2
Format 3
Format 4
Format 5
Format 6
CA Easytrieve® Report Generator 11.6
Format 1
• DBKEY {key-field-name} or DBKEY {'key-literal'}
Key-field-name or 'key-literal' identifies the key of the database record. Key-field-name must be a four-byte binary field.
'Key-literal' must be a four-byte hexadecimal value.
• [RECORD {record-field-name}] or [RECORD {'record-literal'}]
Record-field-name or 'record-literal' identifies the record to be located/retrieved. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
The default is any record type that satisfies the DBKEY.
• [PAGE-INFO {page-field-name}] or [PAGE-INFO {'page-literal'}]
Page-field-name or 'page-literal' identifies the record to be located/retrieved by its page information. Page-field-name must
be a 4-byte binary field. 'Page-literal' must be a 4-byte hexadecimal value.
• [SHARE|SHR] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
Format 2
• [{RECORD|SET|AREA} {field-name|'literal'}]
Field-name or 'literal' identifies the record, set, or area to be located/retrieved. Field-name must be a 16-byte alphanumeric
field. 'Literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value. The default locates/
retrieves the current record of the run-unit.
• [SHARE|SHR] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
Format 3
• {NEXT} or {PRIOR} or {FIRST} or {LAST} or {NTH {nth-field-name|nth-literal}}
Nth-field-name or nth-literal identifies the record occurrence of the set or area to be located/retrieved. Nth-field-name must
be a four-byte binary integer. Nth-literal must be a positive or negative integer.
• [RECORD {record-field-name}|'record-literal'}]
Record-field-name or 'record-literal' identifies the record to be located/retrieved. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
The default is the record that otherwise satisfies the search criteria.
• {SET|AREA}{search-field-name|'search-literal'}
Search-field-name or 'search-literal' identifies the set or area that determines the scope of the search. Search-field-name
must be a 16-byte alphanumeric field. 'Search-literal' must be alphanumeric and is padded to the right (if necessary) to
create a 16-byte value.
• [SHARE|SHR ] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
Format 4
• OWNER SET {set-field-name|'set-literal'}
Set-field-name or 'set-literal' identifies the set to search. Set-field-name must be a 16-byte alphanumeric field. 'Set-literal'
must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• [SHARE|SHR] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
Format 5
• {CALC} or {DUPLICATE}
This parameter determines whether the first (CALC) or next (DUPLICATE) record is located/retrieved.
• RECORD {record-field-name|'record-literal'}
Record-field-name or 'record-literal' identifies the record to locate/retrieve. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• [SHARE|SHR] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
Format 6
• [CURRENT]
CA Easytrieve® Report Generator 11.6
This optional parameter controls the start of the search. The default begins with the owner of the current record within the
set.
• RECORD {record-field-name|'record-literal'}
Record-field-name or 'record-literal' identifies the record to locate/retrieve. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• SET {set-field-name|'set-literal'}
Set-field-name or 'set-literal' identifies the set to search. Set-field-name must be a 16-byte alphanumeric field. 'Set-literal'
must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• USING {control-field-name|'control-literal'}
Control-field-name or 'control-literal' identifies the control data item. The length and code system of the control data item
must match that in the database.
• [SHARE|SHR] or [EXCLUSIVE|EXC]
These optional parameters determine the type of lock to be placed on the object record.
IDMS FINISH
[ {record-field-name}] IDMS G
• RECORD {record-field-name|'record-literal'}
Record-field-name or 'record-literal' identifies the record to locate/retrieve. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
The default record is the current record type of the run-unit.
IDMS IF Statement
The IDMS IF statement tests the status of a set.
The IDMS IF statement tests the status of a set.
This statement has the following format:
{MEMBER }
• SET {set-field-name|'set-literal'}
Set-field-name or 'set-literal' identifies the set to search. Set-field-name must be a 16-byte alphanumeric field. 'Set-literal'
must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• {MEMBER} or {NOMEMBER} or {EMPTY} or {NOEMPTY}
This parameter determines the type of test:
CA Easytrieve® Report Generator 11.6
• [{RECORD|SET|AREA} {field-name|'literal'}]
Field-name or 'literal' identifies the desired record, set, or area to be locked. Field-name must be a 16-byte alphanumeric
field. 'Literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• [EXCLUSIVE]
This optional parameter controls the lock for the record. The default is SHARED LOCK.
{record-field-name} IDMS M
Format 2
Format 1
• RECORD {record-field-name|'record-literal'}
Record-field-name or 'record-literal' identifies the record to be modified. Record-field-name must be a 16-byte
alphanumeric field. 'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
Format 2
CA Easytrieve® Report Generator 11.6
• RECORD logical-record-name
Logical-record-name is a 1- to 16-character name that identifies the logical record to be modified by CA IDMS.
• [WHERE (boolean-expression)]
Code the optional WHERE clause to provide a Boolean expression to CA IDMS to select the logical records to be
modified.
{FIRST} IDM
• {FIRST} or {NEXT}
Specify FIRST to retrieve the first occurrence of the logical record. Specify NEXT to retrieve subsequent occurrences.
• RECORD logical-record-name
Logical-record-name is a 1- to 16-character name that identifies the logical record to be retrieved. Logical-record-name
must be the name of a logical record defined by a LOGICAL-RECORD statement.
• [WHERE (boolean-expression)]
Code the optional WHERE clause to provide a Boolean expression CA IDMS uses to select the logical records to be
retrieved.
• [AREA {area-field-name|'area-literal'}]
Area-field-name or 'area-literal' identifies the area to be made available for processing. Area-field-name must be a 16-byte
alphanumeric field. 'Area-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value. If
not specified, all areas in the subschema are readied.
• [{RETRIEVAL|UPDATE} [PROTECTED|EXCLUSIVE]]
These optional parameters determine the type of access. The default is RETRIEVAL.
{set-field-name} IDMS R
• DBKEY receive-field-name
This is a four-byte binary field with zero (0) decimal places. This field receives the DBKEY of the indexed record.
• FROM {set-field-name|'set-literal'}
Set-field-name or 'set-literal' identifies the index set to be accessed. Set-field-name must be a 16-byte alphanumeric field.
'Set-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
• [KEY symbolic-key]
This parameter retrieves the record's symbolic key into symbolic-key. Symbolic-key is the name of an alphanumeric field
that is large enough to contain the record's symbolic key.
• {CURRENCY|FIRST [CURRENCY]|LAST [CURRENCY]|{NEXT [CURRENCY]|{PRIOR [CURRENCY]}
{USING {key-field-name|'key-literal'}}
These parameters determine the record for which the database key is returned:
• CURRENCY -- the current index entry
• FIRST [CURRENCY] -- the first entry in the index
• LAST [CURRENCY] -- the last entry in the index
• NEXT [CURRENCY] -- the entry following current of index. If the current of index is the last entry, an error status of
1707 (END OF INDEX) is returned.
• PRIOR [CURRENCY] -- the entry before current of index
• 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.
• [CONTINUE]
This optional parameter specifies the action taken after the recovery. The default is to terminate the run-unit.
Format 2
Format 1
• RECORD {record-field-name|'record-literal'}
Record-field-name or 'record-literal' identifies the record to store. Record-field-name must be a 16-byte alphanumeric field.
'Record-literal' must be alphanumeric and is padded to the right (if necessary) to create a 16-byte value.
Format 2
• RECORD logical-record-name
Logical-record-name is a one to sixteen-character name that identifies the logical record that CA IDMS stores.
• [WHERE (boolean-expression)]
Code the optional WHERE clause to provide a Boolean expression CA IDMS uses to select the logical records to be stored.
The following diagram illustrates IF, ELSE-IF, ELSE, and END-IF logic:
CA Easytrieve® Report Generator 11.6
• conditional-expression
For conditional expression syntax, see Conditional Expressions in the chapter "Statements A - C."
• ELSE-IF
ELSE-IF is optional and identifies a conditional expression to be tested when the previous conditional expression is false.
ELSE-IF statements allow multiple conditions to be nested without requiring an END-IF statement on each condition. You
can code as many ELSE-IF statements as necessary.
• ELSE
CA Easytrieve® Report Generator 11.6
ELSE is optional and identifies the statements to be executed when conditions are false. When the conditions of the
preceding IF or ELSE-IF are not satisfied, CA Easytrieve® Report Generator continues execution with the statement
following ELSE.
Note: ELSE must be on a source statement by itself, unless it is followed by a period and a space.
• END-IF
END-IF terminates the logic associated with the previous IF statement. An END-IF statement must be specified after each
IF statement and its associated statements. You do not specify an END-IF for an ELSE-IF.
Examples
The following three examples illustrate the IF statement usage. In each of the illustrated cases, the field XMAS-BONUS is
computed to be three or five percent over PAY-GROSS. If the field PAY-GROSS is non-numeric, a warning message is issued
and the record is bypassed from further processing.
Example 1, Without Nested IF Statements:
ELSE
XMAS-BONUS = PAY-
GROSS * 1.05
END-
IF
TOT-XMAS-BONUS = TOT-
XMASBONUS + + XMAS-
BONUS PRINT MYREPORT
FINISH-
PROC. PROC DISPLAY
XMAS-BONUS END-
PROC *
LAST XMAS-BONUS
XMAS-
BONUS W 6 P 2 VALUE 0 *
JOB INPUT PERSNL NAME MYPROG FINISH FINISH-
PROC
IF PAY-GROSS NOT
NUMERIC
DISPLAY EMP# ' PERSONNEL RECORD IS DAMAGED'
ELSE
IF PAY-GROSS >
500.00
XMAS-BONUS = PAY-
GROSS * 1.03
ELSE
XMAS-BONUS = PAY-
GROSS * 1.05
END-
IF
END-
IF
TOT-XMAS-BONUS = TOT-XMAS-BONUS + XMAS-
BONUS PRINT MYREPORT
FINISH-
PROC. PROC DISPLAY
XMAS-BONUS END-
PROC *
LAST XMAS-BONUS
FINISH-
PROC. PROC DISPLAY
XMAS-BONUS END-
PROC *
LAST XMAS-BONUS
INITIATION. PROC
Example
INITIATION.
PROC
MESSAGE 'Enter an employee number.' LEVEL INFORMATION MOVE ZERO TO EMP-
NO MOVE SPACES TO EMPNAMEEND-PROC
INSERT Statement
Use the INSERT statement to insert a row into a SQL file.
Use the INSERT statement to insert a row into a CA Easytrieve® Report Generator SQL file.
INSERT does not require an open cursor. If no cursor is open for the file, 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.
The file must be specified with the UPDATE parameter.
This statement has the following format:
• [INTO]
CA Easytrieve® Report Generator 11.6
JOB Statement
The JOB statement defines and initiates a processing activity. In a JOB activity, statements can specify
various processing tasks:
The JOB statement defines and initiates a processing activity. In a JOB activity, statements can specify various processing
tasks:
• Retrieval of input files and databases
• Examination and manipulation of data
• Initiation of printed reports
• Production of output files and databases
The JOB statement can also identify the name of an automatic input file (which can be any file or database that is processed
sequentially).
JOB activities can be executed by PROGRAM or SCREEN activities. If a PROGRAM activity is not coded, JOB and SORT
activities are automatically executed sequentially until a SCREEN activity is encountered.
This statement has the following format:
JOB +
[ { }][ENVIRONMENT{NONE }] +[ {COBOL}]
• [INPUT]
The optional INPUT parameter identifies the automatic input to the activity.
When you do not specify INPUT, CA Easytrieve® Report Generator automatically provides an input file. If a SORT
activity immediately preceded the current JOB activity, the default input is the output file from that SORT activity.
Otherwise, the default input is the first file named in the library section.
• {file-name}
File-name identifies the automatic input file. File-name identifies any file defined in the library section of the program
eligible for sequential input processing. When CA Easytrieve® Report Generator processes the last automatic input record,
CA Easytrieve® Report Generator terminates the job activity.
Note: Except in CICS, CA Easytrieve® Report Generator issues a GET HOLD for a VSAM file with the UPDATE
parameter as automatic input. This lets you update an automatic input file in all environments except CICS.
For more information about database processing, see the Programming Guide.
• {[KEY (key-field-name ...)]}
Specify key fields for JOB statement activities.
Code KEY (key-field-name) for each file-name of a synchronized file input process. During synchronized file processing,
CA Easytrieve® Report Generator sequentially processes the files, using KEY fields. KEY fields can be any fields from the
associated file. The only exceptions are varying length, index, or subscript fields, which cannot be used as keys. For more
detailed information about synchronized file processing, see the Programming Guide.
CA Easytrieve® Report Generator 11.6
Note: Synchronized file processing is not allowed for CA IDMS and IMS/DLI database files.
• {NULL}
Code NULL as a file-name to inhibit automatic input. Use this when no input is required or when input is retrieved by
statements in the activity. When NULL is used, a STOP or TRANSFER statement must be executed in the JOB activity,
otherwise the activity executes indefinitely.
• {SQL}
Code SQL instead of a file-name to use automatic retrieval of an SQL database without a file. The selection criteria for
the input are specified on the non-file SQL SELECT statement that must immediately follow the JOB statement. For more
information about automatic retrieval without a file and SQL database processing, see the Programming Guide.
• [START start-proc-name]
The optional START start-proc-name parameter identifies a procedure to be executed during the initiation of the JOB.
CA Easytrieve® Report Generator optionally performs the procedure coded in start-proc-name before it retrieves the first
automatic input record. A typical START procedure sets working storage fields to an initial value or positions a file to a
specific record. You cannot reference fields in automatic input files, because no records have been retrieved at this stage of
processing.
If GOTO JOB is executed in a START procedure, the START procedure is terminated.
• [FINISH finish-proc-name]
The optional FINISH finish-proc-name parameter identifies a procedure to be executed during the normal termination of
the JOB. After CA Easytrieve® Report Generator processes the last automatic input record, it performs the finish-proc-
name procedure. A typical finish-proc-name procedure displays control information accumulated during the activity.
If GOTO JOB is executed in a FINISH procedure, the FINISH procedure is terminated at that point.
If STOP EXECUTE is executed in the JOB activity, the FINISH procedure is not performed.
• ENVIRONMENT (z/OS only)
Specifies to establish the proper execution environment prior to calling any COBOL subprograms. The environment is
established prior to the JOB activity and is terminated after the activity termination.
ENVIRONMENT(COBOL) is ignored if the JOB activity contains no CALL statement and if no FILE EXITs are
specified. When used on the JOB statement, it establishes the ENVIRONMENT for only that JOB activity.
This processing is different if the JOB activity is invoked from within a PROGRAM activity if that PROGRAM activity
had activated the ENVIRONMENT, (through the PROGRAM ENVIRONMENT(COBOL) parm). In that case, the
PROGRAM activity's ENVIRONMENT will remain active during the execution of the invoked JOB activity, and the
ENVIRONMENT will not end at the JOB activity termination. Even if ENVIRONMENT(NONE) is specified on the JOB
or PARM statements, the PROGRAM activity's ENVIRONMENT will remain active during the JOB activity execution.
When this parameter is absent, the default for ENVIRONMENT depends on how the ENVIRON system option was set at
installation and whether the ENVIRONMENT parameter of the PARM statement was specified. Using the subparameter
NONE overrides an existing default of COBOL and using COBOL overrides a default of NONE. See the discussion of the
PROGRAM statement, and see the chapter "Subprograms" for more information about this parameter and the functionality
of this feature.
• [NAME job-name]
The NAME parameter names the JOB activity. Job-name:
• Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
This parameter is used for documentation purposes or to identify this JOB on an EXECUTE statement.
• [COMMIT [ACTIVITY|NOACTIVITY] [TERMINAL|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 ACTIVITY to commit all recoverable work during the normal termination of the activity. Specify NOACTIVITY
to tell CA Easytrieve® Report Generator not to commit at the end of the activity. NOACTIVITY is the default.
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® Report Generator
not to commit during a terminal I/O. TERMINAL is the default.
If this activity is executed by an activity that has NOTERMINAL specified, this activity performs terminal I/O as if
NOTERMINAL was specified.
Note: You can also issue your own COMMIT and ROLLBACK statements to commit or recover work on a controlled
basis.
For more information, see the Programming Guide.
Examples
CA Easytrieve® Report Generator 11.6
Example 1
The following example illustrates the position of the JOB activities in a CA Easytrieve® Report Generator program.
For more information about JOB activity flow control, see the Programming Guide.
Example 2
The following example illustrates a JOB statement that automatically reads a sequential file:
Example 3
The following example illustrates synchronized file processing. It shows a JOB statement for matching a transaction file
(TRANFILE) with a master file (MASTFILE). The JOB uses the FINISH parameter to execute a procedure when all the input
records have been recorded.
KEY Statement
Use the KEY statement to:
Use the KEY statement to:
• Define valid keys for a screen
• Specify descriptive text to be displayed for each valid key
• Assign automatic functions to be executed for each valid key
If a key that is not defined on a KEY statement is pressed, an error message is displayed on the terminal prompting the user to
press a valid key.
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.
When used as the result of pressing an IMMEDIATE key, REFRESH redisplays the screen image with the original data
displayed on the screen. This is useful when the terminal user enters erroneous data on the screen and wants to restore the
screen with its original data.
When used as the result of a non-IMMEDIATE key, REFRESH can be used to rebuild the screen using current data from the
screen.
REFRESH can also be invoked by using the REFRESH statement. For more information, see REFRESH Statement in the
chapter "Statements N - R."
CA Easytrieve® Report Generator 11.6
EXIT can also be invoked indirectly by executing it in a screen procedure. For more information, see EXIT Statement in the
chapter "Statements D - F."
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 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 determined when these keys are pressed.
This statement has the following format:
• key-name
Specify a symbolic name for a terminal key as described by the system-defined field, KEY-PRESSED.
KEY-PRESSED is a two-byte binary field that contains a value representing the most recent terminal key pressed by the
terminal user.
CA Easytrieve® Report Generator automatically defines symbolic names that correspond to values for the most common
keys:
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.
• [THRU key-name]
Use THRU key-name to specify a range of key-names. A range of key-names includes all keys whose constant values for
KEY-PRESSED fall between the constant values of the keys you specify for the range. For example, if you code:
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).
Note: You can also specify a series of non-consecutive key-names by omitting THRU. You can optionally separate a series
of key-names with commas for readability. You can specify a range of key-names and a series of key-names on the same
KEY statement. See the examples below.
• [NAME 'literal']
The optional NAME parameter allows you to specify descriptive text to be displayed with the key on the screen. The
format displayed on the screen is:
key-name=literal
CA Easytrieve® Report Generator 11.6
Example:
Code Meaning
KEY F1 F1 is valid, but nothing is displayed on the screen. You must
provide code.
KEY F1 THRU F24 F1 to 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 fields into program fields. The AFTER-SCREEN
'CANCEL' IMMEDIATE 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 + REFRESH NAME + 'Refresh' F5 ignores the data on the screen and rebuilds the screen with
the values currently in memory. F5=Refresh is displayed on
the screen.
CA Easytrieve® Report Generator 11.6
LINE Statement
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.
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.
For control reports, any quantitative field on the LINE statement is automatically totaled on each summary line. This feature
can be overridden on the SUM statement.
In an XML-formatted report, only one LINE statement is allowed. All LINE statement parameters except field-name and
'literal' are ignored. For a detailed description of the XML report feature, see the Programming Guide.
This statement has the following format:
{[ ] field-name }
• [line-number]
Specify the optional line number with line-number. The line number specifies the position of the line in the line group.
The value must be from 1 to 99; the default is 1. You can omit line-number for the first LINE. You must specify the line
numbers for multiple LINE statements in ascending order with no duplicates. Specify at least one data item (field-name or
literal) on each LINE statement.
• [#font-number]
#Font-number identifies the font specifications to be used for the next display item. You can only specify this option if
the report has been associated with an extended reporting printer. #Font-number identifies the number of a font defined
for the associated extended reporting printer. If you do not code the font, the next display item uses the default font for the
assigned extended reporting printer.
• {field-name}
Field-name can specify any field contained in an active file or in working storage. If the field is contained in a file or
W storage, data is transferred to the print line at the time the PRINT statement is executed. If the field is contained in S
storage, data is transferred to the print line at the time the line is printed.
Note: Field-name cannot specify a K field.
• {'literal'}
'Literal' defines a static value for a line item. It must be a numeric literal, a hexadecimal literal, or an alphanumeric literal.
Alphanumeric literals must be enclosed within single quotes.
• {+offset|-offset}
The space adjustment parameters, +offset or -offset, modify the spacing between line items. The offset value is added to or
subtracted from the SPACE value on the REPORT statement to give the absolute spacing between line items. The absolute
space value can range from zero to any amount that still allows the next line item to fit in the line defined by LINESIZE on
the REPORT statement.
• {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.
When the report is associated with an extended reporting printer, an error results if two or more fields and/or literals
overlap.
• {POS position-number}
The POS parameter lets you position line items on lines 2 to 99 so that they line up under particular line items on the first
line. Position-number corresponds to the line item number of LINE 01 under which the line item is placed.
Example
CA Easytrieve® Report Generator 11.6
LINK Statement
Use the LINK statement 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.
Use the LINK statement 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.
You can use LINK to invoke any program written in any language that is supported by the operating system in which the
program is executing, including CA Easytrieve Report Generator. 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.
For more information, see the Programming section.
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 Report Generator.
This statement has the following format:
{program-field-name}
LINK { } +
{'program-name' }
[ {field-name} ]
[USING { } ] +
[ {'literal' } ]
[GIVING field-name ]
• {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.
'Program-name' is the name of the program to which you want to LINK.
• USING {field-name|'literal'}
Code USING to pass a single parameter to the child program.
Field-name is the name of a field containing the parameter you want to pass to the child program.
'Literal' is a literal value you want to pass to the child program.
• [GIVING field-name]
Specify GIVING to indicate that the parent program can accept a return parameter from the child program. Field-name is
the name of a field to which the returned parameter is written. For more information, see the Programming section.
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.
CA Easytrieve® Report Generator 11.6
Example
LIST Statement
LIST regulates the printing or suppression of all statements in the printed output.
LIST regulates the printing or suppression of all statements in the printed output.
You can place a LIST statement anywhere in CA Easytrieve® Report Generator source code. LIST must be on a record by
itself.
LIST does not appear in the printed output.
To suppress all CA Easytrieve® Report Generator listing information, use the following:
For more information, see PARM Statement in the chapter "Statements N - R."
This statement has the following format:
• [ON|OFF]
ON specifies that all subsequent statements are to be printed. OFF suppresses the printing of all subsequent statements.
• [MACROS|NOMACROS]
MACROS specifies that macro statements are to be printed if a LIST ON is in effect. NOMACROS suppresses the printing
of macro statements.
Default: LIST ON MACROS.
MACRO Statement
The MACRO prototype statement must be the first statement of a macro. It optionally defines the
parameters of a macro. You can use positional and keyword parameters. The definition of positional and
keyword parameters follow the same rules as Field and Label names (see "Syntax Rules").
The MACRO prototype statement must be the first statement of a macro. It optionally defines the parameters of a macro. You
can use positional and keyword parameters. The definition of positional and keyword parameters follow the same rules as Field
and Label names (see "Syntax Rules").
This statement has the following format:
MACRO [positional-count] +
• MACRO
MACRO must be the first word on a prototype statement.
• [positional-count]
CA Easytrieve® Report Generator 11.6
Positional-count is an optional parameter that specifies the number of positional-parameters on the prototype statement. It
is required only when you use keyword-parameters and positional-parameters. You must code the value as zero when you
specify only keyword-parameters on the prototype statement.
• [positional-parameters]
Use positional-parameters when a value is always required for the parameters each time the macro is invoked. Frequently-
used parameters are often positional, because you need only code the value of the parameter.
You must code positional-parameters before any keyword-parameters. The positional values are substituted according to
their position on the prototype statement.
• [keyword-parameters]
Use keyword-parameters:
• To help keep track of a large number of parameters
• For optionally-used parameters
• To specify a default value for parameters
Keyword-parameters have two parts: the keyword name and the default value.
Examples
The following series of examples depict the coding of macro prototype statements. For more information about system
services, see the Programming Guide.
The number of positional-parameters is not indicated. You could have coded the optional positional-count parameter as a '2.'
Code the number of positional-parameters as zero. Positional-count is a required parameter when you use keyword-
parameters.
Macros with both positional and keyword-parameters require that you supply positional-parameters first, and also supply a
positional-count.
MASK Parameter
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 ezt statements:
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 Report Generator statements:
• DEFINE
• ROW
This statement has the following format:
• [mask-identifier]
Any letter from A to Y can be used as an optional mask-identifier. You can use the letter to identify a new mask or to
retrieve a mask that was previously defined in the Site Options Table or by a mask parameter on a previous field definition.
If the new mask that you identify does not already exist, the mask is retained for future reference. If you subsequently
reference a field-name for display, the associated letter identifier is automatically used to determine the edit mask. Do not
use the same identifier to establish more than one mask. You can define 192 unidentified edit masks and 25 identified edit
masks for a total of 217 edit masks.
• [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.
• ['mask-literal']
'Mask-literal' defines an edit mask and must be enclosed within single quotes. For information about coding the actual edit
mask, see the Editing Rules section that follows.
• HEX
HEX is a special edit mask that instructs the product to display the contents of field-name in double-digit hexadecimal
format. You can display fields of up to 50 bytes with the HEX mask.
Note: HEX edit masks are not allowed for VARYING fields.
Editing Rules
• CA Easytrieve Report Generator edits field data only at the time of display and according to a specified edit mask pattern.
• The MASK parameter of the DEFINE and ROW statements specifies the edit mask pattern.
• Each digit of the field must be designated in the mask by an edit mask character:
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.
$ Prints a currency symbol prior to the first non-zero digit. The
type of currency symbol ($, ¥, £, _, etc.) is determined by the
MONEY Site Option.
x Insertion symbol -- prints any character with the edited data.
Decimal Digits
• When you display data, there is no implied relationship between the number of decimal digits in the edit mask and the
number of decimal digits in the field definition. You must code the correct number of decimal digits in the mask.
• When screen data is edited against a mask, the decimal point is automatically aligned.
Alphanumeric Fields
• Alphanumeric fields cannot be edited. (The exception is MASK HEX.)
Currency Symbols
• The currency symbol indicator is recognized in the input edit mask and appears in the output edit mask. For example, if the
currency symbol is set to #, a valid edit mask is '###,##9.99.'
Insertion Symbols
• Z, $, -, and * print digits only when coded as the first symbol of the edit mask, and only up to the first nine 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.
Insertion symbols before the first digit position always print.
• Insertion symbols between digit positions print according to the following rules:
• If the symbol that prints a digit following the insertion symbol is a 9, the insertion characters always print.
• If the digit position following the insertion symbols is a Z, $, -, or *, the insertion symbols print only if the digit position
prints. If the digit position does not print, the insertion symbols are replaced by fill symbols.
CA Easytrieve® Report Generator 11.6
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.
Fill Characters
• The default fill character for an edit mask is a blank, unless an * (asterisk) is specified.
Mask Display Length
• When the first symbol of an edit mask is a dash (-) or a currency symbol, the display length of the mask is the length of the
mask plus one.
• The mask for a SUM field in a report is automatically increased by the number of digits that are specified by the
SUMSPACE parameter on the REPORT statement. The first digit position is duplicated the required number of times.
Negative Indicators
• Symbols following the last digit position specify the negative indicator. The symbols print if the value edited is negative. If
the value edited is positive, the symbols are replaced by fill characters.
System Default Masks - Numeric Fields
When you do not specify a mask, the following defaults apply:
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 the product is installed.
Leading Zeros
Various methods are available for processing leading zeros.
Display
When leading zeros are an important part of the number (such as social security numbers and part numbers) an edit mask that
displays these zeros is essential. These are examples of edit masks that display leading zeros:
CA Easytrieve® Report Generator 11.6
Suppress
In some instances, leading zeros add unnecessary information and can confuse the reader. You can suppress the display of
leading zeros by using one of the following masks:
Replace
In cases where fields must be protected (such as check amounts), you can use edit masks that replace leading zeros with other
symbols:
Negative Numbers
The symbols that are used as negative number indicators are displayed to the right of the last digit of the negative data that you
edit. You can use any symbols as negative number indicators, although the most typical indicators are the minus sign (-) and
the credit indicator (CR). If the number is positive, display of these symbols is inhibited. However, when the field contents turn
negative, the negative number indicators are edited into the displayed output as follows:
Examples
The following edit mask examples illustrate editing mask rules:
MEND Statement
The MEND statement is an optional macro termination command used at the end of a macro. MEND is
required at the end of an instream macro. See also MSTART Statement in this chapter.
The MEND statement is an optional macro termination command used at the end of a macro. MEND is required at the end of
an instream macro. See also MSTART Statement in this chapter.
MEND must be coded on a line by itself.
This statement has the following format:
MEND
MESSAGE Statement
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.
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.
You can code the MESSAGE statement in a screen procedure or in another activity.
You can determine where messages of a particular level are displayed on the screen by overriding the default message area on
a DEFAULT statement. (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.
CA Easytrieve® Report Generator maintains an internal message area for each type of message. The MESSAGE statement
updates the pending message area. When the next screen is displayed, the screen message area is built from the pending
message.
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
If multiple MESSAGE statements of the same precedence are issued before displaying the screen, the last message issued is
displayed. There are Site Options that determine the display attributes for the three levels of messages. You can override these
attributes on a DEFAULT statement.
This statement has the following format:
CA Easytrieve® Report Generator 11.6
• {'literal'} or {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.
The maximum length of a message is 130 characters. If the message exceeds the message area for the screen on which it is
displayed, the message is truncated.
• [LEVEL {INFORMATION|WARNING|ACTION}]
Use LEVEL to specify the type of message you are defining.
INFORMATION messages typically inform a user that processing is proceeding normally.
WARNING messages tell the user that a potentially undesirable condition could occur or has occurred, even though the
error can be ignored.
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 continuing. ACTION is the default message level if no level is specified.
Example
MOVE Statement
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.
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.
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. For more information
about MOVE statement specification rules, see the Programming section.
When you process an SQL table as a CA Easytrieve Report Generator file, the product knows which fields are nullable. This
information is obtained automatically from the SQL catalog when used to generate CA Easytrieve Report Generator field
definitions.
This statement has two formats.
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]
CA Easytrieve® Report Generator 11.6
{receive-field-name } [receive-length-literal]
Format 2
{NULL }
{SPACE }
{SPACES }
MOVE { } TO receive-field-name...
{ZERO }
{ZEROS }
{ZEROES }
{HIGH-VALUES}
{LOW-VALUES }
The first parameter after the MOVE keyword (NULL, SPACE, SPACES, ZERO, ZEROS, ZEROES, HIGH-VALUES,
or LOW-VALUES) 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.
• receive-field-name
Receive-field-name identifies the receiving data area. You can specify multiple receive-field-names. Receive-field-names
are set to the appropriate data format, such as packed zero for fields with a type of P.
Example
Statements:
Results:
0000000099 66
0000000000 00
==========
**********
{send-file-name } {receive-file-name }
MOVE LIKE { } TO { }
{send-record-name} {receive-record-name}
• {send-file-name} or {send-record-name}
Send-file-name or send-record-name identifies the sending data area.
• {receive-file-name} or {receive-record-name}
CA Easytrieve® Report Generator 11.6
MYFILE:NAME-FIRST = PERSNL:NAME-FIRST
CA Easytrieve® Report Generator 11.6
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.
MSTART Statement
The MSTART statement is used to begin an instream macro. MSTART must be the first statement in the
program.
The MSTART statement is used to begin an instream macro. MSTART must be the first statement in the program.
This statement has the following format:
MSTART macro-name
• 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.
Note:
For CA Panvalet and CA Endevor libraries the macro name can be from 1 to 10 characters in length.
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.
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.
You can code a NEWPAGE statement anywhere in CA Easytrieve® Report Generator source code. NEWPAGE must be on a
record by itself. NEWPAGE does not appear in the printed output.
This statement has the following format:
NEWPAGE
PARM Statement
The PARM statement lets you 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.
The PARM statement lets you 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.
CA Easytrieve® Report Generator 11.6
Specification of the PARM statement is optional. Code the PARM statement only to modify the environment for your
program. If used, the PARM statement must be the first statement in your CA Easytrieve® Report Generator job.
Code PARM statement parameters and their subparameters in any order. You must code multiple subparameters within
parentheses.
PARM establishes program-level parameters in the following areas:
• SYNTAX, COMPILE, and LINK determine the mode of execution.
• ABEXIT, DEBUG, and LIST establish control over system facilities associated with compiler output and execution error
handling.
• VFM establishes system control parameters.
• SORT controls the interface to your installation's sort program.
• BIND, PLAN, PREPNAME, SQLID, SSID, USERID, PLANOPTS, and SQLSYNTAX establish parameters for SQL
execution.
• TRANSID controls CICS execution.
For more information about controlling CA Easytrieve® Report Generator with the PARM statement, see Compile and Link
Your Program.
This statement has the following format:
PARM +
[ {SNAP } ]
[ABEXIT {NOSNAP} ] +
[ {NO } ]
[ {DYNAMIC } ]
[BIND {STATIC-ONLY} ] +
[ {ANY
} ]
[
{STATIC } ]
[CALL {DYNAMIC} ] +
[ {AMODE24} ]
[ {EBCDIC } ]
[CODE PROCESS {ASCII } ] +
[ {dbcs-code-name} ]
[COMPAREUSINGALTSEQ {YES|NO } ]
+[COMPILE] +
[STATE
] [XREF {LONG } ] ] [FLOWSIZ number-of-table-entries]
[ ] [ { } ] ) ] +
CA Easytrieve® Report Generator 11.6
[PLAN (planname
[command-program-name])] +
[PLANOPTS 'plan-options-module'] +
[ {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] +
CA Easytrieve® Report Generator 11.6
[TRANSID 'transid'] +
[ [
{DISK } ] ] [VFM ([buffer-core-storage]
[DEVICE { } ] ) ] + [
[ {MEMORY} ] ]
[
{YES} ]
[WORKFILE ( { } [number-of-cylinders] )]
[ {NO } ]
ABEXIT
[ABEXIT {SNAP|NOSNAP|NO}]
ABEXIT indicates the level of control exercised over program interrupt codes 1 to 11. SNAP prints a formatted dump of CA
Easytrieve® Report Generator storage areas along with an error analysis report. NOSNAP prints only an error analysis report.
NO inhibits CA Easytrieve® Report Generator interception of program interrupts.
It is advisable that the ABEXIT value in the site options table be set to NO, and to use the PARM ABEXIT(SNAP or
NOSNAP) during development as a debugging aid. Before moving the CA Easytrieve® Report Generator program into
production, remove the PARM ABEXIT override. This will reduce overhead for production applications.
BIND
[BIND {DYNAMIC|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 used only by the mainframe DB2 SQL interface. It is ignored in other environments.
BIND DYNAMIC results in the dynamic execution of the SQL statements in your program. Dynamic processing requires SQL
statements to be dynamically prepared before they can be executed. The SQL interface controls the SQL environment and does
not prepare SQL statements repeatedly unless a syncpoint has been taken.
BIND STATIC-ONLY indicates that your application program is to execute statically. This option requires the creation of
a static-command-program that is then processed by the DB2 preprocessor. The DB2 preprocessor generates a DBRM and
finally a PLAN. During the execution of your application program, the SQL interface processes the SQL statements in the
static-command-program. If any errors are found in the static-command-program or its PLAN, SQL processing is terminated.
BIND ANY indicates that a static-command-program is to be generated and a PLAN created, as with an option of STATIC-
ONLY. However, if the SQL interface encounters any errors with the static-command-program or its PLAN during the
execution of your application program, it switches to dynamic processing.
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®
Report Generator program. Your CA Easytrieve® Report Generator 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.
If no value is specified for the BIND parameter in the program or in the options table, DYNAMIC is the default mode of
execution. Otherwise, the BIND value in the options table becomes the default.
The following table shows the use of the BIND parameter with the value specified in the options table.
CALL
[CALL {STATIC|DYNAMIC|AMODE24|AMODE31}]
CALL enables you to specify how subprograms referenced in CALL statements are linked to your CA Easytrieve® Report
Generator program. STATIC indicates that you want the subprogram to be linked with your CA Easytrieve® Report
Generator program. DYNAMIC indicates that you want the subprogram to be dynamically loaded. The default is DYNAMIC
on the mainframe and in Windows, and the default is STATIC in Unix environments. Individual subprograms can override
this setting using the DECLARE statement. AMODE24 indicates that this CA Easytrieve® Report Generator program will
be calling an AMODE-24 subprogram, (using the CALL statement or as a FILE EXIT). This will cause the CA Easytrieve®
Report Generator runtime to allocate all dynamic storage and record buffers below the 16 MB line. AMODE31 allows all
possible memory allocations to be made above the 16MB line. The default AMODE is the setting of the AMODE31 system
installation option.
CODE PROCESS
[CODE PROCESS {EBCDIC|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 this parameter is not specified here, the default is taken from the processing code system as defined in the CA PSI
Subsystems DBCS Options Table.
Note: Using multiple code systems in a program can result in a longer execution time due to code system conversions.
COMPAREUSINGALTSEQ
[COMPAREUSINGALTSEQ {YES|NO}]
Identifies whether the collating sequence table is used for the character compare process. YES indicates that the collating
sequence table is used. NO indicates that the collating sequence table is not used. For more information about the alternate
collating sequence table, see Alternate Collating Sequence Table.
COMPILE
[COMPILE]
COMPILE terminates execution after the completion of the syntax check and compile operations. Use COMPILE to review the
code generated in the CA Easytrieve® Report Generator Program Map (PMAP).
DATE
[DATE {MMDDYY|YYMMDD|DDMMYY}]
DATE specifies the format of the date placed at the top of the compiler listing and the date stored in the system-defined
SYSDATE field. Valid values are MMDDYY, YYMMDD, and DDMMYY, where MM is the month, DD is the day, and YY
is the year.
DEBUG
[DEBUG]
DEBUG and its subparameters control generation of certain system outputs.
Warning: These outputs are very helpful to analyze programming errors that cause abnormal execution termination
(ABENDs).
ENVIRONMENT
ENVIRONMENT (z/OS only)
Specifies to establish the proper execution environment prior to calling COBOL subprograms. The environment is established
prior to each JOB activity that contains a CALL statement and is terminated after the activity for which it was established.
When used on the PARM statement, it establishes the default (NONE or COBOL) for all JOB activities in the entire program.
When this parameter is absent, the default for ENVIRONMENT depends on the ENVIRON setting within the Site Options
Table being used. Using this parameter overrides that setting.
This parameter does not establish the default for PROGRAM activities. If the environment is desired for the PROGRAM
activity, the ENVIRONMENT parameter must be specified on the PROGRAM statement. The ENVIRONMENT is not
supported in SORT activities, or in REPORT PROCs executed within a SEQUENCEd REPORT. For more information about
this parameter and its functionality of this feature, see the PROGRAM and JOB statements, and the Code Programs section.
CA Easytrieve® Report Generator 11.6
LINK
[LINK (program-name [R])]
On the mainframe, controls the generation of the link editor NAME command as follows:
• If LINK(program-name) is specified, 'NAME program-name' is generated as the last line in the object deck.
• If LINK(program-name R) is specified, 'NAME program-name (R)' is generated as the last line in the object deck. The
subparameter R specifies that the program replaces an existing program with the same name.
• If no LINK parm is specified, no NAME command is generated into the object deck. In this case, the NAME command
must be provided manually in the link edit JCL. For example:
ALTSEQ identifies the collating sequence table for the sort process. NO indicates usage of the standard table. YES
identifies an alternative 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.
• [MEMORY {storage-amount|(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.
• [MSG {ALL|CRITICAL [CONSOLE|PRINTER]}|{DEFAULT|NO}]
Specifies the level of messages to be output by the sort program.
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.
• [RELEASE core-storage-amount]
RELEASE determines the amount of core storage reserved from the sort program. The value of core-storage-
amount should be set large enough to supply all of the core storage needs of any exits used as a part of the sort
process. Core-storage-amount must be a numeric value from 0 to 1024. The value represents 1024-byte units of storage.
• [WORK number-of-work-data-sets])]
WORK specifies the type and number of work data sets used by the sort.
The value of number-of-work-data-sets controls the allocation of work data sets. When number-of-work-data-sets is
zero, you must supply DD statements for all work data sets (none are dynamically allocated). A number-of-work-data-
sets value from 1 to 31 specifies the number of work data sets dynamically allocated by the sort program.
[SQLID 'auth-id']
SQLID is an SQL parameter. Currently, this parameter is used only by the mainframe DB2 SQL interface.
SQLID enables you to change the authorization ID of your SQL session. If you specify a value for 'auth-id', the DB2 SET
CURRENT SQLID command is executed by the DB2 SQL interface at compile time. For the SET CURRENT SQLID
command to execute successfully, you must have installed the CA Pan/SQL Interface for a DB2 release of 2.1 or greater. You
must also have the correct DB2 authorization to execute the SET CURRENT SQLID command. For more information about
the SET CURRENT SQLID command, see your DB2 documentation.
This parameter is in effect only for the compilation of your application program, unless your program is coded using automatic
processing. If your program is coded using automatic processing, the SET CURRENT SQLID command is executed again at
the start of runtime. For native SQL processing, you must code the SET CURRENT SQLID command in your program if you
want to change the value for the current authorization ID.
For more information, see the SQL Database Processing section.
[SQLSYNTAX {FULL|PARTIAL|NONE}]
Use SQLSYNTAX to specify the level of SQL syntax checking that is to be performed on the SQL statements coded in your
program.
Specify FULL to indicate that detail level syntax checking should be performed. An SQL PREPARE statement is executed
by the CA Pan/SQL interface for those SQL statements that can be dynamically prepared. If you specify FULL, your DBMS
catalog must be available to CA Easytrieve® Report Generator.
Specify PARTIAL to indicate that SQL statements in your program should be syntax checked for valid commands and
secondary keywords. 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® Report Generator. Your
program cannot be executed until it has been fully syntax checked, as described above.
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® Report Generator 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® Report Generator.
If you specify NONE for a non-DB2 environment, partial syntax checking is performed, but the program is not executed until
full syntax checking is performed.
When running under the CA Easytrieve® Report Generator interpreter, dynamic processing is always performed. An option of
NONE is effective only for the batch compilation and execution of your program.
[SSID 'ssid']
SSID is an SQL parameter. Currently, SSID is used only by the DB2, Sybase, and Ingres interfaces.
CA Easytrieve® Report Generator 11.6
(For mainframe DB2) 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.
If no DB2 subsystem ID is specified in the Site Options Table, the SQL interface uses the ID from the DB2 system default
module DSNHDECP. The value of the subsystem ID is obtained at compile and runtime dynamically; therefore, there is no
need to recompile your program to change the ID. For the default values defined for your DB2 system, see your DB2 systems
programmer or administrator.
(For non-mainframe platforms) You can use SSID to specify the name of the database or ODBC data source to which this
session will connect. If you do not specify the subsystem ID, the subsystem ID from the Site Options Table is used. If no DB2
subsystem ID is specified in the site options table, DB2 uses the ID in the DB2DBDFT environment variable.
SSID is ignored in CICS.
[SYNTAX]
SYNTAX terminates CA Easytrieve® Report Generator processing after the syntax check operation.
[TRANSID 'transid']
(CICS only) Use TRANSID to specify the transaction identifier of a program to which control is transferred when the
application user presses an attention key after a pseudo-conversational terminal I/O.
[USERID ('connect-userid' ['password'])]
USERID is an SQL parameter. Currently, USERID is used by the SQL/DS, CA IDMS, and non-mainframe SQL interfaces.
USERID is used by the SQL interface to establish a connection to the database for compilation of the application program.
(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.
(For non-mainframe SQL interfaces) 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.
Note: USERID can be abbreviated as USER.
PARM
LINK(MYPROG) DEBUG(CLIST, DMAP) + SORT (MSG (ALL, PRINTER))
FILE PERSNL FB(150 1800) %PERSNL
JOB INPUT PERSNL
NAME MYPROG PRINT REPORT1
*
REPORT REPORT1
LINE EMPNAME DEPT
CA Easytrieve® Report Generator 11.6
PARM
ABEXIT (SNAP) + DEBUG (PMAP, DMAP, FLDCHK, FLOW, + FLOWSIZ (20),
STATE) FILE PERSNL FB(150 1800)
%PERSNL
JOB INPUT PERSNL NAME MYPROG PRINT
REPORT1 *
REPORT REPORT1
LINE EMPNAME DEPT SALARY-COD
PERFORM Statement
PERFORM transfers control to a procedure and, after the procedure has been executed, returns control to
the next executable statement after the PERFORM statement.
PERFORM transfers control to a procedure and, after the procedure has been executed, returns control to the next executable
statement after the PERFORM statement.
When CA Easytrieve® Report Generator encounters the PERFORM statement, it immediately branches to the named
procedure. After exiting from the procedure, program execution continues with the next executable statement following the
just-executed PERFORM statement.
PERFORM statements in a procedure can invoke other procedures; this is called procedure nesting. However, recursion is
not permitted. That is, procedure A can invoke procedure B, but procedure B cannot then invoke procedure A. If recursion is
attempted, unpredictable results can occur.
This statement has the following format:
PERFORM proc-name
• proc-name
Specify the name of the procedure to be executed.
Example
The following example illustrates the use of the PERFORM statement in executing a user procedure:
POINT Statement
The POINT statement enables you to establish the position in an INDEXED or RELATIVE file from
which subsequent data is sequentially retrieved. Data in the file becomes available only after the next
successful sequential retrieval by either automatic file input or a GET statement.
The POINT statement enables you to establish the position in an INDEXED or RELATIVE file from which subsequent data is
sequentially retrieved. Data in the file becomes available only after the next successful sequential retrieval by either automatic
file input or a GET statement.
You cannot use a file presence test (IF file-name) to test the success of a POINT.
You cannot issue a GET PRIOR statement following a POINT statement, or a GET statement following a POINT PRIOR
statement. For more information, see GET Statement in the chapter "Statements G - M."
GE is not supported for POINT PRIOR when the underlying access method does not support it.
This statement has the following format:
{= }
• file-name
File-name must be the same as on a FILE statement that describes an INDEXED or RELATIVE file.
• [PRIOR]
Specify PRIOR if you want to use PRIOR on the GET statement. For more information, see GET Statement in the chapter
"Statements G - M."
• {= } or {EQ} or {GE} or {GQ} or {>=}
Equal operators (= and EQ) initiate a file position search, based on an exact match between the file's keys and the search
value. The greater-than operators (GE, GQ, and >=) initiate a file position search, based on a file's key being equal to or
greater than the search value.
• {field-name} or {literal}
The search value can be any valid field-name or literal. Alphanumeric literals must be enclosed within single quotes. CA
Easytrieve® Report Generator does not change the data format of field-name or literal. The search value must have the
same length as the file's key. RELATIVE files require field-name to be a 4-byte binary integer field. Field-name cannot be
nullable. Literal is not allowed for a RELATIVE file.
• [STATUS]
Specify the STATUS parameter whenever the possibility exists for an unsatisfactory completion of the input/output
request.
STATUS checks input/output processing to see if it was performed correctly. STATUS causes the file's FILE-STATUS
field to be set with the appropriate return code. To determine the meaning of the contents of FILE-STATUS, see the
appendix "System-Defined Fields." Normally, a zero or non-zero test is sufficient.
Note: FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
If you do not code STATUS and the operating system returns a non-zero status, CA Easytrieve® Report Generator issues
an appropriate diagnostic message.
In addition to FILE-STATUS, IF EOF file-name is true when the search value is greater than the highest key in the file.
Note: CICS does not set EOF.
Example
The following example illustrates the use of POINT:
IF FILE-
STATUS NE 0 OR EOF PERSNL DISPLAY 'B
CA Easytrieve® Report Generator 11.6
STATUS STOP
IF GET PERSN
STATUS NE 0 DISPLAY 'BA
STATUS ELSE
IF STOP
For more detailed examples on the use of POINT in file processing, see the Programming Guide.
POP Statement
POP is a listing control statement that restores previous listing control indicators.
POP is a listing control statement that restores previous listing control indicators.
POP is especially useful in macros to control the listing of the macro expansion without affecting listing control indicators
outside the macro. Use the PUSH statement to save the current indicators. You can then set listing control indicators for use
during macro expansion. The POP statement restores the saved indicators.
Note: Use the LIST statement to set listing control indicators.
You can place POP statements anywhere in the CA Easytrieve® Report Generator source code. POP must be on a record by
itself. POP does not appear in the printed output.
This statement has the following format:
POP
PRINT Statement
The PRINT statement produces report output. Issue the PRINT statement to initiate a printed line.
The PRINT statement produces report output. Issue the PRINT statement to initiate a printed line.
In general, report output is not written directly to a report's printer file as with DISPLAY, but is scheduled for deferred
formatting and writing to the report's printer file, perhaps following resequencing of an intermediate file.
For detailed examples of the use of PRINT in report processing, see the Programming Guide.
When you require an intermediate file (referred to as a report work file) for a report, executing PRINT causes fixed format
records (called spool records) to be output to the work file. CA Easytrieve® Report Generator determines the format of these
records, which includes all the fields required to produce the report except those in S type working storage.
This statement has the following format:
PRINT [report-name]
• [report-name]
Report-name is the name of the report as specified on a REPORT statement. If not given, it is assumed to be the first report
in the JOB activity.
Example
PROC Statement
The PROC statement is used to begin a procedure. A procedure is a group of user-written statements
designed to accomplish a particular objective. The syntax of a procedure has two statements:
The PROC statement is used to begin a CA Easytrieve® Report Generator procedure. A procedure is a group of user-written
CA Easytrieve® Report Generator statements designed to accomplish a particular objective. The syntax of a procedure has two
statements:
• A label naming the procedure
• The PROC statement
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.
PERFORM statements within a procedure can invoke other procedures; this is called procedure nesting. However, recursion is
not permitted. That is, procedure A can invoke procedure B, but procedure B cannot then invoke procedure A. If recursion is
attempted, unpredictable results can occur.
Screens and reports can contain special-named procedures. Each procedure is explained separately in this manual.
The screen procedures are as follows:
• AFTER-SCREEN
• BEFORE-SCREEN
• INITIATION
• TERMINATION
The report procedures are as follows:
• AFTER-BREAK
• AFTER-LINE
• BEFORE-BREAK
• BEFORE-LINE
• ENDPAGE
• REPORT-INPUT
• TERMINATION
This statement has the following format:
Format 1
proc-name. PROC st
PROC
Format 2
proc-name PROC
PROC
• proc-name
Proc-name is a label that identifies the procedure. A label:
• Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
CA Easytrieve® Report Generator 11.6
PROGRAM Statement
The PROGRAM statement identifies and initiates a processing activity that can optionally initiate JOB,
SORT, and SCREEN activities.
The PROGRAM statement identifies and initiates a processing activity that can optionally initiate JOB, SORT, and SCREEN
activities.
Note:
Programs that include the PROGRAM statement must be compiled with the NEWFUNC option set to Y. The following
message is displayed when a program that includes the PROGRAM statement is compiled with the NEWFUNC option set
to N (compatibility mode):
*******B014 UNABLE TO RECOGNIZE STATEMENT
For more information about the NEWFUNC option, see Features and Enhancements Since Release 6.4.
A PROGRAM statement is required when:
• A program is the target of a TRANSFER from another program and parameters are passed between programs. See
TRANSFER Statement in the chapter "Statements S - Z."
• A program is the child program linked to from a parent program and parameters are passed between programs. See LINK
Statement in the chapter "Statements G - M."
• A parameter is passed to a program invoked from the operating system.
• You want to selectively execute other activities or execute a single activity multiple times.
A PROGRAM statement defines an activity in which JOB, SORT, and SCREEN activities can be conditionally invoked. If
there is no PROGRAM statement, any JOB or SORT activities are sequentially executed until a SCREEN activity is detected.
The SCREEN activity is then executed. The sequential execution of activities does not proceed past the first SCREEN activity.
Any remaining activities must be executed by the first SCREEN activity.
A program terminates when:
• The bottom of the activity is reached
• A STOP EXECUTE statement is executed
• A TRANSFER statement is executed
A PROGRAM statement can be used to execute a sequence of statements. You can also use a JOB INPUT NULL statement;
however, you must then execute a STOP statement to terminate the activity.
This statement has the following format:
[ [ACTIVITY ] [TERMINAL
] ] PROGRAM [NAME program-name] [COMMIT ([ ] [ ])]
+ [ [NOACTIVITY] [NOTERMINAL] ]
[ENVIRONMENT {NONE }] + [ {COBOL}]
[USING field-name] [GIVING field-name]
• [NAME program-name]
The NAME parameter names the processing activity. Program-name identifies the program. Program-name:
• Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
This parameter is used for documentation purposes.
CA Easytrieve® Report Generator 11.6
Program code:
Program output:
PUSH Statement
PUSH is a listing control statement that saves the current listing control indicators.
PUSH is a listing control statement that saves the current listing control indicators.
PUSH is useful in macros to control the listing of the macro expansion without affecting the listing control indicators outside
the macro. PUSH saves the current indicators. You can then set the listing control indicators for use during macro expansion.
Use the POP statement to restore the saved indicators.
Note: Use the LIST statement to set listing control indicators.
You can code a PUSH statement anywhere in CA Easytrieve® Report Generator source code. PUSH must be on a record by
itself. PUSH does not appear in the printed output.
This statement has the following format:
PUSH
PUT Statement
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.
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.
To take advantage of VSAM's mass-sequential-insertion capabilities, you can use the PUT statement to add many records to
the same place in any established VSAM file.
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® Report Generator that all input
records can potentially be updated or deleted.
This statement has the following format:
[ {input-file-name] }] PUT o
[STATUS] [ {input-record-name}]
• output-file-name
The output-file-name parameter identifies the output file.
CA Easytrieve® Report Generator 11.6
• [FROM {input-file-name|input-record-name}]
FROM identifies the file or record from which the current record is copied.
When input-file-name is specified, the length of the output data is the same as output-file-name: RECORD-LENGTH. The
current value of input-file-name: RECORD-LENGTH is equal to the length of the input data. However, if the length of the
output file is greater than the length of the input file, the excess storage is not initialized. Also, use of the FROM parameter
does not update the data area of the output file.
For more information about RECORD-LENGTH, see the Programming Guide.
• [STATUS]
Specify the STATUS parameter whenever the possibility exists for an unsatisfactory completion of the input/output
request.
STATUS checks input/output processing to see if it was performed properly. STATUS causes the file's FILE-STATUS
field to be set with the appropriate return code. To determine the meaning of the contents of FILE-STATUS, see System-
defined Fields. Normally, a zero or non-zero test is sufficient.
Note: FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
If you do not code STATUS and the operating system returns a non-zero status, CA Easytrieve® Report Generator issues
an appropriate diagnostic message.
Example
FILE FILEA INDEXED UPDATE %PERSNLFILE PERSNLCOPY FILEAJOB INPUT PERSNL NAME
PUT FILEA FROM PERSNL
STATUS
IF FILE-
STATUS NE 0 DISPLAY 'ADD FAILED' DISPLAY HEX PERSNL STOP END-
IF
READ Statement
READ provides random access to INDEXED and RELATIVE files.
READ provides random access to INDEXED and RELATIVE files.
The key specified is normally a working storage field or a field in another file. It cannot be the key field of the file unless
WORKAREA is specified to make the field available prior to the READ.
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.
This statement has the following format:
• file-name
Specify the file-name of the INDEXED or RELATIVE file to be randomly accessed.
• KEY {key-field-name|'key-literal'}
You must provide the key to the required record. The contents of key-field-name or 'key-literal' are used in a search for a
corresponding record in the file. Alphanumeric literals must be enclosed within single quotes. The data format of key-field-
name or 'key-literal.' is not changed. The access method can require that the search value have the same length as the file's
key. Key-field-name cannot be nullable.
RELATIVE files require key-field-name to be a 4-byte binary integer field. 'Key-literal' is not allowed for a RELATIVE
file.
• [HOLD|NOHOLD]
CA Easytrieve® Report Generator 11.6
A hold request is automatically issued for records when UPDATE is specified on the FILE statement. Use NOHOLD to
override this process.
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 only). 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.
NOHOLD specifies that a record is not held for update.
• [STATUS]
Specify the STATUS parameter whenever the possibility exists for an unsatisfactory completion of the input/output
request.
STATUS checks input/output processing to see if it was performed properly. STATUS causes the file's FILE-STATUS
field to be set with the appropriate return code. To determine the meaning of the contents of FILE-STATUS, see System-
Defined Fields. Normally, a zero or non-zero test is sufficient.
Note: FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
If you do not code STATUS and the operating system returns a non-zero status, an appropriate diagnostic message is
issued.
The key specified is normally a working storage field or a field in another file. It cannot be the file's key field unless
WORKAREA is specified to make the field available prior to the READ.
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.
Example
coded for each segment of the database to be processed. They must be coded in the same order as in the PSB that defines the
database. Not all segments of a database need to be defined, but the parent segment of each RECORD must be coded because
incomplete paths are not supported.
This statement has the following format:
Format 1 (CA IDMS)
Format 2 (IMS/DLI)
REFRESH Statement
The REFRESH statement is used in the AFTER-SCREEN procedure to restore the initial screen image by
rebuilding it with the current values of the program fields.
The REFRESH statement is used in the AFTER-SCREEN procedure to restore the initial screen image by rebuilding it with
the current values of the program fields.
CA Easytrieve® Report Generator 11.6
When used as the result of pressing an IMMEDIATE key, REFRESH redisplays the screen image with the original data
displayed on the screen. This is useful when the terminal user enters erroneous data on the screen and wants to restore the
screen with its original data.
When used as the result of a non-IMMEDIATE key, REFRESH can be used to rebuild the screen using current data from the
screen.
REFRESH can also be invoked directly by pressing a particular attention key. For more information, see KEY Statement.
This statement has the following format:
REFRESH
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 2DEFINE QTY W 4 P 0DEFINE PRICE W 4 P 2SCREEN NAME TEST-
REFRESH KEY F2 NAME 'Reset to zero' KEY F3 EXIT NAME 'Exit' KEY F5 IMMEDIA
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
RELEASE Statement
The RELEASE statement explicitly releases the hold on any record in a file.
The RELEASE statement explicitly releases the hold on any record in a file.
CA Easytrieve® Report Generator 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.
This statement has the following format:
RELEASE file-name
• file-name
File-name is the name of a file.
Example
CA Easytrieve® Report Generator 11.6
[ [ {start-field-name} ] ] REPEAT
END-REPEAT
• number
Number is the number of times the group of ROW statements in the REPEAT construct is repeated.
• [TIMES]
Optionally, code TIMES for statement readability.
• [VARYING subscript]
VARYING is an optional parameter that causes CA Easytrieve® Report Generator to automatically increment a subscript
field (subscript).
The subscript is incremented by one, n times, where n is specified by number.
Subscript can be the name of a previously defined field. However, if it is not defined, CA Easytrieve® Report Generator
automatically defines the field as a 2 B 0 field. If you defined the field, you must have defined it as numeric (N, P, U, B, I)
with zero or no decimal places.
• [FROM {start-field-name|start-integer}]
FROM is an optional parameter that defines the initial value for the REPEAT subscript. Subscript is automatically
incremented by one 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.
• [ROW row-number]
Specify the row-number on which the repeating group of rows starts. If this is not specified, the repeating group of rows
starts on the last screen row specified plus one.
• ROW statements
Code one or more ROW statements to be repeated. ROW statements are coded in a REPEAT/END-REPEAT construct. For
more information, see ROW Statement.
Note: ROW statements to be repeated cannot specify explicit row-numbers.
• END-REPEAT
END-REPEAT terminates the body of the REPEAT statement. END-REPEAT must be specified after each REPEAT
statement and its associated ROW statements.
Example
The following example illustrates how to display an array on a screen. The REPEAT construct displays both a one-dimensional
array (WS-NAME), and a two-dimensional array (WS-STAT). Starting at row 4, CA Easytrieve® Report Generator displays
the first occurrence of the fields. The second dimension of WS-STAT is stated explicitly. CA Easytrieve® Report Generator
increments USER-SUB and displays the next occurrence until 15 occurrences are displayed.
This code:
CA Easytrieve® Report Generator 11.6
...
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 ...
LIST TITLE 'List of E
REPEAT 15 TIMES VARYING USER-SUB
Produces:
List of Employees
Name Statuses WIMN, GLORIA F G O B
REPORT Statement
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.
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.
REPORT statement parameters fall into five basic groups:
• Format determination parameters
• Label parameters
• File directing parameters
• Spacing control parameters
• Testing aid parameters
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.
You need not code the SUMMARY parameter to use SUMFILE.
For a complete explanation of reporting facilities, see Programming.
This statement has the following format:
REPORT [report-name]+
[XML]+ } [SUMMARY]+
} [SUMFILE summary-
CA Easytrieve® Report Generator 11.6
file-
name]+ } [SUMSPACE sumfield-addition]+
} [TALLYSIZE tally-
print-
size]+ }
} [ {EVERY}]
} [DTLCTL{FIRST}]+ } Format [ {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
[PAGESIZE
(line-
page-
size [display-
page-
size])]+ } [LINESIZE line-length]+
} [SKIP number-
of-
lines]+
} [SPACE number-
of-
spaces]+
} [TITLESKIP number-
of-
lines]+
} [CONTROLSKIP number-
of-
lines]+ } }
[SPREAD ]+ }
[NODATE ] }
[LONGDATE ]+ } [SHORTDATE]
} } [NOPAGE]+
} [NOHEADING]+ }
} [LIMIT number-
of-
records]+ } Testing
Aid [EVERY n-
number-
of-lines] } Parameters
• Format Determination [report-name] Report-name identifies the report. It is optional when there is only one report in
a JOB activity. If you code multiple reports, the first report can be unnamed but all others must be named. Each report-
name must be unique in the JOB activity. At least one report-name must be coded on a PRINT report-name statement. For
unnamed reports, code the PRINT statement without a report-name parameter.
Report-name:
• • Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
• [XML]
Optionally use XML to produce a file formatted using Extensible Markup Language (XML). This hierarchically-structured
file is built according to the field relationships defined by REPORT, CONTROL, and LINE statements.
Any spacing or positioning parameters (such as NOADJUST, COL, and SKIP) are ignored because the XML file contains
only field name (or HEADING) values and data values. XML also changes the default setting of the DTLCTL parameter
to EVERY. This causes every line-statement field to be written to the XML output file for each execution of a PRINT
statement. This behavior can be overridden using the DTLCTL parameter described later in this section.
For an XML-formatted report, no printed output is generated. There are no control totals or summary data lines printed or
written to any file. For information about the XML report feature, see Programming.
• [SUMMARY]On control reports, SUMMARY inhibits printing of detail data. Only control totals are printed.
• [SUMFILE summary-file-name]Optionally, use SUMFILE to generate a summary file that contains the control and
summary field values. Summary-file-name identifies the file to contain the summary data.
• [SUMSPACE sumfield-addition]Use SUMSPACE to define the print size for total fields on a control report. Sumfield-
addition is added to the length (in digits) of the field to define its print size. This expansion is necessary to prevent the loss
of significant data due to overflow conditions. The resulting print length is limited to a maximum of 18 digits. Valid values
for sumfield-addition are 0 to 9. No additional numeric edit characters are included in the resulting edit mask. For example,
totals such as 55555,555.55 can appear.
• [TALLYSIZE tally- print-size ]Use TALLYSIZE to set the print size for the field TALLY. Valid values for tally-print-
size are 1 to 18. The number of digits used for TALLY on a summary line is the sum of the values of TALLYSIZE and
SUMSPACE.
• [DTLCTL {EVERY|FIRST|NONE}]DTLCTL optionally defines detail line printing characteristics.
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. Specify NONE to inhibit the printing of control
field values on detail lines.
• [SUMCTL {[ALL|HIAR|NONE|TAG] [DTLCOPY|DTLCOPYALL]}]
SUMCTL optionally defines total line printing characteristics. Specify ALL to print control field values on every total line.
Specify HIAR to print control field values in a hierarchical fashion on total lines. Only values for control fields on the same
hierarchical level, or higher than the breaking control field, are printed on the associated total line.
Specify NONE to inhibit printing of control field values on total lines.
Specify TAG to print control-field-name TOTAL as an annotation to the left of the associated total line where control-field-
name is the field-name for the breaking control field. There must be sufficient unused space on the left side of the total line
for this annotation.
CA Easytrieve® Report Generator 11.6
Specify DTLCOPY to print detail information on total lines. Normally, only control field values and associated totals are
printed on total lines. Coding DTLCOPY prints the detail field contents, prior to the break, on the total line. These fields
are printed only when LEVEL is one (1).
Specify DTLCOPYALL to print detail fields for all control breaks.
• Label [LABELS [ACROSS number-of-labels ][DOWN number-of-lines ][SIZE label-length][NEWPAGE]]
Specify LABELS to indicate that the report is a label report.
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 ACROSS number-of-labels to define the number of labels printed across the print line.
Specify DOWN to define the number of lines in a label. The value of number-of-lines is the number of lines reserved for
each label. The value range for number-of-lines is 1 to nnn, where nnn is at least as large as the largest corresponding LINE
nnn value.
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.
Note: LABELS cannot be specified for extended reporting printers.
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.
The following algorithm confines the overall size of labels:
TITLEs, performs the BEFORE-LINE procedure, and finally prints the line. The line count is not compared again to
line-page-size after the LINE statement performs the BEFORE-LINE procedure.
Specify a value greater than zero for display-page-size to allow the DISPLAY statement to generate page breaks. When
display-page-size is greater than zero, the line count is compared to display-page-size. If the line count is greater than
display-page-size, then the DISPLAY statement performs the ENDPAGE procedure and generates a page break with
TITLEs.
Specify zero for display-page-size to inhibit DISPLAY statement generated page breaks. When display-page-size is
zero, the DISPLAY statement does not compare line count to display-page-size, and a page break is not generated.
The DISPLAY statement always increases line count, regardless of the display-page-size value.
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, because 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.
• [LINESIZE line-length]
Code the LINESIZE parameter to specify the maximum number of data characters that can be printed on a line. Line-
length must be an unsigned integer from 1 to 32767.
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.
There are additional control characters (forms control information) that also must be stored in a logical record. If one of
the record format parameters is specified, it must be large enough to hold both the forms control information and the data
characters. The value of line-length must be less than or equal to the maximum record length minus the size of the forms
control information.
The first character in a PRINTER file contains the ASA carriage control information.
When the report is assigned to an extended reporting printer that is not a standard line printer, the maximum value of line-
length is not dependent upon the record size of the print data set. The insertion of overprint and function codes into print
records and the support of different fonts on the same print line all impact the relationship between LINESIZE and print
data set record size. CA Easytrieve supports any LINESIZE, provided line-length multiplied by the value of the assigned
extended reporting printers default width does not exceed the maximum page width of that extended reporting printer.
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.
• [SKIP number-of-lines]Specify SKIP to define the number of blank lines to be inserted between line groups (between the
last LINE nnn and the next LINE 01). Number-of-lines has a valid range of 0 to nnn, where nnn allows for the printing of
at least one line group on each page. When you specify a value of 0, a line group containing multiple lines can be spanned
across a page break. A non-zero value inhibits this spanning. 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.
• [SPACE number-of-spaces]Specify SPACE to adjust the default number of blanks (space characters) inserted between
fields on TITLE and LINE statement items. The value of number-of-spaces has a valid range of 0 to nnn (default is 3),
where nnn does not cause line overflow. When the report is directed to an extended reporting printer, CA Easytrieve
multiplies number-of-spaces by the default width of the assigned extended reporting printer. This operation expresses
number-of-lines in terms of the printer's W-unit.
Note: The SPREAD parameter overrides this parameter.
• [TITLESKIP number- of-lines ]
Specify TITLESKIP to insert blank lines between the last title line and the first heading line (or LINE 01) of a report. The
value of number-of-lines has a valid range of 0 to nnn, where nnn allows for the printing of at least one line group on each
page.
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.
• [CONTROLSKIP number- of-lines ]Specify CONTROLSKIP to define the number of blank lines to be inserted
following CONTROL total lines and the next detail line. Number-of-lines must be between 0 and 32767. If
CONTROLSKIP is not specified, one blank line plus the SKIP value is inserted after the CONTROL total line.
• [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. For more information about this parameter, and examples, see Programming.
Note: SPREAD overrides the SPACE parameter.
CA Easytrieve® Report Generator 11.6
• [NOADJUST] Specify NOADJUST to left-justify the title lines and report on the page. The default is centered on the
page. SPREAD and NOADJUST are mutually exclusive.
• [NODATE|LONGDATE|SHORTDATE]Specify NODATE to inhibit the printing of the date value on the first title line
(TITLE 01).
LONGDATE specifies that SYSDATE-LONG is to appear on the first title line.
SHORTDATE specifies that SYSDATE is to appear on the first title line.
• [NOPAGE]Specify NOPAGE to inhibit the printing of the value of PAGEWRD (in the Site Options Table) and the current
page number in the report title.
• [NOHEADING]Specify NOHEADING to inhibit the printing of column headings. The default is that each field's
HEADING value is printed as a column heading.
Testing Aid LIMIT and EVERY are used as testing aids for report development. These parameters control the amount of
data output on a report.
• [LIMIT number-of-records]Specify LIMIT to limit the number of records processed by the report. The value of number-
of-records has a valid range of 1 to 32,767.
• [EVERY n-number-of-lines]Specify EVERY to indicate that only every n line is printed in the report. The value of n-
number-of-lines has a valid range of 1 to 32,767.
REPORT-INPUT. PROC
Example
The following example illustrates use of the REPORT-INPUT procedure in final report input selection. Only the first record in
each ZIP code is selected.
Statements:
REPORT-INPUT. PROC
CA Easytrieve® Report Generator 11.6
IF ZIP NE HOLD-
ZIP HOLD-
ZIP = ZIP SELECT
IF END-
PROC *
Data:
BROWNIL6007612345 BROWN
Results:
RESHOW Statement
The RESHOW statement is used in an AFTER-SCREEN procedure to redisplay the screen image with
user-entered data intact. In contrast to the REFRESH statement, the screen image is not rebuilt using the
current values of program fields.
The RESHOW statement is used in an AFTER-SCREEN procedure to redisplay the screen image with user-entered data intact.
In contrast to the REFRESH statement, the screen image is not rebuilt using the current values of program fields.
Upon receiving the screen, CA Easytrieve® Report Generator saves a copy of the screen image. The RESHOW statement
restores the saved image.
This statement has the following format:
RESHOW
Example
As shown in the following example, RESHOW can be used to redisplay a screen following a request for help. The data that
the user entered on the screen before they requested help is redisplayed intact. When RESHOW is used with an IMMEDIATE
KEY, original screen data is retained, but not edited or saved into program fields.
... SCREEN NAME MENU UPPERCASE KEY ENTER KEY F1 NAME 'Help' IMMEDIATE KEY
SCREEN. PROC IF KEY-PRESSED = F1 EXECUTE MENU-
HELP
RESHOW
END-IF CASE OPTION ...
CA Easytrieve® Report Generator 11.6
RETRIEVE file-name +
NAME { }] + [
[ {node-name }] [NOD
[ {dictionary-name }] [DICT
[ {dictionary-node-name }] [DIC
SELECT (record-name +
[ID 'path-literal'] +
Format 2 (IMS/DLI)
RETRIEVE file-name +
• [DICTNODE {dictionary-node-name|'dictionary-node-literal'}]
Dictionary-node-name or 'dictionary-node-literal' specifies the dictionary node of a secondary load area. Dictionary-node-
name must be an eight-byte alphanumeric field. 'Dictionary-node-literal' must be alphanumeric and is padded to the right
(if necessary) to create an eight-byte value.
• [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.
Calc-value-field-name is a data field from tickler-file-name that contains a value for one of the CALC keys of the root
record. Calc-key-field-name is a CALC key field defined in the RECORD statement for the root record that is to receive
the value of calc-value-field-name. For information about coding how calc-value-field-name is assigned to calc-key-field-
name, see the Programming Guide.
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.
• [SELECT (record-name ...)]
The SELECT parameter identifies which paths are retrieved. Record-name must be the same as coded on a RECORD
statement. Any number of records and paths can be coded under control of the following rules of network structure:
• The first record-name coded is the root. It is retrieved by an area sweep, tickler file, or integrated index.
• A repeated record-name denotes a node in the network. A node is a record-type that is common in multiple paths. The
optional subparameters are not allowed when a record-name is repeated as a node.
• Paths are retrieved in the order in which they are identified.
• [AREA 'area-literal']
The optional AREA subparameter is coded to supply the sweep area. This subparameter can be specified only if record-
name is a root record. AREA is not allowed if INDEX has already been specified for this record. The 1- to 16-character
CA IDMS area name ('area-literal') controls retrieval within area of root records. 'Area-literal' must be alphanumeric (non-
DBCS), and is padded to the right (if necessary) to create a 16-byte value.
If the AREA subparameter is coded, CA Easytrieve® Report Generator uses OBTAIN NEXT record-name WITHIN
AREA calls to retrieve occurrences of this record. If this subparameter is omitted, CA Easytrieve® Report Generator uses
OBTAIN NEXT record-name calls instead.
• [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.
If this record is a member of the specified set, CA Easytrieve® Report Generator uses OBTAIN NEXT record-name
WITHIN SET calls to retrieve occurrence of this record. If this record is the owner of the specified set, CA Easytrieve®
Report Generator uses OBTAIN OWNER calls instead.
• [INDEX 'index-set-literal'[USING ('index-key-literal' ...)]]
Code the optional INDEX subparameter to designate the index set ('index-set-literal') that controls root retrieval by
integrated indexing. This subparameter can be specified only if record-name is a root record. INDEX is not allowed if
AREA has already been specified for this record. 'Index-key-literal' must be a 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.
The optional USING subparameter ('index-key-literal') designates the alphanumeric literals used to constrain the index.
You can code as many occurrences of 'index-key-literal' as are required to fully specify the index key value. The values are
concatenated in the order specified and form the index key value that is passed to CA IDMS. The cumulative length of all
literals specified must match the length of the index known to integrated indexing. The code system of the data must also
match.
When the INDEX subparameter is coded, CA Easytrieve® Report Generator uses OBTAIN NEXT WITHIN SET calls to
retrieve all occurrences of the root record except for the first occurrence. The retrieval of the first occurrence is determined
by the optional USING subparameter. If the USING subparameter is coded, CA Easytrieve® Report Generator retrieves
the first root record occurrence using an OBTAIN WITHIN SET USING SORT KEY call. If the USING subparameter is
omitted, an OBTAIN FIRST WITHIN SET call is used. CA Easytrieve® Report Generator uses the USING subparameter
to establish the initial position within the index set. Once this initial position has been established, retrieval of the root
record proceeds until the end of the index set is reached.
• [ID 'path-literal']
CA Easytrieve® Report Generator 11.6
Code the optional ID subparameter to establish the identity of retrieved paths. The system-defined field file-name:PATH-
ID is set to the value of 'path-literal' for the lowest record retrieved in the current path. 'Path-literal' can be an
alphanumeric value of one or two characters. It cannot contain any DBCS data. The default is spaces. Whenever a key of
the tickler file does not correspond to a root record in the database, file-name:PATH-ID is set to NF (Not Found).
• [LIMIT 'number-of-records']
The optional LIMIT subparameter controls the number of record occurrences to be retrieved. The limit applies to the
specific record in the path. 'Number-of-records' must be a positive integer. When this subparameter is not coded, all
occurrences of the record are retrieved.
• [WHILE (condition)]
Code the optional WHILE subparameter to pre-screen input records. The syntax of the condition is exactly the same as the
conditional expressions described in the Programming Guide. When the associated record is retrieved from CA IDMS, the
condition is evaluated. Records are accepted for input only if the condition is true.
Format 2 (IMS/DLI)
• file-name
File-name identifies the database being accessed. File-name is the same as the name coded in JOB INPUT file-name and
FILE file-name statements.
• [KEYFILE tickler-file-name KEYVALUE key-field-name]
You can designate the tickler file option by coding both the KEYFILE and the KEYVALUE parameters. Tickler-file-name
is the name of the file that is sequentially processed to get the keys of the root segments to be retrieved. Key-field-name is a
data field from tickler-file-name that contains the keys. The key values are used in the segment search argument for the root
segment. CA Easytrieve® Report Generator issues GU (get unique) calls at the root level for each key found in tickler-file-
name. Automatic input is terminated at end-of-file for tickler-file-name.
The DBCS code system assigned to tickler-file-name must match the DBCS code system of file-name.
• [SELECT (record-name ...)]
The SELECT parameter identifies which segments (record-name) CA Easytrieve® Report Generator is to retrieve. Record-
name must be the same as the segment-name coded on a RECORD statement. You can identify any number of record-
names for input; however, the parent of all selected segments must also be selected.
• [ID 'path-literal']
Code the optional ID subparameter to establish the identity of retrieved paths. The system-defined field PATH-ID is set
to the value of 'path-literal' for the lowest segment retrieved in the current path. PATH-ID is a two-byte alphabetic field.
'Path-literal' can be an alphabetic value of one or two bytes. It cannot contain any DBCS data. The default value for
PATH-ID is spaces. When a key of the tickler file does not correspond to a root record in the database, PATH-ID is set to
NF (Not Found).
• [LIMIT 'number-of-records']
The optional LIMIT subparameter controls the number of segment occurrences to be retrieved. The limit applies to each
path. 'Number-of-records' must be a positive integer. When this subparameter is not coded, all occurrences of the segment
are retrieved.
• [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.
• [WHILE (condition)]
Code the optional WHILE subparameter to pre-screen input segments. The syntax of the condition is exactly the same as
the conditional expressions described in the Programming Guide. When the associated record is returned by IMS/DLI, the
condition is evaluated. Segments are accepted for input only if the condition is true.
ROLLBACK Statement
The ROLLBACK statement causes all uncommitted updates in the current logical unit of work to be
rolled back.
The ROLLBACK statement causes all uncommitted updates in the current logical unit of work to be rolled back.
For more information about types of work that are recoverable, see the Programming Guide. Use the COMMIT statement to
commit any pending changes.
This statement has the following format:
CA Easytrieve® Report Generator 11.6
ROLLBACK
Example
ROW Statement
The ROW statement specifies the items (fields or literals) to be displayed or received on a row of a
screen. Multiple items can be coded on each ROW statement. Attributes can be specified for each literal
coded on the ROW statement. Attributes and editing criteria can be specified for each field-name coded
on the ROW statement.
The ROW statement specifies the items (fields or literals) to be displayed or received on a row of a screen. Multiple items can
be coded on each ROW statement. Attributes can be specified for each literal coded on the ROW statement. Attributes and
editing criteria can be specified for each field-name coded on the ROW statement.
For more information, see the Programming Guide.
This statement has the following format:
ROW [row-number] +
[ {RIGHT} ] [JUST
NULL}] +
[MASK ({[mask-identifier] [BWZ] ['mask-literal']|
HEX})] + [NOMASK
[ {pattern-name} ] [PATT
[VALUE (literal [THRU literal] [...])] +
• [row-number]
Row-number specifies the line on which the item on the screen is displayed. A ROW without a row-number is assigned the
next row number on the screen. Next is defined as the previous row-number plus one, not the highest number used as yet.
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|COL column-number] {field-name|'row-literal'}
The +offset-value or the COL column-number parameter allows you to control positioning of an item on the row.
+Offset-value is the number of columns (spaces) preceding a screen item. The default +offset-value is +1 because the space
preceding each screen item is reserved for screen attributes. +Offset-value must be a signed positive integer and can only
be used for items other than the first in the row.
Use column-number to explicitly specify the column at which the screen item is displayed.
If you do not code a +offset-value or column-number, the next field-name or 'row-literal' is displayed one column after the
end of the previous field-name or 'row-literal.' If no previous item exists in the row, the item is displayed in column one.
Field-name can be any defined field in your program.
'Row-literal' can be any text you want to display on the screen.
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.
• [ATTR {attribute-name|attribute-list)}]
ATTR specifies either a declared screen attribute name or one or more attribute keywords. For a list of attributes, see
ATTR Parameter . For more information about declared screen attributes, see DECLARE Statement .
The following attributes are invalid for literals and system-defined read-only fields:
CA Easytrieve® Report Generator 11.6
• CURSOR
• NUMERIC
• INVISIBLE
• MUSTFILL
• MUSTENTER
• TRIGGER
• ALARM
They are ignored if used, but CA Easytrieve® Report Generator issues a warning message during compilation.
SENDONLY and ASKIP are assumed for literals and system-defined read-only fields.
• [JUSTIFY {RIGHT|LEFT}]
Use the JUSTIFY parameter to specify whether the data in the field is left or right justified when displayed at the terminal.
• [FILL {'fill-character'|NULL}]
Specify FILL to translate trailing blanks into either 'fill-character' or NULL. 'Fill-character' must be a one-byte
alphanumeric literal.
Upon receiving data from the screen, CA Easytrieve® Report Generator translates all remaining fill characters to spaces.
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.
• [MASK ({[mask-identifier] [BWZ] ['mask-literal']|HEX})]|[NOMASK]
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.
Any letter from A to Y can be used as an optional mask-identifier. You can use the letter to identify a new mask or to
retrieve a mask that was previously defined either in the Site Options Table or by a mask parameter on a previous field
definition or ROW usage. If the new mask that you identify does not already exist, CA Easytrieve® Report Generator
retains the mask for future reference. Do not use the same identifier to establish more than one 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.
'Mask-literal' defines an edit mask and must be enclosed within single quotes. For information about coding the actual edit
mask see MASK Parameter .
Specify HEX to display the field in double-digit hexadecimal format. You can display fields of up to 50 bytes with the
HEX mask.
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 before it is moved into the field data area. For more information, see the Programming Guide.
Note: HEX edit masks are not allowed for VARYING fields.
• [PATTERN {pattern-name|'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 DECLARE Statement for more information.
The valid pattern characters and their meanings are as follows:
• 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"
CA Easytrieve® Report Generator 11.6
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) or (m..*) or (*) or *
Represents the repetition of the preceding pattern 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.
• # 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 precedence of operators from highest to lowest is:
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. For more information, see the
Programming Guide.
• [UPPERCASE]
Specify UPPERCASE to translate the field coming from the terminal to upper case before placing it in the field data area.
• [VALUE (literal [THRU literal] [...])]
Use VALUE to specify a value, a series of values, or a range of values (or a combination) that constrain the values accepted
in the field. Values must be specified as literals of the correct type for the field. See Conditional Expressions for more
information.
• [ERROR [ATTR {attribute-name|(attribute-list)}][{'literal'[ ]}|{field-name[ ]}]
ERROR specifies one or more fields or alphanumeric literals to be used as the error message issued by CA Easytrieve®
Report Generator in case of an automatically-detected error condition. The total length of the message text cannot exceed
the current screen size less two or the compiler issues an error message. Optionally, you can specify the screen attribute to
be used for the field in error.
Example
SCREEN Statement
The SCREEN statement defines and initiates a SCREEN activity. A SCREEN activity defines a
transaction-oriented processing activity under the control of keys pressed by the terminal operator.
Statements can also be inserted in screen procedures to retrieve and maintain files and databases.
The SCREEN statement defines and initiates a SCREEN activity. A SCREEN activity defines a transaction-oriented
processing activity under the control of keys pressed by the terminal operator. Statements can also be inserted in screen
procedures to retrieve and maintain files and databases.
Note: Screen processing is only available in CA Easytrieve® Report Generator Online.
The structure of a SCREEN activity is as follows:
SCREEN activities can be executed by PROGRAM or other SCREEN activities. If a PROGRAM activity is not present, the
first SCREEN activity detected is automatically executed. A SCREEN activity continues processing until an EXIT, STOP,
or TRANSFER statement is executed. CA Easytrieve® Report Generator issues an error message when compiling a screen
activity that does not contain one of these statements.
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® Report Generator 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.
This statement has the following format:
• [NAME screen-name]
Optionally, specify a name for the SCREEN activity. Screen-name:
• Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
The screen-name can be used to identify the screen in an EXECUTE statement.
• [COMMIT [ACTIVITY|NOACTIVITY] [TERMINAL|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 ACTIVITY to commit all recoverable work during the normal termination of the activity. Specify NOACTIVITY
to tell CA Easytrieve® Report Generator not to commit at the end of the activity. NOACTIVITY is the default.
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® Report Generator
not to commit during a terminal I/O. TERMINAL is the default.
If this activity is executed by an activity that has NOTERMINAL specified, this activity performs terminal I/O as if
NOTERMINAL was specified.
Note: You can also issue your own COMMIT and ROLLBACK statements to commit or recover on a controlled basis.
CA Easytrieve® Report Generator 11.6
• [UPPERCASE]
Specify UPPERCASE to translate the data received from the terminal to upper case before it is processed. If UPPERCASE
is not specified, the data is processed as the user enters it.
• [ROWCOUNT rows]
ROWCOUNT rows lets you override the default number of terminal rows for the screen display. The default is set in the
Site Options Table. For valid ROWCOUNT-LINESIZE combinations, see the next parameter, LINESIZE columns.
• [LINESIZE columns]
LINESIZE columns lets you override the default number of columns for the screen display. The default is set in the Site
Options Table.
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.
• [ROW screen-start-row] [COL screen-start-column]
Screen-start-row specifies the starting row of the screen. The default is 1.
Screen-start-column specifies the starting column of the screen. The default is 1.
• [BORDER {SINGLE|DOUBLE|WIDE|'border literal'} [ATTR {attribute-name|(attribute-list)} ] ]
Use BORDER to specify that the screen has a border.
SINGLE, DOUBLE, or WIDE specifies that the border is built from a predefined line-drawing character set.
Borders on the mainframe are:
'Border literal' specifies the character to be used for the screen border. This value must be a single character enclosed in single
quotes.
Optionally, specify a declared screen attribute name or a list of attribute keywords for the screen border. The following
attributes are ignored for BORDER:
• CURSOR
• NUMERIC
• INVISIBLE
• MUSTFILL
• MUSTENTER
• TRIGGER
• ALARM
For a list of attribute keywords, see ATTR Parameter . For more information about declared screen attributes, see the
DECLARE Statement .
Example
SEARCH Statement
The SEARCH statement provides access to table information. Special conditions of the IF statement can
be used to validate the results of SEARCH operations.
The SEARCH statement provides access to table information. Special conditions of the IF statement can be used to validate the
results of SEARCH operations.
CA Easytrieve® Report Generator 11.6
After each SEARCH statement, you can code an IF file-name test to determine the success of the table search. When the search
is successful (IF file-name is true), result-field contains the table's descriptive data corresponding to the search argument of
search-field. When the search is unsuccessful (IF file-name is false), the contents of result-field are unchanged.
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® Report Generator performs a
keyed read of the file. Otherwise, the entire file is read into memory and a binary search is performed. For more information on
table processing, see the Programming Guide.
This statement has the following format:
• 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.
• WITH search-field
Search-field identifies the field containing the search argument for the binary search. This parameter is defined in any file,
except for files with the TABLE parameter, or it can be defined in working storage.
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.
• GIVING result-field
Result-field identifies the receiving field for the results of the table search. This parameter is defined in any file, except for
files with the TABLE parameter or it can be defined in working storage.
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.
Example
The following example illustrates the retrieval of high school class descriptions based upon class identification codes.
Statements:
IF CLASSES D
IF
Results:
ENGLISH II
CA Easytrieve® Report Generator 11.6
• [DISTINCT]
DISTINCT eliminates duplicate rows. If DISTINCT is not specified, all rows are retrieved.
• [FROM] file-name
Optionally, code FROM for statement readability.
file-name must be the name of a CA Easytrieve® Report Generator SQL file.
• [WHERE search-condition]
Search-condition is used to specify conditions for the retrieval of data. The search-condition is applied to create the result
set for the file. For information about the search-condition, see your SQL vendor manuals.
• [GROUP BY column-name]
GROUP BY is used to group data that is fetched into the file. For column-name syntax, see your SQL vendor manuals.
• [HAVING search-condition]
Search-condition is used to specify the data to be provided to the user. HAVING can be used to compare the results of all
the returned data with a specific value in the data provided (such as the minimum or maximum value). For information
about the search-condition, see your SQL vendor manuals.
• [ORDER BY {column-name|integer} [ASC|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.
Examples
The following is a file-based SQL SELECT statement example:
CA Easytrieve® Report Generator 11.6
The next example shows a file-based SQL SELECT statement with DEFER:
{ {* }
FROM table-name [correlation-name] +
[ { {* } ] [
[ FROM table-name [correlation-name] + ] [
• [DISTINCT|ALL]
Specify DISTINCT to eliminate duplicate rows. ALL specifies that duplicate rows are not to be eliminated. ALL is the
default.
• {*|expression|table-name.*|correlation-name.*}
CA Easytrieve® Report Generator 11.6
These parameters are used to identify the columns to be retrieved from the specified table.
• FROM table-name [correlation-name]
Table-name specifies the table from which data is to be retrieved. Correlation-name can be used to specify an alternate
qualifier for the table-name that immediately precedes it.
• [WHERE search-condition]
Search-condition is used to specify conditions for the retrieval of data. The search-condition is applied to the result of the
FROM clause. For information about the search-condition, see your SQL vendor manuals.
• [GROUP BY column-name]
GROUP BY is used to group data that is fetched into the file. Column-name must name a column in the file-name.
• [HAVING search-condition]
Search-condition is used to specify the data to be provided to the user. HAVING can be used to compare the results of all
the returned data with a specific value in the data provided (such as the minimum or maximum value). For information
about the search-condition, see your SQL vendor manuals.
• [UNION...]
The UNION clause is used to include rows from another table.
• [ORDER BY {column-name|integer} [ASC|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.
• INTO :host-variable [, :host-variable...]
INTO identifies where the column values are to be placed. The INTO clause must be the last clause coded on the SELECT
statement.
Example
The pseudo-code generated for automatic SQL processing is:
* IF SQL/
DS SQL CONNE
IF SQL DECLA
process <easy> code END-
DO SQL CLOSE
SELECT
CA Easytrieve® Report Generator 11.6
Example
SELECT
END-IF END-PROC
SELECT
Example
The following example of a SORT activity shows an output file that contains only a reordered subset of the input file. The
output file contains only those records for which the SELECT statement is executed.
END-
IF END-
PROC
SEQUENCE Statement
The SEQUENCE statement optionally specifies the order of a report. You can order any report based on
the content of one or more fields.
The SEQUENCE statement optionally specifies the order of a report. You can order any report based on the content of one or
more fields.
The fields used to SEQUENCE a report do not have to be part of the printed report.
CA Easytrieve® Report Generator 11.6
• field-name
field-name identifies a field on which a report is ordered. You can specify multiple field-names for a report.
field-name must be in an active file or W-type working storage. Each field must be less than 256 bytes. The fields specified
are used as sort keys processed in major to minor order.
Note: Varying length, K, and M fields cannot be specified on a SEQUENCE statement.
• [D]
An optional D following a field-name indicates that the field is sequenced into descending order. If you do not code D after
a field-name, by default the field is sorted in ascending order.
Examples
The following example illustrates using the SEQUENCE statement in a report declaration.
REPORT PERSNL-
REPORT
SEQUENCE REGION BRANCH PAY-NET
D
CONTROL REGION BRANCH TITLE 'PERSONNEL REPORT' LINE REGION BRANCH EMPNAME
NET
SET Statement
The SET statement allows you to dynamically change screen attributes and to control the display of
screen errors.
The SET statement allows you to dynamically change screen attributes and to control the display of screen errors.
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.
The attributes or error message established by a SET statement remain for only one iteration of the SCREEN activity. After
the SCREEN is displayed, the attribute returns to its default as coded on the ROW statement. For changing field attributes
until they are modified further, use a declared attribute. For an example using dynamic screen attributes, see the Programming
Guide.
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 have only their attributes
displayed.
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 redisplayed.
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.
CA Easytrieve® Report Generator 11.6
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.
This statement has the following format:
Format 1
Format 2
{attribute-name } SET f
• field-name
Field-name specifies a field on a ROW statement in your screen declaration. Field-name can be indexed or subscripted. If
the index or subscript of field-name is evaluated and is not on the screen, the SET statement is ignored.
• 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.
4. Site Options Table FIELD ERROR ATTR parameter Default system message: Value entered
is not allowed. Type an acceptable
value.
Note: If you code SET ERROR without the ATTR, 'literal' or field-name parameters, the attributes and messages are
determined by the next statement or area in the above hierarchy.
• [ATTR {attribute-name|(attribute-list)}]
ATTR specifies either a declared screen attribute name or one or more attribute keywords. For a list of attributes, see
ATTR Parameter. For more information about declared screen attributes, see DECLARE Statement.
The following attributes are invalid for literals and system-defined read-only fields:
• ALARM
• CURSOR
• INVISIBLE
• MUSTENTER
• MUSTFILL
• NUMERIC
• TRIGGER
If you use these attributes, they are ignored, but CA Easytrieve® Report Generator Online issues a warning message during
compilation.
SENDONLY and ASKIP are assumed for literals and system-defined read-only fields.
• {'literal'|field-name}
CA Easytrieve® Report Generator 11.6
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.
The maximum length of a message is 130 characters. If the message exceeds the message area for the screen on which it is
displayed, the message is truncated.
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.
In this 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 to 5 are displayed in yellow.
REPEAT 5 TIMES VARYING SUB1 FROM 1 ROW AFIELD(SUB1) ATTR (YELLOW) END-
REPEAT... BEFORE-
SCREEN. PROC
SET AFIELD(1) ATTR (BLUE
CURSOR)
END-PROC
SKIP Statement
SKIP is a listing control statement that spaces the printer a designated number of lines before printing the
next line of the statement listing.
SKIP is a listing control statement that spaces the printer a designated number of lines before printing the next line of the
statement listing.
You can code a SKIP statement anywhere in CA Easytrieve® Report Generator source code. SKIP must be on a record by
itself. SKIP does not appear in the printed output. However, the requested blank line appears.
CA Easytrieve® Report Generator 11.6
SKIP skip-amount
• skip-amount
Skip-amount must be an unsigned integer.
SORT Statement
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.
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.
CA Easytrieve® Report Generator supplies input records to your sort procedure one at a time. If a BEFORE proc-
name procedure is used:
• 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.
SORT activities can be executed by PROGRAM and SCREEN activities. If a PROGRAM activity is not coded, JOB and
SORT activities are automatically executed sequentially until a SCREEN activity is encountered.
For more information about sorting files, see the Programming Guide.
This statement has the following format:
[ [ACTIVITY ] [TERMINAL ] ]
[COMMIT ([ ] [ ])] +
[ [NOACTIVITY] [NOTERMINAL] ]
[SIZE record-count] +
[WORK number-of-work-data-sets] +
[BEFORE proc-name] +
[NAME sort-name]
• input-file-name
input-file-name is the name of the input file for the SORT activity.
input-file-name must reference a FILE statement that defines a SEQUENTIAL, INDEXED, RELATIVE, or VFM file. The
record length of input-file-name controls the length of records to be sorted, except when both files are fixed length. When
this occurs, the length of the records is equal to that of input-file-name or sorted-file-name, whichever is shorter.
• TO sorted-file-name
CA Easytrieve® Report Generator 11.6
sorted-file-name designates the name of the output file of the sort activity. Sorted-file-name must reference a FILE
statement that defines a SEQUENTIAL, INDEXED, RELATIVE, or VFM file.
If sorted-file-name is the same file name as input-file-name, the sorted output is written over the input file.
• USING (sort-key-field-name [D] ...)
USING (sort-key-field-name) specifies key fields for sorting input-file-name.
You can code any number of fields up to the input limit of your installation's sort program. 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.
Code D to sort output in descending order. The default is ascending order.
Note: Varying length, K, and M fields cannot be specified as sort keys.
• [COMMIT [ACTIVITY|NOACTIVITY] [TERMINAL|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 ACTIVITY to commit all recoverable work during the normal termination of the activity. Specify NOACTIVITY
to tell CA Easytrieve® Report Generator not to commit at the end of the activity. NOACTIVITY is the default.
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® Report
Generator not to commit during a terminal I/O. TERMINAL is the default.
If this activity is executed by an activity that has NOTERMINAL specified, this activity performs terminal I/O as if
NOTERMINAL was specified.
For more information, see the Programming Guide.
• [SIZE record-count]
Because CA Easytrieve® Report Generator knows the number of records in files created by previous activities, it
automatically supplies that information to the sort program. If the file was not created by a previous activity, you
can enhance sort efficiency by supplying the approximate number of records as record-count on the optional SIZE
parameter. Record-count must be an unsigned integer.
• [WORK number-of-work-data-sets]
Specifies the number of work data sets used by the sort program. Number-of-work-data-sets must be one of the following:
• A zero -- to indicate that DD statements are supplied
• A value from 1 to 31 -- to indicate the number of work data sets that the sort program dynamically allocates
This parameter overrides the number of work data sets set in the Site Options Table.
• [BEFORE proc-name]
Optionally, specify proc-name to identify your procedure that pre-screens, modifies, and selects input records for the sort.
See SELECT Statement (Sort Selection) for more information.
If you do not specify BEFORE proc-name, CA Easytrieve® Report Generator sorts all records in input-file-name and writes
them to sorted-file-name.
• [NAME sort-name]
Optionally, specify sort-name to identify the SORT activity. Sort-name:
• Can be up to 128 characters in length
• Can contain any character other than a delimiter
• Can begin with A to Z, 0 to 9, or a national character (#, @, $)
• Must not consist of all numeric characters
The sort-name can be used to identify the sort in an EXECUTE statement.
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:
SQL Statement
The SQL statement supports the SQL statements of the following database management systems:
The SQL statement supports the SQL statements of the following database management systems:
• DB2
• SQL/DS
• CA Datacom/DB SQL
• CA IDMS SQL
• Ingres
• Oracle
• Sybase
• ODBC
This statement has the following format:
SQL native-sql-statement
Usage Notes
For information about syntax for native database statements, see the specific database management system manual. Listed
below are the SQL statements currently supported by the SQL interface. For more information about coding native SQL
statements, see the Programming section.
DB2 SQL Statements:
• 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
• SET CURRENT DEGREE
• SET CURRENT PACKAGESET
• SET CURRENT SQLID
• SET host-variable
• UPDATE {where current of cursor-name}
Note: See SQLSYNTAX in PARM Statement for more information.
SQL/DS SQL Statements:
• ACQUIRE
• ALTER
• CLOSE cursor-name
CA Easytrieve® Report Generator 11.6
• 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}
CA Datacom/DB SQL Statements:
• 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}
CA IDMS SQL Statements:
• ALTER
• CLOSE cursor-name
• COMMIT {work} {continue} {release}
• CONNECT TO dictionary-name
• CREATE
• DECLARE cursor-name
• DELETE*
• DROP
• EXPLAIN
• FETCH cursor-name
• GRANT
• INSERT
• OPEN cursor-name
• RELEASE
• RESUME
• REVOKE
CA Easytrieve® Report Generator 11.6
• ROLLBACK {work}
• SUSPEND
• UPDATE*
Note: * Note: WHERE CURRENT OF cursor cannot be dynamically processed by the SQL interface for CA IDMS. To
perform SQL updates, you must code native SQL statements using a search WHERE clause.
Ingres SQL Statements:
• CLOSE cursor-name
• COMMIT {work}
• CONNECT
• CREATE
• DECLARE cursor-name
• DELETE
• DISCONNECT
• DROP
• FETCH cursor-name
• INSERT
• OPEN cursor-name
• ROLLBACK {work}
• UPDATE
Oracle SQL Statements:
• CLOSE cursor-name
• COMMIT {work}
• CONNECT
• CREATE
• DECLARE cursor-name
• DELETE
• DISCONNECT
• DROP
• FETCH cursor-name
• INSERT
• OPEN cursor-name
• ROLLBACK {work}
• UPDATE
Sybase SQL Statements:
• CLOSE cursor-name
• COMMIT {work}
• CONNECT
• CREATE
• DECLARE cursor-name
• DELETE
• DISCONNECT
• DROP
• FETCH cursor-name
• INSERT
• OPEN cursor-name
• ROLLBACK {work}
• UPDATE
• USE
ODBC SQL Statements:
• CLOSE cursor-name
• COMMIT {work}
• CONNECT
• CREATE
CA Easytrieve® Report Generator 11.6
• DECLARE cursor-name
• DELETE
• DISCONNECT
• DROP
• FETCH cursor-name
• INSERT
• OPEN cursor-name
• ROLLBACK {work}
• UPDATE
• USE
SQL INCLUDE +
[(column ...)] +
[ {starting-position} ]
[ {* [+offset] } ]
[LOCATION { } ] +
[ {W } ]
[ {S } ]
[HEADING] +
[UPDATE] +
[NULLABLE] +
• [(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.
• [LOCATION {starting-position|* [+offset]|W|S}]
Use this optional parameter to specify the location at which the field definitions are to be generated. This parameter
functions as the starting-location parameter of the DEFINE statement.
Starting-position specifies the starting position relative to position one of the record or file.
The * (asterisk) indicates that the field begins in the next available starting position (highest position assigned so far, plus
1) within a file. 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. Use * when this SQL INCLUDE is used to generate fields within a FILE.
Coding W or S establishes a working storage field. W fields are spooled to report (work) files; S fields are not. W is the
default location if the LOCATION parameter is not coded.
• [HEADING]
Optionally, code HEADING to cause remarks in the DBMS system catalog entry for a column to be copied into a
HEADING parameter on the generated DEFINE statement for the column. This parameter is ignored for Ingres.
CA Easytrieve® Report Generator 11.6
• [UPDATE]
Code UPDATE to designate a modifiable column.
When a CA Easytrieve® Report Generator 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.
Note: You can use UPDATE only when the field definitions are generated for a CA Easytrieve® Report Generator file.
• [NULLABLE]
Optionally, code NULLABLE to cause default indicator fields to be defined for columns that contain NULL. The indicator
field is defined as a 2 B 0 field preceding the field being defined. CA Easytrieve® Report Generator automatically uses the
default null indicator whenever the associated column is referenced. You can override the use of the default null indicator
by explicitly coding and referencing another indicator variable.
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.
• FROM [owner.] table
FROM identifies the table definition to be defined to CA Easytrieve® Report Generator. Owner is the optional 1- to 18-
character alphanumeric qualifier, and table is the 1- to 32-character alphanumeric name. The period must be used as the
qualification separator for owner-qualified tables.
Note: If the owner is not specified, the current authorization ID is used.
Usage Notes
When used, the SQL INCLUDE statements must precede any other SQL or SELECT statements and must be coded in the
library definition section of your CA Easytrieve® Report Generator program.
The generated CA Easytrieve® Report Generator 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.
Mask information is not retrieved from the DBMS system catalog.
Group qualification structures of owner.table are defined prior to the first included definition. The fields are defined under the
table entity, which is in turn under the owner level entity. This ensures that multiple tables with duplicate column names do not
produce duplicate field names.
Fields with SQL data types that do not have equivalent CA Easytrieve® Report Generator data types are defined as shown in
the following table. Fields of DATE, TIME, 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.
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® Report
Generator 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, you can substitute the host variable TABLE definition in place of coding all host-variables in
the table.
CA Easytrieve® Report Generator 11.6
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.
When the host-variable is a CA Easytrieve® Report Generator group level definition of a table name, an array of type 2 B
0 should be specified immediately following the host-table-name-variable. The number of array elements should match the
number of fields in the CA Easytrieve® Report Generator table name definition. Array elements are matched one-to-one with
the fields defined in the table name.
STOP Statement
The STOP statement terminates activities.
The STOP statement terminates activities.
In CA Easytrieve® Report Generator, activities with automatic file input automatically terminate when all input records have
been processed. You can terminate activities prematurely, however, with a STOP statement. You must use STOP to terminate
JOB activities without automatic file input (for example, JOB INPUT NULL).
Note: Use the EXIT statement to normally terminate SCREEN activities.
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® Report Generator activity procedures are immediately terminated. If STOP is coded in the
START or FINISH procedure, the procedure is terminated.
When used in a SORT activity procedure, a STOP terminates the record selection process and executes the sort program. If
you selected a record, the record is not accepted.
When COMMIT ACTIVITY is specified for the activity, a STOP statement causes a COMMIT of all recoverable work. A
STOP EXECUTE causes a ROLLBACK.
This statement has the following format:
STOP [EXECUTE]
• [EXECUTE]
EXECUTE immediately terminates all CA Easytrieve® Report Generator execution and is considered an abnormal
termination and causes recoverable resources to be rolled back, etc.. STOP without EXECUTE terminates the current
activity only. Subsequent activities (if any) are executed normally.
Examples
The following example illustrates STOP in a SORT activity to limit the number of records being sorted. In this example, only
the first 50 records from PERSNL are sorted, because the STOP statement simulates end-of-file on PERSNL.
ELSE
IF END-
PROC
CA Easytrieve® Report Generator 11.6
Under certain circumstances, you might want to completely terminate all activities using a STOP EXECUTE statement, as in
the next example:
END-
IF END-
PROC *
NUMBER PART-
DESCRIPTION *
STATE, + LOCATION-
CITY) NAME MYSORT *
NUMBER LOCATION-CITY LOCATION-STATE
SUM Statement
The SUM statement is a report definition statement that explicitly specifies the quantitative fields that are
totaled for a control report.
The SUM statement is a report definition statement that explicitly specifies the quantitative fields that are totaled for a control
report.
Normally, CA Easytrieve® Report Generator automatically totals all quantitative fields specified on LINE statements. The
SUM statement overrides this process; only the fields specified on the SUM statement are totaled. The fields specified on a
SUM statement do not have to be specified on a LINE statement. The SUM statement is valid only in a Control Report.
This statement has the following format:
• field-name
Field-name is any quantitative field contained in an active file or W storage. You can specify multiple fields.
TERMINATION. PROC
CA Easytrieve® Report Generator 11.6
Example
The following is an example of report footing:
TERMINATION. PROC
{[ ] field-name}
• [title-number]
CA Easytrieve® Report Generator 11.6
Title-number specifies the position of the title line in the title area. Title-number must be from 1 to 99 (default is 1). You
must specify title numbers in ascending order with no duplicates. The title-number of the first TITLE statement must be 1
or unspecified.
• [#font-number]
#Font-number defines a font index. The value of #font-number identifies a font whose specifications are to be used for the
next display item. You can only specify this option if the report has been associated with an extended reporting printer.
#Font-number identifies the font number of a font defined for the associated extended reporting printer. If you do not code
the font number, then the next display item uses the default font for the assigned extended reporting printer.
• {field-name}
Field-name specifies a field in any active file, working storage field, or system-defined field.
• {'literal'}
'Literal' specifies a character string for a title item. It must be either a numeric literal, a hexadecimal literal, or an
alphanumeric literal. Alphanumeric literals must be enclosed in single quotes.
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 REPORT statement. The +, -, and COL parameters modify this positioning.
Note: You must code at least one title item, specified by field-name or 'literal', on each TITLE statement.
• {+offset|-offset}
The space adjustment parameters, +offset and -offset, modify the normal spacing between title items. Offset is added to
or subtracted from the SPACE parameter on the REPORT statement to get the absolute space between title items. The
absolute space value can range from zero to any amount that still allows the title line to fit within the current LINESIZE
value on the REPORT statement.
• {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.
When the report is associated with an extended reporting printer, an error results if two or more fields or literals overlap.
• [row-number]
Specify the row-number on which you want the TITLE to be displayed. If row-number is not specified, the next screen row
is used for the title. The next screen row is not the highest row used, but the previously-specified row plus one. If no rows
are previously specified, row one is used.
• [COL column-number][+offset]
Use COL to display a title item at a specific column (column-number) on the screen.
Titles are separated by one space on a screen. Use +offset to add additional spaces between titles.
Note: A syntax error occurs when a TITLE overlays another screen item.
• {field-name|'literal'}
Specify a field-name or a 'literal' for the title. Field-name is the name of a field to be displayed as a title on the screen.
'Literal' is an alphanumeric string to be displayed as a title on the screen.
• [ATTR {attribute-name|(attribute-list)}]
Specify a declared screen attribute name or a list of attribute keywords. For a list of attributes, see ATTR Parameter. For
procedures to DECLARE screen attributes, see DECLARE Statement.
Note: The following attributes are invalid for TITLEs:
CA Easytrieve® Report Generator 11.6
If you use these attributes, they are ignored, but CA Easytrieve® Report Generator issues a warning message during
compilation. SENDONLY and ASKIP are assumed for TITLE items.
Example
The following TITLE statement:
produces:
SYSDATE and SYSTIME are displayed starting in specific columns by using the COL parameter. 'Employee Master' is
automatically centered.
TRANSFER Statement
The TRANSFER statement is used to transfer execution to a target program without returning to the
invoking program.
The TRANSFER statement is used to transfer execution to a target program without returning to the invoking program.
The TRANSFER statement completely terminates the current CA Easytrieve Report Generator program and invokes the
program specified by program-name or the program field-name using the linkage conventions of the operating system in which
the program is executing. Issuing a TRANSFER statement is similar to issuing a STOP statement: reports are completed and a
JOB FINISH procedure is executed (if coded).
The screen is automatically cleared when the current program terminates. In CICS, you can request that the screen remains
displayed on the terminal by using the NOCLEAR parameter. In other environments, NOCLEAR is ignored and the screen is
cleared and left in a ready mode.
Note:
The target program inherits the execution environment of the program issuing the TRANSFER statement.
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 Report Generator program and you want to pass a parameter, you must
specify the USING parameter on the target program's PROGRAM statement.
When transferring to another CA Easytrieve Report Generator program in a CICS pseudo-conversational environment, you
must specify the TRANSID parameter on the PARM statement of the target program.
Note:
Using the TRANSFER statement in interpretive execution causes the program execution to terminate. For more information,
see the Programming section.
This statement has the following format:
{field-name } [ {field-name} ]
TRANSFER { } [USING { } ] [NOCLEAR]
{'program-name'} [ {'literal' } ]
• {field-name|'program-name'}
CA Easytrieve® Report Generator 11.6
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.
• [USING {field-name|'literal'}]
Optionally, specify USING to pass a single parameter to the target program.
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 Report
Generator program in CICS.
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#
UPDATE Statement
Use the UPDATE statement to update a row from a SQL file.
Use the UPDATE statement to update a row from a CA Easytrieve® Report Generator SQL file.
UPDATE issues an UPDATE WHERE CURRENT OF cursor.
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 SQL INCLUDE Statement or DEFINE Statement for more information.
Note: UPDATE WHERE CURRENT OF cursor cannot be dynamically processed by the SQL interface for CA IDMS. To
perform SQL updates, you must code native SQL statements using a searched update statement.
This statement has the following format:
UPDATE file-name
• file-name
File-name is the name of a CA Easytrieve® Report Generator SQL file.
Example
The following example changes all employees in department 901 to department 921:
WRITE Statement
WRITE is used in the maintenance of SEQUENTIAL, INDEXED, and RELATIVE files (when allowed
by the underlying access method). During random processing of these files, WRITE updates and deletes
existing records and adds new records. Its syntax has two formats.
WRITE is used in the maintenance of SEQUENTIAL, INDEXED, and RELATIVE files (when allowed by the underlying
access method). During random processing of these files, WRITE updates and deletes existing records and adds new records.
Its syntax has two formats.
This statement has the following format:
Format 1
Format 2
• output-file-name
Specify the name of the SEQUENTIAL, INDEXED or RELATIVE file to be updated, added, or deleted. You must also
code UPDATE on the FILE statement for output-file-name.
• [UPDATE|ADD|DELETE]
Specify UPDATE, ADD, or DELETE to designate the type of file maintenance activity to be performed. UPDATE is the
default.
For SEQUENTIAL files, only UPDATE is allowed. For RELATIVE files, only UPDATE and DELETE are allowed.
• [FROM {input-file-name|input-record-name}]
Specify input-file-name or input-record-name to identify an alternative data source for file UPDATE and ADD operations.
FROM is similar to coding a MOVE statement prior to a WRITE statement.
When input-file-name is specified, the current value of output-file-name:RECORD-LENGTH is the length of the output
data. However, if the output file length is greater than the input file or record length, the excess storage is not initialized.
Also, using the FROM parameter does not update the data area of the output file.
• [STATUS]
Specify the STATUS parameter whenever the possibility exists for an unsatisfactory completion of the input/output
request.
STATUS checks input/output processing to see if it was performed properly. STATUS causes the file's FILE-STATUS
field to be set with the appropriate return code. To determine the meaning of the contents of FILE-STATUS, see System-
defined Fields. Normally, a zero or non-zero test is sufficient.
Note: FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
If you do not code STATUS and the operating system returns a non-zero status, CA Easytrieve® Report Generator issues
an appropriate diagnostic message.
Usage Notes
Format 1
Format 1 of the WRITE statement updates an existing record or adds a new record to the file. When updating, which is the
default, the updated record is the current active record for the file.
Format 2
Format 2 of the WRITE statement deletes the current active record for the file.
CA Easytrieve® Report Generator 11.6
Example
The following example illustrates the use of WRITE:
IF PERSNL:FILE-
STATUS NE 0 DISPLAY 'FILE-
STATUS= ' PERSNL:FILE-
STATUS DISPLAY 'UNSUCCESSFUL UPDATE ON PERSNL FI
IF
END-IF
Symbol References
Special Symbol Reserved Reference
. Syntax delimiter (period)
DISPLAY
LINE
TITLE
& Macro variable prefix
CA Easytrieve® Report Generator 11.6
* Assignment
Comment statement
DEFINE
) Syntax delimiter (right parenthesis)
Ø< Conditional expression POINT
Ø> Conditional expression
Ø= Conditional expression
- Assignment
DISPLAY
LINE
TITLE
** 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
Reserved Words
The following list includes all CA Easytrieve® Report Generator reserved words:
CA Easytrieve® Report Generator 11.6
ATTR EXTERNAL LT S
BY FIRST NE SIZE
COL GR NQ SYSDATE
COMMIT GT OF SYSIN
The DBCSCODE parameter is replaced by the CODE parameter, but still supported as valid syntax.
Environmental Differences
The following table identifies differences in CA Easytrieve® Report Generator for different environments (mainframe, PC,
Linux for zSeries, and UNIX). These differences will be resolved in future versions.
CODE parameter
KEY parameter
CA Easytrieve® Report Generator 11.6
Message ID
The message ID, a four-character code, identifies each error message. The first character of the message ID designates the type
of error:
• Letter A identifies operational error messages.
• Letter B identifies SUPRA statement syntax error messages.
Diagnostic Message
The diagnostic message is a description of the detected error.
Message Supplement
A message supplement might not be provided, depending on the message type and context. When a message supplement is
provided, it identifies which particular object is in error.
A001
ERROR IN SCAN COLUMNS - start-column end-column
ERROR IN SCAN COLUMNS - start-column end-column
Reason:
The column range to scan for input is in error. These columns are set during preprocessor installation. The valid range for both
values is 1 to 80, where start-column is less than end-column.
Action:
Correct the values, recompile the preprocessor, and rerun.
A002
PDM SINON FAILED - status
PDM SINON FAILED - status
Reason:
An error occurred when signing on to the physical data manager.
Action:
Consult your Cincom documentation for the PDM SINON command. Correct any system errors and rerun.
A003
PDM OPENX FAILED - status
CA Easytrieve® Report Generator 11.6
A004
PDM CLOSX FAILED - status
PDM CLOSX FAILED - status
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while closing the directory files. Task extended status data is printed.
Action:
Consult your Cincom documentation for the PDM CLOSX command. Correct any system errors and rerun.
A005
PDM SINOF FAILED - status
PDM SINOF FAILED - status
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while signing off from the physical data manager. Task extended status data is printed.
Action:
Consult your Cincom documentation for the PDM SINOF command. Correct any system errors and rerun.
A006
PDM READ NAME FILE FAILED - status
PDM READ NAME FILE FAILED - status
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while reading the directory name file. The parameter list and task extended status data are printed.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A007
PDM READ STRU FILE FAILED - status
PDM READ STRU FILE FAILED - status
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while reading the directory structure file. The parameter list and task extended status data are printed.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A008
PDM READ DEF# FILE FAILED - status
PDM READ DEF# FILE FAILED - status
CA Easytrieve® Report Generator 11.6
A009
PDM READ DATA FILE FAILED - status
PDM READ DATA FILE FAILED - status
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while reading the directory data file. The parameter list and task extended status data are printed.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A010
PDM SHOWX FAILED - status
PDM SHOWX FAILED - status
Reason:
An error occurred while retrieving the extended status.
Action:
Consult your Cincom documentation for the PDM SHOWX command. Correct any system errors and rerun.
A012
OPEN PARAMETER IS INVALID - parm
OPEN PARAMETER IS INVALID - parm
Reason:
The value specified for OPEN during installation is invalid. The valid values are YES or NO.
Action:
Correct the value, recompile the preprocessor, and rerun.
A013
OVERRIDE PARAMETER IS INVALID - parm
OVERRIDE PARAMETER IS INVALID - parm
Reason:
The value specified for OVERRIDE during installation is invalid. The valid values are YES or NO.
Action:
Correct the value, recompile the preprocessor, and rerun.
A101
RDM SIGN-ON ERROR FSI - fsi VSI - vsi message
RDM SIGN-ON ERROR FSI - fsi VSI - vsi message
Reason:
An error occurred while signing on to the relational data manager.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
CA Easytrieve® Report Generator 11.6
A102
RDM SIGN-OFF ERROR FSI - fsi VSI - vsi message
RDM SIGN-OFF ERROR FSI - fsi VSI - vsi message
Reason:
An error occurred while signing off of the relational data manager.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A103
RDM VIEWS ERRORS FSI - fsi VSI - vsi message
RDM VIEWS ERRORS FSI - fsi VSI - vsi message
Reason:
An error occurred while opening the logical view.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A104
RDM GET ERROR FSI - fsi VSI - vsi message
RDM GET ERROR FSI - fsi VSI - vsi message
Reason:
An error occurred while retrieving the logical view.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
B001
REQUIRED PARAMETER IS NOT CODED - word
REQUIRED PARAMETER IS NOT CODED - word
Reason:
Additional parameters are required. That is, parameters, subparameters, or their associated values are missing.
Action:
Refer to the statement syntax description, add the appropriate parameters, and rerun.
B002
PARAMETER IS INVALID - word
PARAMETER IS INVALID - word
Reason:
The indicated word is invalid as used in the current statement.
Action:
CA Easytrieve® Report Generator 11.6
Refer to the statement syntax description, correct or delete the appropriate parameter, and rerun.
B003
SCHEMA DOES NOT EXIST IN THE DIRECTORY - schema
SCHEMA DOES NOT EXIST IN THE DIRECTORY - schema
Reason:
The specified name does not exist in the directory as a schema.
Action:
Correct the schema name and rerun.
B004
VIEW DOES NOT EXIST IN THE DIRECTORY - view
VIEW DOES NOT EXIST IN THE DIRECTORY - view
Reason:
The specified name does not exist in the directory as a logical view.
Action:
Correct the view name and rerun.
B005
ACCESS SET DOES NOT EXIST FOR THIS VIEW - view
ACCESS SET DOES NOT EXIST FOR THIS VIEW - view
Reason:
The specified name does not exist in the directory as an access set.
Action:
Correct the access set name and rerun.
B007
FIELD DOES NOT EXIST IN THE DIRECTORY - field
FIELD DOES NOT EXIST IN THE DIRECTORY - field
Reason:
The specified name does not exist in the directory as an entity.
Action:
Correct the field name and rerun.
B008
PHYSICAL DETAIL DOES NOT EXIST - field
PHYSICAL DETAIL DOES NOT EXIST - field
Reason:
No physical detail records exist in the directory for the field.
Action:
Verify the existence of a physical detail record for the identified field and rerun.
B009
SELECTED FIELD DOES NOT EXIST IN THE VIEW - field
SELECTED FIELD DOES NOT EXIST IN THE VIEW - field
Reason:
The specified name does not exist in the directory as a field in the access set.
CA Easytrieve® Report Generator 11.6
Action:
Correct the access set field name and rerun.
B010
INCLUDE FOR THIS VIEW WAS NOT FOUND - view
INCLUDE FOR THIS VIEW WAS NOT FOUND - view
Reason:
The specified name was not found in the list of INCLUDEd views.
Action:
Check that the view is coded on a SUPRA INCLUDE statement and rerun.
B011
NUMBER OF KEY VALUES EXCEED ACCESS SET - view
NUMBER OF KEY VALUES EXCEED ACCESS SET - view
Reason:
You specified more key values than exist in the access set for this view.
Action:
Correct the number of key values and rerun.
B012
NO FIELDS ARE FOUND IN THE ACCESS SET - view
NO FIELDS ARE FOUND IN THE ACCESS SET - view
Reason:
There are no fields in the access set that the preprocessor can generate into CA Easytrieve® Report Generator DEFINE
statements.
Action:
Verify the access set contains the correct information and rerun.
B014
TOO MANY FIELDS IN THIS ACCESS SET - view
TOO MANY FIELDS IN THIS ACCESS SET - view
Reason:
There are more fields in the access set than the preprocessor can generate into CA Easytrieve® Report Generator DEFINE
statements. The maximum number of fields is set during the installation of the preprocessor.
Action:
Recompile and link edit the preprocessor with a greater number specified for the FIELDS parameter. Then rerun.
YOU MAY ONLY SELECT 50 FIELDS - view
Reason:
There are more than 50 fields selected for the view.
Action:
Reduce the number of fields in the SELECT clause and rerun.
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA
Support.
This section lists the messages and codes that can display if a program abends during the execution of CA Easytrieve® Report
Generator programs. You can use them to help correct a program error or to help CA Support in case of a system problem.
The actual message identifier and text issued by CA Easytrieve® Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
EZABX000
An error has occurred in program <program name>.The following messages provide diagnostic
information. Please contact the person or persons responsible for maintaining this application. They
may want to see this information. ################## Diagnostic Information ##################
The error occurred at <hh:mm:ss> on <mm/dd/yy>. Reason: Your program terminated abnormally. The
following messages explain the error. This message indicates the time, the day, and the program that
terminated. Action: Examine the messages that follow to determine what the error is.
An error has occurred in program <program name>.The following messages provide diagnostic information. Please
contact the person or persons responsible for maintaining this application. They may want to see this information.
################## Diagnostic Information ##################
The error occurred at <hh:mm:ss> on <mm/dd/yy>.
Reason:
Your program terminated abnormally. The following messages explain the error. This message indicates the time, the day, and
the program that terminated.
Action:
Examine the messages that follow to determine what the error is.
EZABX008
The error occurred at program statement number <nnn>. Reason: This message indicates which statement
in your program is in error. The statement number is from the listing of your program, not the source file.
Action: Refer to the file with the same name as your source file and the .lst extension. Start the debugging
process at the statement with the number listed.
The error occurred at program statement number <nnn>.
Reason:
This message indicates which statement in your program is in error. The statement number is from the listing of your program,
not the source file.
Action:
Refer to the file with the same name as your source file and the .lst extension. Start the debugging process at the statement with
the number listed.
EZABX009
An index or subscript is out of range. Reason: Your program references an array using a subscript or
an index that exceeds the bounds of the array. Action: Use the other messages to locate the line where
the error occurred. Locate every array reference in that line to determine which array reference has the
incorrect subscript or index.
An index or subscript is out of range.
Reason:
Your program references an array using a subscript or an index that exceeds the bounds of the array.
Action:
Use the other messages to locate the line where the error occurred. Locate every array reference in that line to determine which
array reference has the incorrect subscript or index.
EZABX010
A field of an inactive file has been referenced. Reason: Your program references a field in a file that is
not active (that is, the file was not opened or was closed and its buffer was discarded). Action: Use the
other messages to locate the line where the error occurred. Check each field name in that line to see if the
file it belongs to is still open.
A field of an inactive file has been referenced.
CA Easytrieve® Report Generator 11.6
Reason:
Your program references a field in a file that is not active (that is, the file was not opened or was closed and its buffer was
discarded).
Action:
Use the other messages to locate the line where the error occurred. Check each field name in that line to see if the file it
belongs to is still open.
EZABX016
The program executed the following statements most recently: nnn nnn ... Reason: This message lists a
history of what statements were most recently executed. Action: You can use this history to retrace the
execution of your program.
The program executed the following statements most recently: nnn nnn ...
Reason:
This message lists a history of what statements were most recently executed.
Action:
You can use this history to retrace the execution of your program.
EZABX020
The program referred to the following files: File Name State Length Count Status <file_name> <state>
<nnn> <nnn> <status> Reason: This message lists the name of each file that was in use at the time of the
error:
The program referred to the following files: File Name State Length Count Status <file_name> <state> <nnn> <nnn>
<status>
Reason:
This message lists the name of each file that was in use at the time of the error:
Action:
We provide this information to assist you in your debugging.
EZABX024
Interrupt trapped: <interrupt> Reason: An interrupt was trapped while your program was executing.
Following is a list of the possible interrupts: Hangup Interrupt from keyboard Quit Illegal instruction
Floating point error Illegal storage access Write to a pipe with no process to read it Alarm clock Software
termination signal User defined signal 1 User defined signal 2 Unexpected Signal Action: We provide
this information to assist you in your debugging.
Interrupt trapped: <interrupt>
Reason:
An interrupt was trapped while your program was executing. Following is a list of the possible interrupts:
Hangup
Interrupt from keyboard
Quit
Illegal instruction
CA Easytrieve® Report Generator 11.6
EZABX046
A field that is NULL has been accessed. Reason: Your program referenced a field that is NULL. Action:
Use the other messages to locate the line that caused the error. Examine each field on that line to
determine which field caused the error.
A field that is NULL has been accessed.
Reason:
Your program referenced a field that is NULL.
Action:
Use the other messages to locate the line that caused the error. Examine each field on that line to determine which field caused
the error.
EZABX047
MOVE statement specifies an invalid length. Reason: Your program specifies an invalid length on a
MOVE. Action: Use the other messages to locate the line that caused the error. Examine that line and the
preceding lines to determine why the length is not valid.
MOVE statement specifies an invalid length.
Reason:
Your program specifies an invalid length on a MOVE.
Action:
Use the other messages to locate the line that caused the error. Examine that line and the preceding lines to determine why the
length is not valid.
EZABX048
Length of VARYING string is invalid. Reason: The dynamic length of a VARYING string is either
greater than the string's static size or is negative. Action: Use the other messages to locate the line that
caused the errors. Examine each VARYING field on that line to determine which field is in error.
Length of VARYING string is invalid.
Reason:
The dynamic length of a VARYING string is either greater than the string's static size or is negative.
Action:
Use the other messages to locate the line that caused the errors. Examine each VARYING field on that line to determine which
field is in error.
EZABX049
Error Check invoked with invalid parameter. Reason: This is an internal error. Action: Contact CA
Support if this error is reproducible.
Error Check invoked with invalid parameter.
Reason:
This is an internal error.
Action:
Contact CA Support if this error is reproducible.
CA Easytrieve® Report Generator 11.6
EZABX050
Interpreter Option not recognized: <string> Reason: The value of string specifies the option found on the
command line. However, this option is not recognized or supported. Action: Remove the option from the
command line and try again.
Interpreter Option not recognized: <string>
Reason:
The value of string specifies the option found on the command line. However, this option is not recognized or supported.
Action:
Remove the option from the command line and try again.
EZABX051
You did not specify the name of the file to be executed. The command format is: EZTERP [EZTERP
options] PCodeFileName [program options] Reason: The command line did not specify a P-Code
filename. Action: Specify a P-Code filename on the command line and try again.
You did not specify the name of the file to be executed. The command format is: EZTERP [EZTERP options]
PCodeFileName [program options]
Reason:
The command line did not specify a P-Code filename.
Action:
Specify a P-Code filename on the command line and try again.
EZABX053
Command line token not recognized: <string> Reason: The value of string specifies the token found on
the command line. However, this token is not recognized or supported. Action: Remove the token from
the command line and try again.
Command line token not recognized: <string>
Reason:
The value of string specifies the token found on the command line. However, this token is not recognized or supported.
Action:
Remove the token from the command line and try again.
EZABX054
Unable to open PCode File: <pcode file> Reason: The interpreter could not open the P-Code file. This
can be due to a misspelled filename or a syntax error during the compilation. This prevented the creation
of a P-Code file. Action: Check the spelling of the P-Code file. If that is correct, check for syntax errors
in the source (refer to the .lst file).
Unable to open PCode File: <pcode file>
Reason:
The interpreter could not open the P-Code file. This can be due to a misspelled filename or a syntax error during the
compilation. This prevented the creation of a P-Code file.
Action:
Check the spelling of the P-Code file. If that is correct, check for syntax errors in the source (refer to the .lst file).
EZABX055
The PCode File, <pcode file>, is not formatted correctly. Reason: The P-code file is not formatted
correctly. It could be misspelled or you may have specified a non-P-code file. Action: Check the spelling
of the P-code file. If the filename does not end in .pco, the filename is most likely not a P-code filename.
The PCode File, <pcode file>, is not formatted correctly.
Reason:
The P-code file is not formatted correctly. It could be misspelled or you may have specified a non-P-code file.
Action:
Check the spelling of the P-code file. If the filename does not end in .pco, the filename is most likely not a P-code filename.
CA Easytrieve® Report Generator 11.6
EZABX056
The option <string> was specified more than once. Reason: An option (string) appears more than once in
the command line. Action: Remove the extra occurrences of the option from the command line and try
again.
The option <string> was specified more than once.
Reason:
An option (string) appears more than once in the command line.
Action:
Remove the extra occurrences of the option from the command line and try again.
EZABX057
The -t option, has a syntax error at: ... <string> Reason: The -t option has a syntax error. Action: The -t
option is for internal use only.
The -t option, has a syntax error at: ... <string>
Reason:
The -t option has a syntax error.
Action:
The -t option is for internal use only.
EZABX058
The Options Table could not be read after it was opened. Check for incorrect EZOPTBL files in your
current directory and in the directories specified in EZTPATH. Reason: The options table was opened but
could not be read. This occurs when there is a file with a name of EZOPTBL in your path that is not an
options table. Action: Search for files with the name of EZOPTBL in your path. Eliminate any file with
that name that is not an options table. You can create an options table with the etopload utility. For more
information about creating an options table, see the User Guide.
The Options Table could not be read after it was opened. Check for incorrect EZOPTBL files in your current directory
and in the directories specified in EZTPATH.
Reason:
The options table was opened but could not be read. This occurs when there is a file with a name of EZOPTBL in your path
that is not an options table.
Action:
Search for files with the name of EZOPTBL in your path. Eliminate any file with that name that is not an options table.
You can create an options table with the etopload utility. For more information about creating an options table, see the CA
Easytrieve® Report Generator User Guide.
EZABX059
Internal Error Invalid option update order found. Reason: This is an internal error. Action: If you can
reproduce this error, contact CA Support.
Internal Error Invalid option update order found.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZABX060
Illegal Call to IDMS function <function>. IDMS is not installed or the program was linked with the
+OI option. Reason: A CA IDMS function could not be called. Action: Check to see if the EZTPATH
environment variable contains a path to the CA IDMS libraries. Compiling with the +OI option bypasses
the inclusion of CA IDMS libraries.
Illegal Call to IDMS function <function>. IDMS is not installed or the program was linked with the +OI option.
Reason:
A CA IDMS function could not be called.
Action:
CA Easytrieve® Report Generator 11.6
Check to see if the EZTPATH environment variable contains a path to the CA IDMS libraries. Compiling with the +OI option
bypasses the inclusion of CA IDMS libraries.
EZABX061
Illegal Call to SQL function <function>. SQL is not installed or the program was linked with the +OS
option. Reason: An SQL function could not be called. Action: Check to see if the EZTPATH environment
variable contains a path to the SQL libraries. Compiling with the +OS option bypasses the inclusion of
SQL libraries.
Illegal Call to SQL function <function>. SQL is not installed or the program was linked with the +OS option.
Reason:
An SQL function could not be called.
Action:
Check to see if the EZTPATH environment variable contains a path to the SQL libraries. Compiling with the +OS option
bypasses the inclusion of SQL libraries.
EZABX062
Illegal Call to C-ISAM function <function>. C-ISAM is not installed or the program was linked with the
+OC option. Reason: A C-ISAM function could not be called. Action: Check to see if the EZTPATH
environment variable contains a path to the CA Technologies ISAM libraries. Compiling with the +OC
option bypasses the inclusion of CA Technologies ISAM libraries.
Illegal Call to C-ISAM function <function>. C-ISAM is not installed or the program was linked with the +OC option.
Reason:
A C-ISAM function could not be called.
Action:
Check to see if the EZTPATH environment variable contains a path to the CA Technologies ISAM libraries. Compiling with
the +OC option bypasses the inclusion of CA Technologies ISAM libraries.
EZACT001
Error <error number> detected loading program <program name> Reason: failed to load your called
subroutine. The errornumber indicates the cause. Action: For more information, see the link-editing in the
User Guide.
Error <error number> detected loading program <program name>
Reason:
CA Easytrieve® Report Generator failed to load your called subroutine. The errornumber indicates the cause.
Action:
For more information, see the link-editing in the CA Easytrieve® Report Generator User Guide.
EZACT002
A LINK failed: Return code <return code>. Error: <text>. Specification: <path to link> Reason: Your
program attempted to LINK to another program and failed. return code Indicates why the LINK failed.
text Explains why the attempt failed. path to link The path to the LINK target program. Action: Examine
the path to the target program. The program probably is not at that path.
CA Easytrieve® Report Generator 11.6
A LINK failed: Return code <return code>. Error: <text>. Specification: <path to link>
Reason:
Your program attempted to LINK to another program and failed.
return code
Indicates why the LINK failed.
text
Explains why the attempt failed.
path to link
The path to the LINK target program.
Action:
Examine the path to the target program. The program probably is not at that path.
EZACT005
A TRANSFER failed: Return code <return code>. Error: <text>Specification: <path to transfer> Reason:
Your program attempted to transfer control to another program and failed. return code Indicates why the
transfer failed. text Explains why the attempt failed. path to link The path to the target program. Action:
Examine the path to the target program.
A TRANSFER failed: Return code <return code>. Error: <text>Specification: <path to transfer>
Reason:
Your program attempted to transfer control to another program and failed.
return code
Indicates why the transfer failed.
text
Explains why the attempt failed.
path to link
The path to the target program.
Action:
Examine the path to the target program.
Utility Messages
This section lists the messages and codes that can display if encounters a problem in the ETALTSEQ
utility. You can use them to help correct a program error or to help CA Support in case of a system
problem. The actual message identifier and text issued by can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA
Support.
This section lists the messages and codes that can display if CA Easytrieve® Report Generator encounters a problem in the
ETALTSEQ utility. You can use them to help correct a program error or to help CA Support in case of a system problem.
The actual message identifier and text issued by CA Easytrieve® Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
EZALT001
The <string> command line option was specified more than once. The successive specifications are
ignored. Reason: An option (string) appears more than once on the command line. Action: Remove all
occurrences of the option after the first occurrence. Retry the command.
The <string> command line option was specified more than once. The successive specifications are ignored.
Reason:
An option (string) appears more than once on the command line.
Action:
Remove all occurrences of the option after the first occurrence. Retry the command.
EZALT002
The <string> command line option is not defined. Reason: The string appears on the command line.
However, string is not a recognized option. Action: Remove string from the command line. Then, retry
the command.
The <string> command line option is not defined.
CA Easytrieve® Report Generator 11.6
Reason:
The string appears on the command line. However, string is not a recognized option.
Action:
Remove string from the command line. Then, retry the command.
EZALT003
Expected a literal for a single character. The violated rule: reposition_order ::= ( literal ) Reason: The
input contains a left paren that is not followed by a literal consisting of a single character. Action: If you
are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your
corrected input.
Expected a literal for a single character. The violated rule: reposition_order ::= ( literal )
Reason:
The input contains a left paren that is not followed by a literal consisting of a single character.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT004
Expected a right paren. The violated rule: reposition_order ::= ( literal ) Reason: The input contains a left
paren followed by a literal that is not followed by a right paren. Action: If you are redirecting stdin to a
file, review your input file. Otherwise, reissue the command and retype your corrected input.
Expected a right paren. The violated rule: reposition_order ::= ( literal )
Reason:
The input contains a left paren followed by a literal that is not followed by a right paren.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT005
Expected a literal or a string for a collating value.The violated rule: collating_value ::= character_string
| hex_string | octal_string | literal Reason: The input contains a reposition order followed by a reposition
order. Action: If you are redirecting stdin to a file, review your input file. Otherwise, reissue the
command and retype your corrected input.
Expected a literal or a string for a collating value.The violated rule: collating_value ::= character_string | hex_string |
octal_string | literal
Reason:
The input contains a reposition order followed by a reposition order.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT006
Expected a single quote for a character literal. The violated rule: A character_literal is a character
surrounded by single quotes. Reason: The input is missing a single quote. Action: If you are redirecting
stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
Expected a single quote for a character literal. The violated rule: A character_literal is a character surrounded by
single quotes.
Reason:
The input is missing a single quote.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT007
Expected a double quote for a character string. The violated rule: A character_string is one or more
characters surrounded by double quotes. Reason: The input is missing a double quote. Action: If you
are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your
corrected input.
CA Easytrieve® Report Generator 11.6
Expected a double quote for a character string. The violated rule: A character_string is one or more characters
surrounded by double quotes.
Reason:
The input is missing a double quote.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT008
The value of the decimal literal exceeds the capacity of single character. Reason: The input contains a
decimal literal with a value greater than 255. Action: If you are redirecting stdin to a file, review your
input file. Otherwise, reissue the command and retype your corrected input.
The value of the decimal literal exceeds the capacity of single character.
Reason:
The input contains a decimal literal with a value greater than 255.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT009
The data does not conform with the syntax rules. It is not a string, a literal, parens, or a comment. Reason:
The input contains data that does not conform to the syntax rules for defining tokens. The data is not a
string, a literal, parens, or a comment. Action: If you are redirecting stdin to a file, review your input file.
Otherwise, reissue the command and retype your corrected input.
The data does not conform with the syntax rules. It is not a string, a literal, parens, or a comment.
Reason:
The input contains data that does not conform to the syntax rules for defining tokens. The data is not a string, a literal, parens,
or a comment.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT010
Expected a valid octal digit (07). Octal digits always come in triples. Reason: The input contains data that
initially looked like an octal literal or string. Octal literals and strings begin with a 0 and are followed by
a triple (3) of digits for a literal or multiple triples for a string. The data either does not contain a complete
triple or one of the digits is not an octal digit (0-7). Action: If you are redirecting stdin to a file, review
your input file. Otherwise, reissue the command and retype your corrected input.
Expected a valid octal digit (07). Octal digits always come in triples.
Reason:
The input contains data that initially looked like an octal literal or string. Octal literals and strings begin with a 0 and are
followed by a triple (3) of digits for a literal or multiple triples for a string. The data either does not contain a complete triple or
one of the digits is not an octal digit (0-7).
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT011
Expected a valid hex digit (09, af or AF). Hex digits always come in pairs. Reason: The input contains
data that initially looked like a hex literal or string. Hex literals and strings begin with a 0x or a 0X
and are followed by a pair (2) of digits for a literal or multiple pairs for a string. The data either does
not contain a complete pair or one of the digits is not a hex digit (0-9, a-f, or A-F). Action: If you are
redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your
corrected input.
Expected a valid hex digit (09, af or AF). Hex digits always come in pairs.
Reason:
The input contains data that initially looked like a hex literal or string. Hex literals and strings begin with a 0x or a 0X and are
followed by a pair (2) of digits for a literal or multiple pairs for a string. The data either does not contain a complete pair or one
of the digits is not a hex digit (0-9, a-f, or A-F).
Action:
CA Easytrieve® Report Generator 11.6
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT012
Due to the error, the file will not be updated. Reason: The file was not updated due to errors. Action:
Review the previous messages. Correct any errors that the messages identified and reissue the command.
Due to the error, the file will not be updated.
Reason:
The file was not updated due to errors.
Action:
Review the previous messages. Correct any errors that the messages identified and reissue the command.
EZALT013
Empty strings are not allowed. Reason: There is a double quote followed by a double quote in the input.
To place a double quote in a string, precede it with a back slash. Action: If you are redirecting stdin to a
file, review your input file. Otherwise, reissue the command and retype your corrected input.
Empty strings are not allowed.
Reason:
There is a double quote followed by a double quote in the input. To place a double quote in a string, precede it with a back
slash.
Action:
If you are redirecting stdin to a file, review your input file. Otherwise, reissue the command and retype your corrected input.
EZALT014
File failed to open. Reason: The alternate collating sequence file failed to open and you are not attempting
to create it. Action: If you specified a path on the command line, verify that the path is spelled correctly.
If you did not specify a path, a file by the name of EZTPAQTT could not be found in your current
directory or in the path specified by the EZTPATH environment variable. If you are attempting to create
the file, use the -b command line option. For more information, see the Alternate Collating Sequence
Table appendix in the User Guide.
File failed to open.
Reason:
The alternate collating sequence file failed to open and you are not attempting to create it.
Action:
If you specified a path on the command line, verify that the path is spelled correctly. If you did not specify a path, a file by
the name of EZTPAQTT could not be found in your current directory or in the path specified by the EZTPATH environment
variable. If you are attempting to create the file, use the -b command line option. For more information, see the Alternate
Collating Sequence Table appendix in the CA Easytrieve® Report Generator User Guide.
EZCM001
Empty Document. Error loading XML. Reason: The XML configuration file is empty. Action: Open a
different XML file or create a new one from the File, New menu.
Empty Document. Error loading XML.
CA Easytrieve® Report Generator 11.6
Reason:
The XML configuration file is empty.
Action:
Open a different XML file or create a new one from the File, New menu.
EZCM002
Error on line %d, position %n Reason: %s. Error loading XML. Reason: There was an error parsing the
XML configuration file. Action: Manual editing of the xml file may be necessary to correct the error. You
can use the default options table file (eztopt.xml) or the default printer set definition file (eztpsd.xml) as
an example of correct xml format. Or you can use the File – New menu item and create new xml files that
can be used as examples.
Error on line %d, position %n Reason: %s. Error loading XML.
Reason:
There was an error parsing the XML configuration file.
Action:
Manual editing of the xml file may be necessary to correct the error. You can use the default options table file (eztopt.xml) or
the default printer set definition file (eztpsd.xml) as an example of correct xml format. Or you can use the File – New menu
item and create new xml files that can be used as examples.
EZCM003
Failed to save XML file. Reason: There was an error saving the configuration file. Action: Check if the
xml file you are trying to save already exists and is possibly read-only.
Failed to save XML file.
Reason:
There was an error saving the configuration file.
Action:
Check if the xml file you are trying to save already exists and is possibly read-only.
EZCM004
There was an error launching eztgenps.exe or eztgenop.exe. Please make sure the program file exists.
Reason: You chose to generate a binary PSD or OPT file, but there was an error launching the executable.
Action: Ensure that the program file exists in the installed bin directory.
There was an error launching eztgenps.exe or eztgenop.exe. Please make sure the program file exists.
Reason:
You chose to generate a binary PSD or OPT file, but there was an error launching the executable.
Action:
Ensure that the program file exists in the installed bin directory.
EZCM005
eztgenps (or eztgenop) failed with error %u. Reason: The eztgenps.exe or eztgenop.exe failed to produce
a binary output file from the xml file. Action: Improper XML file or a binary file that already exists and
is read-only are a couple of items that can cause this error. If neither of these seems to be the case, contact
CA Support.
eztgenps (or eztgenop) failed with error %u.
Reason:
The eztgenps.exe or eztgenop.exe failed to produce a binary output file from the xml file.
Action:
Improper XML file or a binary file that already exists and is read-only are a couple of items that can cause this error. If neither
of these seems to be the case, contact CA Support.
EZCM006
Printer name cannot be empty Reason: You have not specified a printer name. Action: Enter a valid
printer name.
Printer name cannot be empty
Reason:
CA Easytrieve® Report Generator 11.6
EZCM007
Printer name cannot start with an asterisk Reason: The printer name that you entered is invalid, because it
starts with an asterisk . Action: Enter a valid printer name.
Printer name cannot start with an asterisk
Reason:
The printer name that you entered is invalid, because it starts with an asterisk .
Action:
Enter a valid printer name.
EZCM008
Printer already exists. Please enter another name Reason: The printer name that you entered already
exists. Action: Enter a new valid printer name.
Printer already exists. Please enter another name
Reason:
The printer name that you entered already exists.
Action:
Enter a new valid printer name.
EZCM009
Font number cannot be empty Reason: You have not specified a font number. Action: Enter a valid font
number, between 1 and 256.
Font number cannot be empty
Reason:
You have not specified a font number.
Action:
Enter a valid font number, between 1 and 256.
EZCM010
Font number should be between 1 and 256 Reason: The font number that you entered is invalid; it is
outside the allowable range. Action: Enter a valid font number, between 1 and 256.
Font number should be between 1 and 256
Reason:
The font number that you entered is invalid; it is outside the allowable range.
Action:
Enter a valid font number, between 1 and 256.
EZCM011
Font width cannot be empty Reason: You have not specified a font width. Action: Enter a valid font
width.
Font width cannot be empty
Reason:
You have not specified a font width.
Action:
Enter a valid font width.
EZCM012
Font already exists. Please enter another number Reason: The font name that you entered already exists.
Action: Enter a new valid font name.
Font already exists. Please enter another number
Reason:
The font name that you entered already exists.
CA Easytrieve® Report Generator 11.6
Action:
Enter a new valid font name.
EZCM013
Printer description cannot start with an asterisk Reason: The printer description that you entered is
invalid, because it starts with an asterisk . Action: Enter a valid printer description.
Printer description cannot start with an asterisk
Reason:
The printer description that you entered is invalid, because it starts with an asterisk .
Action:
Enter a valid printer description.
EZCM014
New Line Control field cannot be empty Reason: You have not specified a New Line Control value.
Action: Enter a valid value in the New Line Control field.
New Line Control field cannot be empty
Reason:
You have not specified a New Line Control value.
Action:
Enter a valid value in the New Line Control field.
EZCM015
New Page Control field cannot be empty Reason: You have not specified a new page control value.
Action: Enter a valid value in the New Page Control field.
New Page Control field cannot be empty
Reason:
You have not specified a new page control value.
Action:
Enter a valid value in the New Page Control field.
EZCM016
Printer Record Maximum Length should be greater than 132 Reason: The maximum length that you
entered for printer records is invalid. Action: Enter a valid value, greater than 132, in the Printer Record
Maximum Length field.
Printer Record Maximum Length should be greater than 132
Reason:
The maximum length that you entered for printer records is invalid.
Action:
Enter a valid value, greater than 132, in the Printer Record Maximum Length field.
EZCM017
Printer Record Maximum Bytes should be greater than 132 Reason: The maximum bytes value that you
entered for printer records is invalid. Action: Enter a valid value, greater than 132, in the Printer Record
Maximum Bytes field.
Printer Record Maximum Bytes should be greater than 132
Reason:
The maximum bytes value that you entered for printer records is invalid.
Action:
Enter a valid value, greater than 132, in the Printer Record Maximum Bytes field.
EZCM018
Default EBCDIC/ ASCII Font cannot be empty Reason: You have not specified a default font for
EBCDIC and ASCII. Action: Enter a valid value in the Default EBCDIC/ ASCII Font field.
Default EBCDIC/ ASCII Font cannot be empty
Reason:
CA Easytrieve® Report Generator 11.6
You have not specified a default font for EBCDIC and ASCII.
Action:
Enter a valid value in the Default EBCDIC/ ASCII Font field.
EZCM019
Font Height cannot be empty Reason: You have not specified a font height. Action: Enter a valid value in
the Font Height field.
Font Height cannot be empty
Reason:
You have not specified a font height.
Action:
Enter a valid value in the Font Height field.
EZCM020
Page Height cannot be empty Reason: You have not specified a page height. Action: Enter a valid value
in the Page Height field.
Page Height cannot be empty
Reason:
You have not specified a page height.
Action:
Enter a valid value in the Page Height field.
EZCM021
Please specify an EBCDIC font for the mixed data format Reason: You have not specified an EBCDIC
font for the mixed data format. Action: Enter a valid value for the EBCDIC font.
Please specify an EBCDIC font for the mixed data format
Reason:
You have not specified an EBCDIC font for the mixed data format.
Action:
Enter a valid value for the EBCDIC font.
EZCM022
Please specify a DBCS font for the mixed data format Reason: You have not specified a DBCS font for
the mixed data format. Action: Enter a valid value for the DBCS font.
Please specify a DBCS font for the mixed data format
Reason:
You have not specified a DBCS font for the mixed data format.
Action:
Enter a valid value for the DBCS font.
EZCM023
Enter a value between 0 and %i Reason: You have not specified a value between the 2 values above.
Action: Enter a valid value within the specified range.
Enter a value between 0 and %i
Reason:
You have not specified a value between the 2 values above.
Action:
Enter a valid value within the specified range.
EZCM024
Enter a value between 0 and 255 Reason: You have not specified a value within the allowable range.
Action: Enter a valid value within the specified range. O_889573
Enter a value between 0 and 255
Reason:
You have not specified a value within the allowable range.
CA Easytrieve® Report Generator 11.6
Action:
Enter a valid value within the specified range.
IMS_DLI Messages
This section contains the IMS and DLI messages and codes (EZDLI).
This section contains the IMS and DLI messages and codes (EZDLI).
EZDLI001
PCB specified on FILE not found in PSB. Reason: The PCB list for the PSB specified in the JCL (non-
CICS), or on the DLI PCB statement (CICS), does not contain the PCB identified on the FILE statement.
PCB specified on FILE not found in PSB.
Reason:
The PCB list for the PSB specified in the JCL (non-CICS), or on the DLI PCB statement (CICS), does not contain the PCB
identified on the FILE statement.
• If a DBDName was specified on the FILE statement, either that DBDName is not in the PCB list, or the DBDName
occurrence, if specified, is not in the PCB list.
• If just a relative PCB number was specified on the FILE statement, the PCB list is too short to find the specified PCB.
Action:
Correct the PCB specification on the FILE statement, then rerun the program.
EZDLI002
DLI returned status code: xx on function: yyyy for record zzzzzzzz. Reason: During automatic input
processing, a return code other than GB, GE, or blanks was returned from DLI. Action: See your IBM
Call DL/I manual to determine the meaning and action indicated by the return code.
DLI returned status code: xx on function: yyyy for record zzzzzzzz.
Reason:
During automatic input processing, a return code other than GB, GE, or blanks was returned from DLI.
Action:
See your IBM Call DL/I manual to determine the meaning and action indicated by the return code.
EZDLI003
A DL/I file update was attempted and the Site Options Table specified UPDTDLI=NO Reason: The
global site option for does not permit DL/I updates. Action: See your system administrator about
changing the site option to permit DL/I updates.
A DL/I file update was attempted and the Site Options Table specified UPDTDLI=NO
Reason:
The global site option for CA Easytrieve® Report Generator does not permit DL/I updates.
Action:
See your system administrator about changing the site option to permit DL/I updates.
EZEIP001
An internal <opcode> instruction returned the following error: <text> Reason: The opcode can be ADD,
COMPARE, DIVIDE, MULTIPLY, NEGATE, SHIFT, or SUBTRACT. The supplemental text explains
the type of error that occurred:
An internal <opcode> instruction returned the following error: <text>
Reason:
The opcode can be ADD, COMPARE, DIVIDE, MULTIPLY, NEGATE, SHIFT, or SUBTRACT. The supplemental text
explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a non-quantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP003
The following error occurred while converting a field to PACKED DECIMAL: <text> Reason: The
supplemental text explains the type of error that occurred:
The following error occurred while converting a field to PACKED DECIMAL: <text>
Reason:
The supplemental text explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a non-quantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP004
Unexpected internal data type, <data type>, encountered. Reason: This is an internal error. Action: If you
can reproduce this error, contact CA Support.
Unexpected internal data type, <data type>, encountered.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP005
The following error occurred while executing an internal branch: <text> Reason: This is an internal error.
Action: If you can reproduce this error, contact CA Support.
The following error occurred while executing an internal branch: <text>
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
CA Easytrieve® Report Generator 11.6
EZEIP006
The internal interface has detected that the internal code structure has been corrupted. Reason: This is an
internal error. Action: If you can reproduce this error, contact CA Support.
The internal interface has detected that the internal code structure has been corrupted.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP007
Internal literal pool area too small. Reason: This is an internal error. Action: If you can reproduce this
error, contact CA Support.
Internal literal pool area too small.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP011
The internal interface read past the end of the internal code. Reason: This is an internal error. Action: If
you can reproduce this error, contact CA Support.
The internal interface read past the end of the internal code.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP015
The following error occurred while converting a PACKED DECIMAL field to BINARY: <text> Reason:
The supplemental text explains the type of error that occurred:
The following error occurred while converting a PACKED DECIMAL field to BINARY: <text>
Reason:
The supplemental text explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a nonquantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP017
Data found on an internal expression stack was not of the expected type. Reason: This is an internal error.
Action: If you can reproduce this error, contact CA Support.
Data found on an internal expression stack was not of the expected type.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
CA Easytrieve® Report Generator 11.6
EZEIP018
An internally defined stack frame is too small. The next entry will overflow the defined limits. This often
means your program contains a recursive call. Check for recursive procedure calls or activity executions.
Reason: This message often indicates a recursive call between your procedures. Action: The trace table
can be useful in tracking recursive calls.
An internally defined stack frame is too small. The next entry will overflow the defined limits. This often means your
program contains a recursive call. Check for recursive procedure calls or activity executions.
Reason:
This message often indicates a recursive call between your CA Easytrieve® Report Generator procedures.
Action:
The trace table can be useful in tracking recursive calls.
EZEIP019
The expression stack does not have enough entries to perform the attempted operation. Reason: This is an
internal error. Action: If you can reproduce this error, contact CA Support.
The expression stack does not have enough entries to perform the attempted operation.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP021
The internal operation being requested is undefined. Reason: This is an internal error. Action: If you can
reproduce this error, contact CA Support.
The internal operation being requested is undefined.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
EZEIP022
The following error occurred while converting a BINARY field to PACKED DECIMAL: <text> Reason:
The supplemental text explains the type of error that occurred:
The following error occurred while converting a BINARY field to PACKED DECIMAL: <text>
Reason:
The supplemental text explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a nonquantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP023
Length of mask specified is greater than the length of the output field specified. Reason: The number of
digit selectors in the mask may be less than the number of significant digits in the corresponding field.
Action: Use the other messages to locate the line in error. Examine each field on that line for a mask that
does not have enough digit selectors for the value the field can hold.
Length of mask specified is greater than the length of the output field specified.
Reason:
The number of digit selectors in the mask may be less than the number of significant digits in the corresponding field.
CA Easytrieve® Report Generator 11.6
Action:
Use the other messages to locate the line in error. Examine each field on that line for a mask that does not have enough digit
selectors for the value the field can hold.
EZEIP024
Following error occurred while converting a field to ZONED DECIMAL for edit mask processing: <text>
Reason: The supplemental text explains the type of error that occurred:
Following error occurred while converting a field to ZONED DECIMAL for edit mask processing: <text>
Reason:
The supplemental text explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a nonquantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP025
Following error occurred while storing a PACKED DECIMAL field into another field type: < text >
Reason: The supplemental text explains the type of error that occurred:
Following error occurred while storing a PACKED DECIMAL field into another field type: < text >
Reason:
The supplemental text explains the type of error that occurred:
• Result of the operation exceeded the maximum number of 30 digits allowed.
• The divisor operand is zero.
• High order digits were truncated.
• Number to convert contained an invalid digit or an invalid sign.
• An invalid argument was detected.
• A negative value was loaded from or stored into a nonquantitative number.
Action:
Use the other messages to locate the line where the error occurred. Examine each field and operation on that line to determine
which field caused the error.
EZEIP028
A recursive call was made to a procedure. Reason: does not allow a procedure to call itself directly or
indirectly. Action: Use the other messages to determine the line in error. The flow table can be useful in
determining where the recursion begins.
A recursive call was made to a procedure.
Reason:
CA Easytrieve® Report Generator does not allow a procedure to call itself directly or indirectly.
Action:
Use the other messages to determine the line in error. The flow table can be useful in determining where the recursion begins.
EZEIP992
Internal PCode offset: <nnn> Reason: This information is useful to CA Support. Action: None
Internal PCode offset: <nnn>
Reason:
This information is useful to CA Support.
Action:
None
CA Easytrieve® Report Generator 11.6
EZEIP997
Interpreter terminated abnormally due to above error(s). Reason: This message is informational only.
Action: None
Interpreter terminated abnormally due to above error(s).
Reason:
This message is informational only.
Action:
None
IDMS Messages
This section contains the CA IDMS messages and codes (EZIDM).
This section contains the CA IDMS messages and codes (EZIDM).
EZIDM001
An error occurred loading program xxxxxxxx. Reason: The specified CA IDMS interface program could
not be found. Action: See your system administrator to verify that the CA IDMS interface was correctly
installed.
An error occurred loading program xxxxxxxx.
Reason:
The specified CA IDMS interface program could not be found.
Action:
See your CA Easytrieve® Report Generator system administrator to verify that the CA IDMS interface was correctly installed.
EZIDM002
Unexpected IDMS error encountered: xxxx. Reason: During automatic processing, encountered an error
status from CA IDMS that was not expected. Action: See your CA IDMS documentation for information
about the specified status code.
Unexpected IDMS error encountered: xxxx.
Reason:
During automatic processing, CA Easytrieve® Report Generator encountered an error status from CA IDMS that was not
expected.
Action:
See your CA IDMS documentation for information about the specified status code.
EZIDM003
An IDMS file update was attempted and the Site Options table specified UPDTIDM=NO. Reason: An
update was attempted to an IDMS file that was not permitted. Action: Either change the program to not
update the IDMS file or change the Site Options table to permit updates to IDMS files.
An IDMS file update was attempted and the Site Options table specified UPDTIDM=NO.
Reason:
An update was attempted to an IDMS file that was not permitted.
Action:
Either change the program to not update the IDMS file or change the Site Options table to permit updates to IDMS files.
The actual message identifier and text issued by CA Easytrieve® Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
EZIOE001
Length of print line exceeds LINESIZE for printer <printer name>. Reason: The program attempted to
print a line whose length was greater than the LINESIZE of the printer. This error usually occurs for
the SYSPRINT file when the STDOUT entry in the options table has a LINESIZE that is less than the
line size defined when the program was compiled. If the print line is part of a report, the line size was
obtained from the LINESIZE parameter of the REPORT statement. If the print line is not part of a report,
the line size was obtained from the LINESIZE entry in the options table. Action: Change the length of the
print line.
Length of print line exceeds LINESIZE for printer <printer name>.
Reason:
The program attempted to print a line whose length was greater than the LINESIZE of the printer. This error usually occurs for
the SYSPRINT file when the STDOUT entry in the options table has a LINESIZE that is less than the line size defined when
the program was compiled. If the print line is part of a report, the line size was obtained from the LINESIZE parameter of the
REPORT statement. If the print line is not part of a report, the line size was obtained from the LINESIZE entry in the options
table.
Action:
Change the length of the print line.
EZIOE002
This error can occur for multiple reasons. This article describes the various text messages that can be
displayed.
This error can occur for multiple reasons. This article describes the various text messages that can be displayed.
Error opening file: <file name> Path: <path name> <text>
Reason:
CA Easytrieve Report Generator could not open the file specified. The supplemental text states the reason.
Action:
None.
Operating System does not support either this type of file or its device type.
Reason:
The file is defined with a type or a device type that is not supported in this operation system.
Action:
See the Language Reference section for supported file types and device types. Specify one that is supported and try again.
The attempt to open the file failed.
Reason:
CA Easytrieve Report Generator issued a request to the operating environment to open the data set associated with the
specified file. The operating environment returned an error indicating that the open failed.
Action:
None.
The file is not active.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
SYSNAME length exceeds maximum.
Reason:
The length of the SYSNAME field exceeds the maximum allowed by the operating environment.
If the FILE statement specifies either SYSNAME fieldname or SYSNAME literal, then the length of fieldname or literal
exceeds the maximum length acceptable to the environment.
If the FILE statement did not specify the SYSNAME parameter, then CA Easytrieve® Report Generator builds a default
SYSNAME parameter of the form SYSNAME filename. The number of characters in the resulting literal exceeds the
maximum number acceptable to the environment.
Action:
Correct the size of SYSNAME.
SYSNAME is invalid.
Reason:
The environment could not find the file at the path SYSNAME specified.
CA Easytrieve® Report Generator 11.6
Action:
Check the spelling in the SYSNAME parameter on the FILE statement. If the path is relative to the current directory, the
current directory may be different from where the program was developed, which can cause the problem.
The logical record length could not be determined.
Reason:
The maximum record length for this file was not specified.
The FILE statement for this virtual file did not specify the record length. CA Easytrieve® Report Generator determines the
record length for a virtual file in the following way:
• The record length specified by the record format parameter, if it is coded.
• The value specified by the WORKAREA parameter, if it is coded.
• The number of bytes required to store all fields defined following the FILE statement, if any.
Action:
Specify the maximum record length for the file.
Virtual file was not previously created.
Reason:
The FILE statement for the file specifies the VIRTUAL parameter. The current activity accesses the file for input processing.
The file was never created.
A VIRTUAL file must be opened for output processing before it can be opened for input processing. Possible reasons for not
creating the file are:
• This is the first activity that refers to the VIRTUAL file.
• The activity that creates the VIRTUAL file was not executed.
• The VIRTUAL file was created correctly. However, more than one subsequent activity refers to the file. CA Easytrieve®
Report Generator deleted the file after the first reference. In this case, the FILE statement must specify the RETAIN
parameter.
This condition can also happen in a single activity if the activity contains a CLOSE statement that refers to the VIRTUAL file.
The CLOSE statement deletes the file unless the FILE statement specifies the RETAIN parameter.
Action:
Create the file.
The file type could not be determined from the file descriptor
Reason:
This indexed file did not have a valid file descriptor provided so CA Easytrieve® Report Generator could not determine which
access method to use to process the file.
Action:
Provide a valid file descriptor. For more information, see the Execute a Program article in the CA Easytrieve® Report
Generator Using section.
The log file for this file could not be opened
Reason:
An attempt was made to create or update a C-ISAM INDEXED file and a log file could not be opened.
Action:
Check that CISAMLOG environment variable is set and that it names an existing log file. For more information, see the
Execute a Program article in the CA Easytrieve® Report Generator Using section.
EZIOE003
This error can occur for multiple reasons. This article describes the various text messages that can be
displayed.
This error can occur for multiple reasons. This article describes the various text messages that can be displayed.
Error processing file <file name>. <text>
Reason:
CA Easytrieve Report Generator could not process the specified file. Supplemental text states the reason.
Action:
None.
File referenced in FROM parameter is not active.
Reason:
The file specified in the FROM parameter does not have a record associated with it.
This status results from one of the following:
• The file specified in the FROM parameter is not referenced in any other input/output statements in this activity.
CA Easytrieve® Report Generator 11.6
• The DEFER parameter was specified for the file referenced in the FROM parameter and no input/output statements have
yet executed for this file.
Action:
Resolve the problem and try again.
GET statement follows a RELEASE statement.
Reason:
A GET statement was executed, but the previous statement issued for this file was a RELEASE statement. The RELEASE
statement loses position for sequential retrieval.
Action:
A POINT or a READ statement must execute before a GET statement can execute.
No records are locked.
Reason:
A WRITE UPDATE or a WRITE DELETE statement executed and the current record is not locked.
This error can be caused by one of the following:
• No record was retrieved. A record must be retrieved with a READ or a GET statement before it can be updated or deleted.
• The GET or READ statement that retrieved the record specified the NOHOLD parameter.
• A WRITE UPDATE or a WRITE DELETE statement was previously executed for the current record.
• A RELEASE statement was executed for this file. The RELEASE statement unlocks all locked records.
• A COMMIT statement was executed. Terminal input/output and endof-activity processing can cause an implied COMMIT
statement to execute. The COMMIT statement unlocks all locked records.
Action:
Resolve the problem and try again.
Access to the file by the child activity conflicts with how the parent activity opened it.
Reason:
The parent activity opened the file with a specific type of access. The child activity must access the file in a way that conflicts
with the parent. For example, the child activity attempted to create the file after the parent opened the file to read it.
Action:
Resolve the problem and try again.
Invalid request passed to input/output statement handler.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
GET statement issued after endoffile reached.
Reason:
A GET was executed and there is no current record for this file. The previous GET statement for this file detected endoffile.
Action:
Test the file status to determine if a GET reached end-of-file.
Position for sequential insertion has not been established.
Reason:
A PUT to a relative file was executed without providing a starting record number.
Action:
A PUT to a relative file must be preceded by:
• An OPEN statement
• A POINT statement that specifies the GE parameter
• Another PUT statement
RECORD-LENGTH exceeds the maximum record length of the file. Reason:The record length defined for the program
FILE statement is larger than the LRECL defined for the associated DD statement in the JCL.
Action:Change the incorrect length value. Both length values must be the same.
EZIOE004
This error can occur for multiple reasons. This article describes the various text messages that can be
displayed.
This error can occur for multiple reasons. This article describes the various text messages that can be displayed.
CA Easytrieve® Report Generator 11.6
EZIOE005
The file exit for <file name> either did not link or did not load. Reason: could not locate an entry point for
the exit program. Action: Verify that your library contains the exit program.
The file exit for <file name> either did not link or did not load.
Reason:
CA Easytrieve® Report Generator could not locate an entry point for the exit program.
Action:
Verify that your library contains the exit program.
EZIOE007
SQL DBMS status code is <error code>. Reason: The SQL DBMS detected an error during the
processing of the statement in error. The value of error code is the contents of the SQLCODE field of the
SQL communications area. Action: See the appropriate DBMS guide for the meaning of the error code.
SQL DBMS status code is <error code>.
Reason:
The SQL DBMS detected an error during the processing of the statement in error. The value of error code is the contents of the
SQLCODE field of the SQL communications area.
Action:
See the appropriate DBMS guide for the meaning of the error code.
EZIOE008
ISAM return code is <return code> with error code of <error code>. Reason: The indexed access method
detected an error. Action: See the appropriate access method guide for the meaning of return code and
error code.
CA Easytrieve® Report Generator 11.6
ISAM return code is <return code> with error code of <error code>.
Reason:
The indexed access method detected an error.
Action:
See the appropriate access method guide for the meaning of return code and error code.
EZIOE009
<access method> return code is <return code>. Reason: The access method detected an error. Action:
See the appropriate access method guide for the meaning of return code and error code. When the access
method is RFS the following codes are possible:
<access method> return code is <return code>.
Reason:
The access method detected an error.
Action:
See the appropriate access method guide for the meaning of return code and error code. When the access method is RFS the
following codes are possible:
Code Meaning
0 No error, operation successful
2 OK duplicate indexed key
4 Read. LRECL does not conform to attribute.
5 Open. Optional file is not present.
7 Open/Close. Tape specification error.
10 End of file (46 if past EOF)
14 Read. Relative record number is too large.
21 Index sequence error
22 Duplicate key
23 Non existent record
24 Disk full (if not SEQUENTIAL)
30 Permanent error, no further info
34 Disk full (if SEQUENTIAL)
35 Open Input or I-O on non-present file
37 Open spec. Error on present file
38 Open on locked file
39 Open. Conflicting attributes
41 Open for an opened file
42 Close for not opened file
43 Rewrite/Delete without prior Read
44 Write/Rewrite. LRECL boundary violation
46 Read. Preceding READ or START failed.
47 Read/Start. Not opened in input or I-O mode.
48 Write. File not in OUTPUT or I-O mode.
49 Rewrite/Delete. File not opened in I-O mode.
91 Access denied
92 Open. Environment variable not set.
96 Insufficient storage
CA Easytrieve® Report Generator 11.6
97 Critical error
107 OPEN for NC file (9A)
108 OPEN for JC file (9B)
109 OPEN for JCR file (9C)
110 Dead lock (9D)
115 Invalid operation on logged file (9I)
118 Record or file is locked (9L)
119 Maximum locks exceeded (9L)
124 Roll back forced (9R)
128 Wrong file version (9V)
EZIOE011
The out-of-sequence TABLE ARG is: Reason: The file must be in ARG sequence and cannot contain any
duplicates. Action: Sort the file in ARG sequence.
The out-of-sequence TABLE ARG is:
Reason:
The file must be in ARG sequence and cannot contain any duplicates.
Action:
Sort the file in ARG sequence.
EZKX0001
CA EASYTRIEVE INITIALIZATION FAILED AT XX:XX:XX ON XX/XX/XX. Reason: The
initialization process encountered a major problem that prohibits execution. This message if normally
followed with a EKxx abend code. Seebefore Abend CodeH_2260132after (see page ). Action: Consult
the abend code for assistance in determining the underlying cause of the problem.
CA EASYTRIEVE INITIALIZATION FAILED AT XX:XX:XX ON XX/XX/XX.
Reason:
The initialization process encountered a major problem that prohibits execution. This message if normally followed with a
EKxx abend code. See
EZSRT013
(see page ).
Action:
Consult the abend code for assistance in determining the underlying cause of the problem.
EZKX0004
CA EASYTRIEVE PROGRAM XXXXXXX CANNOT BE LOADED. Reason: An important system
component failed to load. Action: Contact CA Support.
CA Easytrieve® Report Generator 11.6
EZKX0012
HEAP MANAGER DOMAIN INITIALIZATION FAILURE. Reason: The memory heap manager failed
to initialize. Action: Contact CA Support.
HEAP MANAGER DOMAIN INITIALIZATION FAILURE.
Reason:
The memory heap manager failed to initialize.
Action:
Contact CA Support.
EZKX0013
THE CA EASYTRIEVE RESPONSE CODE IS XXXXXXXX. Reason: This message accompanies one
of the other EZKX messages and provides a response code. Action: Contact CA Support.
THE CA EASYTRIEVE RESPONSE CODE IS XXXXXXXX.
Reason:
This message accompanies one of the other EZKX messages and provides a response code.
Action:
Contact CA Support.
EZKX0014
UNABLE TO CONSTRUCT OPTION TABLES. Reason: The Option Module failed to load. Action:
Check that the EZTINI file points to the correct data set.
UNABLE TO CONSTRUCT OPTION TABLES.
Reason:
The CA Easytrieve® Report Generator Option Module failed to load.
Action:
Check that the EZTINI file points to the correct data set.
EZKX0016
OPTIONS TABLE LOADER RESPONSE CODE IS XX(XXXX). Reason: This message accompanies
one of the other EZKX messages and provides a response code. Action: If you cannot determine the cause
of the previous error message, contact CA Support.
OPTIONS TABLE LOADER RESPONSE CODE IS XX(XXXX).
Reason:
This message accompanies one of the other EZKX messages and provides a response code.
Action:
If you cannot determine the cause of the previous error message, contact CA Support.
EZKX0017
CA EASYTRIEVE CA90'S COMPONENT IS MISSING. Reason: A system CA90's component could
not be loaded. Action: Check licensing components. Contact CA Support.
CA EASYTRIEVE CA90'S COMPONENT IS MISSING.
Reason:
LMP licensing for CA Common Services (CCS, formerly known as CA90) is not available.
Action:
Check licensing components. Contact Broadcom Support.
EZKX0060
LOAD FAILURE WAS DUE TO ABEND SXXX-RC. Reason: This message accompanies one of the
other EZKX messages and provides a response code. Action: Contact CA Support.
CA Easytrieve® Report Generator 11.6
EZKX0061
VERSION OF COMPILER GREATER THAN VERSION OF RUNTIME SUPPORT ROUTINES.
Reason: The runtime system is not up to date with the compiler used to compile the program being
executed. Action: Ensure that the runtime system being used is current. It must be at least at the same
version of the compiler module used.
VERSION OF COMPILER GREATER THAN VERSION OF RUNTIME SUPPORT ROUTINES.
Reason:
The CA Easytrieve® Report Generator runtime system is not up to date with the compiler used to compile the program being
executed.
Action:
Ensure that the runtime system being used is current. It must be at least at the same version of the compiler module used.
EZOPT001
The line above contains unrecognizable data. Reason: The previous line contains data that is meaningless
to the program. Action: Review the syntax. Correct the errors, such as spelling or using the wrong
parameters for a keyword. Reissue the command.
The line above contains unrecognizable data.
Reason:
The previous line contains data that is meaningless to the program.
Action:
Review the syntax. Correct the errors, such as spelling or using the wrong parameters for a keyword. Reissue the command.
EZOPT002
Due to the error, the file will not be updated. Reason: The file was not updated due to errors. Action: Use
the other messages to determine the errors and correct them. Reissue the command.
Due to the error, the file will not be updated.
Reason:
The file was not updated due to errors.
Action:
Use the other messages to determine the errors and correct them. Reissue the command.
EZOPT003
The <string> command line option was specified more than once. The successive specifications are
ignored. Reason: The command contains more than one occurrence of the option string. Action: The extra
options were ignored. No action required.
The <string> command line option was specified more than once. The successive specifications are ignored.
Reason:
CA Easytrieve® Report Generator 11.6
The command contains more than one occurrence of the option string.
Action:
The extra options were ignored. No action required.
EZOPT004
The <string> command line option is not defined. Reason: The command contains a string that is not
recognized. Action: Remove or correct the string. Reissue the command.
The <string> command line option is not defined.
Reason:
The command contains a string that is not recognized.
Action:
Remove or correct the string. Reissue the command.
EZOPT005
File failed to open. Reason: The options table file was not opened and you are not attempting to create it.
Action: If you specified a path on the command line, verify that the path is spelled correctly. If you did
not specify a path, a file by the name of EZOPTBL could not be found in your current directory or in the
path specified by the EZTPATH environment variable. If you are attempting to create the file, use the -b
command line option. For more information, see the Installation Guide.
File failed to open.
Reason:
The options table file was not opened and you are not attempting to create it.
Action:
If you specified a path on the command line, verify that the path is spelled correctly. If you did not specify a path, a file by
the name of EZOPTBL could not be found in your current directory or in the path specified by the EZTPATH environment
variable. If you are attempting to create the file, use the -b command line option. For more information, see the CA
Easytrieve® Report Generator Installation Guide.
EZOPT008
SKIP is limited to 255 or PAGESZE, whichever is less. Reason: The value of SKIP is not less than or
equal to the lesser of 255 and PAGESZE. Action: Check your input file for the definition of SKIP and
PAGESZE. Correct the values so the relationship defined in this message is true. Reissue the command.
SKIP is limited to 255 or PAGESZE, whichever is less.
Reason:
The value of SKIP is not less than or equal to the lesser of 255 and PAGESZE.
Action:
Check your input file for the definition of SKIP and PAGESZE. Correct the values so the relationship defined in this message
is true. Reissue the command.
EZOPT009
TITLSKP is limited to 255 or PAGESZE, whichever is less. Reason: The value of TITLSKP is not less
than or equal to the lesser of 255 and PAGESZE. Action: Check your input file for the definition of
TITLSKP and PAGESZE. Correct the values so the relationship defined in this message is true. Reissue
the command.
TITLSKP is limited to 255 or PAGESZE, whichever is less.
Reason:
The value of TITLSKP is not less than or equal to the lesser of 255 and PAGESZE.
Action:
Check your input file for the definition of TITLSKP and PAGESZE. Correct the values so the relationship defined in this
message is true. Reissue the command.
EZOPT010
SPACE cannot exceed LINESIZ 2. Reason: The value of SPACE is greater than the value of LINESIZ
- 2. Action: Check your input file for the definition of SPACE and LINESIZ. Correct the values so the
relationship defined in this message is true. Reissue the command.
CA Easytrieve® Report Generator 11.6
EZOPT011
SCANCOLS must be less than SCANCOLE. Reason: The value of SCANCOLS is not less than
SCANCOLE. Action: Check your input file for the definition of SCANCOLS and SCANCOLE. Correct
the values so the relationship defined in this message is true. Reissue the command.
SCANCOLS must be less than SCANCOLE.
Reason:
The value of SCANCOLS is not less than SCANCOLE.
Action:
Check your input file for the definition of SCANCOLS and SCANCOLE. Correct the values so the relationship defined in this
message is true. Reissue the command.
EZOPT012
Line has extra data. Reason: There is more data after the keyword and its value. Action: Remove the extra
data from the line. Reissue the command.
Line has extra data.
Reason:
There is more data after the keyword and its value.
Action:
Remove the extra data from the line. Reissue the command.
EZOPT013
Value is out of bounds. The lower bound is <nnn>. The upper bound is <nnn>. Reason: The value is not
between its minimum and its maximum values (inclusive). Action: Correct the value in the input and
reissue the command.
Value is out of bounds. The lower bound is <nnn>. The upper bound is <nnn>.
Reason:
The value is not between its minimum and its maximum values (inclusive).
Action:
Correct the value in the input and reissue the command.
EZOPT014
No value found for the keyword. Reason: A value was not found for a keyword. You must type a
keyword and its value on the same line. Action: If you omitted the value, include a value. If the value
appears on another line, move the value to correct line. Reissue the command.
No value found for the keyword.
Reason:
A value was not found for a keyword. You must type a keyword and its value on the same line.
Action:
If you omitted the value, include a value. If the value appears on another line, move the value to correct line. Reissue the
command.
EZOPT015
Value has more than <nnn> characters. Reason: The value has more than the maximum number of
characters allowed for the keyword. Action: Shorten the value to fit within the maximum. Reissue the
command.
Value has more than <nnn> characters.
Reason:
The value has more than the maximum number of characters allowed for the keyword.
CA Easytrieve® Report Generator 11.6
Action:
Shorten the value to fit within the maximum. Reissue the command.
EZOPT016
The value is not a 'Y' or an 'N'. Reason: The possible values for the keyword are Y and N. The value is
not Y or N. Action: Correct the value in the input. Reissue the command.
The value is not a 'Y' or an 'N'.
Reason:
The possible values for the keyword are Y and N. The value is not Y or N.
Action:
Correct the value in the input. Reissue the command.
EZOPT017
The value is not in the list of valid choices. Reason: The value is not in the list of valid choices for the
keyword. Action: Review the documentation for the list of valid choices. Correct the input and reissue the
command.
The value is not in the list of valid choices.
Reason:
The value is not in the list of valid choices for the keyword.
Action:
Review the documentation for the list of valid choices. Correct the input and reissue the command.
EZOPT018
The valid options are <string>, ... Reason: This message appears with EZOPT017 and lists the valid
choices for the keyword. Action: None
The valid options are <string>, ...
Reason:
This message appears with EZOPT017 and lists the valid choices for the keyword.
Action:
None
EZOPT020
The usermask id is not a single character from 'A' to 'Y'. Reason: The usermask identifier must be a single
character between A and Y. Action: Correct the input and reissue the command.
The usermask id is not a single character from 'A' to 'Y'.
Reason:
The usermask identifier must be a single character between A and Y.
Action:
Correct the input and reissue the command.
EZOPT021
The mask is missing. Reason: The mask for a usermask definition is not on the same line as the
definition. Action: If the mask is omitted, include one. If the mask is on a separate line, move the mask to
the correct line.
The mask is missing.
Reason:
The mask for a usermask definition is not on the same line as the definition.
Action:
If the mask is omitted, include one. If the mask is on a separate line, move the mask to the correct line.
EZSHT101
System Termination This message is displayed whenever a serious error occurs that might indicate an
internal problem. If the problem reoccurs after recycling the environment (CICS, CMS, or TSO) have
a copy of this screen and the program causing this message ready when you call CA Support. Reason:
encountered an unrecoverable error when executing your program. This message is normally preceded
by one or more of the messages listed in this section. Action: You should attempt to recycle the operating
environment and retest the program in order to determine if the problem is being caused by .
System Termination
This message is displayed whenever a serious error occurs that might indicate an internal CA Easytrieve® Report Generator
problem. If the problem reoccurs after recycling the environment (CICS, CMS, or TSO) have a copy of this screen and the
program causing this message ready when you call CA Support.
Reason:
CA Easytrieve® Report Generator encountered an unrecoverable error when executing your program. This message is
normally preceded by one or more of the messages listed in this section.
Action:
You should attempt to recycle the operating environment and retest the program in order to determine if the problem is being
caused by CA Easytrieve® Report Generator.
• For the CICS/VS operating environment, your system administrator should restart the CA Easytrieve® Report Generator
runtime system. Recycling can also require restarting the CICS system.
• For the MVS/TSO operating environment, you should log off your TSO session and log back on.
For the CMS/OS operating environment, you should re-IPL your CMS machine.
SQL Messages
This section lists the messages and codes that can display if encounters a problem accessing your
SQL database. You can use them to help correct a program error or to help CA Support in case of a
system problem. The actual message identifier and text issued by can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA
Support. The following codes indicate an unrecoverable error that occurred during an SQL operation.
This section lists the messages and codes that can display if CA Easytrieve® Report Generator encounters a problem accessing
your SQL database. You can use them to help correct a program error or to help CA Support in case of a system problem.
The actual message identifier and text issued by CA Easytrieve® Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
The following codes indicate an unrecoverable error that occurred during an SQL operation.
EZSQL001
An error occurred loading program xxxxxxxx. Reason: The specified SQL interface program could not
be found. Action: Check with your system administrator to make sure that the SQL interface is properly
installed.
An error occurred loading program xxxxxxxx.
Reason:
The specified CA Easytrieve® Report Generator SQL interface program could not be found.
Action:
Check with your CA Easytrieve® Report Generator system administrator to make sure that the SQL interface is properly
installed.
EZSQL002
SQL program xxxxxxxx ended with return code xxxx. Reason: The specified SQL interface program
terminated abnormally with the specified return code. EZSQL003 follows this message. Action: See the
appropriate SQL DBMS guide for the meaning of the error code.
SQL program xxxxxxxx ended with return code xxxx.
Reason:
The specified CA Easytrieve® Report Generator SQL interface program terminated abnormally with the specified return code.
EZSQL003 follows this message.
CA Easytrieve® Report Generator 11.6
Action:
See the appropriate SQL DBMS guide for the meaning of the error code.
EZSQL003
SQL error code xxxx, xxxxxxxx. Reason: The SQL interface terminated with the specified error code.
The brief explanation follows the error code. EZSQL002 precedes this message. Action: If you cannot
detect the cause of the problem from the message, contact CA Support.
SQL error code xxxx, xxxxxxxx.
Reason:
The CA Easytrieve® Report Generator SQL interface terminated with the specified error code. The brief explanation follows
the error code. EZSQL002 precedes this message.
Action:
If you cannot detect the cause of the problem from the message, contact CA Support.
EZSQL004
SQL statement not executed; SQL interface not initialized. Reason: A request to execute an SQL
statement was made when the SQL interface was not initialized. Action: This is an internal error. Contact
CA Support.
SQL statement not executed; SQL interface not initialized.
Reason:
A request to execute an SQL statement was made when the CA Easytrieve® Report Generator SQL interface was not
initialized.
Action:
This is an internal error. Contact CA Support.
EZSQL005
SQL select not executed before xxxxxxxx statement. Reason: The specified FETCH, UPDATE, or
DELETE statement was not preceded by a SELECT or OPEN statement. You closed or released your
file after the SELECT or OPEN was executed and before the specified FETCH, UPDATE, or DELETE.
Action: Either move the CLOSE or RELEASE statement or execute an OPEN or SELECT statement
before the specified statement.
SQL select not executed before xxxxxxxx statement.
Reason:
The specified FETCH, UPDATE, or DELETE statement was not preceded by a SELECT or OPEN statement. You closed or
released your file after the SELECT or OPEN was executed and before the specified FETCH, UPDATE, or DELETE.
Action:
Either move the CLOSE or RELEASE statement or execute an OPEN or SELECT statement before the specified statement.
Sort Messages
This section lists the messages and codes that can display if detects an error sorting records. You can
use them to help correct a program error or to help CA Support in case of a system problem. The actual
message identifier and text issued by can change with new product releases, refreshes, or fixes. If you
cannot determine the cause of the problem from the message, contact CA Support. The following codes
indicate an unrecoverable error that occurred during a sort operation.
This section lists the messages and codes that can display if CA Easytrieve® Report Generator detects an error sorting records.
You can use them to help correct a program error or to help CA Support in case of a system problem.
The actual message identifier and text issued by CA Easytrieve® Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
The following codes indicate an unrecoverable error that occurred during a sort operation.
EZSRT008
The input (E15) for the SORT requested an abort. <reason code>. Reason: A problem was detected while
giving records to the SORT. Action: Review the preceding messages for the cause of the problem.
CA Easytrieve® Report Generator 11.6
The input (E15) for the SORT requested an abort. <reason code>.
Reason:
A problem was detected while giving records to the SORT.
Action:
Review the preceding messages for the cause of the problem.
EZSRT009
The output (E35) for the SORT requested an abort. <reason code> Reason: A problem was detected while
getting ordered records from the SORT. Action: Review the preceding messages for the cause of the
problem.
The output (E35) for the SORT requested an abort. <reason code>
Reason:
A problem was detected while getting ordered records from the SORT.
Action:
Review the preceding messages for the cause of the problem.
EZSRT013
The sort initialization routine requested an abort. <text> Reason: This is an internal error, where text can
be any of the following:
The sort initialization routine requested an abort. <text>
Reason:
This is an internal error, where text can be any of the following:
• Invoked the sort without initializing the sort.
• Invalid processing request.
• Invalid data type for a key.
• Error in #EVAL comparison.
Compiler Messages
This section lists the warning and error messages that can display if the compiler encounters a problem.
You can use them to help correct a program error or to help CA Support in case of a system problem.
This section lists the warning and error messages that can display if the compiler encounters a problem. You can use them to
help correct a program error or to help CA Support in case of a system problem.
The actual message identifier and text issued by CA Easytrieve Report Generator can change with new product releases,
refreshes, or fixes. If you cannot determine the cause of the problem from the message, contact CA Support.
EZTC0744E
File not sequential: detail_text
File not sequential: detail_text
Reason:
CA Easytrieve Report Generator cannot process the file because it is not physically sequential.
detail_text
Describes the specific problem. Valid detail text is:
1. ddname+nnn PDS with no member name
2. ddname+nnn DD DUMMY not allowed
3. ddname+nnn DD is missing
4. ddname+nnn Unacceptable DSORG
5. ddname+nnn Unacceptable RECFM
6. ddname+nnn LRECL exceeds nnnn bytes
7. ddname+nnn Data set is not found on volume
8. ddname+nnn Member name memname not found in library
9. ddname+nnn SWAREQ error for SIOT
10. ddname+nnn SWAREQ error for JFCB
11. ddname+nnn OBTAIN error for DSCB
12. ddname+nnn Dynamic allocation failed
13. ddname+nnn Dynamic unallocation failed
14. ddname+nnn OPEN failed
15. ddname+nnn DESERV GET_ALL failed
16. ddname+nnn Unexpected condition encountered
ddname
Indicates the name of the DD with the problem.
CA Easytrieve® Report Generator 11.6
nnn
Indicates the concatenation sequence number. The number sequence begins at 000.
nnnn
Indicates the number of bytes.
memname
Indicates the member name.
Action:
Perform the action for the corresponding detail text in the previous list.
1. The DD statement has the name of a PDS or PDSE with no member name coded. Correct the data set name or add a
member name for the input and rerun.
2. DD DUMMY is unacceptable in this context. Remove DD DUMMY and rerun.
3. Add the missing DD statement and rerun.
4. The DSORG of this DD cannot be processed sequentially. Correct the DSORG and rerun.
5. The RECFM of this data set cannot be processed sequentially. Correct the RECFM and rerun.
6. The LRECL exceeds the maximum for this processing context. Correct the LRECL and rerun.
7. The data set does not exist. Either it is cataloged to this volume, or UNIT and VOL=SER= was coded and the data set does
not exist. Correct the problem and rerun.
8. The DD specifies a PDS or PDSE with a member name coded but that member does not exist. Correct the DD and rerun.
Note:
For detail text numbers 9 through 16, gather all related output and contact CA Support for assistance.
EBSN
Code Category: Runtime Error Check Reason: Insufficient storage in region to satisfy request.
Code Category:
Runtime Error Check
Reason:
Insufficient storage in region to satisfy request.
EDLI
Code Category: IMS/DLI Interface Reason: Unrecoverable error during IMS/DLI processing.
Code Category:
IMS/DLI Interface
Reason:
Unrecoverable error during IMS/DLI processing.
EDSO
Code Category: Dynamic Loader Reason: Dynamic load table overflowed.
Code Category:
Dynamic Loader
Reason:
Dynamic load table overflowed.
EDSO0
Code Category: Dynamic Segment Manager Reason: Internal procedure stack overflow.
Code Category:
Dynamic Segment Manager
Reason:
Internal procedure stack overflow.
EDSS
Code Category: Dynamic Segment Manager Reason: Segment not defined.
Code Category:
Dynamic Segment Manager
Reason:
Segment not defined.
EDST
Code Category: Dynamic Segment Manager Reason: Invalid Segment.
Code Category:
Dynamic Segment Manager
Reason:
Invalid Segment.
CA Easytrieve® Report Generator 11.6
EDSX
Code Category: Dynamic Segment Manager Reason: Unable to expand segment table.
Code Category:
Dynamic Segment Manager
Reason:
Unable to expand segment table.
EBSL
Code Category: Heap Manager Reason: GETMAIN length error.
Code Category:
Heap Manager
Reason:
GETMAIN length error.
EFLD
Code Category: Heap Manager Reason: Field check error.
Code Category:
Heap Manager
Reason:
Field check error.
EFML
Code Category: Heap Manager Reason: Invalid MOVE length.
Code Category:
Heap Manager
Reason:
Invalid MOVE length.
EFNF
Code Category: Heap Manager Reason: Null check failure.
Code Category:
Heap Manager
Reason:
Null check failure.
EFVL
Code Category: Heap Manager Reason: Invalid VARCHAR length.
Code Category:
Heap Manager
Reason:
Invalid VARCHAR length.
EHMD
Code Category: Heap Manager Reason: Invalid domain ID (usually means that a Heap Tag is invalid).
CA Easytrieve® Report Generator 11.6
Code Category:
Heap Manager
Reason:
Invalid domain ID (usually means that a Heap Tag is invalid).
EHMF
Code Category: Heap Manager Reason: Invalid freemain request.
Code Category:
Heap Manager
Reason:
Invalid freemain request.
EHMH
Code Category: Heap Manager Reason: Invalid heap tag.
Code Category:
Heap Manager
Reason:
Invalid heap tag.
EHMI
Code Category: Heap Manager Reason: Invalid storage control request.
Code Category:
Heap Manager
Reason:
Invalid storage control request.
EHML
Code Category: Heap Manager Reason: Length error.
Code Category:
Heap Manager
Reason:
Length error.
EHMN
Code Category: Heap Manager Reason: No storage available.
Code Category:
Heap Manager
Reason:
No storage available.
EHMO
Code Category: Heap Manager Reason: Internal procedure stack overflow.
Code Category:
Heap Manager
Reason:
Internal procedure stack overflow.
EHMQ
Code Category: Heap Manager Reason: Invalid FAD chain.
Code Category:
Heap Manager
Reason:
Invalid FAD chain.
CA Easytrieve® Report Generator 11.6
EHMR
Code Category: Heap Manager Reason: Error reading temporary storage record.
Code Category:
Heap Manager
Reason:
Error reading temporary storage record.
EHMV
Code Category: Heap Manager Reason: Storage overrun detected.
Code Category:
Heap Manager
Reason:
Storage overrun detected.
EHMW
Code Category: Heap Manager Reason: Error writing temporary storage record.
Code Category:
Heap Manager
Reason:
Error writing temporary storage record.
EHMX
Code Category: Heap Manager Reason: Error resolving relocatable pointer.
Code Category:
Heap Manager
Reason:
Error resolving relocatable pointer.
EIO1
Code Category: Input/Output Statement Handler Reason: An input/output statement referenced a file that
had not been activated.
Code Category:
Input/Output Statement Handler
Reason:
An input/output statement referenced a file that had not been activated.
EIO2
Code Category: Input/Output Statement Handler Reason: Load for access method interface routine failed.
Code Category:
Input/Output Statement Handler
Reason:
Load for access method interface routine failed.
CA Easytrieve® Report Generator 11.6
EIO3
Code Category: Input/Output Statement Handler Reason: Insufficient main storage.
Code Category:
Input/Output Statement Handler
Reason:
Insufficient main storage.
EIO4
Code Category: Input/Output Statement Handler Reason: Attempt to deactivate a file not on the active
file list for current activity.
Code Category:
Input/Output Statement Handler
Reason:
Attempt to deactivate a file not on the active file list for current activity.
EIO5
Code Category: Input/Output Statement Handler Reason: File referenced in an illegal statement.
Code Category:
Input/Output Statement Handler
Reason:
File referenced in an illegal statement.
EIO6
Code Category: Input/Output Statement Handler Reason: Invalid file manager call issued. Feature not
supported or not implemented.
Code Category:
Input/Output Statement Handler
Reason:
Invalid file manager call issued. Feature not supported or not implemented.
EIO9
Code Category: Input/Output Statement Handler Reason: Presentation manager error while browsing a
printer file.
Code Category:
Input/Output Statement Handler
Reason:
Presentation manager error while browsing a printer file.
EIOA
Code Category: Input/Output Statement Handler Reason: File control validity check failed.
Code Category:
Input/Output Statement Handler
Reason:
File control validity check failed.
EIDA
Code Category: Input/Output Statement Handler Reason: IDMS could not be found.
Code Category:
Input/Output Statement Handler
Reason:
IDMS could not be found.
CA Easytrieve® Report Generator 11.6
EIOX
Code Category: Input/Output Statement Handler Reason: Unexpected response received for a CICS/VS
command.
Code Category:
Input/Output Statement Handler
Reason:
Unexpected response received for a CICS/VS command.
EJSC
Code Category: System Spool Printer Interface Module Reason: Spool file close error.
Code Category:
System Spool Printer Interface Module
Reason:
Spool file close error.
EJSW
Code Category: System Spool Printer Interface Module Reason: Spool file write error.
Code Category:
System Spool Printer Interface Module
Reason:
Spool file write error.
EKX1
Code Category: Task Execution Control Program Reason: termination in progress.
Code Category:
Task Execution Control Program
Reason:
CA Easytrieve® Report Generator termination in progress.
EKX2
Code Category: Task Execution Control Program Reason: ETKXCON unable to load runtime system
modules.
Code Category:
Task Execution Control Program
Reason:
ETKXCON unable to load runtime system modules.
EKX5
Code Category: Task Execution Control Program Reason: Error reading/writing PLA to auxiliary storage.
Code Category:
Task Execution Control Program
Reason:
Error reading/writing PLA to auxiliary storage.
EKS6
Code Category: Task Execution Control Program Reason: Resume program version validation error.
(Resume program is not the same as the program that quiesced.)
Code Category:
Task Execution Control Program
Reason:
Resume program version validation error. (Resume program is not the same as the program that quiesced.)
EKX7
Code Category: Task Execution Control Program Reason: Quiesce requested by linked to program.
Code Category:
Task Execution Control Program
Reason:
Quiesce requested by linked to program.
EKX8
Code Category Task Execution Control Program Reason: Internal stack overflow.
Code Category
Task Execution Control Program
Reason:
Internal stack overflow.
EKX9
Code Category: Task Execution Control Program Reason: Version mismatch between compiler and
runtime system.
Code Category:
Task Execution Control Program
Reason:
Version mismatch between compiler and runtime system.
CA Easytrieve® Report Generator 11.6
EKXB
Code Category: Task Execution Control Program Reason: Unable to load runtime anchor module (TSO
only).
Code Category:
Task Execution Control Program
Reason:
Unable to load runtime anchor module (TSO only).
EKXC
Code Category: Task Execution Control Program Reason: Error reading options from the EZOPTBL data
set (TSO/CMS only).
Code Category:
Task Execution Control Program
Reason:
Error reading options from the EZOPTBL data set (TSO/CMS only).
EKXE
Code Category: Task Execution Control Program Reason: Error initializing the heap global domain
(TSO/CMS only).
Code Category:
Task Execution Control Program
Reason:
Error initializing the heap global domain (TSO/CMS only).
EKXF
Code Category: Task Execution Control Program Reason: A CA90 component is missing (CICS/TSO).
Code Category:
Task Execution Control Program
Reason:
A CA90 component is missing (CICS/TSO).
EKXG
Code Category: Task Execution Control Program Reason: Runtime not authorized to run in Batch
(nonTSO) mode.
Code Category:
Task Execution Control Program
Reason:
Runtime not authorized to run in Batch (nonTSO) mode.
EKXH
Code Category: Task Execution Control Program Reason: Error writing PLA to auxiliary storage (CICS
only).
Code Category:
Task Execution Control Program
Reason:
Error writing PLA to auxiliary storage (CICS only).
Reason:
Indicates an error initializing heap local domain.
EKX4
Code Category: Task Management Program Reason: Indicates an error terminating heap local domain.
Code Category:
Task Management Program
Reason:
Indicates an error terminating heap local domain.
EKX80
Code Category: Task Management Program Reason: Indicates internal register stack overflow.
Code Category:
Task Management Program
Reason:
Indicates internal register stack overflow.
EKXA
Code Category: Task Management Program Reason: Indicates that previous abend occurred.
Code Category:
Task Management Program
Reason:
Indicates that previous abend occurred.
EKXD
Code Category: Task Management Program Reason: Indicates that abend complete was called with a
diagnostic work area.
Code Category:
Task Management Program
Reason:
Indicates that abend complete was called with a diagnostic work area.
EKXI
Code Category: Task Management Program Reason: Indicates an invalid request.
Code Category:
Task Management Program
Reason:
Indicates an invalid request.
EKXO
Code Category: Task Management Program Reason: Indicates an invalid option update order.
Code Category:
Task Management Program
Reason:
Indicates an invalid option update order.
EKXS
Code Category: Task Management Program Reason: Indicates that the (E)STAE exit is taking a SNAP
dump.
Code Category:
Task Management Program
Reason:
Indicates that the (E)STAE exit is taking a SNAP dump.
CA Easytrieve® Report Generator 11.6
EPR1
Code Category: Printer File Manager Reason: Invalid printer file handle passed to CLOSE or WRITE
function.
Code Category:
Printer File Manager
Reason:
Invalid printer file handle passed to CLOSE or WRITE function.
EPR2
Code Category: Printer File Manager Reason: Error opening the printer file.
Code Category:
Printer File Manager
Reason:
Error opening the printer file.
EPR3
Code Category: Printer File Manager Reason: Error closing the printer file.
Code Category:
Printer File Manager
Reason:
Error closing the printer file.
EPR4
Code Category: Printer File Manager Reason: Error writing the printer file.
Code Category:
Printer File Manager
Reason:
Error writing the printer file.
EPR5
Code Category: Printer File Manager Reason: Cannot find printer definition.
Code Category:
Printer File Manager
Reason:
CA Easytrieve® Report Generator 11.6
EPR6
Code Category: Printer File Manager Reason: Error opening the system message file.
Code Category:
Printer File Manager
Reason:
Error opening the system message file.
EPR9
Code Category: Printer File Manager Reason: Insufficient storage
Code Category:
Printer File Manager
Reason:
Insufficient storage
Reporting Codes
ERP1
Code Category: Reporting Reason: Insufficient storage for report work area.
Code Category:
Reporting
Reason:
Insufficient storage for report work area.
ERP2
Code Category: Reporting Reason: Insufficient storage for summary work area.
Code Category:
Reporting
Reason:
Insufficient storage for summary work area.
ERS1
Code Category: Runtime Initialization Stub Reason: Transfer of control failure.
Code Category:
Runtime Initialization Stub
Reason:
Transfer of control failure.
ESIB
Code Category: Sort Interface Reason: Nonzero return code from Sort.
Code Category:
Sort Interface
Reason:
Nonzero return code from Sort.
ESQ2
Code Category: SQL Interface Reason: Cannot process SQL files. One of the following conditions was
detected:
Code Category:
SQL Interface
Reason:
Cannot process SQL files. One of the following conditions was detected:
• The SQL data block address in the initialization parameter was zero.
• The cursor descriptor block is missing.
ESQX
Code Category: SQL Interface Reason: Critical error detected during execution of an SQL request.
Condition code of 16 or more returned from CA Pan/SQL.
Code Category:
SQL Interface
Reason:
Critical error detected during execution of an SQL request. Condition code of 16 or more returned from CA Pan/SQL.
ESQY
Code Category: SQL Interface Reason: An SQL request was made and the SQL interface was not
initialized.
Code Category:
SQL Interface
Reason:
An SQL request was made and the SQL interface was not initialized.
EZIO
Code Category: SQL Interface Reason: Nonzero return code from SQL on automatic processing.
Code Category:
SQL Interface
Reason:
Nonzero return code from SQL on automatic processing.
ETID
Code Category: Terminal Printer Despooler Program Reason: Unsupported printer device.
Code Category:
Terminal Printer Despooler Program
Reason:
Unsupported printer device.
ETIO
Code Category: Terminal Printer Despooler Program Reason: Internal stack overflow.
Code Category:
Terminal Printer Despooler Program
Reason:
Internal stack overflow.
ETIS
Code Category Terminal Printer Despooler Program Reason: Invalid spooled report encountered.
Code Category
Terminal Printer Despooler Program
Reason:
Invalid spooled report encountered.
ETIX
Code Category: Terminal Printer Despooler Program Reason: Task initialization or termination error.
Code Category:
Terminal Printer Despooler Program
Reason:
Task initialization or termination error.
EVF1
Code Category: Virtual File Manager Reason: Insufficient main storage.
Code Category:
Virtual File Manager
Reason:
CA Easytrieve® Report Generator 11.6
EVF2
Code Category: Virtual File Manager Reason: The maximum number of VFM data sets allowed for a
single program was exceeded.
Code Category:
Virtual File Manager
Reason:
The maximum number of VFM data sets allowed for a single program was exceeded.
EVF3
Code Category: Virtual File Manager Reason: Virtual file not found, that is, a runtime component
attempted to perform an input/output operation on a system virtual data set that had not been previously
opened.
Code Category:
Virtual File Manager
Reason:
Virtual file not found, that is, a runtime component attempted to perform an input/output operation on a system virtual data set
that had not been previously opened.
EVF4
Code Category: Virtual File Manager Reason: Invalid file handle.
Code Category:
Virtual File Manager
Reason:
Invalid file handle.
EVF5
Code Category: Virtual File Manager Reason: For an input file, the record read from the virtual file was
longer than the caller's input area. For an output file, the record to be written to the virtual file was longer
than the maximum logical record length of the file.
Code Category:
Virtual File Manager
Reason:
For an input file, the record read from the virtual file was longer than the caller's input area. For an output file, the record to be
written to the virtual file was longer than the maximum logical record length of the file.
EVF6
Code Category: Virtual File Manager Reason: An unrecoverable input/output error occurred on the VFM
data set.
Code Category:
Virtual File Manager
Reason:
An unrecoverable input/output error occurred on the VFM data set.
EVF7
Code Category: Virtual File Manager Reason: Insufficient space in the VFM data set to contain the file.
Code Category:
Virtual File Manager
Reason:
Insufficient space in the VFM data set to contain the file.
CA Easytrieve® Report Generator 11.6
EVF8
Code Category: Virtual File Manager Reason: Invalid request returned by the input/output system. This is
a general failure category.
Code Category:
Virtual File Manager
Reason:
Invalid request returned by the input/output system. This is a general failure category.
EVF9
Code Category: Virtual File Manager Reason: Leading and trailing record lengths are not equal.
EVFAError opening the VFM data set.
Code Category:
Virtual File Manager
Reason:
Leading and trailing record lengths are not equal. EVFAError opening the VFM data set.
EVFA
Code Category: Virtual File Manager Reason: Error opening the VFM data set.
Code Category:
Virtual File Manager
Reason:
Error opening the VFM data set.
EVFB
Code Category: Virtual File Manager Reason: Out of buffers. Either DEVICE MEMORY was specified
or one or more VFM files specified MEMORY. There is not enough memory to hold all the data that
must be held in memory. Add an EZTVFM DD statement or DLBL to the JCL.
Code Category:
Virtual File Manager
Reason:
Out of buffers. Either DEVICE MEMORY was specified or one or more VFM files specified MEMORY. There is not enough
memory to hold all the data that must be held in memory. Add an EZTVFM DD statement or DLBL to the JCL.
EVFC
Code Category: Virtual File Manager Reason: Cannot find block. A READBUFFER request was issued
for a MEMORY resident VFM file but the buffer manager could not find the requested block in the buffer
pool.
Code Category:
Virtual File Manager
Reason:
Cannot find block. A READBUFFER request was issued for a MEMORY resident VFM file but the buffer manager could not
find the requested block in the buffer pool.
EVFD
Code Category: Virtual File Manager Reason: Invalid bitmap block read from disk.
Code Category:
Virtual File Manager
Reason:
Invalid bitmap block read from disk.
EVFE
Code Category: Virtual File Manager Reason: Error reading from or writing to the VFM data set.
Code Category:
Virtual File Manager
CA Easytrieve® Report Generator 11.6
Reason:
Error reading from or writing to the VFM data set.
EVFF
Code Category: Virtual File Manager Reason: Too much pending work queued.
Code Category:
Virtual File Manager
Reason:
Too much pending work queued.
EVFG
Code Category: Virtual File Manager Reason: Invalid level number on a read block request.
Code Category:
Virtual File Manager
Reason:
Invalid level number on a read block request.
EVFH
Code Category: Virtual File Manager Reason: Attempt to read a data block that does not exist.
Code Category:
Virtual File Manager
Reason:
Attempt to read a data block that does not exist.
EVFI
Code Category: Virtual File Manager Reason: Load for VFM data set handler failed.
Code Category:
Virtual File Manager
Reason:
Load for VFM data set handler failed.
10 CA EZ/Key
Environment for developing and maintaining CA Easytrieve Plus programs.
CA EZ/Key™ is an interactive, menu oriented, full-screen environment that you can use to develop and maintain CA
Easytrieve Plus programs. These programs can range from simple, straightforward reports to complex updates of files and
data bases. CA EZ/Key provides continuous information about your current actions and makes assumptions about details that
you have not specified. A complete syntax and semantic check is performed as each part of the program is being entered or
modified.
Click the following links to download the CA EZ/Key documentation:
• Administrator's Guide
• Installation Guide
• Reference Manual
• Sample Session
Documentation is available for the following products and releases in PDF format unless otherwise noted.
CA Easytrieve® Report English 6.4, 11 SP4, 11.5 The bookshelves for 11 SP4
Generator and 11.5 include HTML and
PDF files.
Release 6.4 is for CA
Easytrieve® Plus.
BookManager files are also
available for Release 6.4
guides.
12 Additional Resources
Product support, user communities, education, and social media.
Product Support
The following resources provide more information about CA Easytrieve Report Generator:
• CA Easytrieve Report Generator Product Information (Knowledge Base Articles and Solutions)
• Service Pack Information Index (Maintenance Grid)
• z/OS Compatibility Matrix
• Mainframe Product Information (All Products)
• Broadcom Support
User Communities and Support
Consult your peers, reach out to subject matter experts, and read the latest technical insights and information in our global
communities:
• CA Easytrieve Community
• CA Mainframe Community
Education and Training
The following educational resources are available:
• Broadcom Education Learning Management System Video
• Broadcom Mainframe Training
• Broadcom Education YouTube Channel
Social Media
Follow us on social media:
• Facebook
• LinkedIn
• Twitter
CA Easytrieve® Report Generator 11.6
13 Product Names
Product names referenced in the documentation.
This documentation references the following products:
• CA Easytrieve® Report Generator for Linux PC
• CA Easytrieve® Report Generator for Linux zSeries
• CA Easytrieve® Report Generator for UNIX
• CA Easytrieve® Report Generator for Windows
• CA Easytrieve® Report Generator for z/OS
• CA Easytrieve® Report Generator CA Datacom® Option
• CA Easytrieve® Report Generator CA Datacom® Option for SQL
• CA Easytrieve® Report Generator CA Datacom® Option for SQL and NON SQL
• CA Easytrieve® Report Generator CA IDMS™ Option for SQL
• CA Easytrieve® Report Generator CA IDMS™ Option for SQL and NON SQL
• CA Easytrieve® Online Query Report Generator for CICS
• CA Easytrieve® Online Query Report Generator for CICS/SP DB2
• CA Easytrieve® Online Query Report Generator for CICS/XA
• CA Easytrieve® Online Query Report Generator for TSO
• CA Easytrieve® Online Query Report Generator for TSO/XA DB2
• CA Easytrieve® Online Report Generator for z/OS
• Assistive Technology screen readers and screen magnifiers are supported. The batch products are text-based and use input
and output files that are viewed through text editors. However, some output can include visually formatted, tabular data that
require the user to examine the textual screen content to interpret responses.
• The products can be used in a mouseless (keyboard-only) mode. The products also inherit operating system motor control
accessibility features.
Documentation and Support
• Documentation can be viewed online, or downloaded in PDF and EPUB files.
• Support is available online, by email, and by phone.