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
 

 

Changing the DSN name based on the step return code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Changing the DSN name based on the step return code
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

Moderator Team Head


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

PostPosted: Wed Apr 01, 2009 8:40 pm    Post subject: Reply to: Changing the DSN name based on the step return cod
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


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