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

Control variable to pull JOBID from spool


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lalitha_gld

New User


Joined: 12 Jul 2006
Posts: 24

PostPosted: Thu Oct 11, 2007 6:14 pm
Reply with quote

Hi,

I'm trying to send a notification to user regarding a job status. If I use the control variable '&sysjobid', it is giving the job name. But I actually want the JOBID which is listed in the SDSF spool against the JOBNAME.
Can anyone pease let me know of the corresponding control variable.

Thanks,
Lalitha.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 6:21 pm
Reply with quote

Quote:
I actually want the JOBID


By JOBID, Are you referring to the job number?
Back to top
View user's profile Send private message
lalitha_gld

New User


Joined: 12 Jul 2006
Posts: 24

PostPosted: Thu Oct 11, 2007 6:37 pm
Reply with quote

yes, is there a varaible to get the job number?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Oct 11, 2007 10:50 pm
Reply with quote

Yoy can do it all from REXX, using SDSF Batch Commands and TSO's SEND command.

O.
Back to top
View user's profile Send private message
lalitha_gld

New User


Joined: 12 Jul 2006
Posts: 24

PostPosted: Fri Oct 12, 2007 10:43 am
Reply with quote

I would be using a SAS MACRO to send the email notification with the job number. For this I require the control variable to be coded as similar to '&sysjobid' for the job name.

Is there a specific variable for getting the job number similarly !

Thanks,
Lalitha.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Oct 12, 2007 11:08 am
Reply with quote

As suggested by offer, you can do it in REXX with
SDSF batch commands. Do search this forum for
SDSF commands.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Oct 12, 2007 11:13 am
Reply with quote

You can get the job number using this code in REXX.

This traps the output once the job gets submitted. Finally, the variable job_number will have the job number.

Code:
ADDRESS "TSO"                                             
x = outtrap(out.)                                           
"SUB '"file99"'"                                           
x = OUTTRAP(OFF)                                           
parse var out.1 left_part right_part                     
parse var RIGHT_PART job_name '(' job_number ')'


Hope this helps
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 -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Pull data using date difference betwe... DB2 6
No new posts CA7 count with DATE variable CA Products 0
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
Search our Forums:

Back to Top