Need example report with limitations
search cancel

Need example report with limitations

book

Article ID: 135586

calendar_today

Updated On:

Products

File Master Plus for IMS File Master Plus for DB2 for z/OS

Issue/Introduction

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.


Environment

Release : 11.0

Component : CA FILE MASTER PLUS FOR DB2 FOR Z/OS

Resolution

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. 

Additional Information

See https://docops.ca.com/ca-file-master-plus/11/en/using-batch/batch-reference-for-ca-file-master-plus/keywords/keyword-descriptions for all keywords, please.