Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Bypass the step, if the file is empty.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Bypass the step, if the file is empty.
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

Moderator Team Head


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

PostPosted: Fri Apr 19, 2013 1:42 am    Post subject: Reply to: Bypass the step, if the file is empty.
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    Post subject:
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    Post subject:
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Apr 19, 2013 3:20 am    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

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

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Apr 19, 2013 3:31 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 19, 2013 12:00 pm    Post subject:
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

Site Director


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

PostPosted: Fri Apr 19, 2013 8:59 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Fri Apr 19, 2013 9:02 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Sat Apr 20, 2013 3:51 am    Post subject:
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: 1712
Location: UK

PostPosted: Sat Apr 20, 2013 2:08 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us