IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Bypass the step, if the file is empty.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chiranjeevi9

New User


Joined: 14 Dec 2011
Posts: 11
Location: India

PostPosted: Fri Apr 19, 2013 12:05 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Apr 19, 2013 1:42 am
Reply with quote

Use the JOBRC parameter for your job.
Back to top
View user's profile Send private message
Chiranjeevi9

New User


Joined: 14 Dec 2011
Posts: 11
Location: India

PostPosted: Fri Apr 19, 2013 3:14 am
Reply with quote

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
View user's profile Send private message
Chiranjeevi9

New User


Joined: 14 Dec 2011
Posts: 11
Location: India

PostPosted: Fri Apr 19, 2013 3:15 am
Reply with quote

sorry, JCL means, without using any Utility.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Apr 19, 2013 3:20 am
Reply with quote

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
View user's profile Send private message
Chiranjeevi9

New User


Joined: 14 Dec 2011
Posts: 11
Location: India

PostPosted: Fri Apr 19, 2013 3:28 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Apr 19, 2013 3:29 am
Reply with quote

What do you mean we can't change?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Apr 19, 2013 3:31 am
Reply with quote

your subsequent RC from the steps should override the Rc which set by above technique...correct?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 19, 2013 12:00 pm
Reply with quote

Seems to me that the program logic of step2 needs to amended to be able to deal with an empty file..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 19, 2013 8:59 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Apr 19, 2013 9:02 pm
Reply with quote

Chiranjeevi9 wrote:
sorry, JCL means, without using any Utility.

Can't be done.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Sat Apr 20, 2013 3:51 am
Reply with quote

instead of 12 you can set RC to 4 and keep allowable RC to 4 during your scheduling ..may OPC
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 20, 2013 2:08 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top