View previous topic :: View next topic
|
Author |
Message |
Sudhanshu Shekhar
New User
Joined: 23 Jul 2008 Posts: 27 Location: City of Joy
|
|
|
|
I've written a proc to check whether an extract file contains any records or is empty. I also have written the jcl for it but I have to handle the return code in the jcl which i have no clue whatsoever .... for example
if RC = 1
exec pgm1
else
exec pgm2 |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a way to achieve it
Code: |
//STEP0001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=1
/*
//CHECK01 IF (STEP0001.RC = 0) THEN
//*
//SELECT1 EXEC PGM=PGM01
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=0
/*
// ELSE
//SELECT2 EXEC PGM=PGM02
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=0
/*
|
Gerry |
|
Back to top |
|
|
Sudhanshu Shekhar
New User
Joined: 23 Jul 2008 Posts: 27 Location: City of Joy
|
|
|
|
Gerry,
Thanks a ton. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Alternately, you can use COND parameter like this.
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=1
/*
//STEP2 EXEC PGM=PGM1,COND=(1,NE,STEP1)
..........
..........
//STEP3 EXEC PGM=PGM2,COND=(1,EQ,STEP1)
..........
.......... |
Thanks,
Arun |
|
Back to top |
|
|
Sudhanshu Shekhar
New User
Joined: 23 Jul 2008 Posts: 27 Location: City of Joy
|
|
|
|
Arun,
i have been using the COND parameter to check for the proper execution of the step, but never used it for multiple steps .
Thanks a lot. |
|
Back to top |
|
|
|