I need an example of a report - I just want to read a file and if record count is greater than 100 set a return code and end.
Optionally write a message that says something like exceeded 100 records.
Release : 11.0
Component : CA FILE MASTER PLUS FOR DB2 FOR Z/OS
This is an example when using an ordinary data
set:
...
//PRINTREC EXEC
PGM=CAWABATC,REGION=3M
//STEPLIB DD DISP=SHR,DSN=your.FM110.CDBILOAD
//INFILE DD DISP=SHR,DSN=your.input.data.set.name
//SYSLIST DD
SYSOUT=*
//SYSPRINT DD
SYSOUT=*
//SYSUT1 DD
DUMMY
//SYSIN DD
*
PRINT,
INFILE(INFILE),
PADCHAR(C'
'),
MOVE(CLEAR),
MOVE(1,T'*** Attention! ********************************************'),
WRITE(SYSLIST),
MOVE(1,T'*** This report is limited to a maximum of 100 records. ***'),
WRITE(SYSLIST),
MOVE(1,T'***********************************************************'),
WRITE(SYSLIST),
STOP
PRINT,
FORMAT(LIST),
INLIM(100),
INFILE(INFILE)
//
...
The 1st PRINT writes three
"attention" records to the SYSLIST DD.
The 2nd PRINT writes 100 records from
the INFILE DD to the SYSLIST DD - your report.
Unfortunately, there is no way yet to set a
specific RC if there are more than a certain number of records. That would be
an enhancement request.
You can use SETRC, but this would just generally set
the RC - without any dependencies.