<?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 Re: How to read sdsf jobid into a sas program? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70644#M20343</link>
    <description>I've always used this code (MVS and z/OS) to extract the JES Job Number:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&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;
JOBNO=PEEKC(JSABADDR+20,8);                           /* JOB NUMBER  */&lt;BR /&gt;
PUT JOBNO=;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
    <pubDate>Wed, 08 Sep 2010 17:25:06 GMT</pubDate>
    <dc:creator>OS2Rules</dc:creator>
    <dc:date>2010-09-08T17:25:06Z</dc:date>
    <item>
      <title>How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70642#M20341</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Can any one suggest how to read sdsf jobid into a sas program?&lt;BR /&gt;
&lt;BR /&gt;
I am running a SAS Job in z/OS and I want to print the sdsf Jobid in SAS Log then how can this be achieved.</description>
      <pubDate>Wed, 08 Sep 2010 10:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70642#M20341</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-08T10:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70643#M20342</link>
      <description>SDSF is an output display / management tool accessible through TSO (and batch as well).  The JES (Job Entry Subsystem)  facility actually assigns the JobID (also called the JES job number to some).  &lt;BR /&gt;
&lt;BR /&gt;
When you refer to "..sdsf Jobid.." - are you actually interested in printing the JES JobID in the SASLOG?  And would that be the JOB_NAME or assigned JOB_NUMBER?&lt;BR /&gt;
&lt;BR /&gt;
If this is the case, I suggest you look at printing the SAS automatic macro variables that are available - issue this command in your job to display them (and choose the appropriate one of interest) - there is a SYSJOBID but that is the JOB_NAME:&lt;BR /&gt;
&lt;BR /&gt;
%PUT _AUTOMATIC_;&lt;BR /&gt;
&lt;BR /&gt;
If you are looking to extract the JES-assigned job_number, you will need to investigate using CALL SYSTEM possibly to invoke a REXX EXEC - here is a REXX-related post/article:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://itknowledgeexchange.techtarget.com/itanswers/can-you-find-out-the-name-of-the-job-calling-a-rexx-program/" target="_blank"&gt;http://itknowledgeexchange.techtarget.com/itanswers/can-you-find-out-the-name-of-the-job-calling-a-rexx-program/&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
However, the simplest approach would be to issue a FILENAME statement to allocate an unused &lt;FILEREF&gt; and allocate it to SYSOUT=*  in your SAS program.  Then you can use the PATHNAME CALL function to get back the JES-assigned dataset name, which will include your JOB_NAME and JOB_NUMBER - parse it and display as needed, either with a DATA step or with MACRO language.&lt;BR /&gt;
&lt;BR /&gt;
Some history: when SAS re-vamped its software with SAS 6.0x in the early '90s, printing of the JOB_NAME and JOB_NUMBER went away and it was up to users to display this information.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/FILEREF&gt;</description>
      <pubDate>Wed, 08 Sep 2010 13:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70643#M20342</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-08T13:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70644#M20343</link>
      <description>I've always used this code (MVS and z/OS) to extract the JES Job Number:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&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;
JOBNO=PEEKC(JSABADDR+20,8);                           /* JOB NUMBER  */&lt;BR /&gt;
PUT JOBNO=;&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 08 Sep 2010 17:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70644#M20343</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2010-09-08T17:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70645#M20344</link>
      <description>And here's a bit of the collection that I've been using (based on some REXX code I found in MVS forums):&lt;BR /&gt;
