Friday, October 22, 2010

To check for an empty input file

//VERIFY   EXEC PGM=IEBCOMPR                                       
//SYSUT1   DD DSN=WDA.TC.PRFLR.RELOAD.SERNUMS(0),DISP=SHR          
//SYSUT2   DD DSN=WDA.TC.PRFLR.EMPTY.FILE,DISP=SHR                 
//SYSIN    DD DUMMY                                                
//SYSPRINT DD SYSOUT=*                                             
//*                                             

If full input file, RC=8 is received. If empty, RC=0 as compare condition is satisfied.      
Compare has some restrictions with the number of records in the input file.


The following utility is efficient to check for an input file
//VERIFY   EXEC PGM=IEBPTPCH                             
//SYSUT1   DD DSN=U123557.OUTPUT,DISP=SHR                
//SYSUT2   DD DUMMY                                      
//SYSIN    DD *                                          
  PRINT TYPORG=PS                                        
/*                                                       
//SYSPRINT DD SYSOUT=*                                   
It gives RC=4 when the file is empty and RC=0 when the file is full.       

No comments:

Post a Comment