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

Retrieve Job ID and return code in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Mar 23, 2015 5:17 pm
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 -

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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Mar 23, 2015 5:17 pm
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 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 REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
Search our Forums:

Back to Top