- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 09-01-2009 05:09 PM
(2261 views)
I can get &sysjobid to give me the job name but I can not find any command to get the TSO job number.
Is there one or does any one have a method to do so?
Is there one or does any one have a method to do so?
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Found this somewhere on the intertubes:
=====
DATA ZZGETUSR
(Drop=TIOTPTR JSCBPTR SSIBPTR JCTPTR ACTPTR
Label='User information on MVS job');
LENGTH PROGRAMR $20 JOBNAME $8 PROCSTEP $8
STEPNAME $8 PROGNAME $8 JOBNUMBR $8
USERID $8
;
TIOTPTR = peek(peek(540) + 12);
JOBNAME = peekc(TIOTPTR, 8);
PROCSTEP = peekc(TIOTPTR+8, 8);
STEPNAME = peekc(TIOTPTR+16, 8);
JSCBPTR = peek(peek(540) + 180);
PROGNAME = peekc(JSCBPTR + 360, 8);
SSIBPTR = peek(JSCBPTR + 316);
JOBNUMBR = peekc(SSIBPTR + 12, 8);
JCTPTR = peek(JSCBPTR + 260);
JOBCLASS = peekc(JCTPTR + 47, 1);
MSGCLASS = peekc(JCTPTR + 22, 1);
ACTPTR = INPUT('00'X || peekc(JCTPTR + 56, 3), PIB4.);
PROGRAMR = peekc(ACTPTR + 24, 20);
SYSTEMID = PEEKC(PEEK(peek(16, 4) + 196, 4) + 16, 4);
USERID = peekc(peek(peek(548) + 108) + 192, 8);
put (_character_) (=/);
run;
=====
=====
DATA ZZGETUSR
(Drop=TIOTPTR JSCBPTR SSIBPTR JCTPTR ACTPTR
Label='User information on MVS job');
LENGTH PROGRAMR $20 JOBNAME $8 PROCSTEP $8
STEPNAME $8 PROGNAME $8 JOBNUMBR $8
USERID $8
;
TIOTPTR = peek(peek(540) + 12);
JOBNAME = peekc(TIOTPTR, 8);
PROCSTEP = peekc(TIOTPTR+8, 8);
STEPNAME = peekc(TIOTPTR+16, 8);
JSCBPTR = peek(peek(540) + 180);
PROGNAME = peekc(JSCBPTR + 360, 8);
SSIBPTR = peek(JSCBPTR + 316);
JOBNUMBR = peekc(SSIBPTR + 12, 8);
JCTPTR = peek(JSCBPTR + 260);
JOBCLASS = peekc(JCTPTR + 47, 1);
MSGCLASS = peekc(JCTPTR + 22, 1);
ACTPTR = INPUT('00'X || peekc(JCTPTR + 56, 3), PIB4.);
PROGRAMR = peekc(ACTPTR + 24, 20);
SYSTEMID = PEEKC(PEEK(peek(16, 4) + 196, 4) + 16, 4);
USERID = peekc(peek(peek(548) + 108) + 192, 8);
put (_character_) (=/);
run;
=====
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
TSO STATUS and parse the response to get the JES job number.
Scott Barry
SBBWorks, Inc.
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just so you all know... I could not get the first routine to work and I already had the TSO STATUS command but our system people would not let us use it.
However, I did get this to work and it is great.... all the information I need,,
DATA _NULL_;
FILE RPTOUT;
%SYSEXEC STATUS "&SYSJOBID";
LENGTH JOBNO $8;
ASCBADDR=PEEK(548,4);
ASSBADDR=PEEK(ASCBADDR+336,4);
JSABADDR=PEEK(ASSBADDR+168,4);
/* JOB NUMBER */
JOBNO=PEEKC(JSABADDR+20,8);
PUT JOBNO=;
RUN;
Thanks to both of you for responding so quickly...
However, I did get this to work and it is great.... all the information I need,,
DATA _NULL_;
FILE RPTOUT;
%SYSEXEC STATUS "&SYSJOBID";
LENGTH JOBNO $8;
ASCBADDR=PEEK(548,4);
ASSBADDR=PEEK(ASCBADDR+336,4);
JSABADDR=PEEK(ASSBADDR+168,4);
/* JOB NUMBER */
JOBNO=PEEKC(JSABADDR+20,8);
PUT JOBNO=;
RUN;
Thanks to both of you for responding so quickly...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Batch job?
At our site, the JOBNAME and JOBID are used to name temporary SYSOUT datasets, so the following code works nicely without all of the peeking around.
//JOBNAME JOB (ACCTINFO),'DUMMYJOB '
//STEP1OF1 EXEC SASMVS,SASLOG='*',SASLIST='*'
//JOBINFO DD SYSOUT=* /* DO NOT CHANGE...USED TO GET JOBID */
//SYSIN DD *
PROC SQL NOPRINT;
SELECT SCAN(XPATH,2,'.'),SCAN(XPATH,3,'.') INTO
:JOBNAME SEPARATED BY ' ',
:JOBID SEPARATED BY ' '
FROM DICTIONARY.EXTFILES
WHERE FILEREF = 'JOBINFO';
QUIT;
%PUT !&JOBNAME!&JOBID!;
Just checked...works for interactive SAS on TSO, too.
At our site, the JOBNAME and JOBID are used to name temporary SYSOUT datasets, so the following code works nicely without all of the peeking around.
//JOBNAME JOB (ACCTINFO),'DUMMYJOB '
//STEP1OF1 EXEC SASMVS,SASLOG='*',SASLIST='*'
//JOBINFO DD SYSOUT=* /* DO NOT CHANGE...USED TO GET JOBID */
//SYSIN DD *
PROC SQL NOPRINT;
SELECT SCAN(XPATH,2,'.'),SCAN(XPATH,3,'.') INTO
:JOBNAME SEPARATED BY ' ',
:JOBID SEPARATED BY ' '
FROM DICTIONARY.EXTFILES
WHERE FILEREF = 'JOBINFO';
QUIT;
%PUT !&JOBNAME!&JOBID!;
Just checked...works for interactive SAS on TSO, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Honestly, it's ridiculous that your SYSPROGs do not permit you to use the TSO STATUS command...for any reason at all. Slick circumvention with the temp DSN allocation / inquiry though.
Scott Barry
SBBWorks, Inc.
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I agree about the silliness of not allowing the STATUS command - but lots of places practice security theatre - just for show, no real value - so I'm not surprised it happens.