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

How to execute 9th step after the execution of 10th step


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

New User


Joined: 11 Apr 2007
Posts: 5
Location: mumbai

PostPosted: Wed Apr 18, 2007 5:43 pm
Reply with quote

Hi,
I need to submit a job in which there are 10 steps.
I have to execute 9th step after the execution of 10th step..
How can i do so..??
I heard we can make the use of IF in JCL .
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Apr 18, 2007 5:50 pm
Reply with quote

kashyani wrote:
I have to execute 9th step after the execution of 10th step.
How can i do so..??


You can't. Steps are executed in a top-down order only.

kashyani wrote:

I heard we can make the use of IF in JCL.


Yes. See the details here in the z/OS V1R7.0 MVS JCL Reference manual.
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: Wed Apr 18, 2007 9:54 pm
Reply with quote

Hello,

In your process do you want step9 to execute both before and after step10? Your requirement is not very clear. Is this a one-time situation that requires the steps be run out of sequence?

As was pointed out above, jcl executes from the top down.

Your best bet is to create a new set of jcl that will fill the current need.

If this is a long-term requirement, you will want to enhance the jcl to accomodate the alternate ways of processing usng condition codes and possibly IF. (IMHO - if there are different requirements, separate jobstreams would be the way to go).
Back to top
View user's profile Send private message
kashyani

New User


Joined: 11 Apr 2007
Posts: 5
Location: mumbai

PostPosted: Thu Apr 19, 2007 9:43 am
Reply with quote

Yes i know job will execute in top to bottom manner...
But my require ment is I want to execute step 9 only when step 10 executes successfully.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Thu Apr 19, 2007 10:24 am
Reply with quote

dick wrote
Quote:
In your process do you want step9 to execute both before and after step10? Your requirement is not very clear


u didn't give an answer to this!!

If u want it to execute only once ( i.e. after successful execution of step10 ), then interchange the steps and give an IF condition to check the successful execution of UR step10...

Am i clear??
Back to top
View user's profile Send private message
kashyani

New User


Joined: 11 Apr 2007
Posts: 5
Location: mumbai

PostPosted: Thu Apr 19, 2007 10:30 am
Reply with quote

Nah..I can't interchange the steps..
there shud be some other way out.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 19, 2007 12:36 pm
Reply with quote

Run the PROC twice, and cond out the non required steps on the second invocation of the PROC.

// EXEC PROC1
// EXEC PROC1,COND.STEP1=(0,LE),COND.STEP2=(0,LE) ...........
Back to top
View user's profile Send private message
bhaskar80

New User


Joined: 12 Apr 2007
Posts: 7
Location: bangalore

PostPosted: Thu Apr 19, 2007 2:08 pm
Reply with quote

Hello,
you can use DPRTY keyword in the EXEC stmt as follows.

//STEP1 EXEC DPRTY=(15,15)
//SPET2 EXEC DPRTY=(14,15)
//SPET3 EXEC DPRTY=(13,15)
//SPET4 EXEC DPRTY=(12,15)
//SPET5 EXEC DPRTY=(11,15)
//SPET6 EXEC DPRTY=(10,15)
//SPET7 EXEC DPRTY=(9,15)
//SPET8 EXEC DPRTY=(8,15)
//SPET9 EXEC DPRTY=(6,15)
//SPET10 EXEC DPRTY=(7,15)

From the above step1 to step8 executed sequentially, after that step9 will will execute and then step 10 will execute.
If you want u can use COND parameter along with DPRTY in step10 inorder to control the step execution with respect to step9 sucessful execution.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 19, 2007 2:14 pm
Reply with quote

Quote:
From the above step1 to step8 executed sequentially, after that step9 will will execute and then step 10 will execute.

Please post the output from your testing so that we can see how this works.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 19, 2007 2:15 pm
Reply with quote

Quote:
Nah..I can't interchange the steps..
there shud be some other way out.

Nah
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Thu Apr 19, 2007 3:35 pm
Reply with quote

Hi Bhaskar

u said
Quote:
From the above step1 to step8 executed sequentially, after that step9 will will execute and then step 10 will execute.



I tried this one, but it is not giving me results as u said.. I had two steps and i coded like

STEP1 EXEC PGM=XXXX,DPRTY=(2,2)
STEP2 EXEC PGM=YYYY,DPRTY=(1,2)

And in my STEP1, I am creating a file which is being used as input in STEP2. SO if my STEP2 runs first, it should give me a JCL error since the file is not created.
But my job ran successfully.. So i guess this DPRTY didn't have any effect on my job flow..
Can u explain me the problem??
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 19, 2007 3:47 pm
Reply with quote

Raak,

I think that you have made the same mistake as me. Bhaskar did say that step9 would run before step10, although .... I suspect he may have meant to say that step10 would execute before step9.

What I can not understand is the use of DPRTY. As far as I can remember, and at my age the memory isn't all it used to be icon_confused.gif the DPRTY is the despatch priority of the job, which is used to determine the importance of the job/step in terms of whether it received more or less system resource.

Most sites ignore this coding.
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: Thu Apr 19, 2007 7:14 pm
Reply with quote

Hello,

This
Quote:
Nah..I can't interchange the steps..
there shud be some other way out.
we may not be able to help with. Why should there be some other way? The system is performing exactly as it is supposed to.

Either the requirement definition is very misleading or there is an entire agenda we have not been made aware of. If kashyani will tell what the steps do by function not by step1, step2, etc, we may be able to offer suggestions on how to do what is needed for successful execution of the job(s).

How does the job know whether "step9" should run in order, run after "step10" or run on both sides? The job could always run the first 8 steps, then send the required remaining steps, in the desired order thru the internal reader. . .

Kashyani still hasn't answered whether the "step9" should run both before and after "step10". The requested output has also not been posted. . .
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Apr 19, 2007 10:46 pm
Reply with quote

HI,
Can't we use IEBEDIT to specify which step should be executed as follows??

//IEBEDITJ JOB ACCT,'',CLASS=T,MSGCLASS=T,
// MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP0001 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=YOUR.PROC.LIBRARY(PROCNAME),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP10,STEP9,STEP15)
/*
//

~VAMSI
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 20, 2007 12:55 am
Reply with quote

Hello Vamsi,

Yes, we could use IEBEDIT and/or several other approaches - but only if we get info on what really needs to happen. So far, very little info has been provided.

Very difficult to offer suggestions when what is needed is not provided. . .
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 20, 2007 1:29 am
Reply with quote

shreevamsi wrote:
HI,
Can't we use IEBEDIT to specify which step should be executed as follows??


No. The steps will still execute in their originally coded order.
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top