Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2504
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: 8339
Location: Dubuque, Iowa, USA

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 What will happen if we dont code STOP... Poha Eater COBOL Programming 4 Mon Jun 04, 2018 5:27 pm
No new posts JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts RESP2 code -502 pshongal CICS 6 Mon May 28, 2018 10:58 am
No new posts Code Coverage and static analysis too... Aditya.Srivastava PL/I & Assembler 2 Fri May 25, 2018 12:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us