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
 

 

Retrieve Job ID and return code in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mfguy01

New User


Joined: 06 Sep 2010
Posts: 30
Location: India

PostPosted: Mon Mar 23, 2015 5:03 pm    Post subject: Retrieve Job ID and return code in JCL
Reply with quote

Hi,

I need following in my jcl(to be used in same jcl in subsequent steps) :-
1. Job ID of running job, which I need to use in subsequent step for file naming.

2. Return code of a step

Please suggest.
Note:- I need to get both of these values from a job and want to use in same.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Mar 23, 2015 5:17 pm    Post subject: Reply to: Retrieve Job ID and return code in JCL
Reply with quote

I don't think you can retrieve this information via JCL, but perhaps with a 3rd-party scheduler?

The only thing offered is this -

http://www.ibmmainframes.com/viewtopic.php?p=167434&highlight=#167434

HTH....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Mon Mar 23, 2015 5:17 pm    Post subject:
Reply with quote

What are you calling "job ID"? This could be the JES number of the job, which is unique, or it could be the job name, which may not be unique. Furthermore, how are you planning on doing the file naming in the subsequent step? Since the job JCL is fixed when JES runs the converter / interpreter (at the time the job is submitted), you CANNOT change the data set name in the JCL.

Job name and JES number are not that hard to retrieve, but I am not aware of any simple way to retrieve step completion codes while the job is running; check with the job scheduler in use at your site -- I know CA-7 allows testing of step completion codes in JCL.
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 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
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


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