Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum 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: 8518
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 Indent cobol code Renato Zangerolami COBOL Programming 6 Thu Feb 13, 2020 12:53 am
No new posts Using ICETOOL set return code as per ... Bhuvana Narasimhan DFSORT/ICETOOL 4 Fri Jan 24, 2020 12:58 pm
No new posts CP3KEXTR Setup- SYSTEM COMPLETION COD... mighty ABENDS & Debugging 7 Tue Dec 24, 2019 10:08 pm
No new posts Debug set up for COBOL module but ope... elixir1986 IBM Tools 1 Sun Dec 22, 2019 12:05 am
No new posts COBOL -DB2 SQL code to have GROUP BY ... vinu78 DB2 21 Wed Oct 23, 2019 7:00 pm

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