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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm


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