<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Looking for the Job Number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68742#M14887</link>
    <description>I can get &amp;amp;sysjobid to give me the job name but I can not find any command to get the TSO job number.&lt;BR /&gt;
&lt;BR /&gt;
Is there one or does any one have a method to do so?</description>
    <pubDate>Tue, 01 Sep 2009 21:09:08 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-09-01T21:09:08Z</dc:date>
    <item>
      <title>Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68742#M14887</link>
      <description>I can get &amp;amp;sysjobid to give me the job name but I can not find any command to get the TSO job number.&lt;BR /&gt;
&lt;BR /&gt;
Is there one or does any one have a method to do so?</description>
      <pubDate>Tue, 01 Sep 2009 21:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68742#M14887</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-01T21:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68743#M14888</link>
      <description>Found this somewhere on the intertubes:&lt;BR /&gt;
&lt;BR /&gt;
=====&lt;BR /&gt;
DATA ZZGETUSR                                             &lt;BR /&gt;
         (Drop=TIOTPTR JSCBPTR SSIBPTR JCTPTR ACTPTR      &lt;BR /&gt;
          Label='User information on MVS job');           &lt;BR /&gt;
                                                          &lt;BR /&gt;
   LENGTH PROGRAMR $20 JOBNAME  $8 PROCSTEP $8            &lt;BR /&gt;
          STEPNAME $8  PROGNAME $8 JOBNUMBR $8            &lt;BR /&gt;
          USERID  $8                                      &lt;BR /&gt;
          ;                                               &lt;BR /&gt;
                                                          &lt;BR /&gt;
   TIOTPTR = peek(peek(540) + 12);                        &lt;BR /&gt;
                                                          &lt;BR /&gt;
   JOBNAME = peekc(TIOTPTR, 8);                           &lt;BR /&gt;
                                                          &lt;BR /&gt;
   PROCSTEP = peekc(TIOTPTR+8, 8);                        &lt;BR /&gt;
                                                          &lt;BR /&gt;
   STEPNAME = peekc(TIOTPTR+16, 8);                       &lt;BR /&gt;
                                                          &lt;BR /&gt;
   JSCBPTR = peek(peek(540) + 180);                       &lt;BR /&gt;
                                                          &lt;BR /&gt;
   PROGNAME = peekc(JSCBPTR + 360, 8);                    &lt;BR /&gt;
                                                          &lt;BR /&gt;
   SSIBPTR = peek(JSCBPTR + 316);                         &lt;BR /&gt;
                                                          &lt;BR /&gt;
   JOBNUMBR = peekc(SSIBPTR + 12, 8);                     &lt;BR /&gt;
                                                          &lt;BR /&gt;
   JCTPTR = peek(JSCBPTR + 260);                          &lt;BR /&gt;
                                                          &lt;BR /&gt;
   JOBCLASS = peekc(JCTPTR + 47, 1);                      &lt;BR /&gt;
                                                          &lt;BR /&gt;
   MSGCLASS = peekc(JCTPTR + 22, 1);                      &lt;BR /&gt;
                                                          &lt;BR /&gt;
   ACTPTR = INPUT('00'X || peekc(JCTPTR + 56, 3), PIB4.); &lt;BR /&gt;
                                                          &lt;BR /&gt;
   PROGRAMR = peekc(ACTPTR + 24, 20);                     &lt;BR /&gt;
   SYSTEMID = PEEKC(PEEK(peek(16, 4) + 196, 4) + 16, 4);    &lt;BR /&gt;
   USERID = peekc(peek(peek(548) + 108) + 192, 8);          &lt;BR /&gt;
                                                            &lt;BR /&gt;
   put (_character_) (=/);                                  &lt;BR /&gt;
                                                            &lt;BR /&gt;
run;                                                        &lt;BR /&gt;
=====</description>
      <pubDate>Tue, 01 Sep 2009 21:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68743#M14888</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2009-09-01T21:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68744#M14889</link>
      <description>TSO STATUS &lt;USERID&gt;  and parse the response to get the JES job number.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/USERID&gt;</description>
      <pubDate>Wed, 02 Sep 2009 00:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68744#M14889</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-02T00:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68745#M14890</link>
      <description>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.&lt;BR /&gt;
&lt;BR /&gt;
However, I did get this to work and it is great....  all the information I need,,&lt;BR /&gt;
&lt;BR /&gt;
DATA _NULL_;                              &lt;BR /&gt;
  FILE RPTOUT;                            &lt;BR /&gt;
 %SYSEXEC STATUS "&amp;amp;SYSJOBID";             &lt;BR /&gt;
  LENGTH JOBNO $8;                        &lt;BR /&gt;
  ASCBADDR=PEEK(548,4);                   &lt;BR /&gt;
  ASSBADDR=PEEK(ASCBADDR+336,4);          &lt;BR /&gt;
  JSABADDR=PEEK(ASSBADDR+168,4);          &lt;BR /&gt;
  /* JOB NUMBER  */                       &lt;BR /&gt;
  JOBNO=PEEKC(JSABADDR+20,8);             &lt;BR /&gt;
  PUT JOBNO=;                             &lt;BR /&gt;
RUN;                                      &lt;BR /&gt;
&lt;BR /&gt;
Thanks to both of you for responding so quickly...</description>
      <pubDate>Wed, 02 Sep 2009 14:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68745#M14890</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-02T14:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68746#M14891</link>
      <description>Batch job?&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
//JOBNAME    JOB (ACCTINFO),'DUMMYJOB     '              &lt;BR /&gt;
//STEP1OF1   EXEC SASMVS,SASLOG='*',SASLIST='*'                 &lt;BR /&gt;
//JOBINFO    DD SYSOUT=* /* DO NOT CHANGE...USED TO GET JOBID */&lt;BR /&gt;
//SYSIN      DD *                                               &lt;BR /&gt;
  PROC SQL NOPRINT;                                             &lt;BR /&gt;
    SELECT SCAN(XPATH,2,'.'),SCAN(XPATH,3,'.') INTO             &lt;BR /&gt;
           :JOBNAME SEPARATED BY ' ',                           &lt;BR /&gt;
           :JOBID   SEPARATED BY ' '                            &lt;BR /&gt;
      FROM DICTIONARY.EXTFILES                                  &lt;BR /&gt;
      WHERE FILEREF = 'JOBINFO';                                &lt;BR /&gt;
    QUIT;                                                       &lt;BR /&gt;
  %PUT !&amp;amp;JOBNAME!&amp;amp;JOBID!;                                       &lt;BR /&gt;
&lt;BR /&gt;
Just checked...works for interactive SAS on TSO, too.</description>
      <pubDate>Wed, 02 Sep 2009 21:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68746#M14891</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2009-09-02T21:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68747#M14892</link>
      <description>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.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 02 Sep 2009 21:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68747#M14892</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-02T21:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for the Job Number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68748#M14893</link>
      <description>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.</description>
      <pubDate>Wed, 02 Sep 2009 22:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-the-Job-Number/m-p/68748#M14893</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2009-09-02T22:04:17Z</dc:date>
    </item>
  </channel>
</rss>

