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

Executing only one step in a Job


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amit Manas Dubey
Currently Banned

New User


Joined: 15 Dec 2006
Posts: 22
Location: Mumbai

PostPosted: Mon Jan 29, 2007 5:22 pm
Reply with quote

I have a job which has three Steps. I want to execute Step 2 only.

Thanks
Amit.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon Jan 29, 2007 5:34 pm
Reply with quote

Use restart parameter to run from step 2 and comment step 3

or comment step 1 and step 3 and run job..

hope it is one time request

Regards,
JR
Back to top
View user's profile Send private message
Amit Manas Dubey
Currently Banned

New User


Joined: 15 Dec 2006
Posts: 22
Location: Mumbai

PostPosted: Mon Jan 29, 2007 5:55 pm
Reply with quote

Hi

Actually, I am interested in knowing if this can be done without commenting the Step1 and Step3.

One way is to use RESTART parm from Step 2 and then use COND(0,LE) which will skip the Step 3 also, if Step 2 executes with a RC=0.

But what I want is that whatever happens to Step 2, Step 1 and Step 3 are not executed.

Hope I am clear on this.

Thanks
Amit.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Mon Jan 29, 2007 6:11 pm
Reply with quote

I use COND=(1111,NE) to bypass steps (if RC not= 1111, which should be all prev steps).

Since 1111 is not a standard RC, it stands out visually as a special check.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 30, 2007 4:51 am
Reply with quote

Hi Amit,

Code "RESTART=STEP2,COND=(0,LE)" in the JOB card along w/any other params you need.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Jan 30, 2007 11:02 am
Reply with quote

Hi Amit,

You can use IEBEDIT for this

Code:
// JOB . . .
//STEP1 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=dataset that contain jcl,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=STEP2
/*
Back to top
View user's profile Send private message
pankaj_kulkarni111

New User


Joined: 17 Aug 2006
Posts: 13
Location: Pune

PostPosted: Mon Apr 02, 2007 4:02 pm
Reply with quote

Amit,

There are FOUR methods to do this.

1. Use IEBEDIT which is well expalined by few people here.
2. Just comment out all the remaining steps in the pgm.
3. Just mark NULL statement (//) after the step 2 which will end the program.
4. See below pgm
//T91IPPUB JOB ('pppp17',22),'pop-GROUP', CLASS=K,MSGCLASS=T,NOTIFY=&userid
RESTART=STEP2,COND=(0,LE)
.
.
//step1 exec pgm=pgm1
//step2 exec pgm=pgm2,COND=(4095,GE)
//step3 exec pgm=pgm3

I believe there may be another method to do this, just we need to check!

Pankaj
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Mon Apr 02, 2007 4:38 pm
Reply with quote

Please search the forum before you post..

The method to execute STEP2 in a JCL containing 3 steps as Step1,Step2 and Step3.

Please use the COND parameter as COND=ONLY in the steps that you don't want to execute.In this case code it in Steps 1 and 3.

You will get the desired result.. icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 02, 2007 4:41 pm
Reply with quote

Using COND=ONLY is not such a good idea, what happens if STEP2 abends ???
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Mon Apr 02, 2007 4:56 pm
Reply with quote

Amit wrote

Quote:
But what I want is that whatever happens to Step 2, Step 1 and Step 3 are not executed.

Hope I am clear on this.


So His requirement is Step 2 can come out with any type of result but No Step 3 execution...

I am not sure what you mean by IF Step 2 abends?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 02, 2007 5:30 pm
Reply with quote

COND=ONLY states that this step will ONLY process if a previous step abends. So if his STEP2 abends Sx37 then STEP3 WILL be processed.
Back to top
View user's profile Send private message
pankaj_kulkarni111

New User


Joined: 17 Aug 2006
Posts: 13
Location: Pune

PostPosted: Mon Apr 02, 2007 5:48 pm
Reply with quote

muthuvel, i m sorry but pls revise the jcl once..
icon_wink.gif
Pankaj
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Mon Apr 02, 2007 7:20 pm
Reply with quote

Thanks for the correction.. icon_super.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 02, 2007 7:28 pm
Reply with quote

No problems.

Love the image ibmmainframes.com/images/smiles/36_2_35.gif
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts executing XCTL command in COBOL witho... CICS 10
No new posts Forcing a step to run (even if abended) JCL & VSAM 8
Search our Forums:

Back to Top