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

Changing the DSN name based on the step return code


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

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Wed Apr 01, 2009 8:02 pm
Reply with quote

Hi,

I want the below task to be acheived:

Code:

//Step1   EXEC=PGM1
             

     IF STEP1.RC = XX
//Step2 
//  (SET THE STEP3.DSN1=XXXXX.YYYYY.ZZZZZZ)
    END-IF


//STEP3   EXEC=PGM2
//DSN1    DD DUMMY
//DSN2    DSN=AAAA.BBBB.CCCCC


Can anybody help me if this is achievable.

Thanks
Nirmal
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 01, 2009 8:40 pm
Reply with quote

Nirmal, work it out logically, and keep in mind the workflow from the JCL library through the Internal Reader and into the JES sub-system for processing.

As you know, a step must execute either a program or a procedure. So STEP2 has to do something. My suggestion is to use two different steps, based on the return-code of STEP1, which would use the proper dataset as needed:

Code:

//STEP1 EXEC=PGM1
...
// IF STEP1.RC = nnnn THEN
//STEP2A EXEC PGM=PGM2
//DSN1 DD DSN=XXXXX.YYYYY.ZZZZZZ,DISP=...
//DSN2 DSN=AAAA.BBBB.CCCCC
...
//*
// ELSE
//STEP2B EXEC PGM=PGM2
//DSN1 DD DUMMY
//DSN2 DSN=AAAA.BBBB.CCCCC
...
// ENDIF
//*
Back to top
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Thu Apr 02, 2009 12:50 pm
Reply with quote

yes kevin statements are correct
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
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 changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top