CA Easytrieve Report Generator 11 6
CA Easytrieve Report Generator 11 6
6
CA Easytrieve® Report Generator 11.6
Table of Contents
Announcements and News............................................................................................................... 21
Release Notes.....................................................................................................................................22
New Features.................................................................................................................................................................. 22
New Features Since Release 6.4.................................................................................................................................. 24
Differences Between Releases..................................................................................................................................... 30
Release Comparison...................................................................................................................................................... 45
Migration Guidelines...................................................................................................................................................... 46
CA SMP/E Internet Service Retrieval........................................................................................................................... 47
Portfolio Simplification.................................................................................................................................................. 48
Simplified Design System............................................................................................................................................. 50
Documentation Changes............................................................................................................................................... 50
Installing.............................................................................................................................................. 52
Installation Best Practices............................................................................................................................................ 52
Install CA Easytrieve for Windows.............................................................................................................................. 53
Install CA Easytrieve for UNIX and Linux for zSeries................................................................................................54
Install CA Easytrieve for Linux PC.............................................................................................................................. 57
Install CA Easytrieve for z/OS...................................................................................................................................... 62
How the Installation Process Works......................................................................................................................... 64
Preparing for Installation........................................................................................................................................... 65
Install Your Product Using CA CSM.........................................................................................................................66
Acquire Products Using CA CSM......................................................................................................................67
Install Products Using CA CSM........................................................................................................................ 72
Maintain Products Using CA CSM.................................................................................................................... 87
Configure Your Product Using CA CSM..........................................................................................................102
Installing Your Product Using Pax ESD or DVD.................................................................................................... 110
Allocate and Mount a File System.................................................................................................................. 112
Acquire the Product Pax Files.........................................................................................................................113
Create a Product Directory from the Pax File.................................................................................................117
Copy Installation Files to zOS Data Sets........................................................................................................118
Prepare the SMPE Environment for a Pax Installation................................................................................... 119
Run the Installation Jobs for a Pax Installation...............................................................................................120
Clean Up the USS Directory........................................................................................................................... 121
Apply Preventive Maintenance........................................................................................................................ 121
SAMPJCL and CBAAJCL Contents........................................................................................................................125
Upgrade CA Easytrieve for z/OS................................................................................................................................ 128
Install CA Easytrieve Packaged with CCS................................................................................................................ 129
2
CA Easytrieve® Report Generator 11.6
3
CA Easytrieve® Report Generator 11.6
Lesson 4 - Activity Section, REPORT Statement and Report Definition Statements............................................. 197
Library Section - Describe and Define Data............................................................................................................. 203
Describe Files and Fields....................................................................................................................................... 206
Activity Section - Processing and Logic................................................................................................................... 217
JOB Activities.......................................................................................................................................................... 217
SORT Activities....................................................................................................................................................... 233
PROGRAM Activities...............................................................................................................................................235
Activity Section - Input and Output........................................................................................................................... 236
Activity Section - Reporting........................................................................................................................................246
Processing of Reports.............................................................................................................................................250
Label Report............................................................................................................................................................257
Testing Aid Parameters...........................................................................................................................................259
Format Determination Parameters..........................................................................................................................260
Multiple Reports...................................................................................................................................................... 262
Report Procedures (PROCs).................................................................................................................................. 264
System-Defined Fields................................................................................................................................................. 274
General Purpose Fields.......................................................................................................................................... 274
File Processing Fields.............................................................................................................................................275
Report Processing Fields........................................................................................................................................277
Using.................................................................................................................................................. 279
Using Best Practices................................................................................................................................................... 279
Create and Format a Report....................................................................................................................................... 281
Compile and Link Your Program................................................................................................................................ 286
Controlling Compilation........................................................................................................................................... 286
Results of the Compilation......................................................................................................................................288
Program Compilation and Link-Editing Using JCL................................................................................................. 291
Submitting Your Program for Non-Mainframe Compilation.................................................................................... 301
Link-Editing Non-Mainframe Programs................................................................................................................... 305
Execute a Program.......................................................................................................................................................310
Execute a Program in UNIX and Linux for zSeries................................................................................................310
Execute a Program in Windows............................................................................................................................. 311
Execute a Program in z/OS....................................................................................................................................311
File Description String (Non-Mainframe Only)........................................................................................................312
Execute a Windows Indexed File Program............................................................................................................ 313
Execute a Btrieve Program.....................................................................................................................................315
Execute a C-ISAM Program................................................................................................................................... 316
Report Display Facility (z/OS Only)........................................................................................................................ 317
Error Analysis Report..............................................................................................................................................322
Execute a Program on a Web Server.................................................................................................................... 323
Alternate Collating Sequence Table........................................................................................................................... 329
4
CA Easytrieve® Report Generator 11.6
5
CA Easytrieve® Report Generator 11.6
6
CA Easytrieve® Report Generator 11.6
7
CA Easytrieve® Report Generator 11.6
8
CA Easytrieve® Report Generator 11.6
%SINON.................................................................................................................................................................. 767
%VERNUMP............................................................................................................................................................767
%WRITM................................................................................................................................................................. 768
%WRITV.................................................................................................................................................................. 768
Example - Retrieve Records Using a Tickler File.................................................................................................. 769
Language Reference........................................................................................................................ 772
Character Sets.............................................................................................................................................................. 772
Statements.....................................................................................................................................................................774
Statement Overview................................................................................................................................................ 782
% (Macro Invocation) Statement............................................................................................................................ 786
* (Comment) Statement.......................................................................................................................................... 787
ACCESS Statement................................................................................................................................................ 787
AFTER-BREAK Report Procedure..........................................................................................................................787
AFTER-LINE Report Procedure..............................................................................................................................789
AFTER-SCREEN Screen Procedure...................................................................................................................... 791
Assignment Statement............................................................................................................................................ 792
ATTR Parameter..................................................................................................................................................... 796
BEFORE-BREAK Report Procedure.......................................................................................................................798
BEFORE-LINE Report Procedure...........................................................................................................................800
BEFORE-SCREEN Screen Procedure................................................................................................................... 800
CALL Statement...................................................................................................................................................... 801
CASE and END-CASE Statements........................................................................................................................ 802
CLOSE Statement...................................................................................................................................................804
COMMIT Statement................................................................................................................................................ 805
Conditional Expressions..........................................................................................................................................805
Field Bits Condition..........................................................................................................................................806
Field Class Condition.......................................................................................................................................807
Field Relational Condition................................................................................................................................809
Field Series Condition......................................................................................................................................812
File Presence Condition...................................................................................................................................813
File Relational Condition..................................................................................................................................815
Record Relational Condition............................................................................................................................ 816
CONTROL Statement............................................................................................................................................. 817
COPY Statement.....................................................................................................................................................818
CURSOR Statement............................................................................................................................................... 819
DECLARE Statement.............................................................................................................................................. 820
DEFAULT Statement............................................................................................................................................... 822
DEFINE Statement..................................................................................................................................................823
DELETE Statement................................................................................................................................................. 831
DISPLAY Statement................................................................................................................................................ 832
9
CA Easytrieve® Report Generator 11.6
10
CA Easytrieve® Report Generator 11.6
11
CA Easytrieve® Report Generator 11.6
12
CA Easytrieve® Report Generator 11.6
B003................................................................................................................................................................. 974
B004................................................................................................................................................................. 974
B005................................................................................................................................................................. 974
B007................................................................................................................................................................. 975
B008................................................................................................................................................................. 975
B009................................................................................................................................................................. 975
B010................................................................................................................................................................. 975
B011................................................................................................................................................................. 975
B012................................................................................................................................................................. 976
B014................................................................................................................................................................. 976
Program Abend Messages (EZABX).......................................................................................................................... 976
EZABX000............................................................................................................................................................... 976
EZABX008............................................................................................................................................................... 977
EZABX009............................................................................................................................................................... 977
EZABX010............................................................................................................................................................... 977
EZABX016............................................................................................................................................................... 977
EZABX020............................................................................................................................................................... 977
EZABX024............................................................................................................................................................... 978
EZABX046............................................................................................................................................................... 978
EZABX047............................................................................................................................................................... 978
EZABX048............................................................................................................................................................... 979
EZABX049............................................................................................................................................................... 979
EZABX050............................................................................................................................................................... 979
EZABX051............................................................................................................................................................... 979
EZABX053............................................................................................................................................................... 979
EZABX054............................................................................................................................................................... 979
EZABX055............................................................................................................................................................... 980
EZABX056............................................................................................................................................................... 980
EZABX057............................................................................................................................................................... 980
EZABX058............................................................................................................................................................... 980
EZABX059............................................................................................................................................................... 980
EZABX060............................................................................................................................................................... 980
EZABX061............................................................................................................................................................... 981
EZABX062............................................................................................................................................................... 981
Linking, Transferring and Calling Messages............................................................................................................ 981
EZACT001............................................................................................................................................................... 981
EZACT002............................................................................................................................................................... 981
EZACT005............................................................................................................................................................... 982
Utility Messages........................................................................................................................................................... 982
EZALT001................................................................................................................................................................ 982
13
CA Easytrieve® Report Generator 11.6
EZALT002................................................................................................................................................................ 982
EZALT003................................................................................................................................................................ 982
EZALT004................................................................................................................................................................ 982
EZALT005................................................................................................................................................................ 983
EZALT006................................................................................................................................................................ 983
EZALT007................................................................................................................................................................ 983
EZALT008................................................................................................................................................................ 983
EZALT009................................................................................................................................................................ 983
EZALT010................................................................................................................................................................ 984
EZALT011................................................................................................................................................................ 984
EZALT012................................................................................................................................................................ 984
EZALT013................................................................................................................................................................ 984
EZALT014................................................................................................................................................................ 984
Configuration Manager Messages..............................................................................................................................985
EZCM001.................................................................................................................................................................985
EZCM002.................................................................................................................................................................985
EZCM003.................................................................................................................................................................985
EZCM004.................................................................................................................................................................985
EZCM005.................................................................................................................................................................985
EZCM006.................................................................................................................................................................986
EZCM007.................................................................................................................................................................986
EZCM008.................................................................................................................................................................986
EZCM009.................................................................................................................................................................986
EZCM010.................................................................................................................................................................986
EZCM011................................................................................................................................................................. 986
EZCM012.................................................................................................................................................................986
EZCM013.................................................................................................................................................................987
EZCM014.................................................................................................................................................................987
EZCM015.................................................................................................................................................................987
EZCM016.................................................................................................................................................................987
EZCM017.................................................................................................................................................................987
EZCM018.................................................................................................................................................................987
EZCM019.................................................................................................................................................................988
EZCM020.................................................................................................................................................................988
EZCM021.................................................................................................................................................................988
EZCM022.................................................................................................................................................................988
EZCM023.................................................................................................................................................................988
EZCM024.................................................................................................................................................................988
IMS_DLI Messages....................................................................................................................................................... 988
EZDLI001.................................................................................................................................................................989
14
CA Easytrieve® Report Generator 11.6
EZDLI002.................................................................................................................................................................989
EZDLI003.................................................................................................................................................................989
Program Abend Messages (EZEIP)............................................................................................................................ 989
EZEIP001................................................................................................................................................................ 989
EZEIP003................................................................................................................................................................ 990
EZEIP004................................................................................................................................................................ 990
EZEIP005................................................................................................................................................................ 990
EZEIP006................................................................................................................................................................ 990
EZEIP007................................................................................................................................................................ 990
EZEIP011.................................................................................................................................................................991
EZEIP015................................................................................................................................................................ 991
EZEIP017................................................................................................................................................................ 991
EZEIP018................................................................................................................................................................ 991
EZEIP019................................................................................................................................................................ 991
EZEIP021................................................................................................................................................................ 992
EZEIP022................................................................................................................................................................ 992
EZEIP023................................................................................................................................................................ 992
EZEIP024................................................................................................................................................................ 992
EZEIP025................................................................................................................................................................ 993
EZEIP028................................................................................................................................................................ 993
EZEIP992................................................................................................................................................................ 993
EZEIP997................................................................................................................................................................ 993
IDMS Messages............................................................................................................................................................ 993
EZIDM001................................................................................................................................................................993
EZIDM002................................................................................................................................................................994
EZIDM003................................................................................................................................................................994
File I_O Messages........................................................................................................................................................ 994
EZIOE001................................................................................................................................................................ 994
EZIOE002................................................................................................................................................................ 994
EZIOE003................................................................................................................................................................ 996
EZIOE004................................................................................................................................................................ 997
EZIOE005................................................................................................................................................................ 998
EZIOE007................................................................................................................................................................ 998
EZIOE008................................................................................................................................................................ 998
EZIOE009................................................................................................................................................................ 999
EZIOE011.............................................................................................................................................................. 1000
System Initialization Messages................................................................................................................................ 1000
EZKX0001............................................................................................................................................................. 1000
EZKX0004............................................................................................................................................................. 1000
EZKX0012............................................................................................................................................................. 1000
15
CA Easytrieve® Report Generator 11.6
EZKX0013............................................................................................................................................................. 1001
EZKX0014............................................................................................................................................................. 1001
EZKX0016............................................................................................................................................................. 1001
EZKX0017............................................................................................................................................................. 1001
EZKX0060............................................................................................................................................................. 1001
EZKX0061............................................................................................................................................................. 1001
ETOPLOAD Utility Messages.................................................................................................................................... 1002
EZOPT001.............................................................................................................................................................1002
EZOPT002.............................................................................................................................................................1002
EZOPT003.............................................................................................................................................................1002
EZOPT004.............................................................................................................................................................1002
EZOPT005.............................................................................................................................................................1002
EZOPT008.............................................................................................................................................................1003
EZOPT009.............................................................................................................................................................1003
EZOPT010.............................................................................................................................................................1003
EZOPT011............................................................................................................................................................. 1003
EZOPT012.............................................................................................................................................................1003
EZOPT013.............................................................................................................................................................1003
EZOPT014.............................................................................................................................................................1004
EZOPT015.............................................................................................................................................................1004
EZOPT016.............................................................................................................................................................1004
EZOPT017.............................................................................................................................................................1004
EZOPT018.............................................................................................................................................................1004
EZOPT020.............................................................................................................................................................1004
EZOPT021.............................................................................................................................................................1004
System Termination Message................................................................................................................................... 1005
EZSHT101............................................................................................................................................................. 1005
SQL Messages............................................................................................................................................................ 1005
EZSQL001............................................................................................................................................................. 1005
EZSQL002............................................................................................................................................................. 1005
EZSQL003............................................................................................................................................................. 1006
EZSQL004............................................................................................................................................................. 1006
EZSQL005............................................................................................................................................................. 1006
Sort Messages............................................................................................................................................................ 1006
EZSRT008............................................................................................................................................................. 1006
EZSRT009............................................................................................................................................................. 1006
EZSRT013............................................................................................................................................................. 1007
Compiler Messages....................................................................................................................................................1008
EZTC0744E........................................................................................................................................................... 1008
Runtime Error Check Codes..................................................................................................................................... 1009
16
CA Easytrieve® Report Generator 11.6
EBND.....................................................................................................................................................................1009
EBSN..................................................................................................................................................................... 1009
Runtime Code Generator Codes.............................................................................................................................. 1009
ECGO.................................................................................................................................................................... 1009
IMS_DLI Interface Codes........................................................................................................................................... 1010
EDLI.......................................................................................................................................................................1010
Dynamic Loader Codes............................................................................................................................................. 1010
EDSN.....................................................................................................................................................................1010
EDSO.....................................................................................................................................................................1010
Dynamic Segment Manager Codes.......................................................................................................................... 1010
EDSA..................................................................................................................................................................... 1010
EDSO0...................................................................................................................................................................1010
EDSS..................................................................................................................................................................... 1010
EDST..................................................................................................................................................................... 1011
EDSX..................................................................................................................................................................... 1011
Heap Manager Codes.................................................................................................................................................1011
EBND0...................................................................................................................................................................1011
EBSL......................................................................................................................................................................1011
EFLD......................................................................................................................................................................1011
EFML..................................................................................................................................................................... 1011
EFNF..................................................................................................................................................................... 1011
EFVL......................................................................................................................................................................1012
EHMD.................................................................................................................................................................... 1012
EHMF.....................................................................................................................................................................1012
EHMH.................................................................................................................................................................... 1012
EHMI......................................................................................................................................................................1012
EHML.....................................................................................................................................................................1012
EHMN.................................................................................................................................................................... 1012
EHMO.................................................................................................................................................................... 1012
EHMQ.................................................................................................................................................................... 1013
EHMR.................................................................................................................................................................... 1013
EHMV.................................................................................................................................................................... 1013
EHMW................................................................................................................................................................... 1013
EHMX.................................................................................................................................................................... 1013
Input_Output Statement Handler Codes..................................................................................................................1013
EIO0.......................................................................................................................................................................1013
EIO1.......................................................................................................................................................................1013
EIO2.......................................................................................................................................................................1014
EIO3.......................................................................................................................................................................1014
EIO4.......................................................................................................................................................................1014
17
CA Easytrieve® Report Generator 11.6
EIO5.......................................................................................................................................................................1014
EIO6.......................................................................................................................................................................1014
EIO9.......................................................................................................................................................................1014
EIOA...................................................................................................................................................................... 1014
EIDA...................................................................................................................................................................... 1015
EIOX...................................................................................................................................................................... 1015
Activity Management Codes..................................................................................................................................... 1015
EJA1...................................................................................................................................................................... 1015
System Spool Printer Interface Module Codes.......................................................................................................1015
EJSO..................................................................................................................................................................... 1015
EJSC......................................................................................................................................................................1015
EJSW.....................................................................................................................................................................1015
Task Execution Control Program Codes................................................................................................................. 1015
EKX0......................................................................................................................................................................1016
EKX1......................................................................................................................................................................1016
EKX2......................................................................................................................................................................1016
EKX5......................................................................................................................................................................1016
EKS6......................................................................................................................................................................1016
EKX7......................................................................................................................................................................1016
EKX8......................................................................................................................................................................1016
EKX9......................................................................................................................................................................1016
EKXB..................................................................................................................................................................... 1017
EKXC..................................................................................................................................................................... 1017
EKXE..................................................................................................................................................................... 1017
EKXF..................................................................................................................................................................... 1017
EKXG.....................................................................................................................................................................1017
EKXH..................................................................................................................................................................... 1017
Task Management Program Codes.......................................................................................................................... 1017
EKX3......................................................................................................................................................................1017
EKX4......................................................................................................................................................................1018
EKX80....................................................................................................................................................................1018
EKXA..................................................................................................................................................................... 1018
EKXD..................................................................................................................................................................... 1018
EKXI.......................................................................................................................................................................1018
EKXO.....................................................................................................................................................................1018
EKXS..................................................................................................................................................................... 1018
Program Link Manager Codes.................................................................................................................................. 1019
EPML..................................................................................................................................................................... 1019
Printer File Manager Codes...................................................................................................................................... 1019
EPR0..................................................................................................................................................................... 1019
18
CA Easytrieve® Report Generator 11.6
EPR1..................................................................................................................................................................... 1019
EPR2..................................................................................................................................................................... 1019
EPR3..................................................................................................................................................................... 1019
EPR4..................................................................................................................................................................... 1019
EPR5..................................................................................................................................................................... 1019
EPR6..................................................................................................................................................................... 1020
EPR9..................................................................................................................................................................... 1020
Reporting Codes.........................................................................................................................................................1020
ERP1..................................................................................................................................................................... 1020
ERP2..................................................................................................................................................................... 1020
Runtime Initialization Stub Codes............................................................................................................................1020
ERS0..................................................................................................................................................................... 1020
ERS1..................................................................................................................................................................... 1020
Sort Interface Codes.................................................................................................................................................. 1020
ESIB.......................................................................................................................................................................1021
SQL Interface Codes..................................................................................................................................................1021
ESQ1..................................................................................................................................................................... 1021
ESQ2..................................................................................................................................................................... 1021
ESQX.....................................................................................................................................................................1021
ESQY.....................................................................................................................................................................1021
EZIO...................................................................................................................................................................... 1021
Terminal Printer Despooler Program Codes........................................................................................................... 1021
ETID.......................................................................................................................................................................1022
ETIO...................................................................................................................................................................... 1022
ETIS....................................................................................................................................................................... 1022
ETIX....................................................................................................................................................................... 1022
Terminal Printer Interface Program Codes..............................................................................................................1022
ETPS..................................................................................................................................................................... 1022
Virtual File Manager Codes.......................................................................................................................................1022
EVF0......................................................................................................................................................................1022
EVF1......................................................................................................................................................................1022
EVF2......................................................................................................................................................................1023
EVF3......................................................................................................................................................................1023
EVF4......................................................................................................................................................................1023
EVF5......................................................................................................................................................................1023
EVF6......................................................................................................................................................................1023
EVF7......................................................................................................................................................................1023
EVF8......................................................................................................................................................................1023
EVF9......................................................................................................................................................................1024
EVFA......................................................................................................................................................................1024
19
CA Easytrieve® Report Generator 11.6
EVFB..................................................................................................................................................................... 1024
EVFC..................................................................................................................................................................... 1024
EVFD..................................................................................................................................................................... 1024
EVFE..................................................................................................................................................................... 1024
EVFF......................................................................................................................................................................1024
EVFG..................................................................................................................................................................... 1025
EVFH..................................................................................................................................................................... 1025
EVFI....................................................................................................................................................................... 1025
CA EZ/Key....................................................................................................................................... 1026
Documentation for Previous Releases........................................................................................ 1027
Additional Resources.................................................................................................................... 1028
Product Names............................................................................................................................... 1029
Product Accessibility Features.................................................................................................... 1030
Documentation Legal Notice........................................................................................................ 1031
20
CA Easytrieve® Report Generator 11.6
21
CA Easytrieve® Report Generator 11.6
Release Notes
Welcome to the CA Easytrieve® Report Generator Release Notes for Release 11.6. This section contains information
about key features and enhancements.
New Features
This article describes the following new features, enhancements, and changes in CA Easytrieve Report Generator for
Release 11.6:
22
CA Easytrieve® Report Generator 11.6
Linux PC Support
CA Easytrieve Report Generator can now be installed in the Linux PC environment. For more information, see Install CA
Easytrieve for Linux PC.
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.
23
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.
• 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.
24
CA Easytrieve® Report Generator 11.6
• 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.
• Y
Compiles and runs programs using the latest product release. This option incorporates all new functionality. This is the
default.
• N
25
CA Easytrieve® Report Generator 11.6
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.
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).
26
CA Easytrieve® Report Generator 11.6
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
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.
27
CA Easytrieve® Report Generator 11.6
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:
PARM SSID(‘PERSNLDB’)
FILE PERSNL SQL(PERSNL)
SQL INCLUDE LOCATION * FROM PERSNL
28
CA Easytrieve® Report Generator 11.6
29
CA Easytrieve® Report Generator 11.6
• 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.
• 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.
30
CA Easytrieve® Report Generator 11.6
In Release 11.x, ASMTDLI is not statically linked with EZTPA00. When CA Easytrieve Report Generator application
programs specify DLI statements; link edits of these programs need the //SYSLIB DD statement which references the IMS
library that contains the ASMTDLI module.
Bounds Checking
The product now verifies that your indexes and subscripts do not refer past the end of the field. This verification increases
application stability and reliability. However, older programs that were miscoded can now display boundary problems that
silently existed in older versions.
Prior Release
A field definition could be defined that exceeded the length of the file record.
Release 11.x
The FILE record length is used to calculate the maximum length (starting position + length) of the fields defined for that
file.
Example:
FILE FILEA F(80)
FLD 1 1 A OCCURS 81
R11 gives EZTC0170E >>> $ FILE size of 80 exceeded by 1
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.
DEFINE FLD1 S 16 A VALUE '1111111111111111'
DEFINE FLD2 S 16 A OCCURS 2
DEFINE FLD3 S 16 A VALUE '3333333333333333'
DEFINE SUB S 2 N
JOB INPUT NULL
DISPLAY FLD1 +2 FLD3
DO WHILE SUB < 3
FLD2(SUB) = '2222222222222222'
SUB = SUB + 1
END-DO
DISPLAY FLD1 +2 FLD3
STOP
31
CA Easytrieve® Report Generator 11.6
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:
FILE CARDIN
FLD1 1 3 A
JOB INPUT CARDIN
DISPLAY FLD1
/*
//CARDIN DD *
ABC
DEF
XYZ
/*
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.
32
CA Easytrieve® Report Generator 11.6
DISPLAY 'TRUE'
ELSE
DISPLAY 'FALSE'
END-IF
IF FLDV = FLDA. * Reverse the subject and object
DISPLAY 'TRUE'
ELSE
DISPLAY 'FALSE'
END-IF
STOP
33
CA Easytrieve® Report Generator 11.6
DEFINE FLD1 S 3 A
JOB INPUT NULL
DEFINE FLD1 S 3 N
EZTC0393W >>> + type not same as original field
STOP
• 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.
DEFINE FLDP S 4 P OCCURS 3
DEFINE FLDP-R FLDP 5 P
EZTC0715W >>> + subscripting not allowed - length greater than overlayed field
DEFINE SUB S 1 N VALUE 1
JOB INPUT NULL
DO WHILE SUB < 4
FLDP (SUB) = SUB
DISPLAY 'FLDP=' FLDP (SUB)
SUB = SUB + 1
END-DO
SUB = 1
DO WHILE SUB < 4
DISPLAY 'FLDP-R=' FLDP-R (SUB)
SUB = SUB + 1
END-DO
STOP
6.4 gets data exception displaying FLDP-R (SUB)
r11 gives EZTC0715W >>> + subscripting not allowed - length greater than overlayed
field
• 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:
1 FILE PFILE F(80)
2 FLD 1 1 A
3 JOB INPUT NULL
4 DISPLAY FLD
5 STOP
*******B062 FIELD REFERENCED IN UNAVAILABLE FILE - PFILE
*******B063 FIELD REFERENCED WAS - FLD
The following example shows Release 11.x functionality:
1 FILE PFILE F(80)
2 FLD 1 1 A
3 PROGRAM
4 GET PFILE
34
CA Easytrieve® Report Generator 11.6
5 EXECUTE JOB1
6 JOB INPUT NULL NAME JOB1
7 DISPLAY FLD
EZTC0654W >>> + file or file containing field may not be active
8 STOP
• 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:
DEFINE FLDV1 S 10 A VARYING VALUE 'ABC'
DEFINE FLDV2 S FLDV1 VALUE 'DEF'
JOB INPUT NULL
DISPLAY HEX FLDV1
DISPLAY HEX FLDV2
STOP
The following example shows the 6.4 results, in which FLDV2 is not VARYING:
CHAR ABC
ZONE 00CCC44444
NUMR 0312300000
1...5...10
CHAR DEF
ZONE CCC4444444
NUMR 4560000000
1...5...10
The following example, shows r11 results with FLDV2 correctly modeled after FLDV1:
CHAR ABC
ZONE 00CCC44444
NUMR 0312300000
1...5...10
CHAR DEF
ZONE 00CCC44444
NUMR 0345600000
1...5...10
• The behavior of W (work/spooled) fields and S (static) fields is now consistent.
END Statement
See CARD File Input.
35
CA Easytrieve® Report Generator 11.6
If you did not specify WORKAREA on the FILE statement for the input files, the record was processed 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, the record is processed 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 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 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:
FILE VFILE VB(20 200)
VFLD1 * 10 A
VFLD2 * 10 A
JOB INPUT NULL
VFLD1 = '1111111111'
VFLD2 = 'ABC'
RECORD-LENGTH = 13
PUT VFILE
VFLD1 = '2222222222'
VFLD2 = 'X'
RECORD-LENGTH = 11
PUT VFILE
STOP
JOB INPUT VFILE
DISPLAY HEX VFLD2
CHAR X
ZONE E000000000
NUMR 7000000000
1...5...10
CHAR XBC
36
CA Easytrieve® Report Generator 11.6
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.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):
JOB INPUT VFILE
DEFINE SFLD S 10 A
DEFINE LEN S 2 N
LEN = RECORD-LENGTH - 10. * Compute length to safely move data
MOVE VFLD2 LEN TO SFLD FILL ' '
DISPLAY HEX SFLD
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:
FILE VFILE VB(20 200)
VFLD1 * 10 A
VFLD2 * 10 A
FILE VFILEOUT VB(20 200)
JOB INPUT VFILE
VFILEOUT:RECORD-LENGTH = VFILE:RECORD-LENGTH
PUT VFILEOUT FROM VFILE
Example: VS parameter
The following example shows 6.4 syntax:
37
CA Easytrieve® Report Generator 11.6
FILE KSDS VS
FILE ESDS VS ES
FILE RRDS VS
Listing Format
Although the output of a printed report should look the same between Releases 6.4 and 11.x, we reserve the right
to change the format of the compile and runtime listings. While we do not change the listing format unless there is a
compelling case for doing so, it may happen between releases or even service packs. For example, the compile options,
compiler messages, runtime messages, and file statistics have all had formatting changes from Release 6.4 to Release
11.x for improved readability. The order of files shown in the statistics may differ from older versions. The format of the
PARM DEBUG options’ (ex. CLIST, PMAP, DMAP, etc.) output may also change based on need.
New Options
The following new Options Table settings are available in Release 11.x.
WORKFILE {Y|N}
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.
38
CA Easytrieve® Report Generator 11.6
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:
IDMSNAM MACDEV
COMPSTR MACRO
DATEADJ MACSYS$
DATEMLC PLACE
DEVICE PRESIZE
DISK REWIND
DLIV SORTOPT
DLISQL SORTWK#
EXITSTR STORMAX
IDDEXIT SYSTEM
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.
39
CA Easytrieve® Report Generator 11.6
A single, nonsequenced (nonspooled) report was treated All reports work consistently in their handling of W fields. This
differently than other reports. As a result, W (working storage) change can cause older, miscoded programs to behave differently
fields were sometimes used instead of S (static) fields. When that due to misuse of W fields.
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 the Special named break procedures refer to the last detail record
new control group. As a result, detail references did not always of the control group so that detail references match control
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.
1 ARNOLD 445.50
BRANDOW 804.64
…
TALL 492.26
WIMN 373.60
1 4,601.16
FINAL NAME WAS DENNING
2 DENNING 135.85
FORREST 13.80
…
1 ARNOLD 445.50
BRANDOW 804.64
…
TALL 492.26
WIMN 373.60
1 4,601.16
FINAL NAME WAS WIMN
40
CA Easytrieve® Report Generator 11.6
2 DENNING 135.85
FORREST 13.80
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
• LOW-VALUES
• NOTITLE
• SET
• SUMMARY-INDEX
• SYSUSERID
41
CA Easytrieve® Report Generator 11.6
STOP
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:
2 FILE VSINP VS(ES)
3 INREC 1 150 A
4 *
5 WEMP# W 5 N VALUE 10000
6 *
7 JOB INPUT NULL
8 READ VSINP KEY WEMP# STATUS
9 STOP
42
CA Easytrieve® Report Generator 11.6
In the following release 11.x code example, the READ statement shows a syntax error because VS(ES) has not been
changed to INDEXED:
2 FILE VSINP VS(ES)
3 INREC 1 150 A
4 *
5 WEMP# W 5 N VALUE 10000
6 *
7 JOB INPUT NULL
8 READ VSINP KEY WEMP# STATUS
EZTC0443E >>> $ file type not compatible with READ
9 STOP
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.
The following example compiles and executes cleanly in Release 6.4:
2 FILE VSINP VS(ES)
3 INREC 1 150 A
4 *
5 JOB INPUT NULL
6 GET VSINP
7 STOP
The following errors occur when the code is executed in Release 11.x:
EZABX000 An error has occurred in program HELLO.
. . .
################ Diagnostic Information ################
EZABX003 The error occurred at 15:51 on 05/11/11.
EZIOE002 Error opening file VSINP.
File type incompatable with the dataset organization.
EZABX008 The error occurred at program statement number 6.
EZABX020 The program referred to the following files:
43
CA Easytrieve® Report Generator 11.6
When the first report was unsequenced, W (work/spooled) fields were treated like S (static) fields. If the report later
became spooled (by sequencing or insertion of another report), the W fields were spooled and their behavior was
changed. As a result, the behavior of W and S fields was inconsistent. Users were able to invalidate the logic they had
developed for single unsequenced reports.
Release 11.x
All reports are treated as spooled, whether they are single, unsequenced reports. The distinction between W and S fields
is always maintained and their behavior is always consistent when new reports or sequencing is added.
We recommend always using S fields unless you know exactly what W means to your application and the special
processing associated with spooled work fields. W fields are added to the spool record with all FILE fields when PRINT
executes, freezing an instance of that variable. Each spool record has its own instance of that field. S fields behave the
way working storage works in other languages. For more information, see Define Files and Fields .
Remember that all file fields and W fields that are referenced in a REPORT are added to the spool record when the
PRINT is executed. S fields are not. A field is referenced by being coded anywhere in the report declaration, for example,
on a TITLE or LINE or in a report procedure. Work field types are often misused in procedures.
In the following example, a program tries to display a sequence number in an AFTER-LINE procedure:
FILE PERSNL
REGION 1 1 A
NAME 17 8 A
GROSS 94 4 P 2
WFLD W 2 N
JOB
PRINT
REPORT NOADJUST
LINE REGION NAME GROSS
AFTER-LINE. PROC
WFLD = WFLD + 1
DISPLAY 'SEQ=' WFLD
END-PROC
1 NAGLE 554.40
SEQ=01
2 POST 292.00
SEQ=02
2 PETRIK 220.80
SEQ=03
44
CA Easytrieve® Report Generator 11.6
1 NAGLE 554.40
SEQ=01
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.
Release Comparison
This article lists the key features added after Release 6.4. Click the link for more information about a feature.
45
CA Easytrieve® Report Generator 11.6
Migration Guidelines
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.
Migration Strategy
The CA Easytrieve® Report Generator product team provides a formalized migration strategy to help you upgrade from
release 6.4 to release 11.x. Many customers have already migrated to release 11.6 to take advantage of its new features
and functionality. Our migration strategy is based on our experience with those migrations and the resulting customer
46
CA Easytrieve® Report Generator 11.6
comments and feedback. We recommend migrating to release 11.6 compatibility mode first and then moving into new
function mode when you have time to test your migrated programs.
WARNING
Because release 11.x is a major release, do not migrate programs from release 6.4 without testing.
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 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).
47
CA Easytrieve® Report Generator 11.6
• Eliminates time-consuming fix searches and the need to select maintenance manually through CA Support Portal
• Automates delivery of CA maintenance directly to your mainframe
• Fulfills orders based on the status of your SMP/E environments
• Enables scheduling of maintenance downloads
• Facilitates an easier installation of CA Recommended and Preventive service
With the CA SMP/E Internet Service Retrieval, you can acquire maintenance on demand or can schedule an SMP/E job
to run regularly. The CA Order server supports the IBM-documented order types, which include: ALL, APARS, CRITICAL,
HOLDDATA, PTFS, and RECOMMENDED.
If you are an existing CA Chorus™ Software Manager customer, you can also use this new service to download
maintenance and dramatically reduce the time needed to download PTFs.
To get started, review the CA SMP/E Internet Service Retrieval Documentation.
Portfolio Simplification
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.
48
CA Easytrieve® Report Generator 11.6
EZ/Key™ CICS for z/OS Provides a comfortable, highly productive interactive environment
within IBM® CICS® for creating, maintaining and running CA
Easytrieve programs. Regardless of their level of data processing
expertise, users can create programs ranging from simple reports
to complex updates of files and databases.
EZ/Key CMS for z/OS Provides a comfortable, highly productive interactive environment
within CMS for creating, maintaining and running CA Easytrieve
programs. Regardless of their level of data processing expertise,
users can create programs ranging from simple reports to complex
updates of files and databases.
EZ/Key TSO Provides a comfortable, highly productive interactive environment
within TSO for creating, maintaining and running CA Easytrieve
programs. Regardless of their level of data processing expertise,
users can create programs ranging from simple reports to complex
updates of files and databases.
Easytrieve Report Generator Runtime Provides the ability to run CA Easytrieve applications developed
on another system, without requiring the full development
environment.
Report Generator CA Datacom Option for SQL and Non-SQL Enables CA Easytrieve to access data stored in CA Datacom
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.
EZ/Key™ CICS for z/OS Provides a comfortable, highly productive interactive environment
within CICS for creating, maintaining and running CA Easytrieve
programs. Regardless of their level of data processing expertise,
users can create programs ranging from simple reports to complex
updates of files and databases.
EZ/Key CMS for z/OS Provides a comfortable, highly productive interactive environment
within CMS for creating, maintaining and running CA Easytrieve
programs. Regardless of their level of data processing expertise,
users can create programs ranging from simple reports to complex
updates of files and databases.
EZ/Key TSO Provides a comfortable, highly productive interactive environment
within TSO for creating, maintaining and running CA Easytrieve
programs. Regardless of their level of data processing expertise,
users can create programs ranging from simple reports to complex
updates of files and databases.
49
CA Easytrieve® Report Generator 11.6
Easytrieve Report Generator Runtime Provides the ability to run CA Easytrieve applications developed
on another system, without requiring the full development
environment.
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
Release Information
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:
50
CA Easytrieve® Report Generator 11.6
• 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.
51
CA Easytrieve® Report Generator 11.6
Installing
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.
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
CA CSM
CA Chorus™ Software Manager (CA CSM) provides a web interface that works with ESD and standardized installation to
provide a common way to manage CA Technologies mainframe products. You can use CA CSM to acquire, install, and
maintain CA Easytrieve.
After you use CA CSM to download your product or maintenance, you use the same interface to install the downloaded
software packages using SMP/E.
NOTE
• 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.
52
CA Easytrieve® Report Generator 11.6
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.
Pre-Installation Requirements
Before you install the product in the Windows environment, verify that your computer meets the following requirements:
• Windows XP or later
• A minimum of 80 MB of free disk space.
53
CA Easytrieve® Report Generator 11.6
NOTE
CA Easytrieve Report Generator for Windows has a per user license. Therefore, the user who does the
installation is the only user of the product. Administrative privileges are only required to install the licensing
portion. Once licensing is installed, any user can install the product.
Apply Maintenance
We recommend that you download and install the published solutions for CA Easytrieve Report Generator for Windows
from CA Support Online. For more information, see Maintain your Product.
54
CA Easytrieve® Report Generator 11.6
bind dqspsdbc.bnd
bind dqspsdbx.bnd
10. Install the license key as described in Install the License Key.
55
CA Easytrieve® Report Generator 11.6
ezt testezt.ezt
The program compiles.
2. Execute testezt.ezt with the following command:
a.out
The executing program shows the following message on your terminal:
56
CA Easytrieve® Report Generator 11.6
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
The following message appears:
57
CA Easytrieve® Report Generator 11.6
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.
58
CA Easytrieve® Report Generator 11.6
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.
NOTE
For more information about the options table, see Updating the Table.
59
CA Easytrieve® Report Generator 11.6
NOTE
If the numbers for SQLULEN size and SQLLEN size are 8, contact Broadcom Support.
60
CA Easytrieve® Report Generator 11.6
You can 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
The following message appears:
<easy> and Ingres are communicating
<easy> and Oracle are communicating
<easy> and DB2 are communicating
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
3. Follow the instructions in the installer.
4. When you are prompted to exit the installer, press Enter.
Installation Troubleshooting
All installation information is written to a log. If you experience problems during installation, this log can help CA Support
troubleshoot the cause.
61
CA Easytrieve® Report Generator 11.6
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.
62
CA Easytrieve® Report Generator 11.6
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
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
Disk Space
Before you install the product, review the following table for adequate space availability:
63
CA Easytrieve® Report Generator 11.6
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)).
64
CA Easytrieve® Report Generator 11.6
systems. This application also makes obtaining and applying corrective and recommended maintenance easier. A web-
based interface enables you to install and maintain your products faster and with less chance of error. As a best practice,
we recommend that you install mainframe products and maintenance using CA CSM. Using CA CSM, someone with
limited knowledge of JCL and SMP/E can install a product.
NOTE
If you do not have CA CSM, you can download it from Download Management on Broadcom Support. Follow
the installation instructions in the CA CSM documentation.
You can also complete the standardized installation process manually using pax files that are downloaded from Broadcom
Supportor a product DVD.
To install your product, do the following tasks:
1. Prepare for the installation by confirming that your site meets all installation requirements.
2. Verify that you acquired the product using one of the following methods:
– Download the software from Broadcom Support using CA CSM.
– Download the software from Broadcom Support using Pax-Enhanced Electronic Software Delivery (Pax ESD).
– Order a product DVD. To do so, contact your account manager or a CA Technologies Support representative.
3. Perform an SMP/E installation using one of the following methods:
– If you used CA CSM to acquire the product, start the installation process from the SMP/E Environments tab in CA
CSM.
– If you used Pax ESD to acquire the product, you can install the product in the following ways:
• Install the product manually.
• Complete the SMP/E installation using the Add Product option in CA CSM.
– If you have a product DVD, install the product manually.
NOTE
If a CA Recommended Service (CA RS) package is published for your product, install it before proceeding.
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.
65
CA Easytrieve® Report Generator 11.6
Concurrent Releases
You can install this release of your product and continue to use an older release in another SMP/E environment. If you
plan to continue to run a previous release, consider the following points:
• When you install the product into an existing SMP/E environment, this installation deletes previous releases in that
environment.
• If you acquired your product with Pax ESD, select different target and distribution zones for your new release from
where your current release is installed. The new zones use different libraries than your current release.
NOTE
CA CSM installs a product into a new SMP/E environment by default. You can select an existing SMP/E
environment from your working set. For more information, see the online help that is included in CA CSM.
• Define DDDEF entries in your new zones to point SMP/E to the proper libraries for installation. Ensure that they point
to the new release libraries.
66
CA Easytrieve® Report Generator 11.6
67
CA Easytrieve® Report Generator 11.6
Figure 1: Acquiring_Products_CIG
1. Configure CA CSM.
2. If you can download the product package from Broadcom Support:
a. Update the product list.
b. Download product packages.
3. If you cannot download the product package from Broadcom Support:
a. Add external product installation packages.
b. 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.
68
CA Easytrieve® Report Generator 11.6
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.
3. Configure the following settings:
– Proxies that CA CSM uses to communicate with Broadcom Support.
If proxies are not used, CA CSM uses HTTPS Port Number 443 and FTP Port Number 21.
WARNING
If your site uses proxies, review your proxy credentials on the User Settings, Software Acquisition page.
– The USS path to the temporary directory for downloaded software packages
If you do not specify the directory, CA CSM sets it up using default settings that you can change later.
NOTE
These settings are also available on the System Settings, Software Acquisition page.
Select Next.
You are prompted to define your account on Broadcom Support.
4. Select New.
You are prompted for the credentials to use on Broadcom Support.
5. Specify the credentials, select OK, and then Next.
You are prompted to review your user settings.
NOTE
These settings are available on the User Settings page.
6. Change the settings or keep the defaults, and then select Finish.
A dialog opens, which shows the progress of the configuration task.
7. Select the Settings tab, and review other settings, as needed.
You have configured CA CSM to acquire products.
69
CA Easytrieve® Report Generator 11.6
70
CA Easytrieve® Report Generator 11.6
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.
71
CA Easytrieve® Report Generator 11.6
Adds a maintenance package that is not published on Broadcom Support. This option is intended for downloading a
PTF to validate it.
• FTP Host
Specifies the FTP server where the maintenance 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 maintenance package is located. Start the path with a forward slash (/). Enter
only a forward slash to specify the root directory.
Example: /outgoing/
• Maintenance Name
Defines the maintenance package name.
Example: RO01111.bin
• User Name
Defines a valid user name to access the FTP location.
• Password
Defines a valid password to access the FTP location.
– Solution
Adds a published solution from Broadcom Support.
6. Refresh the page to see the added maintenance package.
The product maintenance package is now listed in the product catalog and is available for installation with CA CSM.
You completed the acquiring process. The product packages are ready for installation with CA CSM.
72
CA Easytrieve® Report Generator 11.6
Figure 2: Installing_Products
73
1. (Optional) Configure base installation settings.
CA Easytrieve® Report Generator 11.6
74
CA Easytrieve® Report Generator 11.6
Verifies that all requirements for the Accept step are satisfied before the Accept step executes. If the Accept Check
step fails, installation stops and all the previous steps are undone.
– Suspend Base Installation After Accept Check
Suspends the base installation process after Accept Check is completed and generates pending installation actions
for the SMP/E environment where the product is being installed.
NOTE
This check box is enabled if you enable the Execute Accept Check During Base Installation checkbox.
4. 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.
The base installation settings are configured.
NOTE
If you configure the base installation settings to execute checks during base installation, CA CSM creates a
pending installation for the SMP/E environment. For more information about the pending installation, see the CA
CSM online help.
75
CA Easytrieve® Report Generator 11.6
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.
76
CA Easytrieve® Report Generator 11.6
b. From the target zone drop-down list, select a target zone within the selected SMP/E environment where the
prerequisites are installed.
c. 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.
77
CA Easytrieve® Report Generator 11.6
78
CA Easytrieve® Report Generator 11.6
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 appear.
79
CA Easytrieve® Report Generator 11.6
80
CA Easytrieve® Report Generator 11.6
81
CA Easytrieve® Report Generator 11.6
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.
82
CA Easytrieve® Report Generator 11.6
83
CA Easytrieve® Report Generator 11.6
– 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.
84
CA Easytrieve® Report Generator 11.6
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.
85
CA Easytrieve® Report Generator 11.6
86
CA Easytrieve® Report Generator 11.6
To start the installation, review the summary on the Summary step, and select Install.
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.
You completed the product installation. You can now start maintaining the installed products.
87
CA Easytrieve® Report Generator 11.6
88
CA Easytrieve® Report Generator 11.6
NOTE
To download available HOLDDATA to the software catalog immediately, select Update Immediately.
The automatic HOLDDATA download is configured.
89
CA Easytrieve® Report Generator 11.6
90
CA Easytrieve® Report Generator 11.6
91
CA Easytrieve® Report Generator 11.6
Receive Maintenance
After maintenance has been downloaded for a product, you can receive the maintenance to the global zone of an SMP/E
environment where the related products are installed. Once received, maintenance packages can be applied.
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 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.
92
CA Easytrieve® Report Generator 11.6
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:
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.
93
CA Easytrieve® Report Generator 11.6
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.
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.
94
CA Easytrieve® Report Generator 11.6
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.
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.
95
CA Easytrieve® Report Generator 11.6
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.
a. Connect to the FTP site at the following location:
ftp://ftp.broadcom.com
b. Log in to ftp.broadcom.com as follows:
user name: anonymous
password: your-email-address
c. Change to the following directory:
/pub/ASSIGNS
d. Change your download mode to ASCII.
e. Download the CA RS file. CA RS files appear in the format:
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.
96
CA Easytrieve® Report Generator 11.6
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 CA RS 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.
97
CA Easytrieve® Report Generator 11.6
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.
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.
98
CA Easytrieve® Report Generator 11.6
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:
99
CA Easytrieve® Report Generator 11.6
NOTE
Changes in the allocation parameters apply to the current maintenance processing only.
1. Select Override for a DDDEF to edit its allocation parameters.
A pop-up window opens.
2. 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.
100
CA Easytrieve® Report Generator 11.6
101
CA Easytrieve® Report Generator 11.6
102
CA Easytrieve® Report Generator 11.6
103
CA Easytrieve® Report Generator 11.6
– If you configure a product from an SMP/E environment, you can only configure it on a staging system.
– If you configure a product from a configurable CA CSM deployment, you can configure it on a staging system or a
nonstaging system.
2. Create a configuration.
3. Build the configuration.
4. (Optional) Validate the configuration.
NOTE
Although validation is optional, we recommend that you validate the configuration before implementation.
• If validation fails, edit the configuration and repeat the process from step 3.
• If validation succeeded, implement the configuration.
5. (Staging systems only) Activate the configuration.
The product configuration process completes.
NOTE
Perform any manual configuration steps outside of CA CSM now if needed.
For more information about configuring products, see the CA CSM online help.
Create a Configuration
You can create a configuration for a product that is installed in an SMP/E environment, or a product from an existing
configurable CA CSM deployment.
The configuration wizard consists of several steps that let you set up your configuration as you prepare to implement
it. When you go through the wizard, you define a set of properties for your configuration. For example, you define the
product that you want to configure and the system you are targeting for the configuration. Optionally, you can select to
import product configuration settings and variable values from a previous configuration for the selected product.
Each product configuration includes various settings, such as:
• The functions and options for the product
• Settings and preferences that are associated with the specified target system
• Resources for the product
NOTE
To avoid a conflict of resources between two or more configurations of a product, SCS manages the
resources that are associated with previously defined configurations. To resolve conflicting (not unique)
resources in your configuration, perform one of the following actions:
• Change the appropriate target setting to create a unique resource name.
• Delete the older configuration containing the existing resource name and release the conflicting resource.
If you import values from another configuration, you can optionally delete the configuration that you are importing the
values from to avoid conflicts.
Follow these steps:
1. From the Configurations tab, select Create Configuration from the Actions section.
The configuration wizard opens to step 1.
NOTE
You can also start the configuration wizard from the following locations:
• The SMP/E Environments tab - for a product in an SMP/E environment.
• The Deployments tab - for a product from an existing configurable CA CSM deployment. Starting the
configuration wizard from the Deployments tab opens it to step 2.
104
CA Easytrieve® Report Generator 11.6
2. Follow the instructions on the wizard to navigate through the wizard steps.
3. From the Review and Build step, review the configuration summary.
You are ready to build the configuration.
NOTE
If you do not want to build configuration now, save the configuration and close the wizard. You can build it
later.
105
CA Easytrieve® Report Generator 11.6
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).
106
CA Easytrieve® Report Generator 11.6
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.
107
CA Easytrieve® Report Generator 11.6
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.
108
CA Easytrieve® Report Generator 11.6
109
CA Easytrieve® Report Generator 11.6
• Create a customized set of run-time data sets that youthen move to a target system for the final activation
• Create a fully implemented version of the product and test it locally
Activating the configuration makes your configuration fully functional on the target system.
You perform the following high-level process to activate the configuration:
1. (In CA CSM) Configure a product on a staging system.
2. (In CA CSM) Obtain the activation instructions that are available after the configuration is successfully built, validated,
or implemented on a staging system. The activation instructions include extra steps that you have to perform on the
configuration outside of CA CSM. For example, update data set members, or APF-authorize data sets.
3. (Outside of CA CSM) Perform one of the following actions:
– If you activate a configuration on a staging system, follow the activation instructions on the staging system. Doing
so activates the configuration and completes the configuration process.
– If you activate a configuration on a remote system, deploy the configuration to the remote location. To do so, select
and use a method that is appropriate for your site and environment. Follow the activation instructions on the remote
system to activate the configuration and complete the configuration process.
Follow these steps:
1. Select the Configurations tab and locate the configuration that you want to activate.
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.
110
CA Easytrieve® Report Generator 11.6
the product. Product updates may have occurred after you acquired the product DVD. To obtain the latest updates, go to
Download Management on CA Support.
Perform the following tasks to install a product with a pax file:
111
CA Easytrieve® Report Generator 11.6
We recommend that you allocate and mount a file system that is dedicated to Pax ESD. The amount of space that you
need for the file system depends on the following variables:
• The size of the pax files that you intend to download.
• Whether you plan to keep the pax files after unpacking them. We do not recommend this practice.
We recommend that you use one directory for downloading and unpacking pax files. Reusing the same directory
minimizes USS setup. You need to complete the USS setup only one time. You reuse the same directory for subsequent
downloads. Alternatively, you can create a directory for each pax download.
WARNING
Downloading pax files for the SMP/E installation as part of the Pax ESD process requires write authority to the
UNIX System Services (USS) directories that are used for the Pax ESD process. In the file system that contains
the Pax ESD directories, you also need free space approximately 3.5 times the pax file size to download the pax
file and unpack its contents. For example, to download and unpack a 14 MB pax file, you need approximately
49 MB of free space in the file system hosting your Pax ESD directory.
112
CA Easytrieve® Report Generator 11.6
//SYSUDUMP DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//*
cd /u/maint/
mkdir CA
cd CA
mkdir CAPAX
NOTE
Further references to this mount point appear as yourUSSpaxdirectory.
The mount point is created.
3. Mount the file system by customizing the following sample:
MOUNT FILESYSTEM('your_zFS_data_set_name')
MOUNTPOINT('yourUSSpaxdirectory')
TYPE(ZFS) MODE(RDWR)
PARM(AGGRGROW)
The file system is mounted.
4. (Optional) Set security permissions for the directory. You can use the chmod command to let other users access the
USS pax directory and its files. For example, to allow write access to the USS pax directory for other users in your
USS group, from the TSO OMVS shell, enter the following command:
113
CA Easytrieve® Report Generator 11.6
If you download a zip file, you must unzip it before uploading to your USS file system.
• Download the pax files from http://casupport.broadcom.com directly to your USS file system.
• Download the pax file from the product DVD to your PC, and then upload the pax files to your USS file system.
This section includes the following information:
• A sample batch job to download a product pax file from the Broadcom Support Online FTP server directly to a USS
directory on your z/OS system
• Sample commands to upload a pax file from your PC to a USS directory on your z/OS system
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.
114
CA Easytrieve® Report Generator 11.6
Your FTP download details appear including hostname, username, and password.
TIP
To find the file names with the package, click FTP via Browser.
9. Download the shopping cart file to your workstation.
10. If you downloaded a zip file, unzip the file to prepare the product pax files for use.
The pax file is ready for FTP.
NOTE
Do not change the format of the pax.Z.
11. FTP the pax.Z files in binary mode to your mainframe USS file system.
Sample FTP commands from a Windows command prompt are provided in Download Files to Mainframe through a
PC, starting with step 2.
115
CA Easytrieve® Report Generator 11.6
Host Name: ftp://scftpd.ca.com for product files and download cart files and ftp://ftp.ca.com for individual solution
files.
Both methods display the host, user name, password, and FTP location, which you then can copy into the sample
JCL.
NOTE
The following links provide details regarding FTP: the FTP Help document link in the Review Download
Requests window and the Learn More link available in the Download Methods window.
6. Submit the job.
WARNING
If your FTP commands are incorrect, it is possible for this job to fail and still return a zero condition code.
Read the messages in the job DDNAME SYSPRINT to verify the FTP succeeded.
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:
//GETPAX JOB (ACCOUNTNO),'FTP GET PAX ESD PACKAGE',
// MSGCLASS=X,CLASS=A,NOTIFY=&SYSUID
//*********************************************************************
//* This sample job can be used to download a pax file directly from *
//* CA Support Online to a USS directory on your z/OS system. *
//* *
//* When editing the JCL ensure that you do not have sequence numbers *
//* turned on. *
//* *
//* 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 *
Host
anonymous YourEmailAddress
lcd yourUSSpaxdirectory
binary
get FTP_location
quit
116
CA Easytrieve® Report Generator 11.6
/*
117
CA Easytrieve® Report Generator 11.6
Use the following sample JCL to extract the product pax file into a product installation directory.
118
CA Easytrieve® Report Generator 11.6
119
CA Easytrieve® Report Generator 11.6
• 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.
120
CA Easytrieve® Report Generator 11.6
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.
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.
121
CA Easytrieve® Report Generator 11.6
• To review the CA Technologies mainframe maintenance philosophy, see best practices for your product or visit the
Mainframe Installation and Maintenance Tools site.
• For a comprehensive collection of articles dedicated to all CA mainframe maintenance concepts and procedures, see
Mainframe Common Maintenance Procedures.
122
CA Easytrieve® Report Generator 11.6
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
123
CA Easytrieve® Report Generator 11.6
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.
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
124
CA Easytrieve® Report Generator 11.6
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
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.
125
CA Easytrieve® Report Generator 11.6
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).
CBAAJCL Contents
The CBAAJCL data set contains configuration jobs and utility jobs.
126
CA Easytrieve® Report Generator 11.6
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.
127
CA Easytrieve® Report Generator 11.6
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.
Software Prerequisites
The prerequisites to install CA Easytrieve Report Generator Release 11.6 are as follows:
• You must install CA Common Services (CCS) Release 2.2, Genlevel 9909 or higher. We recommend that you upgrade
to CCS Release 11 SP8 or higher.
NOTE
CAIRIM is the only CA Common Services component required for CA Easytrieve Report Generator.
• For a smooth migration from a release prior to Release 6.4, we recommend that you upgrade to CA Easytrieve
Report Generator 6.4 0311 and apply maintenance before installing Release 11.6. This will ensure the highest level of
compatibility with the Release 11.6 environment.
Installation Information
CA Easytrieve Report Generator Release 11.6 is available only as a new installation.
Several changes have been made in the product installation JCL members that are distributed in the hlq.CBAAJCL data
set. Be sure to review the updated members.
WARNING
128
CA Easytrieve® Report Generator 11.6
• 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.
129
CA Easytrieve® Report Generator 11.6
– -n new_olf
Specifies the name of the new OLF file to merge.
– -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:
MERGEOLF -n ca.nol -c c:\program files\ca\SharedComponents\ca_lic\ca.olf -o c:\program files\ca
\SharedComponents\ca_lic\ca.olf -b c:\program files\ca\SharedComponents\ca_lic\ca.old
130
CA Easytrieve® Report Generator 11.6
131
CA Easytrieve® Report Generator 11.6
Configuring
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.
132
CA Easytrieve® Report Generator 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.
NOTE
If you do not set AMODE31 correctly, it can result in a S0C4 ABEND or undesired storage allocation below the
16 MB line.
NOTE
VFM and VSAM files do not use the BUFNO information.
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.
133
CA Easytrieve® Report Generator 11.6
134
CA Easytrieve® Report Generator 11.6
//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))
//*
135
CA Easytrieve® Report Generator 11.6
If you are upgrading from the CA Easytrieve® Report Generator release 11.x, you do not need to migrate or create a
PSD. All release 11.x PSDs are compatible with the latest release.
136
CA Easytrieve® Report Generator 11.6
EZTPSPRA Macro
The EZTPSPRA macro executes when you execute JOB11SUA or JOB11SUB to install the SUPRA preprocessor. Add
your site-specific settings to the parameters before executing the job.
This macro has the following format:
[ { YES } ]
%EZTPSPRA SCHEMA schema-name [ OVERRIDE { } ] +
[ { NO } ]
[ { YES } ]
137
CA Easytrieve® Report Generator 11.6
• 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}
– 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.
138
CA Easytrieve® Report Generator 11.6
The JOB12TOT job link edits the DATBAS module (from the TOTAL product library) into the target library (CBAALIB).
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.
139
CA Easytrieve® Report Generator 11.6
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.
Endevor(E) Macros are stored in a CA Endevor library and maintained through
CA Endevor.
Security
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.
Linkage Conventions
The exit routine is loaded at initiation, using the LOAD function of the operating system. When the exit routine is called, it
uses a three-word (SYSIN/SYSIPT) or a four-word (SYSPRINT/SYSLST) parameter list.
You must code exit routines following all of the conventions described in Programming .
SYSIN Exit
The SYSIN exit routine is invoked at compile-time and allows for pre-processing of the source statements that are input to
the compiler.
The SYSIN exit routine places the input record (80 bytes) into the data area pointed to by parameter one. Parameter two
points to a one-word code that is always zero, 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 always binary 0. 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 re-entrant coding.
140
CA Easytrieve® Report Generator 11.6
SINEXIT CSECT
STM 14,12,12(13) Save registers
LR 11,15 Set base register
USING SINEXIT,11 Addressability
LA 14,0,(0,13) <easy>
save area
LA 13,MYSAVE Exit save area
ST 13,8(0,14) Chain forward
ST 14,MYSAVE+4 Chain backward
...
L 4,0(1) Data area pointer
L 5,4(1) Code area pointer
...
ENTRY1 NOP ENTRY2 First time switch
OI ENTRY1+1,X'FO' Change to unconditional branch
OPEN (SYSIN,INPUT) Open file
...
ENTRY2 GET SYSIN,(4) Get record into data area
B RETURN
...
ENTRY3 CLOSE SYSIN Close the file
LA 0,8 No more input
ST 0,0(5) Indicate EOF
...
RETURN L 13,4(0,13) <easy>
save area
LM 14,12,12(13) Restore EZT Registers
MVI 8(13),X'FF' Indicate unused save area
SR 15,15 Set zero return code
BR 14 Return to <easy>
...
MYSAVE DC 18A(0) Exit save area
...
SYSIN DCB DISORG=PS,DDNAME=SYSIN,MACREF=GM, *
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.
141
CA Easytrieve® Report Generator 11.6
SPRTEXIT CSECT
STM 14,12,12(13) Save registers
LR 11,15 Set base register
USING SPRTEXIT,11 Addressability
LA 14,0(,13) <easy>
save area
LA 13,MYSAVE Exit save area
ST 13,8(,14) Chain forward
ST 14,MYSAVE+4 Chain backward
L 4,0(1) Data area pointer
L 5,4(1) Code area pointer
...
ENTRY1 NOP ENTRY2 First time switch
OI ENTRY1+1,X'FO' Change to unconditional branch
OPEN (SYSPRINT,OUTPUT) Open file
...
Entry2 L 5,0(5) Get code
CL 5,=F'8' Q.EOF yet
BE ENTRY3 ..YES, go close
...
PUT SYSPRINT,(4) Print the line
B RETURN
ENTRY3 CLOSE SYSPRINT
RETURN L 13,4(,13) <easy>
save area
LM 14,12,12(13) Restore registers
MVI 8(13),X'FF' Indicate unused save area
SR 15,15 Zero return code
BR 14 Return to <easy>
MYSAVE DC 18A(0)
SYSPRINT DCB DSORG=PS,DDNAME=SPRINT,MACRF=PM, *
RECFM=FBA,LRECL=133
END
142
CA Easytrieve® Report Generator 11.6
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.
143
CA Easytrieve® Report Generator 11.6
ingres
openingres
oracle
db2
odbc
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:
144
CA Easytrieve® Report Generator 11.6
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
145
CA Easytrieve® Report Generator 11.6
Each card image can update one (and only one) Site Option. Code the internal name of the option as the first word on the
card image. Code the value, following at least one space on the card image.
NOTE
Some option values are case-sensitive on some platforms.
Several Site Option update card images are sampled below. The following are sample option cards.
ABEXIT N
COMPNME ABC COMPANY, INC.
DMAP Y
LONGDTE N
PMAP N
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.
Example:
PRINTER PRINTER S 132 58 A RSCS SMITH
Example:
PRINTER PRINTER T 80 58 N N N RMT1
Example:
PRINTER PRINTER F 132 58 SYSPRINT
146
CA Easytrieve® Report Generator 11.6
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
The EZOPTBL options table in the current directory is updated.
147
CA Easytrieve® Report Generator 11.6
//STEPLIB DD DSN=EZT.loadlib,DISP=SHR
//SYSPRINT DD SYSOUT=A
//OUTPUT DD SYSOUT=A
//EZOPTBL DD DSN=your.EASYTRIEVE.EZOPTBL,DISP=SHR,
//SYSUT2 DD DISP=(,CATLG),DSN=EZT.option.output,
// SPACE=(TRK,(1,1),RLSE),
//SYSIN DD *
Site Option Update Cards
/*
//
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.
• Report Options are related to the Report Processing Facility.
• Mask Options are site-defined edit masks that are used for formatting numeric data.
• International Options let you customize the product for international use. Includes data and time display, currency
symbol used, and decimal point character.
• Printer Profile Definition maintains the destination to which reports and messages are routed.
148
CA Easytrieve® Report Generator 11.6
149
CA Easytrieve® Report Generator 11.6
150
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.
• Limits: 1 - 80
• Default: 1
151
CA Easytrieve® Report Generator 11.6
WARNSYM - Warnings
WARNSYM specifies the symbol that the product uses on warning 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.
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: $
• 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
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.
152
CA Easytrieve® Report Generator 11.6
2 0xD2 0x4B K
3 0xD3 0x4C L
4 0xD4 0x4D M
5 0xD5 0x4E N
6 0xD6 0x4F O
7 0xD7 0x50 P
8 0xD8 0x51 Q
9 0xD9 0x52 R
LISTUC - Uppercase
LISTUC specifies whether the compilation listing is translated to uppercase characters. Usually, the source statements are
printed as they are coded. Messages that are inserted into the program statements are in lowercase. 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.
LISTUC {Y|N}
• Y
Translates to uppercase if printer does not support lowercase.
• N
Do not translate to uppercase. This is the default.
• Y
Produces the data map.
• N
Suppresses the DMAP. This is the default.
• Y
Produces the program map.
• N
153
CA Easytrieve® Report Generator 11.6
• 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.
• 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.
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.
COMPNME company name
154
CA Easytrieve® Report Generator 11.6
• Limits: 50 characters
• Default: COMPUTER ASSOCIATES, INC. FIELD INSTALLATION.
• Y
Validates references. This is the default.
• N
Suppresses reference validation.
• P
Specifies CA Panvalet.
• ESpecifies CA Endevor
• N
Specifies none.
• D
Specifies PDS. This is the default.
• 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.
• Default: PANDD
155
CA Easytrieve® Report Generator 11.6
• Limits: 1-9
• Default: 1
Example
MAC#LIB is specified as follows:
MACDDN = PANDD
MAC#LIB = 2
• Default: PANMODI
Other Options
NOTE
These options are not available in the Configuration Manager.
• Y
Compiles and runs your programs using the latest product release thereby providing all new functionality therein. This
is the default.
• 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.
156
CA Easytrieve® Report Generator 11.6
SINXIT xxxxxxxx
• Default: @
• 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.
• 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.
DEFINE WS-PERCENT-P1 W 7 P 6
157
CA Easytrieve® Report Generator 11.6
• 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
In the following code, the programmer intends for the file status of PERSONAL to be checked:
FILE IDXF F(4)
IDX 1 4 B
FILE PERSONAL RELATIVE F 150
%PERSNL
JOB INPUT IDXF
READ PERSONAL KEY IDX STATUS
IF FILE-STATUS = 0
DISPLAY IDX +2 EMP# +2 EMPNAME
ELSE
STOP
END-IF
Because FILE-STATUS is not qualified, the following message is issued if STRICTQU is set to W:
strictqu.ezt: Line 7 Col 8: W743: File IDXF used to qualify FILE-STATUS
158
CA Easytrieve® Report Generator 11.6
Execution Options
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 {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.
• A
Indicates that the system determines the block size for disk, tape and PRINTER data sets.
FLOWSIZ nnnn
• Limits: 1 - 4096
• Default: 100
159
CA Easytrieve® Report Generator 11.6
LISTFIL {Y|N}
• Y
Produces the statistics.
• N
Suppresses the statistics. This is the default.
STATE {Y|N}
• Y
Saves the statement number. This is the default.
• N
Does not save the statement number.
STORCHK {Y|N}
• Y
Checks storage areas.
• N
Does not check storage areas. This is the default.
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.
160
CA Easytrieve® Report Generator 11.6
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 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 nnnnn
161
CA Easytrieve® Report Generator 11.6
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 {Y|N}
• Y
Codes are allowed.
• N
Codes are not allowed. This is the default.
SPRTXIT modname
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.
162
CA Easytrieve® Report Generator 11.6
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:
BUFNO nnn
• Limits: 0 - 255.
• Default: 2
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 xxx
163
CA Easytrieve® Report Generator 11.6
• Default: EZT
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 nnn
• Default: 20
VFMDEV {DISK|MEMORY}
• DISK
Overflows to disk. This is the default.
• MEMORY
Overflows to main memory.
164
CA Easytrieve® Report Generator 11.6
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 destination id
• Default: TERMINAL
STDERR destination id
• Default: TERMINAL
PRINTID destination id
• Default: PRINTER. If the profile definition for PRINTID routes output to the originating terminal, an error occurs.
165
CA Easytrieve® Report Generator 11.6
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:
ALTSEQU {Y|N}
• Y
Defines that the product uses an alternate sequence table.
• N
Suppresses the table. This is the default.
ALTSEQ xxxxxxxx
• Default: EZTPAQTT
SORTNAME xxxxxxxx
• Default: SORT
166
CA Easytrieve® Report Generator 11.6
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}
SORTSIZ nnnn
• Limits: 0, 16 - 4096
• Default: 0
NOTE
See the description of SORTMAX for an explanation of how to set this option.
SORTRLS nnnn
• Limits: 0 - 1024
• Default: 0
167
CA Easytrieve® Report Generator 11.6
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 nn
• nn
Specifies the number of work areas that are used by the sort.
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 xxxxx
• Default: SYSDA
SORTPRT xxxxxx
• Default: SYSOUT
168
CA Easytrieve® Report Generator 11.6
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 {D|N|A|C}
• D (Default)
Outputs the level of messages that are specified when the sort program was installed. This is the default.
• 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:
In the Configuration Manager, these options are on the SQL tab of the execution options.
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.
169
CA Easytrieve® Report Generator 11.6
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 xxxxxs
• Default: DQSPS
NOTE
See the CA Pan/SQL documentation for more changes.
PREPNME xxxxxxxx
• Default: EASYPLUS
NOTE
We recommend that you avoid using the default and specify a unique name for each user program.
170
CA Easytrieve® Report Generator 11.6
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:
In the Configuration Manager, these options are on the IDMS tab of the execution options.
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 {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.
171
CA Easytrieve® Report Generator 11.6
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 {HIGHEST|LOWEST|nnnn}
• HIGHEST
This is the default.
• LOWEST
• nnnn
Indicates specific version number.
VERREC {HIGHEST|LOWEST|nnnn}
• HIGHEST
This is the default.
• LOWEST
• nnnn
Indicates specific version number.
VERSCHM {HIGHEST|LOWEST|nnnn}
• HIGHEST
172
CA Easytrieve® Report Generator 11.6
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:
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 nnn
173
CA Easytrieve® Report Generator 11.6
• Limits: 80 - 255
• Default: 132
PAGESIZ nnnnn
• Limits: 1 to 32767
• Default: 58
DISPPAGE nnnnn
• Limits: 0 - 32767
• Default: 0 (DISPLAY statements are not tested for end of page)
SKIP nnn
TITLSKP nnn
174
CA Easytrieve® Report Generator 11.6
SPACE nnn
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 n
• Limits: 0 - 9
• Default: 3
TALYSIZ nn
• Limits: 1 - 18
• Default: 2
175
CA Easytrieve® Report Generator 11.6
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.
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 nnn
• Limits: 1 - 127
• Default: 4
DOWN nnn
176
CA Easytrieve® Report Generator 11.6
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.
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.
177
CA Easytrieve® Report Generator 11.6
International Options
This article describes the international options that you can specify in the options table:
• M (Month)
MM/DD/YY format. This is the default.
• D (Day)
DD/MM/YY format.
• Y (Year)
YY/MM/DD format.
178
CA Easytrieve® Report Generator 11.6
This is a compile-time option. You cannot override this value during program compilation.
PAGEWRD xxxxxxxxxx
• Limits: 1 - 10 characters
• Default: PAGE
• Limits: 1 to 10 characters
• Default: FINAL
• Limits: 1 to 10 characters
• Default: TOTAL
179
CA Easytrieve® Report Generator 11.6
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
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.
180
CA Easytrieve® Report Generator 11.6
Specifies the userid of the recipient of the printed output. The default is blank.
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.rpt
SYSPRINT=\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.
181
CA Easytrieve® Report Generator 11.6
Getting Started
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
• 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:
182
CA Easytrieve® Report Generator 11.6
• 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.
183
CA Easytrieve® Report Generator 11.6
Figure 3: easytrieve_program
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.
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.
184
CA Easytrieve® Report Generator 11.6
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 ...
...
Activity Section PROGRAM ...
(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.
FILE PERSNL FB(150 1800) }
EMPNAME 17 8 A }
EMP# 9 5 N } Library Section
DEPT 98 3 N }
GROSS 94 4 P 2 }
185
CA Easytrieve® Report Generator 11.6
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
Lesson 1 - Library Section, FILE and DEFINE Statements
In this lesson, we show you a sample CA Easytrieve® Report Generator program that you can enter and run on your
computer. However, you can follow the lessons in this tutorial without running the programs to learn the product.
Sample Program
This sample program has only ten lines of code, but it creates a useful report. The program also shows how some of the
most important CA Easytrieve keywords are used. In other programming languages, a more complex program would be
needed to produce the same report.
FILE PERSNL FB(150 1800)
EMPNAME 17 8 A
EMP# 9 5 N
DEPT 98 3 N
GROSS 94 4 P 2
JOB INPUT PERSNL NAME FIRST-PROGRAM
PRINT PAY-RPT
REPORT PAY-RPT LINESIZE 80
TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
LINE 01 DEPT EMPNAME EMP# GROSS
Report Output
The sample program produces the following report, which is an edited display of data from an employee file named
PERSNL.
01/31/18 PERSONNEL REPORT EXAMPLE-1 PAGE 1
186
CA Easytrieve® Report Generator 11.6
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.
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.
187
CA Easytrieve® Report Generator 11.6
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.
EMP# field EMPNAME field
┌─────┴────────┐ ┌───────────┴───────────┐
│ │ │ │ │ │ │ │ │9 │9 │9 │9 │9 │ │ │ │ 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 . . .
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:
188
CA Easytrieve® Report Generator 11.6
• 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.
189
CA Easytrieve® Report Generator 11.6
Although you can control input, CA Easytrieve can also provide automatic input capability.
Automatic Input
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.
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
190
CA Easytrieve® Report Generator 11.6
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.
DEDUCTIONS W 4 P 2
NET-PAY W 4 P 2
191
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.
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.
192
CA Easytrieve® Report Generator 11.6
A report declaration that follows the PRINT statement 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
In our sample program, the PRINT statement is placed directly after the conditional statements that we added in the
previous lesson:
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:
LINE 01 DEPT EMPNAME EMP# GROSS
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:
LINE 01 DEPT EMPNAME EMP# GROSS NET-PAY DEDUCTIONS
The program with all the changes that we have made is as follows:
FILE PERSNL FB(150 1800)
EMPNAME 17 8 A
EMP# 9 5 N
DEPT 98 3 N
GROSS 94 4 P 2
DEDUCTIONS W 4 P 2
NET-PAY W 4 P 2
IF GROSS GE 500
DEDUCTIONS = .28 * GROSS
NET-PAY = GROSS - DEDUCTIONS
ELSE
NET-PAY = GROSS
DEDUCTIONS = 0
193
CA Easytrieve® Report Generator 11.6
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.
Edit Mask
An edit mask is a pattern of characters that specifies how numeric data should appear in the report.
NOTE
Alphanumeric fields cannot have an edit mask.
For example, we have added edit masks to the three currency fields in our example program so that they print with dollar
signs:
GROSS 94 4 P 2 MASK (A '$$,$$9.99')
NET-PAY W 4 P 2 MASK A
DEDUCTIONS W 4 P 2 MASK (A BWZ)
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:
01/31/18 PERSONNEL REPORT EXAMPLE-1 PAGE 1
194
CA Easytrieve® Report Generator 11.6
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.
• 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.
195
CA Easytrieve® Report Generator 11.6
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:
FILE PERSNL FB(150 1800)
EMPNAME 17 8 A
EMP# 9 5 N HEADING ('EMPLOYEE' 'NUMBER')
DEPT 98 3 N
GROSS 94 4 P 2 MASK (A '$$,$$9.99')
NET-PAY W 4 P 2 MASK A
DEDUCTIONS W 4 P 2 MASK (A BWZ)
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
196
CA Easytrieve® Report Generator 11.6
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
In this lesson, we introduce the following statements and add them to our program:
• SEQUENCE
• CONTROL
• SUM
• HEADING
197
CA Easytrieve® Report Generator 11.6
• 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.
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:
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-PAY DEDUCTIONS
198
CA Easytrieve® Report Generator 11.6
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.
With that additional statement, gross and net pay totals are shown for each department with grand totals at the end of the
report:
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-PAY DEDUCTIONS
$3,496.16 $3,215.04
199
CA Easytrieve® Report Generator 11.6
EMPLOYEE
DEPT EMPNAME NUMBER GROSS NET-PAY DEDUCTIONS
914 $2,403.36
200
CA Easytrieve® Report Generator 11.6
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.
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:
EMPLOYEE EMPLOYEE
DEPT NAME NUMBER GROSS NET-PAY DEDUCTIONS
201
CA Easytrieve® Report Generator 11.6
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.
202
CA Easytrieve® Report Generator 11.6
This concludes the tutorial. You can now create your own standard reports using what you have learned.
Statement Area
All CA Easytrieve source statements are records of 80 characters each. The default statement area is in columns 1
through 72. You can place your CA Easytrieve code anywhere within these columns. You can indent or line up certain
statements for readability, but it is not required.
Multiple Statements
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:
COST = FIXED + VARIABLE. PRICE = COST + PROFIT
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'
203
CA Easytrieve® Report Generator 11.6
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:
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:
MASK (A BWZ '$$,$$9.99')
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
204
CA Easytrieve® Report Generator 11.6
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:
, 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'
205
CA Easytrieve® Report Generator 11.6
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'
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:
206
CA Easytrieve® Report Generator 11.6
FILE Statement
The FILE statement describes the files you are using as input to your program and any files your program creates (output)
other than reports. Enter FILE statements at the beginning of the library section.
The FILE statement has the following format:
• 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):
207
CA Easytrieve® Report Generator 11.6
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.
These types of data can have decimal positions:
208
CA Easytrieve® Report Generator 11.6
– N (Numeric)
– P (Packed)
– B (Binary)
– U (Unsigned Packed)
Specify the decimal-positions by coding an integer (0 to 18) after the data-type. For example:
AMOUNT 40 5 N 2
is a five-byte numeric field with two decimal positions.
• HEADING
You use the HEADING parameter to specify an alternative column heading for a field. (The default column heading
is the field-name.) The column heading you specify is automatically used on report output unless overridden by a
HEADING statement in the activity section.
Place the alternate column heading within single quotes. For example:
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
* Replaces leading zeros with an asterisk
- 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
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.
209
CA Easytrieve® Report Generator 11.6
• 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
Mask Result
'$$$,$$$,999 CREDIT' $12,345,678 CREDIT
'$$$,$$$,999-' $12,345,678-
'Z99,999,999-' 12,345,678-
210
CA Easytrieve® Report Generator 11.6
The indicators CREDIT and minus (-) print only if the field contains a negative value.
NOTE
The number of decimal positions can be zero (0).
WORK-DEDUCT W 4 N 2
211
CA Easytrieve® Report Generator 11.6
... | *
| REPORT REPORT1
[ LINE EMP# EMPNAME EMP-COUNT
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.
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
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:
212
CA Easytrieve® Report Generator 11.6
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.
213
CA Easytrieve® Report Generator 11.6
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
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.
214
CA Easytrieve® Report Generator 11.6
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
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.
215
CA Easytrieve® Report Generator 11.6
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.
Example of COPY Statement
216
CA Easytrieve® Report Generator 11.6
*
REPORT REPORT1
LINE NAME-FIRST NAME-LAST
JOB Activities
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:
** Library **
*
217
CA Easytrieve® Report Generator 11.6
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 #
|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
218
CA Easytrieve® Report Generator 11.6
Arithmetic Operators
These arithmetic operators are valid in conditional statements:
Operators Meaning
EQ = Equal to
NE Ø= Not equal to
GT > Greater than
GE >= Greater than or equal to
LT < Less than
LE <= Less than or equal to
• 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
219
CA Easytrieve® Report Generator 11.6
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 )
IF field-name [NOT] ( SPACE )
( SPACES )
( ZERO )
( ZEROS )
( ZEROES )
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:
220
CA Easytrieve® Report Generator 11.6
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:
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.
[ ] [ * ]
| = | | / |
221
CA Easytrieve® Report Generator 11.6
Parentheses in Calculations
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
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.
222
CA Easytrieve® Report Generator 11.6
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 |
[ ZEROES ]
This example fills all of the named fields with blank spaces.
223
CA Easytrieve® Report Generator 11.6
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.
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
224
CA Easytrieve® Report Generator 11.6
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
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.)
225
CA Easytrieve® Report Generator 11.6
DO WHILE CTR1 LT 10
CTR2 = 0
DO WHILE CTR2 LT 5
CTR2 = CTR2 + 1
Inner
** 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 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
226
CA Easytrieve® Report Generator 11.6
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.
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 }
227
CA Easytrieve® Report Generator 11.6
[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.
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
228
CA Easytrieve® Report Generator 11.6
STOP
END-IF
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
229
CA Easytrieve® Report Generator 11.6
ORDER = 'NO'
END-PROC
CODE2-RTN. PROC
ORDER = 'YES'
END-PROC
Nesting PROCs
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.
230
CA Easytrieve® Report Generator 11.6
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:
• 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
231
CA Easytrieve® Report Generator 11.6
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
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.
• 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
232
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 Statement
Use the SORT statement to specify your sorting requirements.
Syntax
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
233
CA Easytrieve® Report Generator 11.6
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]
234
CA Easytrieve® Report Generator 11.6
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.
PROGRAM Activities
You can use a PROGRAM activity for simple processing activities or to control the execution of JOB, SORT, and SCREEN
activities.
235
CA Easytrieve® Report Generator 11.6
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
236
CA Easytrieve® Report Generator 11.6
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:
237
CA Easytrieve® Report Generator 11.6
• 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:
Figure 4: Executing a Print Statement
238
CA Easytrieve® Report Generator 11.6
DISPLAY Statement
A DISPLAY statement sends data to a specified output file or output device. DISPLAY is commonly used:
239
CA Easytrieve® Report Generator 11.6
DISPLAY Format 1
Syntax
[ ] [ [ ] ]
DISPLAY [display-file-name] [{TITLE | NOTITLE}] [ [+]offset ]+
[SKIP skip-integer] [ [-] ]
[ ] [ [ ] ]
[ COL column-number ]
[ POS position-number]
[ ]
[ ] [ ]
[literal-1 ] [literal-n ]
[field-name-1] ... [field-name-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.
DISPLAY Example 1
DISPLAY Format 2
Syntax
240
CA Easytrieve® Report Generator 11.6
[ ] [ ]
DISPLAY [display-file-name] [{TITLE | NOTITLE}] HEX [file-name ]
[SKIP skip-integer] [field-name]
[ ] [ ]
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
• 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
241
CA Easytrieve® Report Generator 11.6
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
PUT NEWPAY2
PUT Example 2
*
END-IF
242
CA Easytrieve® Report Generator 11.6
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
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:
243
CA Easytrieve® Report Generator 11.6
READ Statement
The READ statement provides random access to INDEXED and RELATIVE files.
Syntax
{key-field-name}
READ file-name KEY { } [STATUS]
{'key-literal' }
• 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 **
244
CA Easytrieve® Report Generator 11.6
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.
Syntax
[ ] [ ]
WRITE output-file-name [UPDATE] [FROM input-file-name ] [STATUS]
[ADD ] [ ]
[ ]
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
245
CA Easytrieve® Report Generator 11.6
END-IF
WRITE Format 2
Use Format 2 for deleting a record.
Syntax
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
Standard Reports
The CA Easytrieve report facility includes all of the functions necessary to produce most reports very easily. Using CA
Easytrieve report options, you can produce almost any report format. Most reports, however, are variations of what is
termed the standard report. Standard reports typically consist of the following items:
• Titles
• Headings
• Lines or line groups
The following diagram shows the structure of a standard report:
<──────────────────────LINESIZE──────────────────────>
┌────────────────────────────────────────────────────┐
246
CA Easytrieve® Report Generator 11.6
│ 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:
Statements:
247
CA Easytrieve® Report Generator 11.6
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
HEADING
HEADING Heading
248
CA Easytrieve® Report Generator 11.6
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 ...þ
...
249
CA Easytrieve® Report Generator 11.6
SOCIAL ü
SECURITY SEX ý Heading
EMPLOYEE NAME NUMBER CODE þ
For more information about line item positioning, see CA IDMS Database Processing.
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.
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:
250
CA Easytrieve® Report Generator 11.6
REPORT report-name +
É ù Spacing
êSPREAD ú Control
êNOSPREAD ú + Parameters
ë û
251
CA Easytrieve® Report Generator 11.6
[NOADJUST] +
[NODATE] [NOPAGE] +
[NOHEADING] +
SPREAD TITLESKIP 4
This program produces the following report (only two pages are shown):
EXAMPLE PROGRAM
EMPLOYEE
NAME EMP# DEPT GROSS
EXAMPLE PROGRAM
EMPLOYEE
NAME EMP# DEPT GROSS
252
CA Easytrieve® Report Generator 11.6
SEQUENCE Statement
The SEQUENCE statement lets you specify the order of the lines in a report. For example, you might want reports to be in
alphabetical order by name or in numerical order by employee number.
• You can sequence on any field from any input file or any W working storage field.
• You can sequence on as many fields as your system sort permits.
• Sequence fields are stated in major to minor order.
• The default sequence order is ascending. Coding D after a field-name reverses the order for that field only.
Syntax
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 ú
ë û ë û
253
CA Easytrieve® Report Generator 11.6
• 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
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
254
CA Easytrieve® Report Generator 11.6
prints:
Statements:
255
CA Easytrieve® Report Generator 11.6
$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
256
CA Easytrieve® Report Generator 11.6
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.
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 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.
257
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])
258
CA Easytrieve® Report Generator 11.6
ADDRESS 37 39 A
ADDR-STREET 37 20 A
ADDR-CITY 57 12 A
ADDR-STATE 69 2 A
ADDR-ZIP 71 5 N
LINE 01 NAME
LINE 02 ADDR-STREET
LINE 03 ADDR-CITY ADDR-STATE
LINE 04 ADDR-ZIP
REPORT [report-name] +
[LIMIT number-of-records]
259
CA Easytrieve® Report Generator 11.6
[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.
[SUMMARY] +
[SUMFILE summary-file-name] +
É ìEVERYü ù
êDTLCTLíFIRSTý ú +
ë îNONE þ û
É ì ÉALL ù ü ù
êSUMCTL í ( êHIARú ÉDTLCOPY ù ) ý ú +
ê ï êNONEú ëDTLCOPYALLû ï ú
ë î ëTAG û þ û
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.
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 (* 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.)
260
CA Easytrieve® Report Generator 11.6
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.
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:
261
CA Easytrieve® Report Generator 11.6
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Report:
Line
Description LAST-NAME STATE ZIP PAY-NET
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 CA Easytrieve® Report Generator to produce multiple reports.
262
CA Easytrieve® Report Generator 11.6
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
[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
*
263
CA Easytrieve® Report Generator 11.6
*
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.
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
264
CA Easytrieve® Report Generator 11.6
REPORT-INPUT. PROC
The REPORT-INPUT. PROC allows for final screening and modification of report input data. It is performed for each
record selected for the report that contains the PROC.
• If you code a REPORT-INPUT procedure, then you must execute a SELECT statement in the PROC to cause data to
continue to the report.
• If a report has been sequenced, this procedure is invoked after each record is output from the system sort.
REPORT-INPUT Example
Statements:
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
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:
265
CA Easytrieve® Report Generator 11.6
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
266
CA Easytrieve® Report Generator 11.6
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
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:
267
CA Easytrieve® Report Generator 11.6
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
268
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
SMITHTX7521866666
Produce:
269
CA Easytrieve® Report Generator 11.6
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
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
ENDPAGE. PROC
END-PROC
Data:
270
CA Easytrieve® Report Generator 11.6
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
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
271
CA Easytrieve® Report Generator 11.6
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Produce:
...
╞═════════════════════════════════════════════════════════════════╡
272
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
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
Produces:
273
CA Easytrieve® Report Generator 11.6
IL 1444.32
TX 777.77
2222.09
System-Defined Fields
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.
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).
274
CA Easytrieve® Report Generator 11.6
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
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:
275
CA Easytrieve® Report Generator 11.6
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.
276
CA Easytrieve® Report Generator 11.6
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.
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
277
CA Easytrieve® Report Generator 11.6
BREAK-LEVEL
BREAK-LEVEL indicates the highest field in the break.
278
CA Easytrieve® Report Generator 11.6
Using
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.
Follow to the first line of the CA Easytrieve® Report Generator program (if not already specified):
LIST ON MACROS
279
CA Easytrieve® Report Generator 11.6
LIST FILE
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.
• 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 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.
280
CA Easytrieve® Report Generator 11.6
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
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.
281
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.
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.
282
CA Easytrieve® Report Generator 11.6
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).
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
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.
283
CA Easytrieve® Report Generator 11.6
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'
284
CA Easytrieve® Report Generator 11.6
The sample output from this program follows. Two new columns have been added: NET-PAY and DEDUCTIONS.
Edit Masks
An edit mask is a pattern of characters that specify how numeric data should be printed.
NOTE
Alphanumeric fields cannot be edited.
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:
285
CA Easytrieve® Report Generator 11.6
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
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.
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
286
CA Easytrieve® Report Generator 11.6
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:
NOTE
For more information, see the PARM Statement.
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.
287
CA Easytrieve® Report Generator 11.6
P-Code (Windows)
Unless Visual Studio is detected as being installed on your system, in Windows, your program is converted into a P-Code
file. The p-code is written to a .pco file.
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.
288
CA Easytrieve® Report Generator 11.6
Header
The header of each page of the compile listing consists of four lines:
• The first line, from left to right, contains the date and time of compile, a compiler identifier, and a page number.
• The second line contains the user ID of the person compiling the program and your company name.
• The third line is blank.
• The fourth line is the copyright of the product.
An example of a compile listing header format follows:
mm/dd/yy hh:mm:ss <easy> vv.rf yynn PAGE 1
userid your company name
Programs and all supporting materials copyright (c) 2008 CA, Inc.
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)
Macro name
• (b)
Statement number
• (c)
Statement
289
CA Easytrieve® Report Generator 11.6
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)
290
CA Easytrieve® Report Generator 11.6
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.
291
CA Easytrieve® Report Generator 11.6
//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
292
CA Easytrieve® Report Generator 11.6
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//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.
293
CA Easytrieve® Report Generator 11.6
// 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.
294
CA Easytrieve® Report Generator 11.6
//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:
//jobname JOB accounting.info
//stepname EXEC PGM=TESTPGM
//STEPLIB DD DISP=SHR,DSN=your.ezt.product.loadlib
// DD DISP=SHR,DSN=idms.loadlib
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSCTL DD DISP=SHR,DSN=cdms.sysctl
//EZOPTBL DD DISP=SHR,DSN=your.ezt110.EZOPTBL
//EZTVFM DD UNIT=SYSDA,SPACE=(4096,(100,100))
//SYSIN DD * (optional CARD input)
The following example illustrates the JCL to execute a previously compiled and link-edited CA Easytrieve program with
CA IDMS under local mode:
295
CA Easytrieve® Report Generator 11.6
296
CA Easytrieve® Report Generator 11.6
The following example illustrates the JCL necessary to execute CA Easytrieve with DB2 for z/OS using static SQL mode:
//jobname JOB accounting.info,USER=userid
//*
// SET EZTLOAD='your.ezt.product.loadlib'
// SET APPLOAD='your.ezt.application.loadlib'
// SET APPOBJ='your.ezt.application.objectlib'
// SET DBRMLIB='your.private.dbrmlib'
// SET OPTTBL='your.easytrieve.options.table'
// SET PSQLLOAD='your.pansql.loadlib'
// SET DSNLOAD='your.db2.dsnload'
//*
//* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//* STATIC PANSQL/EASYTRIEVE
//* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//*
//* Compile the EZT application program
//COMP EXEC PGM=EZTPA00
//STEPLIB DD DISP=SHR,DSN=&EZTLOAD
// 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 ...
/*
//*
//**********************************************************
//*
//* STEP B: GENERATE A COMMAND PROGRAM
297
CA Easytrieve® Report Generator 11.6
298
CA Easytrieve® Report Generator 11.6
// UNIT=SYSDA,DCB=BLKSIZE=80,
// SPACE=(TRK,(1,1,1))
//SYSUT1 DD DSN=&&SYSUT1,UNIT=SYSDA,
// SPACE=(TRK,(10,5))
//SYSPUNCH DD DUMMY
//SYSPRINT DD SYSOUT=*
//**********************************************************
//*
//* STEP E: BIND AND GRANT AUTHORIZATION TO THE
//* COMMAND PROGRAM'S APPLICATION PLAN
//*
//**********************************************************
//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)
BIND PACKAGE(myplanname) MEMBER(myplanname) VALIDATE(RUN) -
ACT(REPLACE) ISOLATION(CS)
BIND PLAN(myplanname) PKLIST(myplanname.*) -
ACT(REPLACE) ISOLATION(CS)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIA10) -
LIB('db2.RUNLIB.LOAD')
END
/*
//SYSIN DD *
GRANT EXECUTE ON PLAN myplanname TO PUBLIC;
/*
//* Link-edit the EZT application program and DB2 plan
//LKEDEZT EXEC PGM=IEWL,COND=(0,NE,COMP),PARM=(LIST,XREF,REUS)
//SYSPRINT DD SYSOUT=*
//MYOBJ DD DISP=SHR,DSN=&APPOBJ
//SYSLIN DD *
INCLUDE MYOBJ(myeztpgmname)
INCLUDE MYOBJ(myplanname)
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
299
CA Easytrieve® Report Generator 11.6
//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))
//
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
300
CA Easytrieve® Report Generator 11.6
Refer to your IBM DB2 guides for a detailed explanation of these parameters.
301
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
-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.
302
CA Easytrieve® Report Generator 11.6
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:
303
CA Easytrieve® Report Generator 11.6
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.
– g (UNIX, Linux/PC and Linux for zSeries only)
CA Easytrieve Assembler generator.
– a (UNIX, Linux/PC and Linux for zSeries only)
Assembler (as).
– l (UNIX, Linux/PC and Linux for zSeries only)
Linker (ld).
Note: Some ezt parameters can specify the above linker parameters in a more efficient way. For example, you can
specify W l, N as -N.
• Syntax Check Only Parameter (-x)
304
CA Easytrieve® Report Generator 11.6
The syntax check only parameter (-x) tells ezt to only check CA Easytrieve programs for syntax and semantic errors.
No output files (other than the optional listing file) are generated.
• Linker Runtime Null Pointer Check Parameter (-z) (UNIX, Linux/PC and Linux for zSeries only)
The linker runtime null pointer check parameter (-z) enables the linker to check for references to location zero in
storage. You can specify this parameter to enable null pointer checking in any c programs that are linked in with your
CA Easytrieve program (including the CA Easytrieve runtime program). This parameter is passed directly to ld.
• Linker Runtime Disable Null Pointer Check (-Z) (UNIX, Linux/PC and Linux for zSeries only)
The linker runtime disable null pointer check parameter (-Z) allows the linker to reference location zero in storage. You
can specify this parameter to allow null pointer references in any c programs that are linked with your CA Easytrieve
program. This parameter is passed directly to ld.
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.
305
CA Easytrieve® Report Generator 11.6
For example, if you previously compiled the program browse.ezt with the following command:
ezt -c browse.ezt
You can link edit the program by typing the following command:
ezt -o browse browse.o
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:
warning: xxxx architecture of input file `program.o' is incompatible with yyyy output
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
For a Linux for zSeries environment, add the following switch:
-W a,-m31
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.
306
CA Easytrieve® Report Generator 11.6
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
• For Oracle, specify:
-lclntsh
• For DB2, specify:
-ldb2
• For ODBC, specify:
-lodbc
• For C-ISAM, specify:
-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).
307
CA Easytrieve® Report Generator 11.6
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.
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:
DECLARE program-name PROGRAM DYNAMIC
...
CALL program-name USING parameters
...
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...
308
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:
cc -c +z cos.c sin.c tan.c
2. Use the following command to link-edit the shared library:
ld -b -o cos cos.o sin.o tan.o
3. Use the following command to define additional links for the other subroutines:
ln cos sin
ln cos tan
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:
DECLARE program-name PROGRAM DYNAMIC
...
CALL program-name USING parameters
...
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
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.
309
CA Easytrieve® Report Generator 11.6
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:
cl -c cos.c sin.c tan.c
2. Use the following command to link-edit the DLL:
link /dll /out:funcs.dll cos.obj sin.obj tan.obj
Execute a Program
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.
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.
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.
310
CA Easytrieve® Report Generator 11.6
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.
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.
311
CA Easytrieve® Report Generator 11.6
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.
For more information about how to set the variable, see Workbench Utilities.
312
CA Easytrieve® Report Generator 11.6
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:
313
CA Easytrieve® Report Generator 11.6
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.
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.
[X:B nn:D nn:I nn]
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.
For example, specify the following to indicate that the file has one primary and two alternate keys.:
B = 4
I = (512 / 4) + 3 * 16
I = 128 + 48
I = 176
This means that the memory usage for the index buffers for the file will be:
4K * 176 blocks or 704K
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:
314
CA Easytrieve® Report Generator 11.6
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 IPERSNL INDEXED F(150) SYSNAME 'JPERSNL[X]' CREATE KEY EMPNO
EMPNO 9 5 N
File Descriptor
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.
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
315
CA Easytrieve® Report Generator 11.6
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.
316
CA Easytrieve® Report Generator 11.6
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.
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.log
export CISAMLOG
Display Order
The order in which printed output is displayed with the Report Display Facility is:
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.
317
CA Easytrieve® Report Generator 11.6
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.
Lines x to y of z
The third line is used to indicate how many report lines are currently displayed on the panel: out of z number of lines,
lines x through y are displayed. This line can be temporarily overlaid with error messages regarding commands you have
entered.
Error Messages
Any error messages issued by CA Easytrieve Report Generator are also displayed on the third line of the panel. Error
messages can overlay the Lines x to y of z display.
More Indicator
The third line contains the More: indicator. The More: indicator tells you that there are more report lines or columns than
can currently be displayed on the panel. One of the following symbols can be displayed after More:.
Symbol Meaning
< indicates more report columns to the left
> indicates more report columns to the right
- indicates more report lines backward or above
+ indicates more report lines forward or below
318
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.
319
CA Easytrieve® Report Generator 11.6
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
Moves to the top of the report. Same as the top command.
• csr/cursor
Shifts the report line at the cursor to the top of the panel.
If you do not specify a scroll amount, the amount displayed in the Scroll field is used.
You can use F7 in place of the backward command.
Bottom
The bottom command moves to the bottom of the report.
You can use F23 in place of the bottom command.
Cancel
The cancel command terminates the display of the report. More reports may follow. The cancel and exit commands are
synonymous.
You can use F12 in place of the cancel command.
Exit
The exit command terminates the display of the report. More reports may follow. The exit and cancel commands are
synonymous.
You can use F3 in place of the exit command.
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.
320
CA Easytrieve® Report Generator 11.6
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.
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.
321
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 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.
322
CA Easytrieve® Report Generator 11.6
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.
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.
323
CA Easytrieve® Report Generator 11.6
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
4. Enter .pco as the Extension and click OK.
When a web browser executes a P-Code file in a web browser, the interpreter executes using the name of the P-Code file
as input and has access to simple parameters.
Basic Execution
You can now perform basic execution of your program. The following example shows a simple program called echo.ezt,
compiled into echo.pco in a directory on your web server (that is, http://myserver.com):
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").
324
CA Easytrieve® Report Generator 11.6
#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));
}
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
325
CA Easytrieve® Report Generator 11.6
Output
A CGI program outputs its result by sending the data to the standard output device (stdout); however, you must output in a
specific format.
The most common format is HTML text. You can use the HTML extended printer included with CA Easytrieve® Report
Generator. For more information, see Extended Reporting. The printer is configured to provide the basic format required
by CGI processing. A CGI program must begin its output with the string Content-type: text/html, followed by two new lines.
Any valid HTML can follow.
The data is sent using this extended printer to the system stdout device by using SYSNAME 'stdout':
<html>
<head>
<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.
326
CA Easytrieve® Report Generator 11.6
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.
327
CA Easytrieve® Report Generator 11.6
328
CA Easytrieve® Report Generator 11.6
329
CA Easytrieve® Report Generator 11.6
etaltseq -b -l >eztpaqtt.def</dev/null
Windows:
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
330
CA Easytrieve® Report Generator 11.6
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 )
octal_literal 0 prefixing a triple of octal digits ( 0..7 )
decimal_literal Sequence of digits not starting with 0
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:
331
CA Easytrieve® Report Generator 11.6
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
.
.
.
0x30313233 0x34353637 0x38393A3B 0x3C3D3E3F // 3
.
.
.
// 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:
332
CA Easytrieve® Report Generator 11.6
Printer Definition is a process that converts a set of user supplied printer characteristics into a Printer Set Definition.
Report Printing is a process that formats reports from user supplied report specifications and prints the reports on printers
whose characteristics are defined in a printer set definition.
Configuration Manager
The CA Easytrieve® Report Generator Configuration Manager is a Windows graphical tool that helps you create your
printer definition.
Printer Definition
Printer Definition is a process that converts a set of user supplied printer characteristics into a printer set definition.
The following graphic illustrates the printer definition components:
333
CA Easytrieve® Report Generator 11.6
Printer Support
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.
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
334
CA Easytrieve® Report Generator 11.6
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
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:
335
CA Easytrieve® Report Generator 11.6
There are certain characteristics regarding particular printers that you must consider when determining the unit of
measure. These characteristics are:
– The definition of the height and width characteristic of a font can only be accurate to two decimal positions. If a font
requires greater accuracy, then you must re-evaluate the unit of measure.
– For printers that are "All Points Addressable" (such as the IBM 3800 Model III and VIII, and the IBM 3820), positions
must be assigned to print items in terms of the unit of measure known by that printer. These printers require control
information (item positioning, item sizes, page sizes, and line sizes) in one unit of measure (for example, PELs).
To meet these requirements, you must use the same unit of measure to define the printer characteristics that the
options module identifies.
For example, if you define all the fonts in terms of a number of points, then the Reporting Environment cannot
support a printer that supports PELs as the unit of page addressing. The Reporting Environment positions items
on a page by using values that are multiples of points, but the printer interprets these values as a number of PELs.
This produces incorrect results. Therefore, for "All Points Addressable" printers, the Reporting Environment restricts
the selection of the unit of measure to the unit used to address positions on the page of a report.
– Some printers require values to be merged with the printer function code. These printers use this value for Paper
Control Codes (Carriage Control) where the amount of vertical space to be skipped is defined as a multiple of a
certain unit of measure.
For example, the SHOWA SP-7, SP-8, and the MELCOM 8250 all require the skip amount be defined in terms
of a number of points. For printers having this characteristic, the unit of measure selected to define the other
characteristics of the printer must be the same. Using more than one unit of measure causes the printer to interpret
the value the Reporting Environment merges by a unit of measure different from the one with which it was defined.
• Font Size
As illustrated earlier in the diagram for units of measure, a variety of units of measure can define a printer's
characteristics. From the Reporting Environment point of view, any unit of measure is fine. To simplify the discussion
of fonts, assume a standard unit defines a font's width (W-unit) and another defines a font's height (H-unit). Therefore,
independent of the 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.
336
CA Easytrieve® Report Generator 11.6
An important reference line in any font definition is the baseline. The definition of the baseline changes between
printers. The more commonly accepted definition of a baseline is an imaginary line supporting the bottom of capitals. In
the Reporting Environment, the baseline is an imaginary line supporting the bottom of character cells. The formatting
of a print line containing a mixture of fonts is based on the positioning of the bottom of each character's cell on that
baseline. The amount of vertical space between one print line and the next is the vertical distance between baselines.
This distance is the height of a line.
• Height
A font's height is the amount of vertical space (in H-units) that a printed character occupies. This means that the height
of the font is the height (in H-units) of the character cell associated with the font.
Some printers are able to adjust the vertical position of a font. These printers can move the base of the character cell
up or down a number of H-units from the baseline. You can incorporate this adjustment into the printer control codes
associated with a font. The Reporting Environment supports the definition of an adjust vertical position font, but you
must make the appropriate adjustment to the height to compensate for the font's movement.
• Upward Adjustment
For Upward Adjustment, the height of the font must include the adjustment amount. The reason is that the height of the
font is equal to the height of the character cell plus the amount of vertical adjustment. Therefore, an upward adjustment
is like extending the length of a character's cell. If the font's height is not adjusted up, there exists the possibility of
generating a vertical line feed that would be too small to include the upward adjustment.
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 an upward adjustment of 4 points, then you would have to define the height of the font as 16.
You define the height of the font on the FONT specification. For more detailed information see Font Characteristics.
• 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
337
CA Easytrieve® Report Generator 11.6
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)
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
338
CA Easytrieve® Report Generator 11.6
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.
339
CA Easytrieve® Report Generator 11.6
340
CA Easytrieve® Report Generator 11.6
Basic Printing
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:
Figure 11: Basic Print Record
The length of print data is limited by the amount of data that can be displayed by the particular printer.
Line Printers
This section describes the types of line printers.
ANSI Characters
A common modification to the process of basic printing (as discussed earlier) is to prefix each line of data with a Print
Control Character (PCC). This print control character is often referred to as an ANSI carriage control, or ASA character.
The control character tells the printer how to print this information. The standard control characters (given in EBCDIC) are
explained in the following table.
341
CA Easytrieve® Report Generator 11.6
X'60' C'-' The printer will skip two lines before printing
the next line of data. This will cause the
output to appear as triple spaced.
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.
Point Skip
For Line Mode printers that do not support FCB, ANSI paper control codes, or machine control codes, Point Skip codes
are used to achieve vertical spacing. With this method, the Reporting Environment will generate a vertical spacing value
using the PSNEWPAGE and PSNEWLINE values. For more information on these values, see Using the Configuration
Manager.
Print Data
The format of print data that contains a Carriage Control (CC) is illustrated below:
342
CA Easytrieve® Report Generator 11.6
Most z/OS users are required to tell JES that the output contains an ASA or ANSI carriage control character
(DCB=RECFM=FA).
DOS/VSE users must code the presence of the ASA character into the DTFPR. The Reporting Environment does this.
Overprint Codes
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:
Figure 13: Print Data with Overprint Code
343
CA Easytrieve® Report Generator 11.6
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.
• 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.
344
CA Easytrieve® Report Generator 11.6
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.
345
CA Easytrieve® Report Generator 11.6
The following blocks illustrate the format of the data immediately prior to being combined onto the single print line. Printers
that support the Print Overprint technique prepare or image each print record independently. Although the following three
blocks are destined for the same print line, they have been separated for the purpose of this illustration.
Figure 16: Data format prior to Being Combined (2)
346
CA Easytrieve® Report Generator 11.6
To overcome the problem of characters overlaying one another, the Reporting Environment 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. The Reporting Environment 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. 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.
Figure 17: Print Records - Five
The following blocks illustrate the format of the data immediately prior to being combined onto the single print line. Printers
that support the Print Overprint technique prepare or image each print record independently. Although the following three
blocks are destined for the same print line, they have been separated for the purpose of this illustration.
347
CA Easytrieve® Report Generator 11.6
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 19: Format of Print Data with Function Codes
348
CA Easytrieve® Report Generator 11.6
Print Data
The format of print data that contains both overprint and function codes are 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.
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.
349
CA Easytrieve® Report Generator 11.6
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:
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 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:
350
CA Easytrieve® Report Generator 11.6
Printer Type
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).
351
CA Easytrieve® Report Generator 11.6
Page Printers
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.
352
CA Easytrieve® Report Generator 11.6
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
353
CA Easytrieve® Report Generator 11.6
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:
Figure 23: Structure of Print Records Supported by Function Code Printers
354
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 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.
355
CA Easytrieve® Report Generator 11.6
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.
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.
356
CA Easytrieve® Report Generator 11.6
The following blocks illustrate the format of the data immediately before being combined onto the single print line. Printers
that support the print overprint technique prepare or image each print record independently. Although the following three
blocks are destined for the same print line, they have been separated for the purpose of this illustration.
357
CA Easytrieve® Report Generator 11.6
Figure 27: Data Format prior Combination onto Single Print Line
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.
358
CA Easytrieve® Report Generator 11.6
The following blocks illustrate the format of the data immediately before being combined onto the single print line. Printers
that support the print overprint technique prepare or image each print record independently. Although the following three
blocks are destined for the same print line, they have been separated in this illustration.
Figure 29: Data format prior to Being Combined
359
CA Easytrieve® Report Generator 11.6
Page Printers
Page printers use structured fields to support "All Points Addressable" printing.
NOTE
CA Easytrieve currently does not support page printers.
360
CA Easytrieve® Report Generator 11.6
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
361
CA Easytrieve® Report Generator 11.6
The line counter value is always rounded up to give the maximum displacement down a page.
362
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:
363
CA Easytrieve® Report Generator 11.6
Print Records
Print data sets consist mainly of print records. Each print record that the extended reporting facility builds can contain up
to four components:
• Carriage Control -- The Carriage Control code always starts the record.
• Overprint Code -- The Overprint Code is only required for printers that use multiple print records to support mixed fonts
on one print line. If required, this code always follows the Carriage Control code.
• Function Codes -- If a printer requires special control codes in the print record to identify different fonts and data types,
then CA Easytrieve mixes Function Codes with Print Items in the print record. Function Codes are not present for
printers that do not require such control information.
• Print Items -- Print Items include fields and literals that contain the data for the final print line. When the printer requires
Function Codes, CA Easytrieve mixes print items with Function Codes in the print record. If the printer does not require
Function Codes, the print record only contains Print Items.
364
CA Easytrieve® Report Generator 11.6
The maximum length of a print record is the maximum record length of the print data set that receives the record. A
runtime error occurs if a print record exceeds that size. This error stops the execution of the program and results in the
printing of an error message.
File Format
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:
Figure 33: Print Data 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.
365
CA Easytrieve® Report Generator 11.6
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
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.
366
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.
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).
367
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:
Figure 35: CA Easytrieve Font Identifier
Overprint Code
If the extended reporting printer supports Overprint Codes, all of the fonts associated with that printer must include the
Overprint Code. The FONT specification defines the overprint code.
Space Replacement
For printers that support Overprint Codes and use the Merge Overprint technique to combine print records, the space
character is important.
The reason that the space is important is best demonstrated by an example. In the following diagram, a CA Easytrieve®
Report Generator DISPLAY statement builds a print line containing three literals. The first and third literals are to be output
as 7 point characters and the second is to be output at 9 point. Assuming the printer supports Overprint Codes and uses
the Merge Overprint technique, CA Easytrieve® Report Generator builds two print records. The following diagram also
demonstrates these records and the resultant print line. Note the way that spaces in the first print record are replaced
by non-blank characters in the second. Note also that a space in all the print records prints a space whose size is that
defined by the font of the first print record.
368
CA Easytrieve® Report Generator 11.6
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:
369
CA Easytrieve® Report Generator 11.6
The previous diagram illustrates that a space in the second literal results in the character being positioned on the print line
using the 7 point space (as opposed to the 9 point space that was requested for the print item). The result of this process
is demonstrated by comparing the print line produced by this diagram with the following diagram.
370
CA Easytrieve® Report Generator 11.6
The previous example illustrates that the size of the second character in the second literal coded on the DISPLAY
statement now prints at 9 point (as opposed to the space character in the previous example that printed at only 7 point).
The presence of the space in the literal (as opposed to a non-blank character) causes the characters that follow the space
character to shift left 2 points on the print line. This is not an error but a feature of the printer. CA Easytrieve® Report
Generator cannot prevent this from occurring. CA Easytrieve® Report Generator does compensate for spaces between
print items. CA Easytrieve® Report Generator does not compensate for spaces occurring within a print item. There are
three approaches that you can use to solve this problem.
1. Ensure that the fonts being mixed on one print line all have the same W-unit width.
2. Ensure that any field or literal that occurs on a print record other than the first does not contain spaces.
3. Define an alternative space within each font set that CA Easytrieve® Report Generator uses. Nothing prohibits
you from modifying a font set to replace one of the unused graphic characters with a space character. Once this
replacement space has been assigned to a font defined in the extended reporting options module, CA Easytrieve®
Report Generator automatically scans the contents of each field or literal that uses this font. The scan occurs after CA
Easytrieve® Report Generator moves the field or literal to the print record. The scan replaces all occurrences of the
normal space character with the replacement space. This ensures correct spacing on the report.
Line Complexes
A special printing feature of some extended reporting printers is the ability to define Line Complexes. For example, the
IBM 3200 and the HITACHI 8196 support the ability to expand a print item across multiple lines (2 or 4). This means that
the print items height is multiplied by the number of lines that the print item includes but its width remains the same. The
best way to describe a Line Complex is by a diagram.
As shown in the following diagram, a print item involved in a line complex must be included in all of the print records that
generate the print lines that the Line Complex covers. For a two line Line Complex, the print item must be included in the
371
CA Easytrieve® Report Generator 11.6
two print records that are combined to form the line complex. For four line complexes, the print item must be included in
four print records.
A font defined for an extended reporting printer that supports Line Complexes can include the Line Complex attribute.
CA Easytrieve® Report Generator then positions the print item assigned to such a font on the appropriate number of print
lines. It 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.
372
CA Easytrieve® Report Generator 11.6
373
CA Easytrieve® Report Generator 11.6
• Merant PVCS
• Microsoft Visual SourceSafe
The Workbench can support one or more of these products using a common interface, which, for typical source control
functions, masks the differences between the products.
All product names referenced herein are trademarks of their respective companies.
This article includes the following information:
Merant PVCS
To use this product for Source Control Management, Merant PVCS Version Manager 5.2.10 or higher and the PVCS
Version Manager Interface to Microsoft Development Environments V4.0 are required.
Verify correct installation by invoking the PVCS Version Manager.
The Workbench PVCS interface allows complete access to typical PVCS functions, including: file management, reports
and the PVCS Version Manager. Administrative and other functions not supported by the Workbench's File Source Control
menu must be performed via the PVCS Version Manager.
374
CA Easytrieve® Report Generator 11.6
375
CA Easytrieve® Report Generator 11.6
NOTE
Remember to save new applications when you close the application or exit the Workbench. Click Yes when
prompted to save the changes.
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:
– 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.
376
CA Easytrieve® Report Generator 11.6
Workbench
The CA Easytrieve Workbench is a Windows application that lets you build, run, and debug CA Easytrieve Report
Generator programs.
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
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 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
377
CA Easytrieve® Report Generator 11.6
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
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.
378
CA Easytrieve® Report Generator 11.6
• 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
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.
379
CA Easytrieve® Report Generator 11.6
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.
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
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.
380
CA Easytrieve® Report Generator 11.6
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.
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.
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.)
381
CA Easytrieve® Report Generator 11.6
Open Files
Use either of the following methods to open a file:
• Select the file in the Workbench Explore window.
• Click File, Open. Select the file and click OK.
Save a File
Use any of the following methods to save your files:
• To save the file in the active edit window, click File, Save. Otherwise, close the active file. You are prompted to save.
• To save all files in open edit windows, click File, Save All.
• To automatically save open files at a specified time interval, click Options, File Save. Specify the time interval and
select the Enable Auto Save box.
NOTE
You can only save an analysis file (.CVX) as a text file (.TXT) while in text view using File Save As.
382
CA Easytrieve® Report Generator 11.6
• To print the Tree View of a program, make the Tree View the current window and select File Print. You can also print
Text views.
• To print an individual file definition or procedure of a program, open a WorkSheet window on the portion that you want
to print. For example, double-click a procedure name to open a WorkSheet showing just that procedure, and then
select File Print.
For information about the Print dialog, press F1 help.
Use Applications
Applications let you:
• Use a single command to load and open a series of files, or load and open selective files from the file list.
• Set compile, debug, and source control manager options for each application, so that switching among applications
automatically invokes the specific environment, options, and settings appropriate to it.
• Monitor any program in an application file list during a debug session, without having to first open the file. Instead, you
can simply select it from the file list.
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.
383
CA Easytrieve® Report Generator 11.6
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.
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.
384
CA Easytrieve® Report Generator 11.6
• Select a project
• Check in a file
• Create new archives
• Check out a file
• Cancel a check-out
• Run various reports, such as history or differences
To invoke the source control manager, click File, Source Control, Source Control Manager.
NOTE
To use the Source Control commands to manage your applications, you must first create the appropriate project
for the selected source control manager and then define a CA Easytrieve Report Generator application.
Select a Project
Before you select a project, open the application that uses these project files. This automatically associates the
appropriate source control manager project with your application. When you open that application later, the related source
control manager project is also opened.
Follow these steps:
1. Click File, Source Control, and select Select Project.
The specified source control manager is invoked and the Select Project dialog is displayed. This dialog displays only
projects that were previously defined to your source control manager. You must use the source control manager
directly to create a project; CA Easytrieve Report Generator has no means to create projects.
2. Use the dialog to select a project, and click OK to return to the Workbench.
See the documentation for your source control manager for more information.
385
CA Easytrieve® Report Generator 11.6
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.
386
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. 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.
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.
387
CA Easytrieve® Report Generator 11.6
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.
388
CA Easytrieve® Report Generator 11.6
• 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.
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.
389
CA Easytrieve® Report Generator 11.6
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.
390
CA Easytrieve® Report Generator 11.6
• 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:
391
CA Easytrieve® Report Generator 11.6
• 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.
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 Change the Color of Compile Errors in Set Preferences.
392
CA Easytrieve® Report Generator 11.6
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.
Debug Programs
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:
393
CA Easytrieve® Report Generator 11.6
• 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.
394
CA Easytrieve® Report Generator 11.6
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.
395
CA Easytrieve® Report Generator 11.6
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.
• 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
(Light Blue) session has not been initiated.
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.
396
CA Easytrieve® Report Generator 11.6
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.
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.
397
CA Easytrieve® Report Generator 11.6
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:
• Use the Line Number Margin pop-up menu
• Select the line or data item and use the Debug Breakpoints command
• Tag verbs, then set breakpoints on all the lines with tagged verbs.
Set a Breakpoint Using the Line Number Margin Pop-up Menu
Follow these steps:
1. Click the right mouse button in the line number margin at the line where you want to place the breakpoint. The pop-up
menu above appears.
2. Choose Set Unconditional, Set Conditional, Run to Here, or Set Next Line to set a breakpoint. Press F1 with the cursor
on the command for a description of the command.
Set a Conditional Breakpoint From a Data Item in the Statement
Follow these steps:
1. Click the right mouse button on the data item where you want to set the conditional breakpoint. You cannot set
unconditional breakpoints from the pop-up menu.
2. Choose Set Conditional to set a breakpoint. This selection is available only when a current value exists for the data
item.
3. Set Conditional displays the Set Conditional Breakpoint dialog. After you set a conditional breakpoint, the background
color turns to yellow if you are using the system default options for color.
Set a Breakpoint Using the Debug Breakpoints Menu
Follow these steps:
1. Click the line number margin with the left mouse button to select the statement where the breakpoint is to be placed.
2. Select the Debug menu and choose Breakpoints. Then choose Set Unconditional or Set Conditional to set a
breakpoint:
398
CA Easytrieve® Report Generator 11.6
– Set Unconditional places an unconditional breakpoint at the line you have pointed to. After you set an unconditional
breakpoint, the background color turns to red if you are using the system options for color.
– Set Conditional displays the Set Conditional Breakpoint dialog. After you set a conditional breakpoint, the
background color turns to yellow if you are using the system options for color. See Setting Conditional breakpoints
next.
3. Alternatively, you can select the Debug menu and choose Run to Line to set a temporary breakpoint, or Set Next Line
to set the line where the program resumes execution.
399
CA Easytrieve® Report Generator 11.6
Click the arrow for Operators. Select the test to be made from among the relational operators in the display.
Seven operators are available. All of the operators are binary, except for CHG, which is unary. Descriptions are provided
in the following table.
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).
400
CA Easytrieve® Report Generator 11.6
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.
401
CA Easytrieve® Report Generator 11.6
A of B
Terminating a Session
After you have finished debugging your program you can initiate a new session, end your debugging session, or terminate
the existing session. Initiating a new session causes the existing session state to be maintained so that monitored
402
CA Easytrieve® Report Generator 11.6
programs are still monitored. Terminating a session, on the other hand, removes all breakpoints and drops monitoring
for all monitored programs. Terminating a session is a convenient way to remove all breakpoints and drop all monitored
programs.
Alternatively, you can choose to completely end a debugging session. To end the session, select the Debug menu, then
Session, and choose End. The debugger terminates the application, the application window is closed, and all programs
are dropped. This completely shuts down the debugger. Ending a session is appropriate if you think that you will no longer
be debugging since it frees Windows and memory resources.
In some cases, such as when the program is waiting for a keystroke, you must respond to the prompt and then halt the
program. Then you can end the debug session.
After you select Debug, then Session, and choose Terminate, the status light turns black and the Step button changes to
Initiate. All monitored programs are dropped and all of their breakpoints are removed. The Debugger Session Identifier
disappears from the title bars of all monitored programs as they are dropped from monitoring.
Set Preferences
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.
403
CA Easytrieve® Report Generator 11.6
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.
Compile Feedback
You can select the compiler messages that you want to be displayed. You can also change the text and background colors
for the source line and compiler messages.
Follow these steps:
1. Click Options, Compile Feedback.
The Compiler Feedback Colors dialog opens.
2. Select the compiler messages that you want to display.
3. Change the source line and message colors as needed.
4. Click OK.
404
CA Easytrieve® Report Generator 11.6
Reload
You can control how the product refreshes files when they have been modified by a background task.
Follow these steps:
1. Click Options, Reload.
The Reload Options dialog opens.
2. Select the following options:
– Source Files
This option controls how source files are processed.
Select one of the following options:
• Automatically Refreshed—Files are refreshed (reloaded) if they are altered by another task.
• Never Refreshed—Files are never refreshed.
• Prompt for Refresh—Files are refreshed after prompting.
– Analysis (.CVX) Files
This option controls how Analysis (.CVX) files files are processed. Analysis files are in effect altered whenever a
background compile is done. However, if you are doing a complex navigation or analysis on the currently opened
analysis file, you may not want the file to be refreshed in the middle of what you are doing.
Select one of the following options:
• Automatically Refreshed—Files are refreshed (reloaded) if they are altered by another task.
• Never Refreshed—Files are never refreshed.
• Prompt for Refresh—Files are refreshed after prompting.
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
405
CA Easytrieve® Report Generator 11.6
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.
Configuration Manager
The Configuration Manager tool in the Workbench lets Windows users create, view, and modify the Options Table and
Printer Set Definition (PSD).
406
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)
407
CA Easytrieve® Report Generator 11.6
a. Click the plus box for the options table that you are defining to show the links. The links are compiler, execution,
report, mask, international, and profile.
b. Click the link in the left pane to display the options page you want to modify.
c. Select the appropriate options on the page. See the following sections for option details.
d. Click Apply to save the changes.
e. Repeat steps b through d for each option page.
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.
408
CA Easytrieve® Report Generator 11.6
409
CA Easytrieve® Report Generator 11.6
410
CA Easytrieve® Report Generator 11.6
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.
411
CA Easytrieve® Report Generator 11.6
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).
412
CA Easytrieve® Report Generator 11.6
413
CA Easytrieve® Report Generator 11.6
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:
• 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.
414
CA Easytrieve® Report Generator 11.6
• 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).
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.
415
CA Easytrieve® Report Generator 11.6
416
CA Easytrieve® Report Generator 11.6
417
CA Easytrieve® Report Generator 11.6
Rename a Font
Follow these steps:
1. Right-click the font icon.
The Rename Font pop-up button appears.
2. Click Rename Font.
The New Font dialog appears.
3. Enter the new number and width of the font and click OK.
Delete a Font
Follow these steps:
1. Right-click the font icon.
The Delete Font pop-up button appears.
2. Click Delete Font.
418
CA Easytrieve® Report Generator 11.6
(Optional) Enter the number of lines that the printer supports the font as a line complex. If specified, identifies that
the reporting printer supports the reporting font as a Line Complex. A line complex supports printing a print element
across multiple print lines on a report.
Enter one of the following values:
• 2—If the reporting font supports a Two Line line complex.
• 4—If the reporting font supports a Four Line line complex.
– Space Replace Character
(Optional) Enter the 1-byte character that is used to replace occurrences of X'40' in the print data element that is
associated with the font. This can only be specified when the reporting printer is a line printer with an overprint
attribute of merge.
4. Specify the following properties in the Font Header section:
– Printer Control Code
Enter the font header printer control code that is sent to the printer to accomplish printing.
– Merge Operation 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
5. In the Printer Control Code field of the Font Trailer section, enter the font trailer printer control code that is sent to the
printer to accomplish printing.
6. In the Printer Control Code field of the Overprint Printer section, enter the printer control code overprint code that
identifies the font to a printer. Data is formatted onto a print record with the specified opcode printer control code at the
beginning of the print record.
NOTE
This option is only used if the printer is set to OVERPRINT.
7. Do one of the following actions:
– Click Apply to save the changes.
– Click Reset to undo the changes.
419
CA Easytrieve® Report Generator 11.6
Mainframe Considerations
If the destination system of the ftp is a z/OS mainframe, follow these steps before executing the FTP:
1. After building the Printer Set Definition file, make a note of the size of the file that is generated on the PC.
2. On the target mainframe, go to the =3.2 screen in TSO and allocate the hlq.EZTXRPSD file with the Block Size/
Record Length (they are the same value) equal or greater than the size of the PC file. The file is a fixed-length,
unblocked file. The SPACE for the file should be three blocks of the size that is used above.
The resulting file on the mainframe must be specified on the EZTXRPSD DD statement in the compilation JCL that is
used to compile the CA Easytrieve Report Generator program that references a printer that is defined in that Printer Set
Definition file.
Sample Printers
This section explains the sample printer definitions included with CA Easytrieve Report Generator.
Supported Formats
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.
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
420
CA Easytrieve® Report Generator 11.6
Workbench Explore
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.
421
CA Easytrieve® Report Generator 11.6
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.
422
CA Easytrieve® Report Generator 11.6
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.
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.
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.
423
CA Easytrieve® Report Generator 11.6
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.
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.
424
CA Easytrieve® Report Generator 11.6
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.
425
CA Easytrieve® Report Generator 11.6
To abort a transfer
Click the abort button.
To save a file
Do one of the following:
• Click Save.
The file is automatically uploaded to the host.
• Select File, Save As.
Choose your directory to save a local copy of the file.
426
CA Easytrieve® Report Generator 11.6
427
CA Easytrieve® Report Generator 11.6
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.
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.
428
CA Easytrieve® Report Generator 11.6
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.
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.
429
CA Easytrieve® Report Generator 11.6
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
430
CA Easytrieve® Report Generator 11.6
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.
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.
431
CA Easytrieve® Report Generator 11.6
432
CA Easytrieve® Report Generator 11.6
– The profile that is used for all of the programs or files that are contained within the subdirectory of the currently
loaded program or file
– The profile of the last subdirectory used
Workbench Utilities
CA Easytrieve Report Generator has several tools and utilities accessible from the File, Tools, and Options menus
including:
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
433
CA Easytrieve® Report Generator 11.6
FILE CONVDATA { F(lrecl) | V(lrecl) | FB(lrecl), blksiz) | VB(Lrecl, blksiz) } %MACNAME PROGRAM
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.
434
CA Easytrieve® Report Generator 11.6
435
CA Easytrieve® Report Generator 11.6
436
CA Easytrieve® Report Generator 11.6
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.
437
CA Easytrieve® Report Generator 11.6
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.
438
CA Easytrieve® Report Generator 11.6
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.
439
CA Easytrieve® Report Generator 11.6
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.
440
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
This optional parameter specifies the script that is to be invoked in response to the MenuItem being selected.
Run Program
441
CA Easytrieve® Report Generator 11.6
– 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:
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.
442
CA Easytrieve® Report Generator 11.6
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
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:
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.
443
CA Easytrieve® Report Generator 11.6
Start R2SCRIPT
To start the script interpreter, use either of the following techniques.
Custom Tools Menu File
From your custom Tools Menu file, specify the name of the script at the end of a MenuItem or SubMenuItem statement.
Example 1:
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.
444
CA Easytrieve® Report Generator 11.6
445
CA Easytrieve® Report Generator 11.6
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.
• 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".
446
CA Easytrieve® Report Generator 11.6
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:
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$
447
CA Easytrieve® Report Generator 11.6
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.
This function has the following format:
• 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
448
CA Easytrieve® Report Generator 11.6
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
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
449
CA Easytrieve® Report Generator 11.6
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
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:
450
CA Easytrieve® Report Generator 11.6
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)
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.
451
CA Easytrieve® Report Generator 11.6
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.
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.
452
CA Easytrieve® Report Generator 11.6
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 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 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
• 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:
453
CA Easytrieve® Report Generator 11.6
• -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.
* 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 SDS
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.
454
CA Easytrieve® Report Generator 11.6
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.
Example
The JCL in this example accesses datasets that are included with CA Easytrieve. SAMPLE.PERSONEL contains the data
for the report and CBAAJCL contains the PERSNL member that has the master field definitions that are used in the report
definition.
//jobname JOB (account),'user',MSGCLASS=H,NOTIFY=&SYSUID.
//*------------------------------------------------------*
//EZTP EXEC PGM=EZT
//STEPLIB DD DISP=SHR,DSN=hlq.EZT.R116S0A.CBAALOAD
//EZOPTBL DD DISP=SHR,DSN=hlq.EZT.R116S0A.EZOPTBL
//PANDD DD DISP=SHR,DSN=hlq.EZT.R116S0A.CBAAMAC
// DD DISP=SHR,DSN=hlq.EZT.R116S0A.CBAAJCL
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSNAP DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//PARMS DD DUMMY
//PERSNL DD DISP=SHR,DSN=hlq.EZTRP11.SP01B.SAMPLE.PERSONEL
Next Step:
Create a Project and Host Profile
455
CA Easytrieve® Report Generator 11.6
• 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:
Import File and Field Definitions
456
CA Easytrieve® Report Generator 11.6
457
CA Easytrieve® Report Generator 11.6
458
CA Easytrieve® Report Generator 11.6
Programming
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.
Signed Fields
If you specify a numeric field with decimal positions (0 through 18), the product considers it a signed (quantitative) field.
The following rules apply to signed fields:
459
CA Easytrieve® Report Generator 11.6
• For binary numbers, the product takes the high-order (leftmost) bit as the sign, regardless of field length. For a positive
value, the high-order bit is zero and the remaining bits contain the value in true binary notation. For a negative value,
the high-order bit is 1 and the remaining bits contain the value in 2’s complement notation. For a value of zero, all bits
are zero.
For example, a 1-byte binary field containing a hexadecimal FF has the numeric value -1. Binary numbers are stored in
IBM mainframe byte order on all platforms. That is, the most significant byte of the value is stored first. This is referred
to as 'big endian' byte order.
• For non-negative, zoned decimal numbers on the left side of an assignment statement, the product sets an F sign if
EBCDIC, or a 3 sign if ASCII. Otherwise, it manipulates the number in packed decimal format.
• Packed decimal numbers are manipulated in packed decimal format. Arithmetic operations that result in a positive
result set a C sign.
• By definition, there is no sign in unsigned packed decimal numbers (U format). When you manipulate these numbers,
the product supplies an F sign.
• For most purposes, integer numbers are the same as binary numbers. The difference is that integer numbers are
stored in the native byte order of the platform.
For example, for the Intel X86 platform, integer numbers are stored with the least significant byte first. This is referred
to as 'little endian' byte order.
Unsigned Fields
If you specify a numeric field with no decimal positions, the product considers that field unsigned (non-quantitative). The
following rules apply to unsigned fields:
• For 4-byte binary numbers, the magnitude of the number must fit within 31 bits or less. The NUMERIC test is not true
for a 4-byte binary field with the high-order bit on. If the high-order bit is on, the remaining 31 bits are treated as a
negative value in 2’s complement notation.
• For 8-byte binary numbers, the magnitude of the number must fit within 63 bits or less. The NUMERIC test is not true
for an 8-byte binary field with the high-order bit on. If the high-order bit is on, the remaining 63 bits are treated as a
negative value in 2’s complement notation.
• For 1-, 2-, 3-, 5-, 6-, and 7-byte binary numbers, the high-order bit contributes to the magnitude of the number. For
example, a 1-byte binary field containing a hexadecimal FF has a numeric value of 255.
• All binary numbers are stored in IBM mainframe byte order. That is, the most significant byte is stored first, in big
endian byte order.
• 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:
1. Design the program:
460
CA Easytrieve® Report Generator 11.6
Structured Programming
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
• 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:
461
CA Easytrieve® Report Generator 11.6
Program Sections
A CA Easytrieve® Report Generator program consists of the following main sections:
462
CA Easytrieve® Report Generator 11.6
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.
Defining Files
Use the FILE statement to describe a file or a database. FILE statements must describe all files and databases that your
program references. FILE statements are the first statements that are coded in the library section of a CA Easytrieve
program.
The FILE statement can differ greatly, depending on the operating environment and the type of file being processed.
NOTE
For more information about files, see FILE Statement and File Processing.
Defining Fields
Use the DEFINE statement to define fields. The DEFINE statement specifies data fields within a record or within working
storage. You usually specify file fields and work fields in the library section, but you can also define them within an activity
as the following examples illustrate.
This example shows fields that are defined in the library section:
FILE PERSNL FB(150 1800)
DEFINE EMP# 9 5 N Library
DEFINE EMPNAME 17 20 A
DEFINE EMP-COUNT W 4 N
463
CA Easytrieve® Report Generator 11.6
*
REPORT REPORT1
LINE EMP# EMPNAME EMP-COUNT
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.
464
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:
DEFINE MONTHWORD MONTH-TABLE 9 A OCCURS 12 INDEX MONTH-INDEX
465
CA Easytrieve® Report Generator 11.6
Subscripts
Subscripts are an alternative method available to select an individual element from an array. A subscript is a literal or field
that contains the actual occurrence of the element you are referencing.
Using subscripts removes the requirement of computing the index value; CA Easytrieve does it automatically. See Array
Processing for more information.
Because VARYING is used, this W-type work field has two parts, which are internally defined as follows:
W 2 B 0 for the two-byte field length
W 248 A for the data
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:
DEFINE FLDA W 7 A VALUE 'ABCD' VARYING
JOB INPUT NULL NAME MYPROG
DISPLAY FLDA
DISPLAY HEX FLDA
STOP
Results:
ABCD
CHAR ABCD
ZONE 00CCCC4
NUMB 0412340
466
CA Easytrieve® Report Generator 11.6
Statements:
DEFINE NULLSTRING W 10 A VARYING VALUE ''
DEFINE SENDVAR W 10 A VARYING VALUE '12345678'
DEFINE RECVVAR07 W 7 A VARYING
DEFINE RECVVAR10 W 10 A VARYING
JOB INPUT NULL NAME MYPROG
RECVVAR10 = NULLSTRING . * ASSIGN NULL STRING TO VARYING
DISPLAY '1. VALUE=' RECVVAR10 ' LENGTH=' RECVVAR10:LENGTH
RECVVAR10 = SENDVAR . * ASSIGN 10 BYTE VARYING TO 10 BYTE VARYING
DISPLAY '2. VALUE=' RECVVAR10 ' LENGTH=' RECVVAR10:LENGTH
RECVVAR07 = SENDVAR . * ASSIGN 10 BYTE VARYING TO 7 BYTE VARYING
DISPLAY '3. VALUE=' RECVVAR07 ' LENGTH=' RECVVAR07:LENGTH
RECVVAR10 = RECVVAR07 . * ASSIGN 7 BYTE VARYING TO 10 BYTE VARYING
DISPLAY '4. VALUE=' RECVVAR10 ' LENGTH=' RECVVAR10:LENGTH
MOVE SPACES TO RECVVAR07 . * MOVE SPACES TO 7 BYTE VARYING
DISPLAY '5. VALUE=' RECVVAR07 ' LENGTH=' RECVVAR07:LENGTH
STOP
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.
467
CA Easytrieve® Report Generator 11.6
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.
TEST-B-FIELD=9,223,372,036,854,775,807
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.
468
CA Easytrieve® Report Generator 11.6
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.
469
CA Easytrieve® Report Generator 11.6
• For more information about using screen attributes and patterns, see the Screen Processing section.
• For more information about subprogram linkage, see Inter-Program Linkage.
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'
The left bracket ([) and right bracket (]) indicate shift-out and shift-in codes.
470
CA Easytrieve® Report Generator 11.6
'EEEE[DBDBDB]'
The left bracket ([) and right bracket (]) indicate shift-out and shift-in codes.
471
CA Easytrieve® Report Generator 11.6
In the following table, the code ASIS means that the data format (SBCS, MIXED, or DBCS) of the literal coded in the
program source is retained by the CA Easytrieve Report Generator compiler (it is not converted).
472
CA Easytrieve® Report Generator 11.6
473
CA Easytrieve® Report Generator 11.6
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.
Screen Flow
The following code shows the basic flow of a SCREEN activity. See Screen Processing for more information.
474
CA Easytrieve® Report Generator 11.6
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
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:
475
CA Easytrieve® Report Generator 11.6
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
JOB/SORT
476
CA Easytrieve® Report Generator 11.6
– ACTIVITY -- Indicates to commit during the normal activity termination process. This is the default for PROGRAM
activities, if it is not specified.
– NOACTIVITY -- Indicates to not commit during activity termination. This is the default for JOB, SCREEN, and SORT
activities, if it is not specified.
• Use the TERMINAL | NOTERMINAL subparameter to indicate whether a commit point is issued during each terminal I/
O operation that is performed in the activity.
– TERMINAL -- Indicates to commit during each terminal I/O. This includes terminal I/O for SCREEN activities
and also for the Report Display Facility. In CICS, committing during terminal I/O runs your program pseudo-
conversationally. This is the default, if not specified.
– NOTERMINAL -- Indicates to not commit during terminal I/O. In CICS, this runs your program conversationally.
NOTE
• 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.
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.
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
477
CA Easytrieve® Report Generator 11.6
CASE IF
DO GOTO
EXECUTE PERFORM
PROC STOP
EXIT REFRESH
478
CA Easytrieve® Report Generator 11.6
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'
File presence IF EOF file-name
File relational IF MATCHED file-1, file-2, file-3
Record relational IF DUPLICATE file-name
For more information about each of these conditional expressions, see the Language Reference section.
479
CA Easytrieve® Report Generator 11.6
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
480
CA Easytrieve® Report Generator 11.6
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.
The following example illustrates how parentheses found within arithmetic expressions are evaluated:
11 + 5 * ((8 - 48) / 16 + 4) Step 1
└────Ú──────┘
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} {+}
{-}
481
CA Easytrieve® Report Generator 11.6
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:
482
CA Easytrieve® Report Generator 11.6
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 }
{EQ} {arithmetic-expression}
483
CA Easytrieve® Report Generator 11.6
Numeric field Numeric field, Result is padded on left with zeros to fit
literal, the description of receive-field-name. If the
or arithmetic expression value of the assignment is too large to be
stored in receive-field-name, it is 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 operands Indicator for receive-field-name is set to 0.
are NOT NULL
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.
484
CA Easytrieve® Report Generator 11.6
Examples
The following examples of Format 1 of the assignment statement illustrate its various rules:
485
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
Results:
Resulting
Value
486
CA Easytrieve® Report Generator 11.6
(1 + 0.6666)
Example
The following example of Format 2 of the assignment statement illustrates its various rules:
Format 2 (Logical Expression Evaluation) Statements:
Statements:
DEFINE F1P W 2 P MASK HEX
DEFINE F2P W 2 P VALUE X'123D'
JOB INPUT NULL NAME MYPROG
F1P = F2P AND X'FFFE'
DISPLAY SKIP 2 +
487
CA Easytrieve® Report Generator 11.6
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:
Table Processing
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.
488
CA Easytrieve® Report Generator 11.6
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.
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.
489
CA Easytrieve® Report Generator 11.6
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:
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.
Contents
490
CA Easytrieve® Report Generator 11.6
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
ARRAY-ELEMENT = 11
MONTH-INDEX = (ARRAY-ELEMENT - 1) * 10
DISPLAY MONTH
STOP
Results:
NOVEMBER
491
CA Easytrieve® Report Generator 11.6
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
Statements:
DEFINE QUARTER-ROW W 2 N
DEFINE MONTH-COL W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
MARCH +
492
CA Easytrieve® Report Generator 11.6
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
Result:
NOVEMBER
DEFINE QUARTER-ROW W 2 N
DEFINE MONTH-COL W 2 N
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
493
CA Easytrieve® Report Generator 11.6
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
494
CA Easytrieve® Report Generator 11.6
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
For this array the maximum value that can be specified for the occurrence number is 12.
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).
495
CA Easytrieve® Report Generator 11.6
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 +
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)
496
CA Easytrieve® Report Generator 11.6
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:
497
CA Easytrieve® Report Generator 11.6
EMPNAME 6 20 A
NO-OF-DEPENDS 26 2 N
NO-OF-JOBS 28 2 N
*
* DEPENDENT SEGMENTS
*
DEPEND-INFO 30 26 A OCCURS 20
DEPEND-NAME 30 20 A INDEX DEPINDEX
DEPEND-BIRTH 50 6 N INDEX DEPINDEX
*
* SALARY HISTORY SEGMENTS
*
SALARY-HISTORY 30 16 A OCCURS 10
SALARY-AMOUNT 30 8 N 2 INDEX SALINDEX
SALARY-GRADE 38 2 N INDEX SALINDEX
SALARY-EFF-DATE 40 6 N INDEX SALINDEX
WORK-CTR W 2 N
*
JOB INPUT MASTER NAME PERSONNEL-REPORTS
MOVE ZEROS TO DEPINDEX, WORK-CTR . * INITIALIZE DEPENDENT INDEX,CTR
DO WHILE WORK-CTR < NO-OF-DEPENDS. * PROCESS ALL DEPENDENT PORTIONS
PRINT DEPEND-REPORT
WORK-CTR = WORK-CTR + 1
DEPINDEX = DEPINDEX + 26
END-DO
*
MOVE ZERO TO WORK-CTR . * REINITIALIZE CTR
SALINDEX = (NO-OF-DEPENDS * 26) . * START OF SALARY HISTORY IS THE
* . * END OF THE DEPENDENT PORTION
DO WHILE WORK-CTR < NO-OF-JOBS . * PROCESS ALL SALARY PORTIONS
PRINT SALARY-REPORT
WORK-CTR = WORK-CTR + 1
SALINDEX = SALINDEX + 16
END-DO
*
REPORT DEPEND-REPORT LINESIZE 72 SPACE 1
TITLE 'DEPENDENT REPORT'
LINE EMP-ID EMPNAME DEPEND-NAME DEPEND-BIRTHDATE
*
REPORT SALARY-REPORT LINESIZE 72 SPACE 1
TITLE 'SALARY REPORT'
LINE EMP-ID EMPNAME SALARY-AMOUNT SALARY-GRADE SALARY-EFF-DATE
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
498
CA Easytrieve® Report Generator 11.6
499
CA Easytrieve® Report Generator 11.6
Inter-Program Linkage
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.
Program Linking
Called subprograms can be statically or dynamically linked with the CA Easytrieve® Report Generator object module. You
must declare which type of linkage you want to use in your CA Easytrieve® Report Generator program. To do this, use
one of the following on the PARM statement:
• The CALL parameter; for example:
500
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.
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
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
501
CA Easytrieve® Report Generator 11.6
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
LM 14,12,12(13) restore <easy> registers
MVI 8(13),X'FF' indicate unused save area
SR 15,15 set zero return code
BR 14 return to <easy>
...
MYSAVE DC 18A(0) 18 fullword save area
...
...
502
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
...
503
CA Easytrieve® Report Generator 11.6
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.
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.
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
504
CA Easytrieve® Report Generator 11.6
. . .
DECLARE CPROG PROGRAM STATIC
. . .
505
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.
The parameter lists passed to subprograms for EXIT (FILE) and CALL are quite similar. In fact, the list for CALL is
identical to that associated with the USING subparameter of EXIT. The only difference is that EXIT always passes at least
two parameters.
Note: If multiple fields are coded on the USING subparameter, and storage areas overlap, results are unpredictable.
506
CA Easytrieve® Report Generator 11.6
For input/output exits, work area address and the control code address are required parameters. The control code is a
fullword used to indicate the function to be performed by the exit. For instance:
Control Code
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.
507
CA Easytrieve® Report Generator 11.6
Parameters coded on the optional USING subparameter of EXIT are appended to the standard two parameters. The
following example shows input/output and MODIFY subprogram parameter list examples:
508
CA Easytrieve® Report Generator 11.6
Figure 43: Examples of Input, Output and MODIFY Subprogram Parameter List
509
CA Easytrieve® Report Generator 11.6
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 CA Easytrieve® Report Generator program.
Storage Management
Called subprograms should use the malloc and free functions to allocate and free storage. The subprogram should free
any storage it has allocated.
Linkage Conventions
The CALL statement can be used to call programs that conform to the C calling conventions for the platform on which you
are running CA Easytrieve® Report Generator. For more information, see Using.
FILE EXIT Linkage
You can use the EXIT parameter of the FILE statement to invoke subprograms written in other programming languages
for input/output related events. There are two types of exits you can code:
• Standard
• Using the MODIFY subparameter
Standard Exits
A standard exit should perform its own I/O. A standard exit function should look like this:
510
CA Easytrieve® Report Generator 11.6
Has a value as shown in the following list of constants. These constants enumerate the possible values for eOperation
and their meaning:
• 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:
511
CA Easytrieve® Report Generator 11.6
/* the file */
#define FC_NRFOUND 16 /* The key specified for the */
/* operation does not match */
/* the key of any record in */
/* the file */
#define FC_LOCKED 20 /* The operation attempted to */
/* retrieve a record that is */
/* locked by another user */
#define FC_IOERROR 24 /* The operation failed for some */
/* reason other than one of */
/* those given above */
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.
512
CA Easytrieve® Report Generator 11.6
#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;
} 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
513
CA Easytrieve® Report Generator 11.6
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.
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).
514
CA Easytrieve® Report Generator 11.6
USING Parameter
A single parameter can be passed to the child program by specifying the USING parameter. The parameter is passed
to the child program by value; that is, the parent program passes a copy of the value of the field or literal to the child
program. The child 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 child program.
Giving Parameter
You can allow the parent program to accept a return parameter from the child program by specifying the GIVING
parameter. You specify the field to be returned in the GIVING parameter of the PROGRAM statement in the child program.
CA Easytrieve® Report Generator returns a value to the parent program by writing the return value into the same
parameter area that was used by CA Easytrieve® Report Generator to pass the USING parameter to the child program.
When the child program terminates, the parameter is copied from the parameter area to the variable specified in the
GIVING parameter of the parent program. Because a single parameter area is used for communications in both directions,
CA Easytrieve® Report Generator determines the size of the parameter area by the larger of the fields specified on
the USING and GIVING parameters. If the child program copies a return parameter into the parameter area with
the PROGRAM GIVING parameter, but there is no GIVING parameter specified in the parent program, the returned
parameter is ignored without any error indication.
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.
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.
515
CA Easytrieve® Report Generator 11.6
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.
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
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.
516
CA Easytrieve® Report Generator 11.6
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.
517
CA Easytrieve® Report Generator 11.6
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.
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.
518
CA Easytrieve® Report Generator 11.6
519
CA Easytrieve® Report Generator 11.6
• Before CA Easytrieve Report Generator can process these databases, the CA Pan/SQL Interface product, version 2.4,
must be correctly installed. To process an Oracle database, CA Pan/SQL version 2.5 must be installed. For complete
information, see the CA Pan/SQL Interface Getting Started Guide, available from Bookshelves and PDFs.
Non-mainframe users:
• All SQL Interface functionality is installed with CA Easytrieve Report Generator. No additional installation or
documentation is required.
To use these facilities effectively, you should have a basic knowledge of SQL and the database management system to be
processed.
Programming Methods
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.
520
CA Easytrieve® Report Generator 11.6
Program Environment
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.
• 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.
521
CA Easytrieve® Report Generator 11.6
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.
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.
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
522
CA Easytrieve® Report Generator 11.6
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:
//EXECEZT EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DISP=SHR,DSN=your.ezt.target.library
// DD DISP=SHR,DSN=your.ezt.db2.application.library
// DD DISP=SHR,DSN=your.pansql.tso.load.library
// DD DISP=SHR,DSN=your.db2.sdsnload.library
//PAN$SQL DD *
TSO <=== Indicate TSO execution
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//REPORT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD *
DSN SYSTEM(D810)
RUN PROGRAM(eztpgm) PLAN(testplan)
END
/*
523
CA Easytrieve® Report Generator 11.6
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.
524
CA Easytrieve® Report Generator 11.6
525
CA Easytrieve® Report Generator 11.6
526
CA Easytrieve® Report Generator 11.6
BINARY x B y *1 N N N
none xUy - - -
527
CA Easytrieve® Report Generator 11.6
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.
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.
528
CA Easytrieve® Report Generator 11.6
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
529
CA Easytrieve® Report Generator 11.6
SQLCA S 344 A
SQLCAID SQLCA 8 A
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)
530
CA Easytrieve® Report Generator 11.6
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
531
CA Easytrieve® Report Generator 11.6
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
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.
532
CA Easytrieve® Report Generator 11.6
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:
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:
533
CA Easytrieve® Report Generator 11.6
GET CARDFIL
SELECT FROM PERSNL WHERE WORKDEPT = :CARDDEPT
END-PROC
Multiple Tables
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:
534
CA Easytrieve® Report Generator 11.6
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:
535
CA Easytrieve® Report Generator 11.6
FILENAME 17 20 A
FILE PERSNL SQL (PERSONNEL)
EMPNAME * 20 A
WORKDEPT * 2 P 0
JOB NAME MATCH-PERSNL INPUT (ESDS KEY (FILENAME) PERSNL KEY (EMPNAME))
IF NOT MATCHED AND ESDS
DISPLAY 'EMPLOYEE NOT IN SQL FILE' FILENAME
ELSE
IF NOT MATCHED AND PERSNL
DISPLAY 'EMPLOYEE NOT ON ESDS FILE' EMPNAME
ELSE
DISPLAY 'EMPLOYEE ON BOTH FILES' EMPNAME
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:
536
CA Easytrieve® Report Generator 11.6
END-IF
Automatic Processing
The following example changes the department number for all employees in departments 901 through 921:
537
CA Easytrieve® Report Generator 11.6
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
• 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.
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
538
CA Easytrieve® Report Generator 11.6
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 +
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.
539
CA Easytrieve® Report Generator 11.6
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.
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.
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.
540
CA Easytrieve® Report Generator 11.6
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.
541
CA Easytrieve® Report Generator 11.6
Reassign Departments
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
542
CA Easytrieve® Report Generator 11.6
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
543
CA Easytrieve® Report Generator 11.6
PRINT PERSNL
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 WORKDEPT EMPPHONE
544
CA Easytrieve® Report Generator 11.6
Example
The following example shows how to list the fields in a CSV file:
545
CA Easytrieve® Report Generator 11.6
2. From the Tools dropdown menu, select Share Workbook, and then check Allow changes by more than one user at the
same time. The Excel workbook is now shared.
3. Define the SQL table name for the Excel spreadsheet:
a. Highlight all the rows and columns that are to be part of the SQL table.
b. From the Insert dropdown menu, select Name, Define. The Define Name dialog opens.
c. Enter the name of the SQL table to be used in your CA Easytrieve® Report Generator program.
Note: The name must be valid for use in the syntax of a CA Easytrieve® Report Generator program.
4. Define the SQL column name for each Excel spreadsheet column to be used:
a. Highlight an entire column by clicking on the Excel-generated column heading.
b. From the Insert dropdown menu, select Name, Define. The Define Name dialog opens, showing the default name
you entered for this column in Step
c. Click OK to use the default name.
d. Repeat for each column.
5. Define the data format for each column:
a. Highlight an entire column by clicking on the Excel-generated column heading.
b. From the Format dropdown menu, select Cells. The Format Cells dialog opens.
c. From the Category list, select the data format for the SQL column.
6. Save your Excel worksheet. Your SQL table is now defined.
7. Define your Excel spreadsheet as an ODBC Data Source:
a. From the Windows Start menu, select Settings, Control Panel, Administrative Tools, Data Sources (ODBC). The
ODBC Data Source Administrator dialog opens.
b. Under the User DSN tab, click Add… and then select Microsoft Excel Driver (*.xls).
c. Enter a Data Source Name, click the Select Workbook… button, and then find and select your Excel file.
Processing Overview
The following diagram gives an overview of how CA Easytrieve® Report Generator interacts with a CA IDMS database:
546
CA Easytrieve® Report Generator 11.6
Automatic Input
-------------
| |
RETRIEVE file-name-1 ... ---------------->| <IDMS> |
| |
| |
(<idms> records in <----------| | |
path form for automatic input) | |
... -------------
Controlled Processing
-------------
| |
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.
547
CA Easytrieve® Report Generator 11.6
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.
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.
RECORD Identify the database records available for automatic or controlled
processing.
LOGICAL-RECORD Identify the logical records available for automatic or controlled
processing.
ELEMENT-RECORD Identify the element records that comprise the logical record.
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:
548
CA Easytrieve® Report Generator 11.6
549
CA Easytrieve® Report Generator 11.6
550
CA Easytrieve® Report Generator 11.6
Automatic Input
Automatic input is a facility whereby CA Easytrieve retrieves information from the database and makes it available to
the program. See Controlled Processing and Automatic Processing for a description of automatic input as it applies to
conventional files. To indicate that automatic input is to occur for a database, you must perform certain steps.
Follow these steps:
1. Code the INPUT parameter on the JOB statement for each activity that requires automatic input from the database.
The INPUT parameter must specify the file name from the FILE statement that defines the subschema. This must be
the only file name specified. CA Easytrieve does not support synchronized file processing for CA IDMS database files.
2. Code either a RETRIEVE statement or a SELECT statement following the JOB statement. Use a RETRIEVE
statement to retrieve database records. Use a SELECT statement for logical records. Only one statement, RETRIEVE
or SELECT, must be coded.
The RETRIEVE and SELECT statements describe the particular portion of the database to be retrieved. CA Easytrieve
performs all the calls needed to retrieve the information described by the automatic input statements. The sequence of
processing for automatic input from a CA IDMS database is shown in the following code:
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 +
551
CA Easytrieve® Report Generator 11.6
END-IF
retrieve next set of information
IF no more information
wrap up reports
STOP
END-IF
... (your program processes the information)
GO TO JOB
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.
552
CA Easytrieve® Report Generator 11.6
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.
CUSTOMER SALES
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.
553
CA Easytrieve® Report Generator 11.6
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.
PRODUCT SALES CUSTOMER ORDOR ITEM
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.
554
CA Easytrieve® Report Generator 11.6
555
CA Easytrieve® Report Generator 11.6
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
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.
FILE DBASE IDMS(DEMOSS03)
RECORD CUSTOMER 104
CUST-NO 1 10 A
CUST-NAME 11 20 A
JOB INPUT (DBASE) NAME RECORD-PROCESSING
RETRIEVE DBASE +
SELECT (CUSTOMER AREA 'CUSTOMER-REGION' +
WHILE (CUST-NAME EQ 'JONES'))
DISPLAY CUST-NO
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:
556
CA Easytrieve® Report Generator 11.6
• 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.
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.
557
CA Easytrieve® Report Generator 11.6
558
CA Easytrieve® Report Generator 11.6
PERFORM STATUS-CHECK
END-PROC
*
STATUS-CHECK. PROC
* IF STATUS NOT OK, TERMINATE PROCESSING
IF IDMSSTATUS NE '0000'
DISPLAY NEWPAGE, 'IDMS STATUS IS ', IDMSSTATUS
IDMS FINISH
END-IF
END-PROC
*
SIGN-OFF. PROC
* SIGN-OFF THE DATA BASE
IDMS FINISH
END-PROC
*
REPORT CALC-RPT LINESIZE(72)
TITLE 'RECORD RETRIEVAL BY CALC KEY'
LINE CUST-NO CUST-NAME
*
559
CA Easytrieve® Report Generator 11.6
GO TO ORDER-NEXT
END-IF
* IF "END-OF-AREA", GET THE NEXT
* CUSTOMER
IF IDMSSTATUS EQ '0307'
GO TO CUSTOMER-NEXT
END-IF
PERFORM STATUS-CHECK
*
SIGN-ON. PROC
* BIND THE RUN-UNIT
IDMS BIND 'DEMOSS03'
PERFORM STATUS-CHECK
* ASSIGN RECORD WORK AREA
IDMS BIND, FILE DBASE, RECORD CUSTOMER
PERFORM STATUS-CHECK
* ASSIGN ORDER WORK AREA
IDMS BIND, FILE DBASE, RECORD ORDOR
PERFORM STATUS-CHECK
* READY THE AREA
IDMS READY, AREA 'CUSTOMER-REGION'
PERFORM STATUS-CHECK
* READY THE AREA
IDMS READY, AREA 'ORDER-REGION'
PERFORM STATUS-CHECK
END-PROC
*
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 CUST-ORD LINESIZE(72), DTLCTL(FIRST)
SEQUENCE CUST-NO
CONTROL FINAL NOPRINT, CUST-NO NOPRINT, CUST-NAME NOPRINT
TITLE 'CUSTOMER ORDERS'
LINE CUST-NO, CUST-NAME ORD-NO, ORD-CPO#
560
CA Easytrieve® Report Generator 11.6
IDD Interface
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
561
CA Easytrieve® Report Generator 11.6
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.
562
CA Easytrieve® Report Generator 11.6
Examples
Defining a Subschema
563
CA Easytrieve® Report Generator 11.6
564
CA Easytrieve® Report Generator 11.6
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
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.
565
CA Easytrieve® Report Generator 11.6
ITEM-PROD# 1 8 A
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.
566
CA Easytrieve® Report Generator 11.6
SELECT
STORE SALES.
*
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
567
CA Easytrieve® Report Generator 11.6
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 the Test Database Structure
section.
This article includes the following information:
568
CA Easytrieve® Report Generator 11.6
PSB Specification
In batch and TSO environments, the PSB name is passed to IMS/DLI as a parameter on the statement that executes the
DFSRRC00 program. When your CA Easytrieve Report Generator program begins executing, the PCB specified on the
FILE statement is found in the PSB by the CA Easytrieve® Report Generator library routines and made available to your
program automatically.
In CICS, your program must explicitly schedule a PSB before any DLI file can be accessed. The DLI PCB statement must
be used to schedule a PSB. For a complete description, see DLI Statement. For information about PSB scheduling and
terminating, see the IBM CICS Application Programmer's Reference Manual.
After a DLI PCB statement is executed, all DLI files in the CA Easytrieve Report Generator program are accessible. The
DLI PCB statement must be executed even when automatic input (the RETRIEVE statement) is being used to read the
database. Because the PSB can only be scheduled once, the DLI PCB statement should be placed in a JOB START proc,
or in some other one-time only code. When all DLI processing is finished, use the DLI TERM statement to terminate the
PSB. If this is not done, the PSB remains scheduled until task termination.
Note: In non-CICS environments, the DLI PCB and DLI TERM statements have no effect.
569
CA Easytrieve® Report Generator 11.6
Status Information
After each DLI operation, the PCB Status Code field is placed in the CA Easytrieve Report Generator system-defined
field, FILE-STATUS. For the definition of the status code values, see the IBM DLI Programmer's Reference Manual.
In CICS, two additional system-defined fields are supplied to give additional status data: UIBFCTR and UIBDLTR. Each is
a 1-byte binary field. The value of each field is copied directly from the same-named UIB fields after each DLI operation.
For a definition of the UIB field values, see the IBM CICS Application Programmer's Reference Manual.
In non-CICS environments, UIBFCTR and UIBDLTR contain zeros.
Automatic Input
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.
570
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.
571
CA Easytrieve® Report Generator 11.6
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
572
CA Easytrieve® Report Generator 11.6
...
RETRIEVE DLIFILE ... +
SELECT (PARTROOT)
...
...
...
RETRIEVE DLIFILE ... +
SELECT (PARTROOT +
STANINFO +
STOKSTAT)
...
paths are: 1 - PARTROOT AND STANINFO
2 - PARTROOT AND STOKSTAT
...
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
573
CA Easytrieve® Report Generator 11.6
Note: The DLI PCB and DLI TERM statements are required only in CICS environments. They are ignored in non-CICS
environments.
574
CA Easytrieve® Report Generator 11.6
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.
575
CA Easytrieve® Report Generator 11.6
576
CA Easytrieve® Report Generator 11.6
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.
577
CA Easytrieve® Report Generator 11.6
...
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
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, +
...)
END-PROC
TEST-STATUS. PROC
IF FILE-STATUS ...
...
END-IF
END-PROC.
...
...
578
CA Easytrieve® Report Generator 11.6
...
... ...
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
END-PROC
...
...
579
CA Easytrieve® Report Generator 11.6
*
DEFINE IMSSTAT W 8 A
*
JOB INPUT FPDEDB FINISH TERM-PROC
RETRIEVE FPDEDB +
SELECT ( F99DS1 ID 'S1' +
F99DS2 ID 'S2' +
F99DS3 ID 'S3' )
DISPLAY F99DS1K ' ' PATH-ID
TERM-PROC. PROC
DLI CHKP IMSSTAT
DISPLAY HEX CHKP-STATUS
END-PROC
Required Knowledge
To use this interface, you must know how to use CA Datacom/DB and know the layout of the database that you want
processed. Specifically, you must know:
• The purpose and syntax of the commands common to CA Datacom/DB.
• The contents of the database.
• How the data is organized within the database.
• What elements of data you can read and/or update.
Such knowledge makes the task of accessing the database much simpler.
Preparatory Work
Preparatory work by your database administrator significantly reduces the effort of writing the CA Easytrieve Report
Generator programs that access CA Datacom/DB databases. The database administrator should place the data definition
statements necessary to access each element in the database into the CA Easytrieve® Report Generator macro library.
Keeping these element field definition statements within the control of the database administrator can greatly reduce the
number of programming errors that are associated with database processing. See Access Macros for examples that use
the test database that is supplied with CA Datacom/DB.
580
CA Easytrieve® Report Generator 11.6
Automatic Processing
With automatic processing, you sequentially retrieve all or part of a table within any defined CA Datacom/DB key.
Automatic processing uses the EXIT parameter of the FILE statement. The EXIT parameter of the FILE statement
automatically links with the assembler routine that enables CA Easytrieve Report Generator and CA Datacom/DB to
communicate. The name of this routine is ETDTCM.
Controlled Processing
With controlled processing, you can perform any retrieval process (for example, sequential access and/or random access)
on all or part of a table. Just use the CALL statement to link to the ETDTCM routine that enables CA Easytrieve Report
Generator and CA Datacom/DB to communicate.
NOTE
Never mix automatic and controlled processing in the same CA Easytrieve Report Generator job activity. This
is because automatic processing automatically performs functions that are not automatically performed under
controlled processing.
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:
• 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:
581
CA Easytrieve® Report Generator 11.6
Generating Calls
The following macros generate the appropriate calls to CA Datacom/DB.
• %DBFILE generates the FILE statement that you use during automatic processing. Code this macro immediately
before the Job statement in your CA Easytrieve Report Generator program. Use this macro for automatic processing
only.
• %DBOPEN opens the CA Datacom/DB tables for further processing. Use this macro for controlled processing only.
• %DBCLOSE closes all open CA Datacom/DB tables. Use this macro for controlled processing only.
• %DBLREQ (long parameter list) provides the direct request interface to CA Datacom/DB using all four parameter
areas (UIB, RA, EL, and WA). Use this macro for controlled processing only.
• %DBSREQ (short parameter list) provides the direct request interface to CA Datacom/DB using only the UIB and RA
parameter areas. Use this macro for controlled processing only.
Macro Synopsis
The following table is a reference tool that lists information about each macro and where it is coded in the CA Easytrieve
Report Generator program.
Syntax
%DBUIB literal urt-name
582
CA Easytrieve® Report Generator 11.6
Specifies the eight-character name of the link-edited URT/ETDRVR module that is prepared by the database
administrator for your use. The urt-name is located outside the normal bounds of the UIB as defined by CA Datacom/
DB. Including this field causes no problems for any of the CA Datacom/DB requirements.
A URT/ETDRVR must be generated for each table that is accessed by your application. For instructions to generate the
URT, see install JOB09URT in the Installing section.
Syntax
%DBRA prfx tbl-nm ky-nm [DBID db-id-no]
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.
Syntax
%DBEL prfx elmt-nm [elmt-nm ...]
• prfx
583
CA Easytrieve® Report Generator 11.6
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
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.
Syntax
%DBWA prfx wrk-area-sz
Usage Notes
The %DBWA macro generates the following statement:
DEFINE prfx-WORK-AREA W 1 A OCCURS wrk-area-sz
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. Search for
Controlled Processing Examples here for a working storage definition with the %DBWA macro.
584
CA Easytrieve® Report Generator 11.6
Syntax
%DBFILE prfx wrk-area-sz [START strt-val]
• 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:
START '''Smith 91700'''
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:
DEFINE prfx-KEY-VAL2 prfx-REQ-AREA +76 180 A VALUE 'strt-val'
FILE prfx +
WORKAREA(wrk-area-sz) +
EXIT (ETDTCM USING (USER-INFO +
prfx-REQ-STRT +
prfx-ELEM-LIST))
WORK-AREA 1 1 A OCCURS wrk-area-sz
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.
Syntax
%DBOPEN
585
CA Easytrieve® Report Generator 11.6
Usage Notes
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.
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.
Syntax
%DBLREQ prfx cmnd-cd [EL el-prfx] [WA wa-prfx]
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.
586
CA Easytrieve® Report Generator 11.6
Usage Notes
After the call, the result of the operation is found in prfx-RET-CD.
Syntax
%DBSREQ prfx cmnd-cd
Usage Notes
After the call, the result of the operation is found in prfx-RET-CD.
Examples
The following programs with CA Datacom/DB interface macro examples are based on the sample database and programs
that are provided with CA Datacom/DB and illustrated in the Programming section in the CA Datacom/DB documentation.
587
CA Easytrieve® Report Generator 11.6
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.
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:
%DBUIB EZT+DB MYURT
* DEFINE USER-INFO S 40 A
* DEFINE USER-PGM USER-INFO 8 A VALUE 'EZT+DB'
* DEFINE URT-NAME USER-INFO +32 8 A VALUE 'MYURT'
%DBRA ABC POH POLI
* DEFINE ABC-REQ-AREA S 284 A
* DEFINE ABC-REQ-STRT S 1 A
* DEFINE ABC-CMND ABC-REQ-AREA 5 A
* DEFINE ABC-TBL-NM ABC-REQ-AREA +5 3 A VALUE 'POH'
* DEFINE ABC-KEY-NM ABC-REQ-AREA +8 5 A VALUE 'POLI'
* DEFINE ABC-RET-CD ABC-REQ-AREA +13 2 A
* DEFINE ABC-INT-RET-CD ABC-REQ-AREA +15 1 B VALUE 0
* DEFINE ABC-DB-ID ABC-REQ-AREA +16 2 B VALUE 0
* DEFINE ABC-REC-ID ABC-REQ-AREA +18 7 A
* DEFINE ABC-TBL-ID ABC-REQ-AREA +18 2 B VALUE 0
* DEFINE ABC-BLK ABC-REQ-AREA +20 4 B VALUE 0
* DEFINE ABC-REC ABC-REQ-AREA +24 1 B VALUE 0
* DEFINE ABC-RQA-ERR ABC-REQ-AREA +26 4 A
* DEFINE ABC-RQA-SEC ABC-REQ-AREA +26 1 A
* DEFINE ABC-RQA-ENTRY ABC-REQ-AREA +27 3 N VALUE 0
* DEFINE ABC-SET-CNT ABC-REQ-AREA +40 4 B VALUE 0
* DEFINE ABC-SET-NBR ABC-REQ-AREA +44 4 B VALUE 0
* DEFINE ABC-CNT-MAX ABC-REQ-AREA +50 2 B VALUE 0
* DEFINE ABC-IO-CNT ABC-REQ-AREA +52 2 B VALUE 0
* DEFINE ABC-SKP-CNT ABC-REQ-AREA +71 2 B VALUE 0
* DEFINE ABC-KEY-VAL ABC-REQ-AREA +76 180 A
* DEFINE ABC-WHO-AM-I ABC-REQ-AREA +256 28 A VALUE 'ABC'
%DBEL ABC PO LI VENDR TPVAL LATE
* DEFINE ABC-ELEM-LIST S 101 A
* DEFINE ABC-ELM01 ABC-ELEM-LIST 7 A VALUE 'PO '
* DEFINE ABC-ELM02 ABC-ELEM-LIST +6 7 A VALUE 'LI '
* DEFINE ABC-ELM03 ABC-ELEM-LIST +12 7 A VALUE 'VENDR '
* DEFINE ABC-ELM04 ABC-ELEM-LIST +18 7 A VALUE 'TPVAL '
* DEFINE ABC-ELM05 ABC-ELEM-LIST +24 7 A VALUE 'LATE '
* DEFINE ABC-ELM06 ABC-ELEM-LIST +30 7 A VALUE ' '
588
CA Easytrieve® Report Generator 11.6
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.
589
CA Easytrieve® Report Generator 11.6
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 ('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.
1 %DBUIB EZT+DB MYURT
2 %DBRA GHI POH POLI
3 %DBEL GHI PO LI VENDR TPVAL LATE
4 %DBWA GHI 20
5 DEFINE GHI-PO GHI-WORK-AREA 5 A
6 DEFINE GHI-LI GHI-WORK-AREA +5 3 A
7 DEFINE GHI-VENDR GHI-WORK-AREA +8 3 A
8 DEFINE GHI-TPVAL GHI-WORK-AREA +11 8 N MASK 'ZZZ,ZZ9.99'
9 DEFINE GHI-LATE GHI-WORK-AREA +19 1 A
10 *
11 JOB NAME ALL-RECORDS INPUT NULL START STARTUP FINISH DBCLOSE
12 PRINT GHI-RPT . * Print this record
13 %DBLREQ GHI REDNX . * Read next record
14 IF GHI-RET-CD = '14' . * Have we reached end of file?
15 STOP . * Yes; we're done
16 END-IF
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 *
30 REPORT GHI-RPT LINESIZE 80
31 LINE GHI-PO GHI-VENDR GHI-TPVAL GHI-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-4 define the other three standard parameter areas - the Request Area (RA), the Element List (EL), and the Work
Area (WA).
590
CA Easytrieve® Report Generator 11.6
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:
%DBUIB EZT+DB MYURT
* DEFINE USER-INFO S 40 A
* DEFINE USER-PGM USER-INFO 8 A VALUE 'EZT+DB'
* DEFINE URT-NAME USER-INFO +32 8 A VALUE 'MYURT'
%DBRA GHI POH POLI
* DEFINE GHI-REQ-AREA S 284 A
* DEFINE GHI-REQ-STRT S 1 A
* DEFINE GHI-CMND GHI-REQ-AREA 5 A
* DEFINE GHI-TBL-NM GHI-REQ-AREA +5 3 A VALUE 'POH'
* DEFINE GHI-KEY-NM GHI-REQ-AREA +8 5 A VALUE 'POLI'
* DEFINE GHI-RET-CD GHI-REQ-AREA +13 2 A
* DEFINE GHI-INT-RET-CD GHI-REQ-AREA +15 1 B VALUE 0
* DEFINE GHI-DB-ID GHI-REQ-AREA +16 2 B VALUE 0
* DEFINE GHI-REC-ID GHI-REQ-AREA +18 7 A
* DEFINE GHI-TBL-ID GHI-REQ-AREA +18 2 B VALUE 0
* DEFINE GHI-BLK GHI-REQ-AREA +20 4 B VALUE 0
* DEFINE GHI-REC GHI-REQ-AREA +24 1 B VALUE 0
* DEFINE GHI-RQA-ERR GHI-REQ-AREA +26 4 A
* DEFINE GHI-RQA-SEC GHI-REQ-AREA +26 1 A
* DEFINE GHI-RQA-ENTRY GHI-REQ-AREA +27 3 N VALUE 0
* DEFINE GHI-SET-CNT GHI-REQ-AREA +40 4 B VALUE 0
* DEFINE GHI-SET-NBR GHI-REQ-AREA +44 4 B VALUE 0
* DEFINE GHI-CNT-MAX GHI-REQ-AREA +50 2 B VALUE 0
* DEFINE GHI-IO-CNT GHI-REQ-AREA +52 2 B VALUE 0
* DEFINE GHI-SKP-CNT GHI-REQ-AREA +71 2 B VALUE 0
* DEFINE GHI-KEY-VAL GHI-REQ-AREA +76 180 A
* DEFINE GHI-WHO-AM-I GHI-REQ-AREA +256 28 A VALUE 'GHI'
%DBEL GHI PO LI VENDR TPVAL LATE
* DEFINE GHI-ELEM-LIST S 101 A
* DEFINE GHI-ELM01 GHI-ELEM-LIST 7 A VALUE 'PO '
* DEFINE GHI-ELM02 GHI-ELEM-LIST +6 7 A VALUE 'LI '
* DEFINE GHI-ELM03 GHI-ELEM-LIST +12 7 A VALUE 'VENDR '
* DEFINE GHI-ELM04 GHI-ELEM-LIST +18 7 A VALUE 'TPVAL '
* DEFINE GHI-ELM05 GHI-ELEM-LIST +24 7 A VALUE 'LATE '
* DEFINE GHI-ELM06 GHI-ELEM-LIST +30 7 A VALUE ' '
591
CA Easytrieve® Report Generator 11.6
592
CA Easytrieve® Report Generator 11.6
* PROC
* CALL ETDTCM USING(USER-INFO 'CLOSE')
* END-PROC
REPORT GHI-RPT LINESIZE 80
LINE GHI-PO GHI-VENDR GHI-TPVAL GHI-LATE
593
CA Easytrieve® Report Generator 11.6
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.
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:
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.
594
CA Easytrieve® Report Generator 11.6
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
595
CA Easytrieve® Report Generator 11.6
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:
596
CA Easytrieve® Report Generator 11.6
– For file type SEQUENTIAL, the records are accessed in the sequence in which the records were added to the file.
– For file type INDEXED, the records are accessed in the sequence defined by the key of the associated data set.
– For file type RELATIVE, the records are accessed in ascending sequence of relative record numbers.
• Sequential access allows the use of the GET, PUT, and WRITE UPDATE statements. If the file type is INDEXED or
RELATIVE, sequential access also allows the use of the WRITE DELETE statement.
• Direct -- Indicates that records are accessed in a sequence determined by the program. Each statement that accesses
a record specifies the key of the record to be accessed as follows:
– For file type SEQUENTIAL, direct access is not allowed.
– For file type INDEXED, the key value must be an alphanumeric item whose length is equal to the key length
specified for the associated data set.
– For file type RELATIVE, the key value is a four-byte binary integer that specifies a relative record number.
• Direct access allows the use of the READ, WRITE ADD, WRITE DELETE, and WRITE UPDATE statements.
Hold/Release Processing
CA Easytrieve® Report Generator automatically issues a hold for a record when the FILE statement specifies UPDATE.
You can override this by specifying HOLD or NOHOLD on your READ and GET statements.
When CA Easytrieve® Report Generator holds a record for update, it establishes the intent to update a record with the
operating system. This intent does not mean you are obligated to actually perform the update. It just holds the position in
the file and may also lock the record (in CICS). Locks are automatically released when the update operation completes or
a commit point is taken.
You can manually release the hold on any file with the RELEASE statement.
597
CA Easytrieve® Report Generator 11.6
In CICS, the default action for a READ statement is HOLD when you specify UPDATE on the FILE statement. The default
action for a GET statement and for automatic input is NOHOLD. CICS does not allow you to browse a file for update.
In all other environments, CA Easytrieve® Report Generator issues a HOLD by default for READs, GETs, and for
automatic input. See Commit Processing for examples of hold processing in screen processing.
Sequential Files
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 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:
598
CA Easytrieve® Report Generator 11.6
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.
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
599
CA Easytrieve® Report Generator 11.6
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.
600
CA Easytrieve® Report Generator 11.6
• VFM files without the RETAIN option are deleted once CA Easytrieve® Report Generator has processed them as input
files and closed them.
• VFM files with the RETAIN option are deleted at the end of the associated CA Easytrieve® Report Generator
execution.
• VFM files are automatically blocked. Any block size you supply is ignored.
The following example illustrates a typical use of the VFM access method:
Indexed Files
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
601
CA Easytrieve® Report Generator 11.6
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):
602
CA Easytrieve® Report Generator 11.6
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
You can use the WRITE statement to delete individual records from an indexed file. The deleted record is the file's current
input record.
603
CA Easytrieve® Report Generator 11.6
Updating a Record
You can modify and rewrite the current input record by using the WRITE statement.
Relative Files
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
604
CA Easytrieve® Report Generator 11.6
Skip-Sequential Processing
This example shows RELATIVE skip-sequential processing:
605
CA Easytrieve® Report Generator 11.6
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:
Record Addition
File Creation
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.
606
CA Easytrieve® Report Generator 11.6
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:
607
CA Easytrieve® Report Generator 11.6
Sorting Files
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.
608
CA Easytrieve® Report Generator 11.6
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
609
CA Easytrieve® Report Generator 11.6
SELECT
END-IF
END-PROC
*
JOB INPUT SORTWRK NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1
LINE REGION BRANCH DEPT NAME-LAST NAME-FIRST
Example
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:
610
CA Easytrieve® Report Generator 11.6
...
KEY2X ...
...
FILE FILEN ...
KEYNA 17 5 A
KEYNB 10 7 N
...
KEYNX ...
...
JOB INPUT(FILE1 KEY KEY1A +
FILE2 KEY KEY2A)
...
JOB INPUT (FILEN KEY(KEYNB, KEYNA) +
FILE1 KEY(KEY1B, KEY1A) +
FILE2 KEY(KEY2B, KEY2A))
...
JOB INPUT (FILE1 KEY(KEY1A ...) +
... +
FILEN KEY(KEYNA ...))
...
...
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:
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
611
CA Easytrieve® Report Generator 11.6
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 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.
612
CA Easytrieve® Report Generator 11.6
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}
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.
For more detailed examples of conditional expressions, see the Language Reference section.
613
CA Easytrieve® Report Generator 11.6
T-AMT 3 3 N
FILE NEWMSTR SEQUENTIAL
N-KEY 1 2 N
N-AMT 3 3 N
JOB INPUT (OLDMSTR KEY(O-KEY) +
TRANS KEY(T-KEY)) NAME MYPROG
* FOR MATCHED: UPDATE WITH TRAN AMT AND PUT NEWMSTR.
* IF TRAN IS A DUPLICATE BUT NOT THE FIRST, BYPASS THE RECORD.
IF MATCHED
IF DUPLICATE TRANS AND NOT FIRST-DUP TRANS
GOTO JOB
END-IF
MOVE O-KEY TO N-KEY
N-AMT = O-AMT + T-AMT
PUT NEWMSTR
GOTO JOB
END-IF
* ON OLDMSTR ONLY: PUT THE NEWMSTR WITHOUT ANY UPDATE.
IF OLDMSTR
PUT NEWMSTR FROM OLDMSTR
GOTO JOB
END-IF
* ON TRANS ONLY: PRINT ERROR REPORT.
IF TRANS
PRINT ERROR-RPT
GOTO JOB
END-IF
*
REPORT ERROR-RPT
TITLE 'REPORT OF TRANSACTION WITH INVALID KEYS'
LINE T-KEY T-AMT
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:
614
CA Easytrieve® Report Generator 11.6
PRINTER Files
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.
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.
615
CA Easytrieve® Report Generator 11.6
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.
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.
616
CA Easytrieve® Report Generator 11.6
Report Processing
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.
NOTE
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.
617
CA Easytrieve® Report Generator 11.6
618
CA Easytrieve® Report Generator 11.6
By default, work files are written to the CA Easytrieve Report Generator system work file, xxxVFM (where xxx is the
value of WKDSNPF in the options table). The algorithm for naming work files is xxxRnnn, where xxx is the value of the
WKDSNPF option and nnn is the sequential number of the report within the JOB activity. A typical work file name for the
first work file in a JOB is EZTR001.
To save the work file contents for future processing, code the FILE parameter on the REPORT statement. The
corresponding FILE statement, coded in the library, must identify a sequential file. You must also specify that the work
file's record length is at least as long as the dynamically created work file record. Records should be blocked to a
reasonable value to ensure efficient processing. This technique can also be used to offload the amount of Virtual File
Manager (VFM) space that is required by the program to another file.
Large Reports
If you have multiple large reports in a program, you can code the WORKFILE YES parameter on the PARM statement or
set the WORKFILE site option to Y. This allows you to use a report work file without coding a FILE statement and a FILE
parameter on the REPORT statement for every report in your program. REPORT WORKFILEs are dynamically allocated,
no DD statements are required to be coded in the JCL.
If you code the WORKFILE DD statements in your JCL, the dynamic allocation will not be done.
If you manually code the DD statements, the DDname must conform to the format xxxRnnn, where xxx is the WKDSNPF
option in your site option table (EZT is the default) and nnn is the report number. For example, the first report in your
program would use the DD EZTR001.
We also recommend that you code a large block size in the JCL. The default DCB for the work file is FB with record and
block lengths set for maximum efficiency. For more information, see PARM Statement.
NOTE
Use VFM for small reports and all reports executing in CICS.
619
CA Easytrieve® Report Generator 11.6
Report Formats
620
CA Easytrieve® Report Generator 11.6
Standard Report
The CA Easytrieve® Report Generator default report format is the standard format illustrated below:
Figure 51: Default Report Format
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.
621
CA Easytrieve® Report Generator 11.6
Label Report
The second report format is used to print labels. The following exhibit illustrates the basic label report page format:
Figure 52: Basic Label Report Page
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. CA Easytrieve® Report Generator produces a label for each PRINT
statement execution. CA Easytrieve® Report Generator formats the labels on the page in the order as numbered above.
DOWN and SIZE indicate the dimensions of each label.
Report Generation
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 ...
...
622
CA Easytrieve® Report Generator 11.6
PRINT ...
...
REPORT
{ 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.
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.
623
CA Easytrieve® Report Generator 11.6
Standard Reports
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:
Figure 53: Title Area of a Report
624
CA Easytrieve® Report Generator 11.6
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:
625
CA Easytrieve® Report Generator 11.6
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
626
CA Easytrieve® Report Generator 11.6
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
...
627
CA Easytrieve® Report Generator 11.6
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:
Results:
poor good
column column
1 5 10 15 1 5 10 15
628
CA Easytrieve® Report Generator 11.6
............... ...............
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:
629
CA Easytrieve® Report Generator 11.6
................................................................. .
Label Reports
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.
630
CA Easytrieve® Report Generator 11.6
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
631
CA Easytrieve® Report Generator 11.6
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 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.
• 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:
632
CA Easytrieve® Report Generator 11.6
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>
</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 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.
633
CA Easytrieve® Report Generator 11.6
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.
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.
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:
634
CA Easytrieve® Report Generator 11.6
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
BREAK-LEVEL
BREAK-LEVEL is a system-defined field whose value indicates the highest control break level. The following example
illustrates using BREAK-LEVEL to display an appropriate message in a BEFORE-BREAK procedure:
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
635
CA Easytrieve® Report Generator 11.6
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
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
636
CA Easytrieve® Report Generator 11.6
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
637
CA Easytrieve® Report Generator 11.6
Data:
BROWN IL6007612345
BROWN IL6007667890
JONES IL6007709876
JONES IL6007754321
SMITH TX7521811111
SMITH TX7521866666
Results:
Line
Description Control Fields Accumulator
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
638
CA Easytrieve® Report Generator 11.6
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
The next three examples show the results of using each of the DTLCTL options:
EVERY
EVERY prints all control fields on every detail line.
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
639
CA Easytrieve® Report Generator 11.6
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
640
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 +
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
641
CA Easytrieve® Report Generator 11.6
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
642
CA Easytrieve® Report Generator 11.6
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
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
643
CA Easytrieve® Report Generator 11.6
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
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
644
CA Easytrieve® Report Generator 11.6
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
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPYALL
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE ZIP
LINE 01 LAST-NAME STATE ZIP PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
SMITH TX 2222.09
645
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
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:
646
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
*
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*
647
CA Easytrieve® Report Generator 11.6
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
LINE 01 LAST-NAME STATE ZIP T-PAY-NET
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
648
CA Easytrieve® Report Generator 11.6
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:
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
649
CA Easytrieve® Report Generator 11.6
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
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.
650
CA Easytrieve® Report Generator 11.6
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
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:
651
CA Easytrieve® Report Generator 11.6
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 CA Easytrieve® Report Generator to satisfy this requirement.
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:
(BEFORE-LINE)
detail IL 60076 678.90
(AFTER-LINE)
652
CA Easytrieve® Report Generator 11.6
(BEFORE-LINE)
detail IL 60077 543.21
(AFTER-LINE)
(REPORT-INPUT - caused by the fourth PRINT statement)
(BEFORE-LINE)
detail IL 60077 98.76
(AFTER-LINE)
(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:
653
CA Easytrieve® Report Generator 11.6
• 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
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.
*******************************************************
**** 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:
654
CA Easytrieve® Report Generator 11.6
TESTA
TESTB
TESTC
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:
655
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
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:
1888.77
656
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
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
SMITHTX7521811111
SMITHTX7521866666
Results:
657
CA Easytrieve® Report Generator 11.6
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
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:
658
CA Easytrieve® Report Generator 11.6
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:
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
659
CA Easytrieve® Report Generator 11.6
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
660
CA Easytrieve® Report Generator 11.6
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
...
* CONFIDENTIAL - FOR INTERNAL USE ONLY *
..................................................
...
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:
661
CA Easytrieve® Report Generator 11.6
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
...
..................................................
2222.09 IS THE Y-T-D COMPANY NET PAY
662
CA Easytrieve® Report Generator 11.6
PRINT REPORT1
ELSE
PRINT REPORT2
END-IF
*
REPORT REPORT1 PRINTER PRINTR1 LINESIZE 120 +
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 REPORT2 PRINTER PRINTR2 LINESIZE 120 +
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
663
CA Easytrieve® Report Generator 11.6
• 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
664
CA Easytrieve® Report Generator 11.6
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.
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
• 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.
665
CA Easytrieve® Report Generator 11.6
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.
01 12/03/09 Proposed Salary Schedule for Region 4 Employees Page 1
02 Detail by Branch -- Descending Gross Pay
03
04 Social Current Pay Raise New Pay
05 Security Empl
06 Branch Number Number Employee Name Gross/Net % Gross/Net
07
08 01 216-44-7756 05525 TALUS RUTH 460.80 9.00 502.27
09 9331 CAROLINE AVENU 279.56 304.72
10 SEATTLE WA 98003
11
666
CA Easytrieve® Report Generator 11.6
43
44 03 1,228.80 8.00 1,330.91
45 843.08 913.30
Print Elements
Print Elements are the individual fields or items that appear on a print line.
The following diagram redisplays the title print lines from the sample report.
667
CA Easytrieve® Report Generator 11.6
Print line 01 contains four print elements as marked by the arrowed lines:
• #1 Date, left justified on the print line
• #2 Title line 1 text, centered on the print line
• #3 Page text
• #4 A page number, right justified on the print line.
Print line 02 contains only one print element as marked by the arrowed lines:
• #5 Title line 2 text, centered on the print line.
Attributes
When a print element is defined to the Reporting Environment, the Reporting Environment requires certain information
about that print element. The information required by the Reporting Environment for a print element includes:
• Length
Length defines the number of bytes in the print element. The Reporting Environment uses this value when positioning
the print element in a print item and when placing the print element on a print line.
• Font
Font provides the font identification of a reporting font that is used to print the characters in the print element.
668
CA Easytrieve® Report Generator 11.6
The font assigned to a print element must be defined for the printer that is assigned to print the print element, and the
data format supported by that font must match the data format of the print element.
When a print element is defined without a font, the Reporting Environment will select a printer's default font for the data
format of the print element.
• WfbOffset
WfbOffset is required for a variable print element.
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
669
CA Easytrieve® Report Generator 11.6
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.
• 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.
Figure 56: Print Item
The definition of Print Group #1 to the Reporting Environment included the following characteristics:
670
CA Easytrieve® Report Generator 11.6
The definition of Print Group #2 to the Reporting Environment included the following characteristics:
• Print line 02 was defined in print group #2.
• Print item #1 was defined in print group #2.
• Print element #1 was defined in print item #1, to appear on print line 02.
The processing performed by the Reporting Environment for print group #2 included the following actions:
• Print item #1 was centered across the print line defined in print group #2.
• Print element #1 was centered in print item #1 and thereby assigned a print position on print line 02.
Print Group #3
The following diagram redisplays the heading, detail and summary print lines that form Print Group #3.
671
CA Easytrieve® Report Generator 11.6
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:
672
CA Easytrieve® Report Generator 11.6
673
CA Easytrieve® Report Generator 11.6
Attributes
When a print group is defined to the Reporting Environment, the Reporting Environment requires certain information about
that print group. The information required by the Reporting Environment for a print group includes:
• Spacing
Spacing defines the number of spaces that are to be inserted between each print item defined in the print group.
• Justification
Justification defines how the Reporting Environment is to distribute the print items in a print group across the print lines
defined in the print group.
• Indentation
Indentation defines the size of left and/or right margins that are to be allocated on the print lines of the print group.
• Line Size
Line Size establishes the number of character positions in the print lines generated for a print group.
Operations
The Reporting Environment supports a set of operations that manipulate the print items in a print group. The operations
include:
• Spacing -- inserts spaces between print items in a print group
• Justification -- controls how print items in a print group are distributed across the page of a report
• Indentation -- adjusts the size of margins on the left and right sides of a report.
A detailed description of each operation follows.
Spacing
Spacing defines the number of space characters that the Reporting Environment is to insert between print items in a print
group.
The spacing operation defines a minimum separation between print items that is applied to the print items in a print group
before any justification operation is performed.
The following diagram illustrates an unjustified set of four print items with a spacing value of zero.
The following diagram illustrates the same unjustified set of four print items with a spacing value of three.
674
CA Easytrieve® Report Generator 11.6
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:
• 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:
675
CA Easytrieve® Report Generator 11.6
• 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:
676
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:
677
CA Easytrieve® Report Generator 11.6
678
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:
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.
679
CA Easytrieve® Report Generator 11.6
After calculating the windows, CA Easytrieve® Report Generator determines the format of each of the print lines. To do
this, CA Easytrieve® Report Generator must center each print element within its own window and then determine the
correct amount of space between those elements that occur on the same print line. This step is illustrated by the following
diagram.
680
CA Easytrieve® Report Generator 11.6
As is shown in the previous diagram, there are four gaps that must be filled with spaces by CA Easytrieve® Report
Generator. CA Easytrieve® Report Generator attempts to fill each gap using a combination of the fonts assigned to
print items on the original CA Easytrieve® Report Generator statement. In this example, not only will CA Easytrieve®
Report Generator use the default font (size of 10 points), but also font #1 (8 points in width) and font #2 (7.2 points). CA
Easytrieve® Report Generator will analyze each gap individually and attempt to determine the spacing factors that will
position an element as close as possible to its assigned print position. For the current example, the following diagram
illustrates the results produced by CA Easytrieve® Report Generator.
681
CA Easytrieve® Report Generator 11.6
As illustrated above, the first gap on Heading Line 1 was filled by 2 spaces using the 7.2 point font. This is as close to
print position 14 as was possible with the available fonts. For the gap on Heading Line 2, the insertion of 3 spaces using
the 10 point font filled the gap exactly. On the Detail Line, the first gap was filled by 6 spaces using the 7.2 point font. The
second gap to be filled on the Detail Line was originally 95 points wide but because the first gap on this same line actually
increased, the second gap was reduced by 0.2 points (the increase in the first gap). The resultant gap of 94.8 was then
filled exactly by CA Easytrieve® Report Generator using a combination of 9 spaces of 7.2 points in width and 3 spaces of
10 points in width. Consequently, CA Easytrieve® Report Generator was able to position the second element on the Detail
Line exactly at its assigned print position.
As was illustrated by Heading Line 1 in the previous diagram, when CA Easytrieve® Report Generator cannot position
an element at its assigned print position, CA Easytrieve® Report Generator will position the element as close as possible
to its assigned position. If this movement of the element results in the element moving outside the item window for the
element, the window will be expanded and all the elements to be positioned in that window will be re-centered. The
spacing between elements on the same print line will then be re-calculated. When CA Easytrieve® Report Generator
expands the size of a window, CA Easytrieve® Report Generator ensures that a window does not overlap another window.
This technique ensures that no two elements on the same print line will ever overlap.
682
CA Easytrieve® Report Generator 11.6
683
CA Easytrieve® Report Generator 11.6
The following blocks illustrate the format of the data immediately prior to being combined onto the single print line. Printers
that support the Print Overprint technique prepare or image each print record independently. Although the following three
blocks are destined for the same print line, they have been separated for the purposes of this illustration.
Figure 62: Data Format before Combination to Single Print Line
The same process applies to the third character that is to print from a 7 point print record. To ensure that this character
does not print over the 9 or the 12 point character, CA Easytrieve® Report Generator inserts sufficient spaces before
the 7 point character in the third print record. The correct amount of space would be 24 points of spaces as the 7 point
character cannot print over the 12 point character that is positioned 12 points from the start of the line (12 + 12 = 24). For
the 7 point print line though, 24 points of spacing is not possible using a 7 point space. The closest CA Easytrieve® Report
Generator can come to this figure is 28 (four 7 point spaces). As a result, there is a 4 point gap between the second and
third characters. Again another Overprint Gap.
CA Easytrieve® Report Generator automatically calculates the correct positioning of print items such that they do not
overlap, thereby incorporating this limitation into the positioning of items on a report.
684
CA Easytrieve® Report Generator 11.6
characters to their assigned location is 28 points (4 X 7 point spaces). CA Easytrieve® Report Generator cannot solve the
inability to position the characters on the 24th point.
CA Easytrieve® Report Generator allows for the effects of this limitation when it occurs by positioning the print item as
close as is possible to the assigned location, but always on the right side of the location.
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.
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.
685
CA Easytrieve® Report Generator 11.6
<easy> Program
FILE
(library section)
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.
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
686
CA Easytrieve® Report Generator 11.6
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
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:
687
CA Easytrieve® Report Generator 11.6
• 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.
688
CA Easytrieve® Report Generator 11.6
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:
– 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.
689
CA Easytrieve® Report Generator 11.6
• 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.
690
CA Easytrieve® Report Generator 11.6
– If attributes are not specified for a title item (ATTR parameter on the TITLE statement), default attributes that are
specified on the DEFAULT TITLE statement at the beginning of the SCREEN declaration are used.
– If a DEFAULT TITLE statement is not coded in the SCREEN activity, attributes that are set in the site options are
used.
Because titles are not updatable, the following attributes are flagged as warnings when compiled, and ignored when
used:
– ALARM
– CURSOR
– INVISIBLE
– MUSTENTER
– MUSTFILL
– NUMERIC
– TRIGGER
691
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.
• 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.
692
CA Easytrieve® Report Generator 11.6
Name . . . . BERG
Dept . . . . 943
Attribute Examples
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.
693
CA Easytrieve® Report Generator 11.6
• FILL
• JUSTIFY
• MASK
This article contains the following information:
Name . . . . BERG________________
Name . . . . BRG
The user can then insert characters into the field to change it to the correct name, BERG.
694
CA Easytrieve® Report Generator 11.6
Name . . . . BERG
Name . . . . BERG
Mask Example
The following example illustrates masks:
695
CA Easytrieve® Report Generator 11.6
Mask Examples
Mask Examples
Name . . . . C2C5D9C740404040404040404040404040404040
Gross Pay . . 0075920C
696
CA Easytrieve® Report Generator 11.6
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.
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.
697
CA Easytrieve® Report Generator 11.6
698
CA Easytrieve® Report Generator 11.6
3. The best pattern character for each position is D, because D represents the character set of digits. The pattern
becomes: DDDDD.
4. Because only one order is expected for this field, Step 4 of How to Build a Pattern does not apply.
5. Because D repeats five times, the pattern can be D(5). In this case, the application of this step is not required. DDDDD
and D(5) are internally generated the same way. You can use either pattern.
Example 2: Build a Name Pattern
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
699
CA Easytrieve® Report Generator 11.6
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.
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:
700
CA Easytrieve® Report Generator 11.6
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.
701
CA Easytrieve® Report Generator 11.6
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.
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
702
CA Easytrieve® Report Generator 11.6
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:
703
CA Easytrieve® Report Generator 11.6
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:
• 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.
704
CA Easytrieve® Report Generator 11.6
705
CA Easytrieve® Report Generator 11.6
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
706
CA Easytrieve® Report Generator 11.6
screen declaration. By default, all three levels of messages are sent to the same screen row number. Use the DEFAULT
statement to designate from one to three rows to display different levels of messages on the screen.
Message Attributes
You can specify attributes for the three levels of messages on DEFAULT MESSAGE statements. If you do not use a
DEFAULT MESSAGE statement, screen attributes for each message level are taken from the site options.
Message Text
The screen message area is used for both system-issued and programmer-issued messages. System-issued messages
result from the edit process that the product automatically performs on input data. You can override the message resulting
from the edit process with the ERROR parameter of the ROW statement. See Automatic Editing of Input for more
information.
You can also issue messages from the screen procedures that you code following the screen declaration by executing the
MESSAGE or SET statement prior to the display of the screen.
Location
The function key area is always located at the bottom of the screen. The display is determined by the KEY statements you
code in the screen declaration. You can specify descriptive text on each KEY statement to be displayed with the name of
the key. Depending on the number of keys and the length of the descriptive text, more than one row of the screen may be
required to display the active function keys.
NOTE
If you specify that one or more message areas use the same screen row as the function key area, messages
may overlap the function key area. The default location for messages is just above the function key area.
Attributes
You can specify attributes for the function key area on a DEFAULT KEY statement. If you do not use a DEFAULT KEY
statement, screen attributes for the function key area are taken from the site options.
707
CA Easytrieve® Report Generator 11.6
• Each KEY statement specifies one or more keys that are active for that SCREEN activity. If the user presses an
inactive key, an error message is automatically sent to the user.
• Each KEY statement can specify a NAME parameter containing text to be displayed at the bottom of the screen.
• If you do not code any KEY statements in your SCREEN activity, all keys are active and you must provide code in your
SCREEN procedures to validate key values.
• With each KEY statement, you can optionally assign the key to perform a branch action automatically. Branch actions
cause activity execution to branch to a specific step in the process. The branch actions that you can code on a KEY
statement and their effects are:
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:
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.
708
CA Easytrieve® Report Generator 11.6
INITIATION
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.
Branch Actions
This article describes the four actions that cause program execution to branch to specific steps in the SCREEN activity
process:
709
CA Easytrieve® Report Generator 11.6
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
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:
710
CA Easytrieve® Report Generator 11.6
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
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.
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:
711
CA Easytrieve® Report Generator 11.6
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.
712
CA Easytrieve® Report Generator 11.6
_ View employee
Edit employee
Delete employee
Add employee
...
F2=Select F3=Exit
713
CA Easytrieve® Report Generator 11.6
• 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.
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.
714
CA Easytrieve® Report Generator 11.6
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 File Processing Modes for information about how requests are processed to
update records during file processing.
This article contains the following information:
715
CA Easytrieve® Report Generator 11.6
WHEN F5
READ KPERSNL KEY WORK-EMP# STATUS
IF NOT KPERSNL
MESSAGE 'EMPLOYEE NOT FOUND. ENTER NEXT EMPLOYEE.'
MOVE ZERO TO SSN
ELSE
MESSAGE 'ENTER NEW SSN. PRESS F6.' LEVEL INFORMATION
CURSOR AT SSN
END-IF
WHEN F6
WRITE KPERSNL UPDATE STATUS
IF FILE-STATUS NE 0
MESSAGE 'EMPLOYEE NOT UPDATED. REASON=' FILE-STATUS
ELSE
MESSAGE 'SSN UPDATED. ENTER NEXT EMPLOYEE. PRESS F5.' +
LEVEL INFORMATION
END-IF
END-CASE
END-PROC
716
CA Easytrieve® Report Generator 11.6
CASE KEY-PRESSED
WHEN F5
READ KPERSNL KEY WORK-EMP# NOHOLD STATUS
IF NOT KPERSNL
MESSAGE 'EMPLOYEE NOT FOUND. ENTER NEXT EMPLOYEE.'
MOVE ZERO TO SSN
ELSE
MESSAGE 'ENTER NEW SSN. PRESS F6.' LEVEL INFORMATION
CURSOR AT SSN
END-IF
WHEN F6
MOVE KPERSNL TO WORK-AREA
READ KPERSNL KEY WORK-EMP# HOLD
MOVE WORK-AREA TO KPERSNL
WRITE KPERSNL UPDATE STATUS
IF FILE-STATUS NE 0
MESSAGE 'EMPLOYEE NOT UPDATED. REASON=' FILE-STATUS
ELSE
MESSAGE 'SSN UPDATED. ENTER NEXT EMPLOYEE. PRESS F5.' +
LEVEL INFORMATION
END-IF
END-CASE
END-PROC
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.
FILE KPERSNL INDEXED UPDATE
%PERSNL
WORK-EMP# W 5 N
WORK-AREA W 150 A
SAVE-SSN W SSN
SCREEN NAME UPDATE-KPERSNL COMMIT TERMINAL
KEY F3 NAME 'Exit' EXIT
KEY F5 NAME 'Find Employee'
KEY F6 NAME 'Update employee'
717
CA Easytrieve® Report Generator 11.6
718
CA Easytrieve® Report Generator 11.6
719
CA Easytrieve® Report Generator 11.6
END-IF
END-CASE
END-PROC
720
CA Easytrieve® Report Generator 11.6
END-PROC
...
721
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:
722
CA Easytrieve® Report Generator 11.6
...
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
EXECUTE MENU-HELP
RESHOW
END-IF
723
CA Easytrieve® Report Generator 11.6
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:
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
724
CA Easytrieve® Report Generator 11.6
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?'
ROW 5 'Press F6 to update record'
ROW 6 'Press F12 to cancel update'
AFTER-SCREEN. PROC
MOVE PERSNL TO WORK-AREA
READ PERSNL KEY EMP#
MOVE WORK-AREA TO PERSNL
WRITE PERSNL UPDATE
MESSAGE 'Record updated.' LEVEL INFORMATION
EXIT
END-PROC
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
725
CA Easytrieve® Report Generator 11.6
Confirm Update
F6=Update F12=Cancel
F3=Exit F6=Update
EMPLOYEE RECORD
Options
+---------------+
...
When the user presses F10, the following pull-down menu is displayed:
EMPLOYEE RECORD
Options
726
CA Easytrieve® Report Generator 11.6
+---------------+
| Find>> |
| Print | 00370
| | BER 256-52-8737
| |
| F3=Exit | NAGLE
+---------------+
...
727
CA Easytrieve® Report Generator 11.6
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.
This article contains the following information:
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.
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.
728
CA Easytrieve® Report Generator 11.6
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:
ACCESS 'eight-byte code'
VSAM
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:
ACCESS 'eight-byte password'
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 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
...
729
CA Easytrieve® Report Generator 11.6
macro-1
expanded
statements
...
macro-2
expanded
statements
...
Define Macros
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
Positional Parameters
Use positional parameters when a value is always required for the parameter each time the macro is invoked. Frequently
used parameters are often positional, because you need to code only the value of the parameter.
Keyword Parameters
Use keyword parameters as follows:
730
CA Easytrieve® Report Generator 11.6
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.
Process Macros
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
731
CA Easytrieve® Report Generator 11.6
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.
732
CA Easytrieve® Report Generator 11.6
TYPE VIRTUAL
... FILE &NAME &TYPE &FORMAT
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 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
****************************************************************
* *
* 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
733
CA Easytrieve® Report Generator 11.6
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:
27
734
CA Easytrieve® Report Generator 11.6
NOTE
You must use the interface with CA Easytrieve Report Generator Release 5 or higher.
Prerequisite Knowledge
To use this interface effectively, you should have:
• Basic knowledge of the SUPRA Database Management System
• Working knowledge of CA Easytrieve Report Generator
• Knowledge of the views you want to access
Specifically, you should know:
• Your SUPRA user ID and password
• Names of the views you want to access
• Names of the attributes and keys that comprise those views
• How-to-use the fields that are contained in TIS-CONTROL to control access to the logical views
Related Publications
The following publications (not produced by CA Technologies) are either referenced in this section or are recommended
reading:
• SUPRA RDM COBOL
• PL/I Programmer's Guide
More Information:
For more information, see the following sections:
• SUPRA Interface Operation
• Diagnostic Messages
735
CA Easytrieve® Report Generator 11.6
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.
This program accesses the logical records that are defined as CUSTOMER:
736
CA Easytrieve® Report Generator 11.6
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:
TITLE 01 'THIS IS A +
SUPRA PROGRAM'
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.
TITLE 01 'THIS IS +
A SUPRA PROGRAM'
737
CA Easytrieve® Report Generator 11.6
SUPRA GET
Contents
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 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.
738
CA Easytrieve® Report Generator 11.6
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
Syntax
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:
739
CA Easytrieve® Report Generator 11.6
• 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.
DEFINE view-fieldname (2)
DEFINE ASI-view (1,2) Defines the view's ASI area.
DEFINE ASI-fieldname (1) Defines the field's Attribute Status Indicator (ASI).
DEFINE ASI-view-fieldname (2)
(1) Used when the PREFIX parameter is not specified.
(2) Used when the PREFIX parameter is specified.
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.
740
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
741
CA Easytrieve® Report Generator 11.6
SUPRA ON ERROR
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.
See your SUPRA RDM COBOL or PL/I Programmer's Guide for details of the RESET function.
Syntax
SUPRA RESET
SUPRA SIGN-OFF
The SUPRA SIGN-OFF statement informs the RDM that the user no longer wants access to the system.
Syntax
SUPRA SIGN-OFF
742
CA Easytrieve® Report Generator 11.6
SUPRA SIGN-ON
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.
743
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.
744
CA Easytrieve® Report Generator 11.6
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.
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
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.
745
CA Easytrieve® Report Generator 11.6
KEY-PRODUCT 5 9 A
SUPRA INCLUDE STOCK
JOB INPUT KEYFILE START SIGNON FINISH SIGNOFF
SUPRA GET STOCK USING (KEY-BRANCH KEY-PRODUCT)
IF TIS-FSI = 'N'
DISPLAY 'NOT FOUND' +1 KEY-BRANCH +1 KEY-PRODUCT
ELSE
PRINT QNTY-REPORT
END-IF
*
SIGNON. PROC
SUPRA SIGN-ON 'SMITH'
END-PROC
*
SIGNOFF. PROC
SUPRA SIGN-OFF
DISPLAY 'END OF REPORT'
END-PROC
*
REPORT QNTY-REPORT
TITLE 'QUANTITY REPORT'
LINE STOCK-BRANCH STOCK-PRODUCT STOCK-QNTY
END
1241TL-4002-A
1241HD-7214-C
PARM LINK(TSTPGM1 R)
SUPRA INCLUDE CUSTOMER
PASSWORD S 8 A
PARM-DATA S 8 A VALUE ' '
*
PROGRAM MAINRTN USING(PARM-DATA)
EXECUTE JOB1
*
JOB NAME JOB1 INPUT NULL START SIGNON FINISH SIGNOFF
SUPRA GET CUSTOMER
DO WHILE TIS-FSI = '*'
DISPLAY 'BRANCH=' CUSTOMER-BRANCH
SUPRA GET CUSTOMER
END-DO
STOP
*
SIGNON. PROC
IF PARM-DATA = SPACES . * PASSWORD WAS NOT SUPPLIED
DISPLAY '****** PASSWORD MISSING'
746
CA Easytrieve® Report Generator 11.6
ELSE
PASSWORD = PARM-DATA
END-IF
END-PROC
*
SIGNOFF. PROC
SUPRA SIGN-OFF
END-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.
747
CA Easytrieve® Report Generator 11.6
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.
748
CA Easytrieve® Report Generator 11.6
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
• 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
749
CA Easytrieve® Report Generator 11.6
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
DO WHILE TOTALREALMF NE TOTALENDP
IF TOTALREALMS NE '****'
DISPLAY 'OPEN ERROR FOR', +
TOTALREALMF, ' ', +
TOTALREALMS
TOTALSTATUS = 'OPEN'
END-IF
REALMINDEX = REALMINDEX + 12
END-DO
IF TOTALSTATUS = 'OPEN'
STOP
END-IF
REALMINDEX = 0
750
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.
Syntax
• 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.
TOTALCMND = 'ADD-M'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTAL CMND, +
TOTALSTATUS, +
TOTAL FILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
Syntax
• literal-1
751
CA Easytrieve® Report Generator 11.6
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.
TOTALCMND = 'literal-1'
TOTALFILE = 'literal-2'
TOTALREF = field-1
TOTALLINK = 'literal-3'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%CBLCNVRT
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.
752
CA Easytrieve® Report Generator 11.6
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.
Syntax
%CLOSX
TOTALREALMM = 'COMP'
TOTALCMND = 'CLOSX'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALREALM, +
TOTALEND)
%CONCAT
Contents
Takes two fields and concatenates them into one, with variable spacing between the fields. The result is placed in the first
field.
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
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
753
CA Easytrieve® Report Generator 11.6
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
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.
CONVAE and CONVEA use the CV and CVDBNAME macros internally.
Syntax
• [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.
754
CA Easytrieve® Report Generator 11.6
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
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.
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.
755
CA Easytrieve® Report Generator 11.6
%DATECONV
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
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]
756
CA Easytrieve® Report Generator 11.6
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
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
YYDDD (Julian)
• [THRESHOLD]
757
CA Easytrieve® Report Generator 11.6
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
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.
TOTALCMND = 'DEL-M'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
758
CA Easytrieve® Report Generator 11.6
TOTALEND)
%DELVD
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.
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
%DFNTOTF
Contents
Use the %DFNTOTF macro to initialize the REALM= (TOTALREALM) values.
759
CA Easytrieve® Report Generator 11.6
Syntax
• literal-1
Four-character name of the file.
• literal-2
File's mode.
TOTALREALMF = 'literal-1'
TOTALREALMM = 'literal-2'
TOTALREALMS = '****'
REALMINDEX = REALMINDEX + 12
TOTALREALMK = TOTALENDP
%EZSSID
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
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]
760
CA Easytrieve® Report Generator 11.6
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
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.
TOTALCMND = 'FINDX'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
field-4, +
TOTALEND)
%GETCALEN
Contents
Converts an integer into a date in the format CCYYMMDD.
Syntax
761
CA Easytrieve® Report Generator 11.6
• [date-in]
Integer value that represents a Julian day number.
• [date-out]
Returned date in the format CCYYMMDD.
%GETJULI
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
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
Name of the field containing the argument list.
• field-3
Name of the field into which the data is retrieved.
TOTALCMND = 'RDNXT'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
762
CA Easytrieve® Report Generator 11.6
TOTALEND)
%OPENX
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
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.
• 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.
TOTALCMND = 'READD'
TOTALFILE = 'literal-1'
TOTALREF = field-1
TOTALLINK = 'literal-2'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
TOTALREF, +
TOTALLINK, +
763
CA Easytrieve® Report Generator 11.6
field-2, +
field-3, +
field-4, +
TOTALEND)
field-1 = TOTALREF
%READM
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.
TOTALCMND = 'READM'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
%READR
Contents
Use the %READR macro to retrieve records by following the chain of back pointers.
Syntax
764
CA Easytrieve® Report Generator 11.6
• 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.
TOTALCMND = 'READR'
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
%READV
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
765
CA Easytrieve® Report Generator 11.6
TOTALCMND = 'READV'
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
%RGHTJUST
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
Use the %SINOF macro to terminate task activities.
Syntax
%SINOF
766
CA Easytrieve® Report Generator 11.6
TOTALCMND = 'SINOF'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALTASK, +
TOTALEND)
%SINON
Contents
Use the %SINON macro to initialize task activities.
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.
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
767
CA Easytrieve® Report Generator 11.6
Syntax
%VERNUMP [param]
• [param]
The parameter field to be verified.
%WRITM
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.
TOTALCMND = 'WRITM'
TOTALFILE = 'literal-1'
CALL EZTPDBAS, +
USING(TOTALCMND, +
TOTALSTATUS, +
TOTALFILE, +
field-1, +
field-2, +
field-3, +
TOTALEND)
%WRITV
Contents
Use the %WRITV macro to update variable file records.
Syntax
768
CA Easytrieve® Report Generator 11.6
• 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.
• 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.
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
769
CA Easytrieve® Report Generator 11.6
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
*
770
CA Easytrieve® Report Generator 11.6
771
CA Easytrieve® Report Generator 11.6
Language Reference
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
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.
772
CA Easytrieve® Report Generator 11.6
• 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
773
CA Easytrieve® Report Generator 11.6
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.
– The shift-out code is found as part of the identified DBCS data.
Statements
This article contains an alphabetical list of CA Easytrieve Report Generator statements and a summary of the statements,
categorized by function.
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.
774
CA Easytrieve® Report Generator 11.6
775
CA Easytrieve® Report Generator 11.6
IDMS BIND Sign on the activity with the database management system.
IDMS BIND FILE Give the database management system access to the record in
program storage.
IDMS BIND PROCEDURE Establish communications between a program and a DBA-written
database procedure.
IDMS COMMIT Request the creation of a checkpoint.
IDMS CONNECT Establish a record as a member of a set occurrence.
IDMS DISCONNECT Cancel the relationship between a record and a set occurrence.
IDMS ERASE Make a record or logical record unavailable for further processing
and remove it from all set occurrences in which it participates as a
member.
IDMS FIND Locate a record.
IDMS FINISH Sign off the database management system.
IDMS GET Retrieve current data records.
IDMS IF Test the status of a set.
IDMS KEEP Place a shared or exclusive lock on a record.
IDMS MODIFY Update a record or logical record within the database.
IDMS OBTAIN Locate and then retrieve a record. For database records, see
IDMS FIND and IDMB OBTAIN Statements. For logical records,
see IDMS OBTAIN.
IDMS READY Establish area availability with the database manager.
IDMS RETURN Retrieve the database key for an indexed record without retrieving
the record.
IDMS ROLLBACK Request recovery.
IDMS STORE Place a new record or logical record occurrence into a database.
IF Control the execution of associated statements by testing
conditional expressions.
INITIATION A SCREEN procedure invoked during the start of a SCREEN
activity.
INSERT Insert a row into an SQL file.
JOB Define and initiate processing activities.
JOB INPUT Identify automatic input to the activity.
JOB INPUT NULL Inhibit automatic input.
JOB INPUT SQL Allow to automatically manage the SQL cursor without a file.
KEY Define valid terminal keys for a screen, specify descriptive text,
and assign functions to terminal keys.
LINE Define the content of a report line.
LINK Transfer control from current program to another named program
and return to current program.
LIST Regulate the printing or suppression of all statements in the
printed output of a program.
LOGICAL-RECORD Identify the logical records available for automatic or controlled
processing of CA IDMS databases.
MACRO Define the parameters of a macro.
MEND Terminate a macro.
776
CA Easytrieve® Report Generator 11.6
MESSAGE Define message type and text for messages in a SCREEN activity.
MOVE Transfer character strings from one storage location to another.
MOVE LIKE Move contents of fields with identical names from one file or
record to another.
MSTART Begin an instream macro.
NEWPAGE Eject the printer to the top of the next page before printing the next
line of source program on a statement listing.
PARM Override selected general standards for a program that are set in
the Site Options Table.
PERFORM Transfer control to a procedure and return control to next
executable statement in current program.
POINT Establish a position within an INDEXED or RELATIVE file from
which subsequent data is sequentially retrieved.
POP Restore the previous listing control indicators.
PRINT Produce report output.
PROC Initiate a CA Easytrieve Report Generator procedure.
PROGRAM Identify and initiate a processing activity that can optionally initiate
JOB, SORT, and SCREEN activities.
PUSH Save the current listing control indicators.
PUT Perform sequential file output.
READ Provide random access to INDEXED and RELATIVE files.
RECORD Identify the CA IDMS database records available for automatic or
controlled processing.
REFRESH Restore the initial screen image by rebuilding it with the current
values of program fields.
RELEASE Manually release the hold on any record in an INDEXED or
RELATIVE file.
REPEAT Display arrays on a screen.
REPORT Define the type and characteristics of a report.
REPORT-INPUT A REPORT procedure that selects or modifies report input data.
RESHOW Redisplay a screen image without rebuilding the screen using the
current values of program fields.
RETRIEVE Identify the CA IDMS or IMS/DLI database records that are input
to the JOB activity.
ROLLBACK Roll back all recoverable work since the last commit-point.
ROW Specify items to be displayed and received on a row of a screen.
SCREEN Define and initiate a SCREEN activity.
SEARCH Provide access to table data.
SELECT (File-based SQL) Cause a cursor to be declared and opened for a SQL file.
SELECT (CA IDMS) Specify automatic input of logical records from CA IDMS
databases.
SELECT (Non-file SQL) Identify the rows and columns to be input to a JOB activity when a
CA Easytrieve Report Generator file is not used.
777
CA Easytrieve® Report Generator 11.6
SEQUENCE Specify the order of a report based on the content of one or more
fields.
SET Dynamically change screen attributes and control the display of
screen errors.
SKIP Space the printer a designated number of lines before printing the
next line of a statement listing.
SORT Sequence an input file in alphabetical or numerical order based on
fields specified as keys.
SQL Indicate a valid SQL statement for any of the supported SQL
database management systems.
SQL INCLUDE Indicate SQL table information is used to generate CA Easytrieve
Report Generator field definitions.
Library Definition
• COPY
• DECLARE
• DEFINE
• FILE
• SQL INCLUDE
778
CA Easytrieve® Report Generator 11.6
File Management
• CLOSE
• COMMIT
• DELETE
• DISPLAY
• ENDTABLE
• FETCH
• GET
• INSERT
• JOB
• JOB INPUT NULL
• JOB INPUT SQL
• POINT
• PUT
• 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
779
CA Easytrieve® Report Generator 11.6
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
780
CA Easytrieve® Report Generator 11.6
Listing Control
• * (asterisk)
• LIST
• NEWPAGE
• POP
• PUSH
• SKIP
Macro Processing
• % (percent)
• ACCESS
• MACRO
• MEND
• MSART
Native SQL
• SQL
781
CA Easytrieve® Report Generator 11.6
Statement Overview
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
782
CA Easytrieve® Report Generator 11.6
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.
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 'ABC-
DEF'
----------------------------
FIELD-NAME W 6 A -
VALUE 'ABC+
DEF'
DBCS Data
To continue a statement defining DBCS data, you must delimit the DBCS data. This means a shift-in code must precede
the continuation character and a shift-out code must precede the continuing DBCS data on the next record. The following
example illustrates continuing a DBCS literal:
783
CA Easytrieve® Report Generator 11.6
FIELD-NAME W 10 K +
VALUE '[DBDBDB] +
[DBDB]'
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.
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
FILEONE:RECORD-COUNT
(RECORD-COUNT)
'RECORD-COUNT'
RECORD-COUNT,
RECORD-COUNT.
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.
784
CA Easytrieve® Report Generator 11.6
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:
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 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:
785
CA Easytrieve® Report Generator 11.6
• 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
786
CA Easytrieve® Report Generator 11.6
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.
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.
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.
787
CA Easytrieve® Report Generator 11.6
The AFTER-BREAK procedure is invoked once for each level of break. For example, assume two control fields are
specified. When the minor field causes a control break, the AFTER-BREAK procedure is invoked only once. When the
major field causes a control break, AFTER-BREAK is invoked twice.
The value of LEVEL (a system-defined field) can be used to determine which control break is being processed. The value
of BREAK-LEVEL (a system-defined field) contains the number of the field causing the control break. TALLY (a system-
defined field) contains the number of records in a particular control group. For examples of LEVEL and BREAK-LEVEL,
see Programming.
NOTE
If NOPRINT is specified on a CONTROL statement, the AFTER-BREAK procedure is still executed.
An AFTER-BREAK procedure must be delimited by an END-PROC statement. For more information, see PROC
Statement.
This procedure has the following format:
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 +
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
788
CA Easytrieve® Report Generator 11.6
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:
789
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
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:
790
CA Easytrieve® Report Generator 11.6
IL 1444.32
TX 777.77
2222.09
AFTER-SCREEN. PROC
Example
AFTER-SCREEN. PROC
GET PERSNL
IF EOF PERSNL
EXIT
791
CA Easytrieve® Report Generator 11.6
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 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
792
CA Easytrieve® Report Generator 11.6
{= } {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
793
CA Easytrieve® Report Generator 11.6
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:
Format 1 (Normal Assignment)
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
794
CA Easytrieve® Report Generator 11.6
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:
795
CA Easytrieve® Report Generator 11.6
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:
• 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] +
796
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]
797
CA Easytrieve® Report Generator 11.6
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]
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.
798
CA Easytrieve® Report Generator 11.6
BEFORE-BREAK. PROC
Example
Consider the following percentage calculation, paying special attention to when and how PERCENT is calculated:
Statements:
END-PROC
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
Results:
799
CA Easytrieve® Report Generator 11.6
TX 777.77 35.00
2222.09 100.00
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
GET PERSNL
IF EOF PERSNL
800
CA Easytrieve® Report Generator 11.6
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 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:
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 program-name [USING ( { } ...)] [RETURNS return-field]
[ {'literal' } ]
• 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.
801
CA Easytrieve® Report Generator 11.6
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
[OTHERWISE ]
[ statement-n+1]
END-CASE
802
CA Easytrieve® Report Generator 11.6
• 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.
803
CA Easytrieve® Report Generator 11.6
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'.
FILE EMPLOYEE
EMPYRS 5 2 N
...
CASE EMPYRS
WHEN 0 THRU 4
DISPLAY 'ONE WEEK VACATION'
WHEN 5 THRU 10
DISPLAY 'TWO WEEKS VACATION'
OTHERWISE
DISPLAY 'THREE WEEKS VACATION'
END-CASE
...
CLOSE Statement
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.
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:
804
CA Easytrieve® Report Generator 11.6
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 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
ELSE
ROLLBACK
END-IF
Conditional Expressions
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 accepts seven different conditions: Field Relational, Field Series, Field Class, Field
Bits, File Presence, File Relational, Record Relational.
This statement has the following format:
{IF } [ {AND} ]
{DO WHILE } condition [ { } condition]...
{DO UNTIL } [ {OR } ]
805
CA Easytrieve® Report Generator 11.6
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 Operator Object
• 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:
806
CA Easytrieve® Report Generator 11.6
Subject Object
{ALPHABETIC }
{BREAK }
{CURSOR }
{HIGHEST-BREAK}
{IF } {MODIFIED }
{DO UNTIL } field-name [NOT] {NULL }
{DO WHILE } {NUMERIC }
{SPACE }
{SPACES }
{ZERO }
{ZEROS }
{ZEROES }
{HIGH-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}
807
CA Easytrieve® Report Generator 11.6
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.
• {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:
808
CA Easytrieve® Report Generator 11.6
Example
This example illustrates the use of the field class condition:
TOTAL-NUMERIC = TOTAL-NUMERIC + 1
END-IF
IF BRANCH NOT ZERO
TOTAL-NON-ZEROS = TOTAL-NON-ZEROS + 1
END-IF
IF EMPNAME ALPHABETIC
TOTAL-ALPHABETIC = TOTAL-ALPHABETIC + 1
END-IF
*
FINISH-PROC. PROC
DISPLAY TOTAL-NUMERIC
DISPLAY TOTAL-NON-ZEROS
DISPLAY TOTAL-ALPHABETIC
END-PROC
Relational
Subject Operator Object
{IF } {EQ|= }
{ELSE-IF } {NE|Ø=|NQ } {field-name-2 }
{ } field-name-1 {LT|< |LS } {literal }
{DO WHILE} {LE|<=|LQ|Ø> } {arithmetic-expression }
{DO UNTIL} {GT|> |GR }
{GE|>=|GQ|Ø< }
• Subject
809
CA Easytrieve® Report Generator 11.6
810
CA Easytrieve® Report Generator 11.6
• CA Easytrieve Report Generator supports only equal (EQ =) and not equal (NE Ø= NQ) conditions. If you use any of
the other conditional operators, an error occurs.
• The object must be a field, an alphanumeric literal, a MIXED literal, or a DBCS literal.
• If the object is an EBCDIC alphanumeric field or literal, then each character is converted into the DBCS code system of
field-name-1.
• If the object is a MIXED field or literal, the DBCS portion of data is converted into the DBCS code system of the
subject. CA Easytrieve® Report Generator also converts the EBCDIC portion of data to its equivalent DBCS value
based on the code system of the subject. Shift codes are removed.
• If the object is a DBCS field or literal, the data is converted into the DBCS code system of the subject.
• If necessary, numeric field objects are converted to zoned decimal and then converts the EBCDIC result into the
equivalent DBCS characters based on the code system of field-name-1.
• To match the length of the subject, CA Easytrieve Report Generator truncates or pads the object. Padding uses the
DBCS space character.
• Comparison is logical (bit-by-bit).
Example
This example illustrates various field relational conditions:
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 TOTAL-EMP#
811
CA Easytrieve® Report Generator 11.6
DISPLAY TOTAL-SEX
DISPLAY TOTAL-PAY
DISPLAY TOTAL-FIRST-NAME
END-PROC
Relational
Subject Operator
{IF }
{ELSE-IF } {EQ | = }
{ } field-name-1 { } +
{DO WHILE } {NE | Ø= | NQ}
{DO UNTIL }
Object
{field-name-2 [ {field-name-3 } ] }
{ [THRU { } ]...}
{literal-1 [ {literal-2 } ] }
• 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:
812
CA Easytrieve® Report Generator 11.6
BRANCH 2 2 N
DEPT 98 3 N
MARITAL-STAT 128 1 A
*
TOTAL-REGION W 3 N VALUE 0
TOTAL-BRANCH W 3 N VALUE 0
TOTAL-DEPT W 3 N VALUE 0
TOTAL-MARITAL W 3 N VALUE 0
WORK-REGION W 2 N VALUE 04
*
JOB INPUT PERSNL NAME MYPROG FINISH FINISH-PROC
IF REGION = 0, 8, 9
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 TOTAL-REGION
DISPLAY TOTAL-BRANCH
DISPLAY TOTAL-DEPT
DISPLAY TOTAL-MARITAL
END-PROC
Subject
813
CA Easytrieve® Report Generator 11.6
{IF }
{DO WHILE} [NOT] [EOF] {file-name}
{DO UNTIL}
• 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:
814
CA Easytrieve® Report Generator 11.6
END-IF
IF NOT SECONDARY
Subject
[file-name]
IF [NOT] MATCHED [PRIMARY ] ...
[SECONDARY]
• 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:
815
CA Easytrieve® Report Generator 11.6
COUNT-1 = COUNT-1 + 1
END-IF
*
FINISH-PROC. PROC
DISPLAY COUNT-1
END-PROC
Subject
{DUPLICATE} {file-name}
IF [NOT] {FIRST-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:
816
CA Easytrieve® Report Generator 11.6
COUNT-1 = COUNT-1 + 1
END-IF
IF DUPLICATE SORT2
COUNT-2 = COUNT-2 + 1
END-IF
*
FINISH-PROC. PROC
DISPLAY COUNT-1
DISPLAY COUNT-2
END-PROC
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.
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]...
817
CA Easytrieve® Report Generator 11.6
[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.
Example
COPY Statement
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 { }
{[database-file-name]:record-name}
• 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:
818
CA Easytrieve® Report Generator 11.6
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.
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:
819
CA Easytrieve® Report Generator 11.6
CURSOR AT field-name
• field-name
Field-name refers to a field on a ROW statement within the screen declaration.
Example
END-PROC
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 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:
{ATTR [(attribute-list)] }
DECLARE name {PATTERN 'pattern' }
{PROGRAM {STATIC|DYNAMIC}}
• 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.
820
CA Easytrieve® Report Generator 11.6
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).
(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.
821
CA Easytrieve® Report Generator 11.6
• 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).
If used, DEFAULT statements must be the first statements coded in a screen activity.
You cannot code overlapping overrides. For example, the following code is in error because the attribute for
INFORMATION level messages is coded twice:
DEFAULT MESSAGE INFORMATION ATTR BLUE
DEFAULT MESSAGE (INFORMATION WARNING) ATTR GREEN
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.
822
CA Easytrieve® Report Generator 11.6
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
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:
DEFAULT MESSAGE INFORMATION ATTR YELLOW
DEFAULT MESSAGE (WARNING ACTION) ATTR (RED INTENSE)
Example 2
You can override the placement of messages on a screen using the ROW parameter:
SCREEN NAME MENU-SCREEN
DEFAULT FIELD ATTR (TURQ PROTECT)
DEFAULT FIELD ERROR ATTR (RED BLINK ALARM)
DEFAULT MESSAGE (INFORMATION WARNING) ATTR YELLOW ROW 23
DEFAULT MESSAGE (ACTION) ATTR RED ROW 24
DEFINE Statement
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:
823
CA Easytrieve® Report Generator 11.6
* For table file fields, ARG (argument) and DESC (description), the maximum length is 254 bytes.
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 +
{start-location } }
{* [+offset-value] } }
{W } + } Location
{S } }
{[file-qualifier:] overlay-field-name [+offset-value]} }
[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] }
824
CA Easytrieve® Report Generator 11.6
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
– Can contain any character other than a delimiter
– Must begin with A through Z, 0 to 9, or a national character (#, @, $)
– Cannot be all numeric characters
Location
You must establish the location of the field's leftmost (starting) position in one of the following ways:
• {start-location}
Start-location specifies the starting position relative to position one of the current file or record.
NOTE
Start-location must be specified as an unsigned integer.
• {* [+offset-value]}
The * (asterisk) indicates that the field begins in the next available starting position (highest location defined so far, plus
1). The optional +offset-value is an offset you want added to the * value. There must be at least one blank between the
* and the optional +offset-value.
NOTE
+offset-value must be specified as a positive literal.
• {W} or {S}
Coding W or S establishes a working storage field. S indicates a static working storage field. The product spools W
fields to report (work) files; it does not spool S fields.
NOTE
For more information about working storage fields, see Define Files and Fields.
• {[file-qualifier:] overlay-field-name [+offset-value]}
Specify overlay-field-name if you want an overlay redefinition. If you use overlay redefinition, make sure that field-
name fits within the storage boundaries of overlay-field-name. Overlaying fields with a different data format is allowed
but may result in unexpected results as contents are not revalidated. Any indexes associated with overlay-field-
name also apply to field-name.
Specify the optional file-qualifier if the redefined field is in a file or record other than the file or record currently being
defined.
The optional +offset-value allows you to offset the field from the beginning of overlay-field-name.
Attributes
For each field-name you define, you must specify the field length in bytes, the data format, the number of decimal-
positions (if any), and the optional VARYING parameter for varying length alphanumeric fields.
• {field-length}
Field-length specifies the length (in bytes) of the defined field. Field-length must be an unsigned integer.
• {A|M|K|N|P|B|U|I}
Specify the data format by entering one of the following letters:
825
CA Easytrieve® Report Generator 11.6
– A (alphanumeric) -- Use A when none of the numeric data types applies to the associated field. A-type fields
in files are EBCDIC format, unless the associated file was declared ASCII on the CODE parameter of the PARM
or FILE statement. A-type fields in working storage are either EBCDIC or ASCII, depending on the PARM CODE
PROCESS value.
– M (MIXED alphanumeric) -- (Mainframe only) Use M when you know the data in the associated field is EBCDIC,
DBCS, or a mixture of both. CA Easytrieve processes the field assuming that it contains EBCDIC data. The DBCS
data in this field must be identified by the shift codes in the field's DBCS code system. CA Easytrieve assumes that
the field's DBCS code system is the CA-PSI/DBCS processing code system, unless the field belongs to a file that
has the CODE parameter specified on its FILE statement. This field type is invalid for those DBCS code systems
that do not have an assigned shift code system and cannot support a MIXED field type.
– K (DBCS alphanumeric) -- (Mainframe only) Use K when you know the data in the field is in DBCS format. The
length of the field must be a multiple of two. The data in this field is associated with the DBCS code system defined
as the CA-PSI/DBCS processing code, unless the field belongs to a file that has the CODE parameter specified on
its FILE statement.
– N (zoned decimal) -- Use N when the field contains digits 0 to 9 in external decimal form. For example, 0 = X'F0' in
EBCDIC and X'30' in ASCII.
Note: In the options table, ASCSIGN specifies which system to use to create zoned numeric fields. For more
information, see Compiler Options.
– P (packed decimal) -- Use P when the field contains numbers that meet the IBM definition of internal packed
decimal. For example, the two-byte packed field containing 123 looks like X'123F', and the two-byte packed field
containing -123 looks like X'123D'
– 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:
(HEX) 7F = (BIN) 0111 1111 = (DECIMAL) 127
(HEX) 80 = (BIN) 1000 0000 = (DECIMAL) 128-
For a one-byte non-quantitative binary field, the following is true:
(HEX) 7F = (BIN) 0111 1111 = (DECIMAL) 127
(HEX) 80 = (BIN) 1000 0000 = (DECIMAL) 128
The following table shows the length equivalent and maximum possible values for quantitative binary fields:
826
CA Easytrieve® Report Generator 11.6
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:
• {[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.
827
CA Easytrieve® Report Generator 11.6
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.
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.
828
CA Easytrieve® Report Generator 11.6
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.
Example 1: DEFINE Statement in the Library Section
{ FILE PERSNL FB(150 1800)
Library { DEFINE EMP# 9 5 N
{ DEFINE EMPNAME 17 20 A
{ DEFINE EMP-COUNT W 4 N
*
{ JOB INPUT PERSNL NAME MYPROG
{ EMP-COUNT = EMP-COUNT + 1
Activities { PRINT REPORT1
*
{ REPORT REPORT1
829
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
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
830
CA Easytrieve® Report Generator 11.6
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.
Because VARYING is used, this W type work field has two parts that are internally defined as follows:
W 2 B 0 forthetwo-bytefieldlength
W 248 A forthedata
Edit Masks
To add an edit mask to a telephone number, use the MASK parameter:
DEFINE PHONE S 10 N MASK '(999) 999-9999'
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.
DEFINE ARRAY W 20 A
DEFINE ELEMENT ARRAY 2 N 0 OCCURS 10
DELETE Statement
Use the DELETE statement to delete a specific row from a CA Easytrieve® Report Generator SQL file.
831
CA Easytrieve® Report Generator 11.6
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.
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-integer ] +
832
CA Easytrieve® Report Generator 11.6
[ [ ]field-name]
[ [#font-number] ]
[ [ ]'literal' ]
[+offset ] ...
[-offset ]
[COL column-number ]
[POS position-number ]
Format 2
[display-file-name] [{TITLE|NOTITLE} ]
DISPLAY [ ] [SKIP skip-integer ] +
[SYSPRINT ] [CONTROL 'carriage-control-character']
{file-name }
HEX {field-name }
{record-name}
Format 3
[display-file-name] [ ]
DISPLAY [ ] [CONTROL 'control-literal']
[SYSPRINT ] [ ]
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 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
833
CA Easytrieve® Report Generator 11.6
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:
834
CA Easytrieve® Report Generator 11.6
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 NY10012 @ 911
ZONE FFF21683FFFFF44FCDDDDC44DCDCC4444444FFFF4CDDDDCCD4ECDD4CDCE4EDDD4444DEFFFFF4444444444444403670450FFF
NUMR 1048327C019630071956340039541000000015690363659130359901556086920000581001200000000000000058C045C911
1...5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80...85...90...95..100
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.
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' }
835
CA Easytrieve® Report Generator 11.6
DLI { } { } id-field-name +
{XRST} {seg-len-field-name}
[ {'checkpoint-len-literal' } ]
[ { } checkpoint-field-name ] ...
[ {checkpoint-len-field-name} ]
Format 3
DLI CHKP id-field-name
Format 4
DLI file-name FOR ACCESS
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 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-
836
CA Easytrieve® Report Generator 11.6
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)
837
CA Easytrieve® Report Generator 11.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.
• {'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
...
statement-n
END-DO
838
CA Easytrieve® Report Generator 11.6
• {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.
Examples
DO UNTIL statement example:
FILE FILEA
ELEMENT 1 10 A OCCURS 10
CTR W 2 N
JOB INPUT FILEA
CTR = 1
DO UNTIL CTR > 10
839
CA Easytrieve® Report Generator 11.6
ENDPAGE. PROC
Example
ENDPAGE is typically used to produce page totals or other annotations, as in the following example of page footer
annotation:
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
840
CA Easytrieve® Report Generator 11.6
END-PROC Statement
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.
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.
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 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.
841
CA Easytrieve® Report Generator 11.6
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}
Identifies the JOB, SORT, or SCREEN activity to be executed.
Example
PARM-FIELD W 5 A
PROGRAM NAME SAMPLE-PROGRAM USING PARM-FIELD
IF PARM-FIELD = 'DAILY'
EXECUTE DAILY-JOB
ELSE
EXECUTE WEEKLY-JOB
END-IF
JOB NAME DAILY-JOB
. . .
JOB NAME WEEKLY-JOB
EXIT Statement
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
842
CA Easytrieve® Report Generator 11.6
FETCH Statement
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 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):
FILE file-name VS ([ES] [F] [PASSWORD 'literal'] +
CREATE [RESET|UPDATE] [NOVERIFY]
For more information about using the FILE statement, see the Programming section.
843
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] +
844
CA Easytrieve® Report Generator 11.6
[ASA] +
[EXTENDEDxrpt-printer] +
[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} ] ] }
845
CA Easytrieve® Report Generator 11.6
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.
846
CA Easytrieve® Report Generator 11.6
(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)
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.
847
CA Easytrieve® Report Generator 11.6
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).
848
CA Easytrieve® Report Generator 11.6
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
FILE file-name FB(0 0)
This tells CA Easytrieve® Report Generator to pick up the LRECL from the JCL and to utilize the block size set by
SMS.
FILE file-name FB(150 0)
This tells CA Easytrieve® Report Generator to pick up the LRECL from this definition and to utilize the block size set by
SMS.
FILE file-name FB(150 3000)
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.
•
849
CA Easytrieve® Report Generator 11.6
850
CA Easytrieve® Report Generator 11.6
For file types SEQUENTIAL, INDEXED, and RELATIVE, and device type PRINTER, this is the DDname of the
associated data set. The requirements for the format of the file-identifier character string are the same as the
requirements for the DDname. If fewer than eight characters are provided, the value is padded with blanks on the
right to obtain a string of eight characters. File-identifier-field-name must be an alphanumeric field of any format.
Only uppercase alphabetic and numeric digits are allowed. The first character must not be a digit. If File-identifier-
field-name is defined with a length greater than eight, the DDname must reside in the first 8 (or less) bytes with the
remainder set to blanks.
For data set type VIRTUAL, the SYSNAME parameter is ignored.
For CMS:
For file types SEQUENTIAL, INDEXED, and RELATIVE, and device type PRINTER, this is the FILEDEF or DLBL
name of the associated data set. The requirements for the format of the file-identifier character string are the same
as the requirements for the FILEDEF or DLBL. If fewer than eight characters are provided, the value is padded with
blanks on the right to obtain a string of eight characters. File-identifier-field-name must be an alphanumeric field of
any format. Only uppercase alphabetic and numeric digits are allowed. The first character must not be a digit. If File-
identifier-field-name is defined with a length greater than eight, the FILEDEF or DLBL name must reside in the first 8
(or less) bytes with the remainder set to blanks.
For non-mainframe platforms:
For SEQUENTIAL, INDEXED, and RELATIVE file types and the PRINTER device type, SYSNAME is either a
file description string or an environment variable specifying the file description string. If the value of SYSNAME
contains a path separator (/ or \), it is treated as a file description string. If it does not contain a path separator, CA
Easytrieve® Report Generator searches for an environment variable with the same name. If such a variable is
found, the value of the variable is used as the file description string. If the variable is not found, the SYSNAME value
is used as the path.
For more information about the file description string, see File Description String (Non-Mainframe Only).
The length of SYSNAME is limited to the lesser of 256 characters or the maximum path length supported by your
operating system.
• [VIRTUAL] (return to top)
VIRTUAL identifies a file as a CA Easytrieve® Report Generator Virtual File Manager (VFM) file. CA Easytrieve®
Report Generator virtual files are temporary sequential work files that are normally deleted after the file is read and
closed.
– [RETAIN]
RETAIN inhibits the automatic deletion of a VFM file after it is read. The file is deleted if it is opened for OUTPUT or
CREATE in a subsequent JOB activity or at program termination.
– [MEMORY] or [DISK]
MEMORY and DISK indicate the type of CICS temporary storage that CA Easytrieve® Report Generator is to use
for storing this file. MEMORY indicates a main storage resident temporary storage queue in CICS. DISK indicates
an auxiliary storage resident temporary storage queue. DISK is the default.
• [TERMINAL] (return to top)
Code the TERMINAL parameter to route the output for this printer file to an online terminal. The TERMINAL parameter
is mutually exclusive with the SPOOL, VIRTUAL, and SYSNAME parameters.
A device type of PRINTER is implied.
– [ID {'terminal-id-literal'}] or [ID {terminal-id-field-name}] (CICS only)
Specify the name of the destination terminal in 'terminal-id-literal' or terminal-id-field-name. This terminal can be
either a display terminal or an online printer. Any valid terminal ID is accepted.
When ID is not specified, output directed to this file is spooled until the file is closed. The output can then be
browsed at the originating terminal using the Report Display Facility. You can also then print the file.
– [NOFORMFEED]
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]
851
CA Easytrieve® Report Generator 11.6
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
852
CA Easytrieve® Report Generator 11.6
GET Statement
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:
[HOLD ]
GET file-name [PRIOR] [ ] [STATUS]
[OHOLD ]
• 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.
NOTE
FILE-STATUS is not defined if you do not specify a file type parameter on the FILE statement.
853
CA Easytrieve® Report Generator 11.6
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:
IF PERSNL:FILE-STATUS NE 0
DISPLAY PERSNL:FILE-STATUS
ELSE
DISPLAY HEX PERSNL
END-IF
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.
This statement has the following format:
{GOTO } {label }
{ } {JOB }
{GO TO} {SCREEN}
• {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:
854
CA Easytrieve® Report Generator 11.6
– Assignment
– CASE
– COMMIT
– DELETE
– DLI
– END-DO
– END-PROC
– EXIT
– 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}
855
CA Easytrieve® Report Generator 11.6
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.
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 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
856
CA Easytrieve® Report Generator 11.6
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
The following example illustrates various report heading options:
Statements:
EMPNAME 17 20 A
NAME-LAST EMPNAME 8 A
NAME-FIRST EMPNAME +8 12 A
PAY-NET 90 4 P 2
JOB INPUT PERSNL NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65
HEADING PAY-NET ('NET', 'PAY')
Results:
SOCIAL
SECURITY NET
EMPNAME NUMBER PAY
[ {HIGHEST}]
IDD FILE file-name [VERSION {LOWEST }] +
857
CA Easytrieve® Report Generator 11.6
[ {nnnn }]
[SELECT (record-name...)] +
[FILENAME new-file-name]
• 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.
858
CA Easytrieve® Report Generator 11.6
[ {HIGHEST}]
IDD RECORD record-name [VERSION {LOWEST }] +
[ {nnnn }]
[ {start-position}]
[ {* [+offset] }]
[LOCATION { }]
[ {W }]
[ {S }]
• 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.
859
CA Easytrieve® Report Generator 11.6
[FILENAME file-name]
• 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 VERSION [SCHEMA {LOWEST }] +
[ {nnnn }]
[ {HIGHEST}]
[FILE {LOWEST }] +
[ {nnnn }]
[ {HIGHEST}]
[RECORD {LOWEST }]
[ {nnnn }]
860
CA Easytrieve® Report Generator 11.6
Specify HIGHEST, LOWEST, or a positive integer (nnnn) to identify the default version of any FILE to be retrieved
when the version is not specified on the IDD FILE statement.
• [RECORD {HIGHEST}] or {LOWEST} or {nnnn}]
Specify HIGHEST, LOWEST, or a positive integer (nnnn) to identify the default version of any RECORD to be retrieved
when the version is not specified on the IDD RECORD statement.
[{RECORD} {currency-field-name}]
IDMS ACCEPT DBKEY receive-field-name [{AREA } { }]
[{SET } {'currency-literal' }]
Format 2
{NEXT } {set-field-name}
IDMS ACCEPT DBKEY receive-field-name {PRIOR} { }
{OWNER} {'set-literal' }
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}
861
CA Easytrieve® Report Generator 11.6
• 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 ACCEPT PROCEDURE { } TO apib-field-name
{'proc-literal' }
• {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 BIND { } +
{'subschema-literal'}
[ {program-name }]
862
CA Easytrieve® Report Generator 11.6
[PROGRAM-NAME { }] +
[ {'program-literal'}]
[ {db-name-table-name }]
[DBNAME { }] +
[ {'db-name-table-literal'}]
[ {node-name }]
[NODE { }] +
[ {'node-literal'}]
[ {dictionary-name }]
[DICTNAME { }] +
[ {'dictionary-literal'}]
[ {dictionary-node-name }]
[DICTNODE { }]
[ {'dictionary-node-literal'}]
• {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
863
CA Easytrieve® Report Generator 11.6
{proc-field-name}
IDMS BIND PROCEDURE { } TO receive-field-name
{'proc-literal' }
• {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} {set-field-name}
IDMS CONNECT RECORD { } SET { }
{'record-literal' } {'set-literal' }
• {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.
864
CA Easytrieve® Report Generator 11.6
{record-field-name} {set-field-name}
IDMS DISCONNECT RECORD { } SET { }
{'record-literal' } {'set-literal' }
[MEMBERS ]
{record-field-name} [PERMANENT]
IDMS ERASE RECORD { } [ ]
{'record-literal' } [SELECTIVE]
[ALL ]
Format 2
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)]
865
CA Easytrieve® Report Generator 11.6
Code the optional WHERE clause to provide a Boolean expression CA IDMS uses to select the logical records to be
erased.
[ {record-field-name}]
[ RECORD { }]
{FIND } {key-field-name} [ {'record-literal' }] [SHARE|SHR ]
IDMS { } DBKEY { } [ ] [ ]
{OBTAIN} {'key-literal' } [ {page-field-name }] [EXCLUSIVE|EXC]
[ PAGE-INFO { }]
[ {'page-literal' }]
Format 2
Format 3
Format 4
866
CA Easytrieve® Report Generator 11.6
Format 5
Format 6
{control-field-name} [SHARE|SHR ]
USING ({ }...) [ ]
{'control-literal' } [EXCLUSIVE|EXC]
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'}
867
CA Easytrieve® Report Generator 11.6
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]
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
868
CA Easytrieve® Report Generator 11.6
[ {record-field-name}]
IDMS GET [RECORD { }]
[ {'record-literal' }]
• 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.
This statement has the following format:
{MEMBER }
{set-field-name} {NOMEMBER}
IDMS IF SET { } { }
{'set-literal' } {EMPTY }
{NOEMPTY }
• 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:
– Specify MEMBER if the current record is a member of specified set.
– Specify NOMEMBER if the current record is not a member of specified set.
– Specify EMPTY if no member record occurrences exist.
– Specify NOEMPTY if member record occurrences exist.
The IDMS IF statement is similar to the CA Easytrieve® Report Generator IF statement in that a corresponding END-IF
statement is required and the ELSE statement is optional. For more information, see the following sections in this chapter:
• IF Statement
• ELSE-IF Statement
• ELSE Statement
• END-IF Statement
[{RECORD} {field-name}]
IDMS KEEP [{SET } { }] [EXCLUSIVE]
[{AREA } {'literal' }]
• [{RECORD|SET|AREA} {field-name|'literal'}]
869
CA Easytrieve® Report Generator 11.6
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 MODIFY RECORD { }
{'record-literal' }
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
• 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}
IDMS OBTAIN { } RECORD logical-record-name [WHERE(boolean-expression)]
{NEXT }
• {FIRST} or {NEXT}
Specify FIRST to retrieve the first occurrence of the logical record. Specify NEXT to retrieve subsequent occurrences.
• RECORD logical-record-name
870
CA Easytrieve® Report Generator 11.6
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 RETURN DBKEY receive-field-name FROM { } +
{'set-literal' }
[KEY symbolic-key] +
{ }
{CURRENCY }
{FIRST [CURRENCY] }
{LAST [CURRENCY] }
{NEXT [CURRENCY] }
{PRIOR [CURRENCY] }
{ }
{ {key-field-name} }
{USING ({ }...)}
{ {'key-literal' } }
• 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]
871
CA Easytrieve® Report Generator 11.6
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.
{record-field-name}
IDMS STORE RECORD { }
{'record-literal' }
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)]
872
CA Easytrieve® Report Generator 11.6
Code the optional WHERE clause to provide a Boolean expression CA IDMS uses to select the logical records to be
stored.
IF conditional-expression-1
[statement-1]
[ELSE-IF conditional-expression-2] [ . . . ]
[ [statement-2] ] [ ]
[ELSE ]
[ [statement-3] ]
END-IF
The following diagram illustrates IF, ELSE-IF, ELSE, and END-IF logic:
873
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
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
874
CA Easytrieve® Report Generator 11.6
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:
TOT-XMAS-BONUS = TOT-XMASBONUS +
+ XMAS-BONUS
PRINT MYREPORT
*
FINISH-PROC. PROC
DISPLAY
DISPLAY 'TOTAL $ SPENT IN BONUS ' +
'MONEY ====> ' TOT-XMAS-BONUS
END-PROC
*
REPORT MYREPORT
LINE NAME-LAST XMAS-BONUS
875
CA Easytrieve® Report Generator 11.6
END-IF
876
CA Easytrieve® Report Generator 11.6
REPORT MYREPORT
LINE NAME-LAST XMAS-BONUS
INITIATION. PROC
Example
INITIATION. PROC
INSERT Statement
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]
Optionally, code INTO for statement readability.
• file-name
File-name identifies a CA Easytrieve® Report Generator SQL file.
Example
The following example inserts a new row into a table:
877
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:
• 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 +
[START start-proc-name] +
[FINISH finish-proc-name] +
[NAME job-name] +
[ { }]
[ENVIRONMENT{NONE }] +
[ {COBOL}]
[ [ACTIVITY ] [TERMINAL ] ]
[COMMIT ([ ] [ ])]
[ [NOACTIVITY] [NOTERMINAL] ]
• [INPUT]
The optional INPUT parameter identifies the automatic input to the activity.
878
CA Easytrieve® Report Generator 11.6
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.
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
879
CA Easytrieve® Report Generator 11.6
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
Example 1
The following example illustrates the position of the JOB activities in a CA Easytrieve® Report Generator program.
Environment
...
Library
...
Activities {JOB...
... {...
JOB, SCREEN { job procedures
and/or { ...
SORT { ...
... { reports
... { ...
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:
880
CA Easytrieve® Report Generator 11.6
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:
• 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."
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:
[EXIT ]
KEY key-name [THRU key-name]...[NAME 'literal'] [ ] [IMMEDIATE]
881
CA Easytrieve® Report Generator 11.6
[REFRESH]
• 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:
key-name=literal
Example:
882
CA Easytrieve® Report Generator 11.6
Specify EXIT to terminate the screen activity after editing and extracting data from screen fields into program fields.
Specify REFRESH to restore the initial screen image by rebuilding it with current values of the program fields. Data in
screen fields is edited and extracted into program fields.
If no action is specified for key-name, you can test for key-name in your SCREEN activity procedures with the system-
defined field, KEY-PRESSED.
• [IMMEDIATE]
Specify IMMEDIATE to execute a branch action, or the AFTER-SCREEN procedure if no action is specified, without
editing data in screen fields and moving it into the program fields.
Examples
The following table shows KEY statement examples:
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
'CANCEL' IMMEDIATE screen fields into program fields. The AFTER-SCREEN procedure
(if any) is not executed. F12=CANCEL is displayed on the screen.
KEY F3 IMMEDIATE The AFTER-SCREEN procedure (if any) is executed without
editing or moving data in screen fields to program fields. Nothing
is displayed on the screen. You must provide code for F3.
KEY F3 EXIT F3 terminates the activity after editing and moving data from the
screen.
KEY F5 IMMEDIATE + 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.
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.
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 }
{[#font-number] }
{[ ] 'literal' }
883
CA Easytrieve® Report Generator 11.6
• [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
884
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.
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.
Example
885
CA Easytrieve® Report Generator 11.6
LIST Statement
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:
LIST OFF
PARM LIST(NOPARM)
For more information, see PARM Statement in the chapter "Statements N - R."
This statement has the following format:
[ON ] [MACROS ]
LIST [ ] [ ]
[OFF] [NOMACROS]
• [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").
This statement has the following format:
MACRO [positional-count] +
• MACRO
MACRO must be the first word on a prototype statement.
• [positional-count]
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]
886
CA Easytrieve® Report Generator 11.6
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 CA Easytrieve Report Generator statements:
• DEFINE
• ROW
This statement has the following format:
[MASK ({[mask-identifier][BWZ]['mask-literal']|HEX })]
• [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
887
CA Easytrieve® Report Generator 11.6
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:
888
CA Easytrieve® Report Generator 11.6
– 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.
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.
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.
889
CA Easytrieve® Report Generator 11.6
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:
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
890
CA Easytrieve® Report Generator 11.6
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.
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.
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:
891
CA Easytrieve® Report Generator 11.6
• 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:
MESSAGE {'literal' }
{ } ... +
{field-name}
[ {INFORMATION} ]
[LEVEL {WARNING } ]
[ {ACTION } ]
• {'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.
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
892
CA Easytrieve® Report Generator 11.6
{send-file-name }
{send-record-name } [send-length-field ]
MOVE { } [ ] +
{send-field-name } [send-length-literal ]
{send-literal }
{receive-file-name } [receive-length-field ]
TO {receive-record-name} [ ] [FILL fill-character]
{receive-field-name } [receive-length-literal]
Example
Format 2
{NULL }
{SPACE }
{SPACES }
893
CA Easytrieve® Report Generator 11.6
MOVE { } TO receive-field-name...
{ZERO }
{ZEROS }
{ZEROES }
{HIGH-VALUES}
{LOW-VALUES }
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}
894
CA Easytrieve® Report Generator 11.6
Usage Notes
When you issue a MOVE LIKE statement, the contents of fields in send-file-name or send-record-name replace the
contents of fields with identical names in receive-file-name or receive-record-name. When receive-file-name or receive-
record-name contains overlapping fields, the order in which the fields are defined is important. The moves occur starting
with the first identically-named field in receive-file-name or receive-record-name and ending with the last identically-named
field in the file.
NOTE
The order in which fields are processed differs from previous versions of the product. In previous versions, the
moves occurred starting with the last identically-named field in receive-file-name or receive-record-name and
ended with the first identically-named field in the file.
If you want to move identically-named fields to or from working storage, you can use the keyword WORK as the send-file-
name or receive-file-name.
Example
895
CA Easytrieve® Report Generator 11.6
COPY PERSNL
JOB INPUT PERSONL NAME MYPROG
MOVE LIKE PERSNL TO MYFILE
PUT MYFILE
MYFILE:NAME-FIRST = PERSNL:NAME-FIRST
MYFILE:NAME-LAST = PERSNL:NAME-LAST
MYFILE:NAME = PERSNL:NAME
MYFILE:BRANCH = PERSNL:BRANCH
MYFILE:REGION = PERSNL:REGION
Whatever values were in the fields of the file PERSNL are now found in the fields of the file MYFILE.
MSTART Statement
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.
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.
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.
Environment <============== PARM
...
Library
896
CA Easytrieve® Report Generator 11.6
...
Activities
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] +
[ {MMDDYY}]
[DATE {YYMMDD}] +
[ {DDMMYY}]
[ { }]
897
CA Easytrieve® Report Generator 11.6
[ENVIRONMENT{NONE }] +
[ {COBOL}]
[ [FILE ] [PARM ] ]
[LIST ([ ] [ ] ] +
[ [NOFILE] [NOPARM] ]
[PLANOPTS 'plan-options-module'] +
[PREPNAME(SQL-access-module ['access-userid'])] +
[SORT +
[ {NO } ]
([ALTSEQ { } ] +
[ {(YES [alt-sort-table])} ]
[DEVICE device-type] +
[ {storage-amount } ]
[MEMORY { } ] +
[ {(MAX [-storage-released])} ]
[ {ALL [CONSOLE] } ]
[ { [PRINTER] } ]
[ { } ]
[MSG ( {CRITICAL [CONSOLE] } ) ] +
[ { [PRINTER] } ]
[ {DEFAULT } ]
[ {NO } ]
[RELEASE core-storage-amount] +
[WORK number-of-work-data-sets])] +
[SQLID 'auth-id'] +
[ {FULL } ]
[SQLSYNTAX {PARTIAL} ] +
[ {NONE } ]
[SSID 'ssid'] +
[SYNTAX] +
[TRANSID 'transid'] +
898
CA Easytrieve® Report Generator 11.6
[ [ {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.
BIND Parameter Options Table Options Table Options Table Options Table
Value Value Value Value
Value None A S D
None BIND defaults to BIND defaults to BIND defaults to BIND defaults to
DYNAMIC ANY STATIC-ONLY DYNAMIC
ANY ANY is the BIND ANY is the BIND Invalid -- an error Invalid -- an error
parameter parameter occurs occurs
899
CA Easytrieve® Report Generator 11.6
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).
900
CA Easytrieve® Report Generator 11.6
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.
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:
//LINK EXEC PGM=IEWL,PARM='LET,LIST,MAP'
...
//SYSLIN DD DISP=SHR,DSN=&&OBJECT.FROM.COMPILE
// DD *
NAME PROGNAM(R)
/*
NOTE
On non-mainframe platforms, LINK is ignored
LIST
[LIST [FILE|NOFILE] [PARM|NOPARM]]
LIST controls the printing of certain system outputs.
FILE prints file statistics at the end of each activity. NOFILE inhibits this operation.
PARM prints a compile summary and system parameters at the conclusion of the syntax check operation. NOPARM
inhibits this operation.
[PLAN (planname [command-program-name])]
PLAN is an SQL parameter. Currently, it is used only by the mainframe DB2 SQL interface.
The PLAN parameter enables you to specify values for the static-command-program and its DB2 PLAN. The name
you specify for the static-command-program must be a valid load module name. This name must be different from the
program-name specified for the LINK parameter.
The value specified for planname must be the name of the DB2 PLAN that identifies the DBRM of the given static-
command-program. For information about how to generate the static-command-program, see Program Environment.
If not specified, command-program-name defaults to planname.
Because the link-edit of the static-command-program and the bind of the DB2 PLAN are performed outside the control of
CA Easytrieve® Report Generator, you must specify the correct names on the batch JCL to ensure successful execution
of your program.
901
CA Easytrieve® Report Generator 11.6
[PLANOPTS 'plan-options-module']
PLANOPTS is an SQL parameter. Currently, this parameter is used only by the CA Datacom/DB SQL interface.
Use PLANOPTS to specify the name of the plan options module that is to override the default CA Easytrieve® Report
Generator plan options module.
[PREPNAME (SQL-access-module ['access-userid'])]
PREPNAME is an SQL parameter. Currently, it is used by the SQL/DS and CA Datacom/DB SQL interfaces.
For the SQL/DS SQL interface, the PREPNAME parameter enables you to specify the name of the access module or
package that is to be associated with the SQL statements for this application program.
For the CA Datacom/DB SQL interface, PREPNAME enables you to specify the access plan.
For either database, the PREPNAME parameter also enables you to specify an owner ID ('access-userid') for the access
module or access plan. For information about obtaining an authorization ID, see your specific database documentation.
If PREPNAME is not specified, SQL-access-module defaults to program-name on the LINK parameter. If the LINK
parameter is not specified, SQL-access-module defaults to the value specified in the Site Options Table.
NOTE
You should specify a unique value for the SQL-access-module for each CA Easytrieve® Report Generator
program. If you use the same name for either parameter value, database catalog contention can occur, or
an existing access module could be replaced with another one. For information about establishing naming
conventions, see your database administrator.
PREPNAME can be abbreviated to PREP.
[SORT]
SORT overrides the default parameters used to interface with your installation's sort program. For information about these
SORT parameters, see the installation procedures on your product media.
• – [ALTSEQ {NO|(YES [alt-sort-table])}]
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.
902
CA Easytrieve® Report Generator 11.6
[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.
(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'])]
903
CA Easytrieve® Report Generator 11.6
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.
Examples
The following examples illustrate typical uses of the PARM statement.
Example: Use of PARM for Production
904
CA Easytrieve® Report Generator 11.6
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:
ELSE
PERFORM STANDARD-BONUS
END-IF
PRINT MYREPORT
*
SPECIAL-BONUS. PROC
XMAS-BONUS = PAY-GROSS * 1.20
END-PROC
*
STANDARD-BONUS. PROC
XMAS-BONUS = PAY-GROSS * 1.05
END-PROC
*
REPORT MYREPORT
LINE NAME-LAST XMAS-BONUS
905
CA Easytrieve® Report Generator 11.6
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.
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:
{= }
{EQ} {field-name}
POINT file-name [PRIOR] {GE} { } [STATUS]
{GQ} {literal }
{>=}
• 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:
906
CA Easytrieve® Report Generator 11.6
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 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.
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.
907
CA Easytrieve® Report Generator 11.6
Example
FILE PERSNL FB(150 1800)
%PERSNL
JOB INPUT PERSNL NAME PRINT-RPT
PRINT REPORT1
REPORT REPORT1
TITLE 'PERSONNEL REPORT'
LINE EMP# SSN EMPNAME
PROC Statement
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
statement-1
...
statement-n
END-PROC
908
CA Easytrieve® Report Generator 11.6
Format 2
proc-name
PROC
statement-1
...
statement-n
END-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
Proc-name must be followed by the keyword PROC as a separate statement.
• statement-1...n
Statement-1 to statement-n are the statements that accomplish your procedure's task.
• END-PROC
The END-PROC statement delimits the statements contained in the procedure.
PROGRAM Statement
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:
909
CA Easytrieve® Report Generator 11.6
[ENVIRONMENT {NONE }] +
[ {COBOL}]
• [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.
• [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. ACTIVITY 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 program is linked to by another CA Easytrieve® Report Generator program, this program 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 about commit processing, see the Programming Guide.
• ENVIRONMENT (z/OS only)
Specifies to establish the proper execution environment prior to calling any COBOL subprograms. The environment
is established prior to the PROGRAM activity startup and is terminated after the activity has terminated.
ENVIRONMENT(COBOL) is ignored if the PROGRAM activity contains no CALL or EXECUTE statement, and if no
FILE EXITs are specified.
The COBOL ENVIRONMENT started at the PROGRAM activity level stays active during any JOB activities invoked
from that PROGRAM activity. If the PROGRAM activity does not start a COBOL ENVIRONMENT, (or if there is no
PROGRAM activity), the COBOL ENVIRONMENT will be started for the JOB activities as directed by the PARM
ENVIRONMENT or the JOB ENVIRONMENT parameter specification.
When this parameter is absent, the default is ENVIRONMENT(NONE). No PARM statement, or Site Option default is
used. See JOB Statement for more information about this parameter and the functionality of this feature.
910
CA Easytrieve® Report Generator 11.6
WARNING
For performance considerations, we recommend that you set the ENVIRONMENT option to COBOL if many
CA Easytrieve® Report Generator programs are calling Language Environment subprograms. The option
should be set to NONE if most CALLs are made to non-Language Environment subprograms.
• [USING field-name]
Specify USING to indicate that this program (child program) can accept a parameter from the parent program or
operating system. Field-name is the name of a field to which the parameter is passed.
NOTE
The data for the field-name consists of a two-byte length value followed by the data. If the field-name
definition includes the VARYING parameter, the data in the field is alphanumeric and of varying length. This
applies to the standard way that z/OS invokes main programs. For more information about the VARYING
parameter, see DEFINE Statement.
If the program is linked via the LINK option of the PARM statement, the program could be invoked directly
on the JCL EXEC statement. Other programs could also invoke the program, but the other program must
observe the standard type one linkage convention. For more information, see "Conventions for passing
information through a parameter list" in the IBM z/OS MVS Programming: Assembler Services Guide,
available on the IBM website.
• [GIVING field-name]
Code GIVING to return a single parameter to the parent program. Field-name is the name of a field containing the
parameter you want to return to the parent program.
Example: Equivalent Statements
FILE ...
...
PROGRAM NAME EXAMPLE1
EXECUTE JOB1
EXECUTE PANEL1
JOB NAME JOB1
...
SCREEN NAME PANEL1
...
is equivalent to:
FILE ...
...
JOB NAME JOB1
...
SCREEN NAME PANEL1
...
911
CA Easytrieve® Report Generator 11.6
PARM DUMP(PCODE)
DEFINE JCL-PARM S 100 A VARYING
PROGRAM NAME TESTPARM USING(JCL-PARM)
EXECUTE TESTPARM1
JOB INPUT(NULL) NAME TESTPARM1
DISPLAY 'JCL-PARM: +' JCL-PARM '+'
DISPLAY 'JCL-PARM:LENGTH: +' JCL-PARM:LENGTH '+'
STOP
Program output:
JCL-PARM: +0123456789ABCDEF +
JCL-PARM:LENGTH: + 16 +
PUSH Statement
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.
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 output-file-name [FROM { }][STATUS]
[ {input-record-name}]
• output-file-name
The output-file-name parameter identifies the output file.
• [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
912
CA Easytrieve® Report Generator 11.6
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
%PERSNL
FILE PERSNL
COPY FILEA
JOB INPUT PERSNL NAME MYPROG
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.
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:
{key-field-name} [HOLD ]
READ file-name KEY { } [ ] [STATUS]
{'key-literal' } [NOHOLD]
• 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.
913
CA Easytrieve® Report Generator 11.6
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]
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
IF PERSNL:FILE-STATUS NE 0
DISPLAY 'UNSUCCESSFUL READ +
PERFORMED ON FILE PERSNL' +
+2 'KEY= ' WHO
ELSE
TOTAL-NET = TOTAL-NET + PAY-NET
END-IF
DISPLAY-TOTAL. PROC
DISPLAY 'TOTAL NET PAY' TOTAL-NET
END-PROC
914
CA Easytrieve® Report Generator 11.6
RECORD statements (Format 2) identify the IMS/DLI database segments that are to be available for processing.
CA IDMS
All fields defined following the RECORD statement are part of this record. The name of each field must be unique within
the record. However, the field does not have to be unique within the file that contains the record being defined. If a field
defined in another record has the same name as a field defined in this record, then all references to either field must be
qualified with the name of the field's containing record.
NOTE
The RECORD statement cannot be used to define logical records. To define a logical record, use the LOGICAL-
RECORD statement. To define an element record within a logical record, use the ELEMENT-RECORD
statement.
IMS/DLI
RECORD allocates a work space that contains the segment data during execution. Field definition statements, coded
immediately following a RECORD statement, relate to data fields within that segment. One RECORD statement must
be coded for each segment of the database to be processed. They must be coded in the same order as in the PSB 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)
915
CA Easytrieve® Report Generator 11.6
Parent-segment-name is an optional parameter that designates the parent of segment-name. This parameter is not
coded for the root segment, but it is required for all other segments.
• [KEY]
The optional KEY parameter identifies the sequence field for the segment.
The KEY parameter is not necessary for the RECORD statement that defines the lowest segment in a path. The KEY
parameter is required for the root segment when using the tickler file.
• (key-field-name)
Key-field-name is the one- to eight-character name used to designate the keyfield to the IMS/DLI database. The name
must correspond to the sequence field named in the DBD.
• (key-field-location)
Key-field-location is a positive numeric integer that specifies the location of the key field within the segment.
• (key-field-length)
Key-field-length is a positive numeric integer that specifies the length of the key field.
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.
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 2
DEFINE QTY W 4 P 0
DEFINE PRICE W 4 P 2
SCREEN NAME TEST-REFRESH
KEY F2 NAME 'Reset to zero'
KEY F3 EXIT NAME 'Exit'
KEY F5 IMMEDIATE REFRESH NAME 'Refresh screen'
KEY F6 NAME 'Compute Ext Price'
TITLE 'TEST REFRESH'
ROW 3 'Quantity . .' QTY
ROW 5 'Price . . .' PRICE
ROW 7 'Ext Price .' EXT-PRICE
BEFORE SCREEN. PROC
MOVE ZERO TO QTY, PRICE, EXT-PRICE
END-PROC
AFTER-SCREEN. PROC
916
CA Easytrieve® Report Generator 11.6
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.
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
END-IF
[ [ {start-field-name} ] ]
REPEAT number [TIMES] [VARYING subscript [FROM { } ] ] +
[ [ {start-integer } ] ]
[ROW row-number]
ROW statements
917
CA Easytrieve® Report Generator 11.6
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:
...
WS-EMPLOYEE W 33 A OCCURS 30 . * 2-DIMENSIONAL TABLE OF
WS-NAME WS-EMPLOYEE 30 A . * 30 EMPLOYEES CONTAINING:
WS-STATUSES WS-EMPLOYEE +30 3 A . * EMPLOYEE NAME AND
WS-STAT WS-STATUSES 1 A OCCURS 3. * 3 STATUSES
...
SCREEN NAME EMPLOYEE-LIST
TITLE 'List of Employees'
ROW 3 'Name' COL 30 'Statuses'
REPEAT 15 TIMES VARYING USER-SUB
918
CA Easytrieve® Report Generator 11.6
END-REPEAT
Produces:
List of Employees
Name Statuses
WIMN, GLORIA F G O
BERG, NANCY C
CORNING, GEORGE I T
...
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.
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-
file-
name]+ }
[SUMSPACE sumfield-addition]+ }
[TALLYSIZE tally-
print-
size]+ }
}
[ {EVERY}] }
[DTLCTL{FIRST}]+ } Format
[ {NONE}] } Determination
} Parameters
[ { [ALL] }] }
919
CA Easytrieve® Report Generator 11.6
[ [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 ]+ }
[LONGDATE ]+ }
[SHORTDATE] }
}
[NOPAGE]+ }
[NOHEADING]+ }
}
920
CA Easytrieve® Report Generator 11.6
[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.
921
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:
LINESIZE >= (ACROSS - 1) * SIZE + (number of print positions on an individual label)
• File Directing [FILE work-file-name]
Optionally, specify FILE to identify the work file used for very large reports. Code this parameter when the default VFM
work file is too small to contain the report data. Work-file-name identifies the FILE that receives the work file data
NOTE
You should not use the FILE parameter in CICS. An execution error occurs when work-file-name is not a
virtual file.
NOTE
Instead of coding the FILE parameter for each report in your program, you can use the WORKFILE YES
parameter on the PARM statement. For more information, see PARM Statement.
• [PRINTER receive-file-name]
Optionally, specify PRINTER to direct the report's printed output. Receive-file-name identifies the FILE that receives
the report. This file must have the PRINTER or EXTENDED attribute specified. The default is the CA Easytrieve
standard print output file: SYSPRINT. The actual destination of SYSPRINT is determined by a site option. For more
information about the actual destination of SYSPRINT, see your system administrator. For more information about
PRINTER files, see Programming.
If the system print output file or receive-file-name has been associated with an extended reporting printer, then CA
Easytrieve automatically formats the report to satisfy the requirements defined for that extended reporting printer. CA
Easytrieve restricts the support of extended reporting facilities to those reports that are output to printer files that have
been associated with an extended reporting printer.
Spacing Control-each of the following parameters modifies the default spacing of a report page. You normally do not
use these parameters; however, they are available to support unique report spacing requirements.
• [PAGESIZE (line-page-size [display-page-size])]Specify PAGESIZE to define the logical print length of a printed
page. Line-page-size must be an unsigned integer from 1 to 32767, and must be at least as large as the sum of:
922
CA Easytrieve® Report Generator 11.6
923
CA Easytrieve® Report Generator 11.6
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.
• [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.
924
CA Easytrieve® Report Generator 11.6
When the report data has been spooled (because the report had been sequenced or the printer file was in use), the
REPORT-INPUT procedure is invoked as each spooled record is read to produce this report. This means that all records
printed are spooled and sorted (if SEQUENCE is specified). The REPORT-INPUT procedure is then invoked. For
performance reasons, you should select the records in a JOB activity, if possible.
A REPORT-INPUT procedure must be delimited by an END-PROC statement. See PROC Statement for more
information.
This statement has the following format:
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:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
HOLD-ZIP S 5 N VALUE 00000
JOB INPUT FILE1 NAME MYPROG
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
REPORT-INPUT. PROC
IF ZIP NE HOLD-ZIP
HOLD-ZIP = ZIP
SELECT
END-IF
END-PROC
*
Data:
BROWNIL6007612345
BROWNIL6007667890
JONESIL6007709876
JONESIL6007754321
SMITHTX7521811111
SMITHTX7521866666
925
CA Easytrieve® Report Generator 11.6
Results:
333.43
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.
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 F3 NAME 'Exit' EXIT
TITLE...
ROW...
AFTER-SCREEN. PROC
IF KEY-PRESSED = F1
EXECUTE MENU-HELP
RESHOW
END-IF
CASE OPTION
...
END-PROC
SCREEN NAME MENU-HELP
KEY F3 NAME 'Exit' EXIT
926
CA Easytrieve® Report Generator 11.6
TITLE...
ROW...
RETRIEVE file-name +
[ {program-name }]
[PROGRAM-NAME { }] +
[ {'program-literal'}]
[ {db-name-table-name }]
[DBNAME { }] +
[ {'db-name-table-literal'}]
[ {node-name }]
[NODE { }] +
[ {'node-literal'}]
[ {dictionary-name }]
[DICTNAME { }] +
[ {'dictionary-literal'}]
[ {dictionary-node-name }]
[DICTNODE { }] +
[ {'dictionary-node-literal'}]
[KEYFILE tickler-file-name + ] ]
[KEYVALUE (calc-key-field-name EQ calc-value-field-name ...) ] + ]
[ ] +
[DUPS ]
[NODUPS ]
SELECT (record-name +
[AREA 'area-literal' + ]
[SET 'set-literal' + ] +
[INDEX 'index-set-literal' [USING ('index-key-literal' ...)]]
[ID 'path-literal'] +
[LIMIT number-of-records] +
927
CA Easytrieve® Report Generator 11.6
[WHILE (condition)] +
...)
Format 2 (IMS/DLI)
RETRIEVE file-name +
SELECT (record-name +
[ID 'path-literal'] +
[LIMIT number-of-records] +
[SSA 'segment-literal'] +
[WHILE (condition)] +
...)
928
CA Easytrieve® Report Generator 11.6
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']
929
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.
930
CA Easytrieve® Report Generator 11.6
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:
ROLLBACK
Example
ELSE
COMMIT
END-IF
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] +
[+offset-value ] {field-name }
[ ] { } +
[COL column-number] {'row-literal'}
[ {attribute-name } ]
[ATTR { } ] +
[ {(attribute-list)} ]
[ {RIGHT} ]
[JUSTIFY { } ] +
[ {LEFT } ]
[FILL {'fill-character'|NULL}] +
[ {pattern-name} ]
[PATTERN { } ] +
[ {'pattern' } ]
[UPPERCASE] +
931
CA Easytrieve® Report Generator 11.6
[ [ {attribute-name }] ] ]
[ERROR ( [ATTR { }] + ] ]
[ [ {(attribute-list)}] ] ]
[ ] ] ...
[ [ {'literal' [ ] } ] ] ]
[ [ { [...] } ] ) ] ]
[ [ {field-name [ ] } ] ] ]
• [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:
– 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.
932
CA Easytrieve® Report Generator 11.6
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.
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"
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.
– ()
933
CA Easytrieve® Report Generator 11.6
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
ROW 5 'Number' COL 20 EMP-NUMBER ATTR PROTECT MASK 'ZZ9'
ROW 'Name' COL 20 EMP-NAME UPPERCASE
ROW 'Dept' COL 20 EMP-DEPT VALUE (900 THRU 999) +
ERROR 'Invalid Department'
934
CA Easytrieve® Report Generator 11.6
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.
NOTE
Screen processing is only available in CA Easytrieve® Report Generator Online.
The structure of a SCREEN activity is as follows:
SCREEN statement
Screen declaration statements:
DEFAULTs (first in declaration section)
KEYs, TITLEs, ROWs (in any order)
Screen procedures (both special-named and user-defined, in any order)
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:
[ [ACTIVITY ] [TERMINAL ] ]
SCREEN [NAME screen-name] [COMMIT ([ ] [ ])] +
[ [NOACTIVITY] [NOTERMINAL] ]
[ {attribute-name } ]
[BACKGROUND ATTR { } ] +
[ {(attribute-list)} ]
[ {SINGLE } ]
[ {DOUBLE } [ {attribute-name } ] ]
[BORDER ({ } [ATTR { } ] ] +
[ {WIDE } [ {(attribute-list)} ] ]
[ {'border literal'} ]
[SHADOW]
• [NAME screen-name]
Optionally, specify a name for the SCREEN activity. Screen-name:
935
CA Easytrieve® Report Generator 11.6
'Border literal' specifies the character to be used for the screen border. This value must be a single character enclosed in
single quotes.
936
CA Easytrieve® Report Generator 11.6
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
DEFINE WS-REPLY W 1 A
SCREEN NAME MAIN-MENU
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.
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:
937
CA Easytrieve® Report Generator 11.6
• 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:
DEFINE CODE W 4 A
DEFINE DESCRIPTION W 40 A
FILE CLASSES TABLE INSTREAM
ARG 1 4 A
DESC 10 40 A
1011 ENGLISH I
1012 ENGLISH II
1013 ENGLISH III
1014 ENGLISH IV
ENDTABLE
PROGRAM NAME MYPROG
MOVE '1012' TO CODE
SEARCH CLASSES WITH CODE, GIVING DESCRIPTION
IF CLASSES
DISPLAY DESCRIPTION
ELSE
DISPLAY 'CLASS NOT FOUND'
END-IF
Results:
ENGLISH II
938
CA Easytrieve® Report Generator 11.6
• If no SELECT statement is issued for an SQL file, a default SELECT is used (SELECT all defined columns FROM file-
name).
• If SELECT is the first statement in a JOB activity, the following happens:
– If the SELECT is for an automatic input file, the SELECT overrides the default SELECT.
– If the SELECT is for a file not used for automatic input, a DEFER should be coded on the SQL FILE statement. If
DEFER is not coded, the default SELECT is opened during the initialization processing, then closed, and the coded
SELECT processed. This causes unnecessary processing to occur.
• If a SELECT is specified for a file that has already been opened, either by the default SELECT or another coded
SELECT, then the existing SELECT for the file is closed and the new SELECT is used to open the file again.
SELECT can be coded in a JOB's START procedure. However, since a file is normally opened before invoking the START
procedure, you should specify DEFER on the FILE statement. Otherwise, the default SELECT is opened before the
START procedure, and then the SELECT in the START procedure closes the default SELECT before it opens. This
causes extra processing that is not needed.
This statement has the following format:
[WHERE search-condition] +
[GROUP BY column-name + ] +
[ [, column-name ...] ]
[HAVING search-condition] +
[ {column-name} [ASC ] ]
[ORDER BY { } [ ] + ]
[ {integer } [DESC] ]
[ ]
[ [ {column-name} [ASC ] ] ]
[ [, { } [ ] ...] ] +
[ [ {integer } [DESC] ] ]
[FOR UPDATE]
• [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]]
939
CA Easytrieve® Report Generator 11.6
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:
The next example shows a file-based SQL SELECT statement with DEFER:
END-PROC
940
CA Easytrieve® Report Generator 11.6
{ {* }
[DISTINCT] { {expression }
SELECT [ ] { { } +
[ALL ] { {table-name.* }
{ {correlation-name.*}
}
[ {expression } ] }
[, {table-name.* } . ..] } +
[ {correlation-name.*} ] }
}
[WHERE search-condition] +
[GROUP BY column-name + ] +
[ [, column-name ...] ]
[HAVING search-condition] +
[ { {* } ]
[ [DISTINCT] { {expression } ]
[UNION SELECT [ ] { { } + ]
[ [ALL ] { {table-name.* } ]
[ { {correlation-name.*} ]
[ ]
[ } ]
[ [ {expression } ] } ]
[ [, {table-name.* } ...] } + ]
[ [ {correlation-name.*} ] } ]
[ } ]
[ ]
[ FROM table-name [correlation-name] + ]
[ [,table-name [correlation-name] ...] + ] +
[ ]
[ [WHERE search-condition] + ]
[ ]
[ [GROUP BY column-name + ] + ]
[ [ [, column-name ...] ] ]
[ ]
[ [HAVING search-condition] ]
[ {column-name} [ASC ] ]
[ORDER BY { } [ ] + ]
[ {integer } [DESC] ]
[ ]
[ [ {column-name} [ASC ] ] ]
[ [, { } [ ] ...] ] +
[ [ {integer } [DESC] ] ]
941
CA Easytrieve® Report Generator 11.6
• [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.*}
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 CONNECT :user-id IDENTIFIED BY :password
* END-IF
SQL DECLARE cursor CURSOR FOR select clause
SQL OPEN cursor
DO WHILE SQLCODE NE 100
SQL FETCH cursor INTO :host-variable-1 +
[, :host-variable-2...]
process <easy> code
END-DO
SQL CLOSE cursor
942
CA Easytrieve® Report Generator 11.6
If coded, a REPORT-INPUT procedure is performed for each PRINT statement (report input). 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 does not get selected is bypassed for continued processing. See REPORT-INPUT Report Procedure for more
information.
This statement has the following format:
SELECT
Example
REPORT-INPUT. PROC
IF ZIP NE HOLD-ZIP
HOLD-ZIP = ZIP
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
943
CA Easytrieve® Report Generator 11.6
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 fields used to SEQUENCE a report do not have to be part of the printed report.
This statement has the following format:
• 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
SET Statement
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.
944
CA Easytrieve® Report Generator 11.6
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.
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
[ [ {attribute-name } ] [ {'literal' [ ] } ] ]
[ [ATTR { } ] [ { [...] } ] ]
[ [ {(attribute-list)} ] [ {field-name [ ] } ] ]
Format 2
{attribute-name }
SET field-name ATTR { }
{(attribute-list)}
• 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.
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:
945
CA Easytrieve® Report Generator 11.6
– 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}
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:
END-IF
END-PROC
In the next example, when a user types a value greater than 50,000 into PAY-GROSS, PAY-GROSS is displayed in
yellow; otherwise PAY-GROSS is displayed in turquoise.
ROW PAY-GROSS
...
AFTER-SCREEN. PROC
IF PAY-GROSS > 50,000
SET PAY-GROSS ATTR (YELLOW)
ELSE
SET PAY-GROSS ATTR (TURQ)
END-IF
END-PROC
In 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.
946
CA Easytrieve® Report Generator 11.6
...
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.
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.
This statement has the following format:
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.
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:
SORT input-file-name TO sorted-file-name +
[ [ACTIVITY ] [TERMINAL ] ]
[COMMIT ([ ] [ ])] +
[ [NOACTIVITY] [NOTERMINAL] ]
[SIZE record-count] +
[WORK number-of-work-data-sets] +
[BEFORE proc-name] +
947
CA Easytrieve® Report Generator 11.6
[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
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:
948
CA Easytrieve® Report Generator 11.6
SQL Statement
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:
949
CA Easytrieve® Report Generator 11.6
• 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:
950
CA Easytrieve® Report Generator 11.6
• ACQUIRE
• ALTER
• CLOSE cursor-name
• COMMENT
• COMMIT {work}
• CONNECT userid
• CONNECT TO database
• CREATE
• DECLARE CURSOR-NAME
• DELETE {where current of cursor-name}
• DROP
• EXPLAIN
• FETCH cursor-name
• GRANT
• INSERT
• LABEL
• LOCK
• OPEN cursor-name
• PUT
• REVOKE
• ROLLBACK {work}
• UPDATE {where current of cursor-name}
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:
951
CA Easytrieve® Report Generator 11.6
• 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
• 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:
952
CA Easytrieve® Report Generator 11.6
• 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
• DECLARE cursor-name
• DELETE
• DISCONNECT
• DROP
• FETCH cursor-name
• INSERT
• OPEN cursor-name
• ROLLBACK {work}
• UPDATE
• USE
953
CA Easytrieve® Report Generator 11.6
[(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.
• [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
954
CA Easytrieve® Report Generator 11.6
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.
955
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.
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.
956
CA Easytrieve® Report Generator 11.6
ELSE
SELECT
END-IF
END-PROC
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
*
REPORT MYREPORT
LINE PART-NUMBER PART-DESCRIPTION
*
SORT INVENT TO SORTWRK USING +
(LOCATION-STATE, +
LOCATION-CITY) NAME MYSORT
*
JOB INPUT SORTWRK NAME MYPROG2
PRINT MYREPORT
*
REPORT MYREPORT
LINE PART-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.
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.
957
CA Easytrieve® Report Generator 11.6
TERMINATION. PROC
Example
The following is an example of report footing:
FILE FILE1
LAST-NAME 1 5 A
STATE 6 2 A
ZIP 8 5 N
PAY-NET 13 5 N 2
TOTAL-NET S 8 N 2
JOB INPUT FILE1 NAME MYPROG
TOTAL-NET = TOTAL-NET + PAY-NET
PRINT REPORT1
*
REPORT REPORT1 LINESIZE 65 +
SUMMARY SUMCTL DTLCOPY
SEQUENCE STATE ZIP LAST-NAME
CONTROL STATE NEWPAGE ZIP
TITLE 'REPORT FOR THE STATE OF' STATE
LINE 01 LAST-NAME STATE ZIP PAY-NET
*
TERMINATION. PROC
DISPLAY TITLE
DISPLAY SKIP 5 TOTAL-NET 'IS THE Y-T-D COMPANY NET PAY'
DISPLAY SKIP 5 'PLEASE ROUTE THIS REPORT TO CORPORATE OFFICERS'
END-PROC
958
CA Easytrieve® Report Generator 11.6
TERMINATION. PROC
{[ ] field-name}
{[#font-number] }
TITLE [title-number] {[ ] 'literal' } ...
{+offset }
{-offset }
{COL column-number }
• [title-number]
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.
959
CA Easytrieve® Report Generator 11.6
[ {attribute-name } ] ]
[ATTR { } ] ] ...
[ {(attribute-list)} ] ]
• [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:
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.
960
CA Easytrieve® Report Generator 11.6
TRANSFER Statement
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'}
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'
961
CA Easytrieve® Report Generator 11.6
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 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:
FILE PERSNL SQL PERSONNEL UPDATE
EMPNAME * 20 A
WORKDEPT * 2 P 0
EMPPHONE * 3 P 0
JOB NAME RETRIEVE-PERSONNEL INPUT PERSNL
SELECT FROM PERSNL WHERE WORKDEPT = 901 FOR UPDATE
WORKDEPT = 921
UPDATE PERSNL
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.
This statement has the following format:
Format 1
[UPDATE] [ {input-file-name }]
WRITE output-file-name [ ] [FROM { }][STATUS]
[ADD ] [ {input-record-name}]
Format 2
962
CA Easytrieve® Report Generator 11.6
• 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. 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.
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 FILE'
END-IF
963
CA Easytrieve® Report Generator 11.6
END-IF
Symbol References
964
CA Easytrieve® Report Generator 11.6
= Assignment
Conditional expression
POINT
@ R Reserved for future use
965
CA Easytrieve® Report Generator 11.6
Reserved Words
The following list includes all CA Easytrieve® Report Generator reserved words:
ENTER REPORT-INPUT
RESHOW
CA Easytrieve® Report Generator 11.6
Supported Syntax
Following are discussions of syntax that is still supported but is not documented in the syntax diagrams contained in this
section. Some of the items in this chapter are ignored in this implementation, while others still function as before but are
replaced by new syntax in this section.
CALL Statement
The NR parameter is ignored.
DISPLAY Statement
The DISPLAY NEWPAGE function has been replaced by the DISPLAY TITLE and DISPLAY NOTITLE functions. The
reason for this change is that previous versions of DISPLAY NEWPAGE did not consistently produce report titles and
headings. For source compatibility, DISPLAY NEWPAGE is accepted and functions the same as DISPLAY TITLE.
END Statement
The END statement is effectively ignored, because CARD input cannot be compiled with the program.
FILE Statement
The VS parameter is replaced with SEQUENTIAL, INDEXED, and RELATIVE. The underlying access method is
determined at execution time. VS is still accepted as valid syntax however, the correct sub-parameter must be specified
for the type of VSAM file being accessed.
The SQL SELECT parameter is replaced with the more powerful SQL file type. SQL SELECT is still supported.
PARM Statement
Current versions of CA Easytrieve® Report Generator ignore the following:
DEVICE
VFM DEVICE (except DISK│MEMORY)
SORT DIAG│NODIAG
SORT ERASE│NOERASE
SORT SYS
SORT TP│NOTP
SORT VIRTUAL│REAL
SORT WORK DA
PRESIZE
EXITSTR
The DBCSCODE parameter is replaced by the CODE parameter, but still supported as valid syntax.
967
CA Easytrieve® Report Generator 11.6
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.
Feature Mainframe Online PC, UNIX, Linux for zSeries, MVS Batch
Screen processing X
FILE statement: X X
CODE parameter
KEY parameter
Double Byte Character Set (DBCS) support X MVS Batch Only
968
CA Easytrieve® Report Generator 11.6
969
CA Easytrieve® Report Generator 11.6
• Operational ErrorsErrors that occur in both the preprocessor and in the resulting CA Easytrieve Report Generator
program.
• Syntax ErrorsErrors in SUPRA statements.
Message Format
All SUPRA interface diagnostic messages conform to the following format:
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
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
970
CA Easytrieve® Report Generator 11.6
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
******EXTENDED STATUS CODE DATA FOLLOWS ******
Reason:
An error occurred opening the directory files. Task extended status data is printed.
Action:
Consult your Cincom documentation for the PDM OPENX command. Correct any system errors and rerun.
A004
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
******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
******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.
971
CA Easytrieve® Report Generator 11.6
A007
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
******EXTENDED STATUS CODE DATA FOLLOWS******
Reason:
An error occurred while reading the directory def# file. The parameter list and task extended status data are printed.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A009
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
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
Reason:
The value specified for OPEN during installation is invalid. The valid values are YES or NO.
Action:
972
CA Easytrieve® Report Generator 11.6
A013
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
Reason:
An error occurred while signing on to the relational data manager.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
A102
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
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
Reason:
An error occurred while retrieving the logical view.
Action:
Consult your Cincom documentation. Correct any system errors and rerun.
973
CA Easytrieve® Report Generator 11.6
B001
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
Reason:
The indicated word is invalid as used in the current statement.
Action:
Refer to the statement syntax description, correct or delete the appropriate parameter, and rerun.
B003
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
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
974
CA Easytrieve® Report Generator 11.6
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
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
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
Reason:
The specified name does not exist in the directory as a field in the access set.
Action:
Correct the access set field name and rerun.
B010
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
Reason:
975
CA Easytrieve® Report Generator 11.6
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
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
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.
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:
976
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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:
977
CA Easytrieve® Report Generator 11.6
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.
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.
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.
978
CA Easytrieve® Report Generator 11.6
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.
EZABX049
Error Check invoked with invalid parameter.
Reason:
This is an internal error.
Action:
Contact CA Support if this error is reproducible.
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.
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.
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.
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).
979
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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 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.
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:
980
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.
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.
EZACT001
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.
981
CA Easytrieve® Report Generator 11.6
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.
Utility Messages
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.
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.
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.
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.
982
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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.
983
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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 CA Easytrieve® Report Generator User Guide.
984
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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.
985
CA Easytrieve® Report Generator 11.6
EZCM006
Printer name cannot be empty
Reason:
You have not specified a printer name.
Action:
Enter a valid printer name.
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.
EZCM008
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.
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.
EZCM011
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:
986
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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.
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.
987
CA Easytrieve® Report Generator 11.6
EZCM019
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.
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.
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.
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.
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.
IMS_DLI Messages
This section contains the IMS and DLI messages and codes (EZDLI).
988
CA Easytrieve® Report Generator 11.6
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.
• 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.
EZDLI003
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:
• 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:
989
CA Easytrieve® Report Generator 11.6
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:
• 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.
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.
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.
EZEIP007
Internal literal pool area too small.
Reason:
This is an internal error.
Action:
If you can reproduce this error, contact CA Support.
990
CA Easytrieve® Report Generator 11.6
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.
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:
• 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.
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 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.
991
CA Easytrieve® Report Generator 11.6
EZEIP021
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:
• 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.
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:
• 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.
992
CA Easytrieve® Report Generator 11.6
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:
• 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:
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
EZEIP997
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).
EZIDM001
An error occurred loading program xxxxxxxx.
Reason:
The specified CA IDMS interface program could not be found.
Action:
993
CA Easytrieve® Report Generator 11.6
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, 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.
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.
EZIOE002
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:
994
CA Easytrieve® Report Generator 11.6
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.
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.
995
CA Easytrieve® Report Generator 11.6
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.
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.
• 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:
996
CA Easytrieve® Report Generator 11.6
• 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.
Logical I/O error on file <file name> <text>
Reason:
CA Easytrieve® Report Generator could not process the file specified because of a logical I/O error. These errors occurred
for an I/O statement where the STATUS parameter was not specified. If you specified STATUS, these errors are reflected
997
CA Easytrieve® Report Generator 11.6
in the system-defined field FILESTATUS for the program to handle. When this message is issued, supplemental text
states the reason.
Action:
None.
Duplicate record inserted.
Reason:
This error condition indicates that an attempt was made to store a record with a duplicate key or there is a duplicate
record for an alternate index with the unique key option.
This condition can occur following a PUT statement for a RELATIVE file. It indicates that the slot designated by the
relative record number already contains a record (the slot is not empty).
Action:
Correct the logic in your program. You may want to use the STATUS parameter to detect this situation.
Requested record not found.
Reason:
The record designated by the KEY parameter is not present in the file.
This condition can occur following a READ statement or a POINT statement for a RELATIVE file. It indicates that the slot
designated by the relative record number is empty.
Action:
Correct the logic in your program. Use the STATUS parameter to detect this situation.
Record is locked.
Reason:
An attempt was made to access or update a record that has a lock placed on it by another process.
Action:
Correct the logic in your program. You may want to use the STATUS parameter to detect this situation.
Error indicator returned by access method.
Reason:
The access method routines used to access this file detected a logical or physical error condition. The condition detected
was not one of the conditions listed above.
Action:
Correct the logic in your program. You can use the STATUS parameter to detect this situation.
EZIOE005
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.
EZIOE008
ISAM return code is <return code> with error code of <error code>.
Reason:
998
CA Easytrieve® Report Generator 11.6
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:
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
97 Critical error
107 OPEN for NC file (9A)
999
CA Easytrieve® Report Generator 11.6
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.
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. 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.
EZKX0012
HEAP MANAGER DOMAIN INITIALIZATION FAILURE.
Reason:
The memory heap manager failed to initialize.
Action:
1000
CA Easytrieve® Report Generator 11.6
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.
EZKX0014
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.
EZKX0017
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.
EZKX0061
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.
1001
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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 CA
Easytrieve® Report Generator Installation Guide.
1002
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
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.
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.
1003
CA Easytrieve® Report Generator 11.6
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.
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.
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.
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.
EZOPT018
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.
EZOPT021
The mask is missing.
1004
CA Easytrieve® Report Generator 11.6
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 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 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 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 CA Easytrieve® Report Generator 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.
1005
CA Easytrieve® Report Generator 11.6
EZSQL003
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 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.
Sort Messages
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.
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.
1006
CA Easytrieve® Report Generator 11.6
EZSRT013
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.
1007
CA Easytrieve® Report Generator 11.6
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.
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
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.
1008
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 Broadcom Support for assistance.
EBSN
Code Category:
Runtime Error Check
Reason:
Insufficient storage in region to satisfy request.
1009
CA Easytrieve® Report Generator 11.6
EDSO
Code Category:
Dynamic Loader
Reason:
Dynamic load table overflowed.
EDSO0
Code Category:
Dynamic Segment Manager
Reason:
Internal procedure stack overflow.
EDSS
Code Category:
Dynamic Segment Manager
Reason:
Segment not defined.
1010
CA Easytrieve® Report Generator 11.6
EDST
Code Category:
Dynamic Segment Manager
Reason:
Invalid Segment.
EDSX
Code Category:
Dynamic Segment Manager
Reason:
Unable to expand segment table.
EBSL
Code Category:
Heap Manager
Reason:
GETMAIN length error.
EFLD
Code Category:
Heap Manager
Reason:
Field check error.
EFML
Code Category:
Heap Manager
Reason:
Invalid MOVE length.
EFNF
Code Category:
Heap Manager
Reason:
Null check failure.
1011
CA Easytrieve® Report Generator 11.6
EFVL
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).
EHMF
Code Category:
Heap Manager
Reason:
Invalid freemain request.
EHMH
Code Category:
Heap Manager
Reason:
Invalid heap tag.
EHMI
Code Category:
Heap Manager
Reason:
Invalid storage control request.
EHML
Code Category:
Heap Manager
Reason:
Length error.
EHMN
Code Category:
Heap Manager
Reason:
No storage available.
EHMO
Code Category:
1012
CA Easytrieve® Report Generator 11.6
Heap Manager
Reason:
Internal procedure stack overflow.
EHMQ
Code Category:
Heap Manager
Reason:
Invalid FAD chain.
EHMR
Code Category:
Heap Manager
Reason:
Error reading temporary storage record.
EHMV
Code Category:
Heap Manager
Reason:
Storage overrun detected.
EHMW
Code Category:
Heap Manager
Reason:
Error writing temporary storage record.
EHMX
Code Category:
Heap Manager
Reason:
Error resolving relocatable pointer.
EIO1
Code Category:
1013
CA Easytrieve® Report Generator 11.6
EIO2
Code Category:
Input/Output Statement Handler
Reason:
Load for access method interface routine failed.
EIO3
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.
EIO5
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.
EIO9
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.
1014
CA Easytrieve® Report Generator 11.6
EIDA
Code Category:
Input/Output Statement Handler
Reason:
IDMS could not be found.
EIOX
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.
EJSW
Code Category:
System Spool Printer Interface Module
Reason:
Spool file write error.
1015
CA Easytrieve® Report Generator 11.6
EKX0
Code Category:
Task Execution Control Program
Reason:
Application request not understood by ETKXCON.
EKX1
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.
EKX5
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.)
EKX7
Code Category:
Task Execution Control Program
Reason:
Quiesce requested by linked to program.
EKX8
Code Category
Task Execution Control Program
Reason:
Internal stack overflow.
EKX9
Code Category:
1016
CA Easytrieve® Report Generator 11.6
EKXB
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).
EKXE
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).
EKXG
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).
1017
CA Easytrieve® Report Generator 11.6
EKX4
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.
EKXA
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.
EKXI
Code Category:
Task Management Program
Reason:
Indicates an invalid request.
EKXO
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.
1018
CA Easytrieve® Report Generator 11.6
EPR1
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.
EPR3
Code Category:
Printer File Manager
Reason:
Error closing the printer file.
EPR4
Code Category:
Printer File Manager
Reason:
Error writing the printer file.
EPR5
Code Category:
Printer File Manager
Reason:
1019
CA Easytrieve® Report Generator 11.6
EPR6
Code Category:
Printer File Manager
Reason:
Error opening the system message file.
EPR9
Code Category:
Printer File Manager
Reason:
Insufficient storage
Reporting Codes
ERP1
Code Category:
Reporting
Reason:
Insufficient storage for report work area.
ERP2
Code Category:
Reporting
Reason:
Insufficient storage for summary work area.
ERS1
Code Category:
Runtime Initialization Stub
Reason:
Transfer of control failure.
1020
CA Easytrieve® Report Generator 11.6
ESIB
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:
• 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.
ESQY
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.
1021
CA Easytrieve® Report Generator 11.6
ETID
Code Category:
Terminal Printer Despooler Program
Reason:
Unsupported printer device.
ETIO
Code Category:
Terminal Printer Despooler Program
Reason:
Internal stack overflow.
ETIS
Code Category
Terminal Printer Despooler Program
Reason:
Invalid spooled report encountered.
ETIX
Code Category:
Terminal Printer Despooler Program
Reason:
Task initialization or termination error.
EVF1
Code Category:
Virtual File Manager
Reason:
1022
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.
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.
EVF4
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.
EVF6
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.
EVF8
Code Category:
Virtual File Manager
Reason:
Invalid request returned by the input/output system. This is a general failure category.
1023
CA Easytrieve® Report Generator 11.6
EVF9
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.
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.
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.
EVFD
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.
EVFF
Code Category:
Virtual File Manager
Reason:
Too much pending work queued.
1024
CA Easytrieve® Report Generator 11.6
EVFG
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.
EVFI
Code Category:
Virtual File Manager
Reason:
Load for VFM data set handler failed.
1025
CA Easytrieve® Report Generator 11.6
CA EZ/Key
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
1026
CA Easytrieve® Report Generator 11.6
Documentation is available for the following products and releases in PDF format unless otherwise noted.
1027
CA Easytrieve® Report Generator 11.6
Additional Resources
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
CA-Pan/SQL PDFs
The following CA-Pan SQL guides are available as PDFs:
• CA-Pan/SQL Cover Letter 2.5
• CA-Pan/SQL Getting Started 2.4c
• CA-Pan/SQL Interface Installation Guide 2.3 (MVS, CMS, VSE)
Social Media
Follow us on social media:
• Facebook
• LinkedIn
• Twitter
1028
CA Easytrieve® Report Generator 11.6
Product Names
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
1029
CA Easytrieve® Report Generator 11.6
1030
CA Easytrieve® Report Generator 11.6
1031