To check VSAM File if its empty or not with zero ReturnCODE



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

To check VSAM File if its empty or not with zero ReturnCODE

Postby Shanti Priya Kolli » Tue Jan 22, 2008 11:38 pm

Hi all,

I need to code a JCL so that the First step checks a VSAM File . If its empty , the second step is skipped. If its having records then the next step should be executed.
In either case , the first step should return ZERO return code.
Please help me if this is possible.

Thanks
Shanti
Shanti Priya Kolli
 
Posts: 1
Joined: Tue Jan 22, 2008 10:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To check VSAM File if its empty or not with zero ReturnCODE

Postby MrSpock » Wed Jan 23, 2008 12:25 am

You can use:

//STEPXXXX EXEC PGM=ICETOOL                         
//TOOLMSG  DD   SYSOUT=*                             
//DFSMSG   DD   SYSOUT=*                             
//IN       DD   DSN=VSAM...
//TOOLIN   DD   DATA                                 
  COUNT FROM(IN) EMPTY                               
/*                                                   


or

//STEPXXXX EXEC PGM=ICETOOL                         
//TOOLMSG  DD   SYSOUT=*                             
//DFSMSG   DD   SYSOUT=*                             
//IN       DD   DSN=VSAM...
//TOOLIN   DD   DATA                                 
  COUNT FROM(IN) NOTEMPTY                               
/*                                                   


or

//STEPXXXX EXEC PGM=IDCAMS
//IN       DD   DSN=VSAM..
//SYSPRINT DD   SYSOUT=*
//SYSIN  DD *
  PRINT INFILE(IN) COUNT(1)
/*


However, I don't get this statement

In either case , the first step should return ZERO return code.


It's either going to have to give an RC=0 if it's empty, and a non-zero RC if it's not, or vice-versa. Both conditions can't result in the same RC.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: To check VSAM File if its empty or not with zero ReturnCODE

Postby arunprasad.k » Wed Jan 23, 2008 2:43 pm

Shanti,

Based on the return code of STEP01 only you can decide whether to run STEP02 or NOT.

You can NOT make a decision with same RC for both the cases.

Could you please clarify on why do you specifically want to have RC=0 for STEP01?

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post