How to check an empty file in JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: How to check an empty file in JCL

Postby sinmani » Wed May 23, 2012 5:31 pm

You can use IEBCOMPR utility
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: How to check an empty file in JCL

Postby Akatsukami » Wed May 23, 2012 10:57 pm

sinmani wrote:You can use IEBCOMPR utility

Indeed? And would you be so good as to offer an example?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to check an empty file in JCL

Postby ibmmf4u » Thu May 24, 2012 6:29 am

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,
ibmmf4u
 
Posts: 65
Joined: Wed Dec 14, 2011 10:26 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How to check an empty file in JCL

Postby sensuixel » Wed May 30, 2012 1:32 pm

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                           
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post