View previous topic :: View next topic
|
Author |
Message |
Chiranjeevi9
New User
Joined: 14 Dec 2011 Posts: 11 Location: India
|
|
|
|
Hi,
I have a issue.
there are several step in my JCL. just think that there are 5 steps
step1
step2
step3
step4
step5
Step2 is having the empty input file.
Requirement is:
If the input file is empty, the step2 should not execute and the remaining steps should execute.
i am able to do the above. but the another issue is, even though if i bypass, the job return code should be zero. i am struck up with this issue.
Please help me on this. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Use the JOBRC parameter for your job. |
|
Back to top |
|
|
Chiranjeevi9
New User
Joined: 14 Dec 2011 Posts: 11 Location: India
|
|
|
|
Hi Superk,
Thanks for the suggestion.
Is there any possibility to set JOBRC, based on condition(IF) in JCL using IDCAMS?
i know that there is no possibility to set JOBRC based on condition in JCL.Please let me know, if i am wrong. |
|
Back to top |
|
|
Chiranjeevi9
New User
Joined: 14 Dec 2011 Posts: 11 Location: India
|
|
|
|
sorry, JCL means, without using any Utility. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
There are multiple ways you can achieve this...
Using ICE TOOL...
Code: |
// EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD DSN=XXX.YYY.ZZZ,DISP=SHR
//TOOLIN DD *
COUNT FROM(INFILE) EMPTY
/* |
RC=12, tells us.. given file is empty.
Using IDCAMS.
Code: |
//CHECKING EXEC PGM=IDCAMS
//INFILE DD DSN=XXX.YYY.ZZZ,DISP=SHR
//SYSIN DD *
PRINT INFILE(INFILE) COUNT(1)
IF LASTCC NE 0 THEN SET LASTCC = 12
/* |
RC=12, tells us.... given file is empty.
And then you can use IF conditions accordingly in further steps which all you want to bypass. |
|
Back to top |
|
|
Chiranjeevi9
New User
Joined: 14 Dec 2011 Posts: 11 Location: India
|
|
|
|
Hi Rohit,
as per my knowledge, we can set only that perticular step return code using IDCAMS and ICETOOL. we cann't change the already completed step return code. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
What do you mean we can't change? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
your subsequent RC from the steps should override the Rc which set by above technique...correct? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Seems to me that the program logic of step2 needs to amended to be able to deal with an empty file.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
we cann't change the already completed step return code. |
Correct - once a step completes, the return code (completion code) cannot be changed.
As Expat mentioned, the process of step2 needs to be aware of the situation and set the return code accordingly. The rest of the steps would check the COND to run or skip. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Chiranjeevi9 wrote: |
sorry, JCL means, without using any Utility. |
Can't be done. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
instead of 12 you can set RC to 4 and keep allowable RC to 4 during your scheduling ..may OPC |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
Is there any possibility to set JOBRC, based on condition(IF) in JCL using IDCAMS?
i know that there is no possibility to set JOBRC based on condition in JCL.Please let me know, if i am wrong. |
These two statements contradict each other and your meaning is unclear. What Kevin suggested is exactly what you need provided you have the latest versionof z/OS which is when JOBRC was introduced. Note that this should only be a temporary solution until you get you program that cannot handle an empty file fixed. |
|
Back to top |
|
|
|