Page 2 of 2

Re: How to check an empty file in JCL

PostPosted: Wed May 23, 2012 5:31 pm
by sinmani
You can use IEBCOMPR utility

Re: How to check an empty file in JCL

PostPosted: Wed May 23, 2012 10:57 pm
by Akatsukami
sinmani wrote:You can use IEBCOMPR utility

Indeed? And would you be so good as to offer an example?

Re: How to check an empty file in JCL

PostPosted: Thu May 24, 2012 6:29 am
by ibmmf4u
Hi,

The below piece of code will determine whether the input sequential data set is empty or not. It return's an return code 4 if it's empty and 0 if it has any records in it.

//STEP010   EXEC PGM=IDCAMS                       
//SYSPRINT  DD SYSOUT=*                           
//INPUT     DD DSN=YOUR.INPUT.FILE,DISP=SHR
//SYSIN DD *                                     
  PRINT INFILE(INPUT) CHARACTER COUNT(1)         
/*                                               
                                         


Thanks,

Re: How to check an empty file in JCL

PostPosted: Wed May 30, 2012 1:32 pm
by sensuixel
Hi,

You can also use ICETOOL with EMPTY parameter.

//ISEMPTY EXEC PGM=ICETOOL                         
//TOOLMSG DD SYSOUT=*                             
//DFSMSG  DD SYSOUT=*                             
//IN      DD DISP=SHR,DSN={Your file}
//TOOLIN  DD *                                     
* Empty File ==> RC=04
* Else       ==> RC=12                     
* If RC4 omitted then an empty file will return RC=12
COUNT FROM(IN) EMPTY RC4