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
 

 

How can we execute only particular steps in jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
pavankumar.k
Currently Banned

New User


Joined: 21 Dec 2006
Posts: 2
Location: chennai

PostPosted: Tue Jan 30, 2007 6:29 am    Post subject: How can we execute only particular steps in jcl
Reply with quote

hai,


how can we execute only particularsteps in jcl,for an eg if there are 5steps,
and i would like to execute from step 2 to step 4regardless of rc,plz explain me with an eg
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: Tue Jan 30, 2007 7:24 am    Post subject:
Reply with quote

Hello again,

Look in the JCL manual on how to use COND=.

To "always" execute step2 thru step4 regardless of the condition code, do not code COND= on the EXEC statement. To conditionally execute other steps, use COND= appropriately. What is appropriate for your job depends on your requirements and we won't be able to give you a generic solution.

Here is a sample of what is in the manual - there is Much more . . .

Quote:
16.5.8 Examples of the COND Parameter

Example 1

//STEP6 EXEC PGM=DISKUTIL,COND=(4,GT,STEP3)

In this example, if the return code from STEP3 is 0 through 3, the system bypasses STEP6. If the return code is 4 or greater, the system executes STEP6. Because neither EVEN nor ONLY is specified, the system does not execute this step if a preceding step abnormally terminates.
Example 2




//TEST2 EXEC PGM=DUMPINT,COND=((16,GE),(90,LE,STEP1),ONLY)


The system executes this step ONLY if two conditions are met:

A preceding job step abnormally terminated.
No return code tests are satisfied.

Therefore, the system executes this step only when all three of the following are true:

A preceding job step abnormally terminated.
The return codes from all preceding steps are 17 or greater.
The return code from STEP1 is 89 or less.

The system bypasses this step if any one of the following is true:

All preceding job steps terminated normally.
The return code from any preceding step is 0 through 16.
The return code from STEP1 is 90 or greater.


I'd suggest setting up a several step test job that is ONLY for condition testing until you get comfortable with it. In this test, i'd only use the system standard utilities so there will be no additional confusion with your application code.

Good Luck icon_biggrin.gif
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Tue Jan 30, 2007 10:40 am    Post subject:
Reply with quote

Hi there,

You can also use IEBEDIT for this

// JOB . . .
Code:
//STEP1 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=dataset name that contain jcl,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP2,STEP3,STEP4)
/*


Hope this will be helpful
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts CEXEC not able to execute if no SLINE... boyti ko CLIST & REXX 2 Wed Apr 13, 2016 4:31 pm
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm
No new posts CALL MACRO EXECUTE FORM - Setting the... sudarshan.srivathsav PL/I & Assembler 7 Tue Feb 09, 2016 10:32 pm


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