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: 2504
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: 8569
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 Execute step regardless of previous s... JCL & VSAM 2
No new posts Error 0C1 Reason Code 1 with branch i... PL/I & Assembler 3
No new posts JCL for replacing code in Cobol JCL & VSAM 7
No new posts Easytrieve EZABX007 with error code 0... CA Products 7
No new posts Retrieve multiple records with metaco... CA Products 0
Search our Forums:

Back to Top