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

Skipping some steps in a Procedure


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskars

Guest





PostPosted: Tue Sep 28, 2004 4:02 pm
Reply with quote

Hi, A catalogued procedure consists of five steps and I dont want to execute all the step , I want to skip 2nd and 4th steps in procedure and this procedure is called by JCL Program? This is possible by overriding or symbolic parameters?
Give me solution?
Thanks!!
Back to top
superk

Global Moderator


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

PostPosted: Tue Sep 28, 2004 6:34 pm
Reply with quote

I don't know exactly what your PROC looks like, but let's assume that the PROC MYPROC has five steps, PROC0001 through PROC0005. You say that you want to bypass processing for PROC steps 2 and 4. You can try this:

Code:

//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=ONLY,
// COND.PROC0004=ONLY
//*
Back to top
View user's profile Send private message
bhaskar

Guest





PostPosted: Wed Sep 29, 2004 12:51 pm
Reply with quote

code which you have sent is not correct for my problem because, PROC0002 will be executed if there is abend in previous steps that is PROC0001, this is I dont want. As far as I know COND.PROC0002=ONLY means PROC0002 (step) will be executed if there is any abend in previous steps.
My question is:
1) I have a JCL program which is calling catalogued procedure.
2) catalogued procedure consists of five steps,as u assumed PROC0001,PROC0002,PROC0003,PROC0004,PROC0005.
3) When I am Running the jcl program I want to bypass steps PROC0002,PROC0004 and steps PROC0001,PROC0003,PROC0005 have to be executed.
I think my problem is clear.
I have a Idea for the above problem check this how far it is correct.
// COND.PROC0002=(0,GE)
// COND.PROC0004=(0,GE)
this code bypass the steps PROC0002 and PROC0004 if successful or any abends in previous steps.

This works like this.
1) step1 that is PROC0001 executed first, after execution it will return some code that might be zero or greater than zero.
2) this code is checked for condition(COND.PROC0002=(0,GE)) condition satisfies because returncode will be either zero or greater than zero.Therefore, second step(PROC0002) will be bypassed.
3)after that step3(PROC0003) will be executed,it will also return zero or greater than zero return code
4) this is compared again with the condition.
5) this process will continued until the last step that is PROC0005.

Check this is correct or not.
If you guys found better idea or solution plz send me a solution.
Back to top
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Thu Sep 30, 2004 8:26 pm
Reply with quote

Dear Bhaskar,

You can code like that:

//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=ONLY,
// COND.PROC0004=ONLY
//*

or


//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=(0,LE),
// COND.PROC0004=(0,LE)
//*
Back to top
View user's profile Send private message
abdul278

New User


Joined: 10 Jun 2003
Posts: 2

PostPosted: Wed Nov 17, 2004 4:00 pm
Reply with quote

Hi ,

Just to add a correction on this post.. Out of suggested two methods to bypass PROC steps, one with COND=ONLY will not work always.
Whenever there is an abend in any of previous steps, STEP with COND=ONLY will be executed. The requirement is to bypass the step execution irrespective of other steps.
In this case,
//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=ONLY,
// COND.PROC0004=ONLY
//*
If PROC0001 abends, PROC0002 and PROC0004 will get executed.

So the two options that we have is :

//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=(0,LE),
// COND.PROC0004=(0,LE)
//*

OR

//MYJOB JOB (...)
//*
//STEP0001 EXEC MYPROC,
// COND.PROC0002=(4095,GE),
// COND.PROC0004=(4095,GE)
//*


Let me know if you need any clarification on this.


Thanks
Abdul
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Wed Dec 08, 2004 7:38 pm
Reply with quote

the answer given by abdul to bypass certain steps is absolutely correct.....bhaskar follow only this to get desired results
Back to top
View user's profile Send private message
badal

New User


Joined: 05 Sep 2004
Posts: 21

PostPosted: Thu Feb 17, 2005 5:30 pm
Reply with quote

hai,
if i need to skip the 1st of that catlog procedure then what to do?
mind it i don't have any access to procedure.where will i give the condition and what will be the condition?
thanks and regards
badal.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top