[pre]&lt;BR /&gt;
%let tiot_pointer = %sysfunc(peek(%sysfunc(peek(540))+12));    &lt;BR /&gt;
%let job_name     = %sysfunc(peekc(&amp;amp;tiot_pointer,8));          &lt;BR /&gt;
%let proc_step    = %sysfunc(peekc(&amp;amp;tiot_pointer+8,8));        &lt;BR /&gt;
%let step_name    = %sysfunc(peekc(&amp;amp;tiot_pointer+16,8));       &lt;BR /&gt;
%let jscb_pointer = %sysfunc(peek(%sysfunc(peek(540))+180));   &lt;BR /&gt;
%let pgm_name     = %sysfunc(peekc(&amp;amp;jscb_pointer+360,8));      &lt;BR /&gt;
%let ssib_pointer = %sysfunc(peek(&amp;amp;jscb_pointer+316));         &lt;BR /&gt;
%let job_id       = %sysfunc(peekc(&amp;amp;ssib_pointer+12,8));       &lt;BR /&gt;
%let job_number   = %sysfunc(peekc(&amp;amp;ssib_pointer+15,5));       &lt;BR /&gt;
%let jct_pointer  = %sysfunc(peek(&amp;amp;jscb_pointer+260));         &lt;BR /&gt;
%let job_class    = %sysfunc(peekc(&amp;amp;jct_pointer+47,1));        &lt;BR /&gt;
%let msg_class    = %sysfunc(peekc(&amp;amp;jct_pointer+22,1));        &lt;BR /&gt;
%let act_pointer  = 00%sysfunc(peekc(&amp;amp;jct_pointer+56,3),hex6.);&lt;BR /&gt;
%let act_pointer  = %sysfunc(inputn(&amp;amp;act_pointer,hex8.));      &lt;BR /&gt;
%let pgmr_field   = %sysfunc(peekc(&amp;amp;act_pointer+24,20));       &lt;BR /&gt;
%let system_id    = %sysfunc(peek(%sysfunc(peek(16,4))+196,4));&lt;BR /&gt;
%let system_id    = %sysfunc(peekc(&amp;amp;system_id+16,4));          &lt;BR /&gt;
%let user_id      = %sysfunc(peek(%sysfunc(peek(548))+108));   &lt;BR /&gt;
%let user_id      = %sysfunc(peekc(&amp;amp;user_id+192,8));           &lt;BR /&gt;
[/pre]&lt;BR /&gt;
Can't tell whether they're still valid with the latest and greatest of z/OS releases (we are at z/OS 1.10 now). Nor can I guarantee for the field names being super-accurate &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Wed, 08 Sep 2010 18:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70645#M20344</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2010-09-08T18:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70646#M20345</link>
      <description>sorry I missed this a couple of weeks ago.&lt;BR /&gt;
Here is how I get %sysjesID to provide the JES job ID.&lt;BR /&gt;
%put the sdsf jes job-id is %sysJesID ;&lt;BR /&gt;
based on my little macro[pre]%macro sysjesid() /des='get jes/sdsf jobID ' ;                   &lt;BR /&gt;
  %local ascb assb jsab ;    %*******mvs jargon ! ;              &lt;BR /&gt;
  /* ASCB is at 548   */                                         &lt;BR /&gt;
  /* ASSB is at ASCB+336 */                                      &lt;BR /&gt;
  /* JSAB is at ASSB+168 */                                      &lt;BR /&gt;
          %let ascb = %sysfunc( peek( 548) );                    &lt;BR /&gt;
          %let assb = %sysfunc( peek( %eval( 336 + &amp;amp;ascb ) ) );  &lt;BR /&gt;
          %let jsab = %sysfunc( peek( %eval( 168 + &amp;amp;assb ) ) );  &lt;BR /&gt;
  /* now get job ID as in JES/sdsf */                            &lt;BR /&gt;
                      %sysfunc( PEEKc(%eval(  20 + &amp;amp;jsab), 8 ))  &lt;BR /&gt;
%mend  sysjesid;                                                 &lt;BR /&gt;
 /* demo                                                         &lt;BR /&gt;
%put  %sysjesid;                                                 &lt;BR /&gt;
*******************/</description>
      <pubDate>Sun, 19 Sep 2010 17:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70646#M20345</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-09-19T17:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70647#M20346</link>
      <description>Simplest approach - four lines, no control block references with PEEK:&lt;BR /&gt;
&lt;BR /&gt;
FILENAME MYDUMMY SYSOUT=*;                     &lt;BR /&gt;
%LET MYPATH = %SYSFUNC(PATHNAME(MYDUMMY));     &lt;BR /&gt;
%PUT %SYSFUNC(SCAN(&amp;amp;MYPATH,3,%STR(.)));&lt;BR /&gt;
FILENAME MYDUMMY CLEAR;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sun, 19 Sep 2010 17:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70647#M20346</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-19T17:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70648#M20347</link>
      <description>thanks Scott,&lt;BR /&gt;
:-( but I like function macros that can be used within statements.</description>
      <pubDate>Sun, 19 Sep 2010 17:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70648#M20347</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-09-19T17:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to read sdsf jobid into a sas program?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70649#M20348</link>
      <description>The process can be done either in a DATA step or with using SAS macro language (invocation) statements.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sun, 19 Sep 2010 17:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-sdsf-jobid-into-a-sas-program/m-p/70649#M20348</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-19T17:56:51Z</dc:date>
    </item>
  </channel>
</rss>

