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

Obtaining Job ID dynamically..


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Fri Sep 26, 2008 12:35 pm
Reply with quote

Hi Friends,
Could you advise if we can obtain a Job ID dynamically when a job is submitted. We have a situation wherein a file needs to be created within the same job with name as A.B.<JOBID>.

Thanks for your help..

Partha
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 26, 2008 12:38 pm
Reply with quote

Do You really think that double posting will get You more answers ??

the other post will be deleted
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 1:21 pm
Reply with quote

I am not sure of JCL, but you can do it with a program.

Do you want to do it ONLY with JCl?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Sep 26, 2008 1:49 pm
Reply with quote

This topic contains a link to a site that shows how to retrieve the running jobid in a COBOL program.

This topic shows how to retrieve the running jobid in a REXX program.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Sep 26, 2008 3:30 pm
Reply with quote

Well, I see the link to the Rexx program points to the cobol program and I cannot find the link to a rexx program wich retrieve the jobid in the Rexx forum, I've found how to get the jobid of a JOB submitted by a Rexx program.

Well, the code to get the Jobid of the job in which the rexx program is running is this:
Code:
numeric digits 10                             
                                             
tcb     = storage(21C,4)                     
JSCB    = storage(d2x(c2d(tcb)+180),4)       
ssib    = storage(d2x(c2d(JSCB)+316),4)       
ssibjnum= strip(storage(d2x(c2d(ssib)+12),8))
say 'ssibjnum:' ssibjnum                     
exit                                         



if you need the jobid of a job submitted by a rexx program you can read this topic
www.ibmmainframes.com/viewtopic.php?t=25664

hth
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 Dynamically pass table name to a sele... DB2 2
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts How to replace a string dynamically i... CLIST & REXX 16
No new posts Dynamically switching terminal model TSO/ISPF 9
No new posts Dynamically read input files using BP... COBOL Programming 23
Search our Forums:

Back to Top