Did you know that you can use &SYSJOBID to get the Process ID
(PID) of SAS tasks running on UNIX and Linux servers?
This can be useful for differentiating between multiple SAS
sessions you have running on a UNIX or Linux server. It is also useful when you want to correlate
the PID of a particular SAS batch task with UNIX or Linux system performance
information.
Here is an example of using &SYSJOBID that I have coded in many
of my SAS/Connect programs:
data _null_;
pid =
&SYSJOBID;
put '******************************************************';
put '* *';
put '*The
Process ID of this SAS/Linux Session is: ' pid '*';
put '* *';
put '******************************************************';
run;
This code produced the following in the SAS log when running
from a PC client to a Linux server:
******************************************************
* *
* The Process ID of this SAS/Linux Session is: 31037 *
* *
******************************************************
---MMMMIIIIKKKKEEEE
(aka Michael A. Raithel)
Author of the new cult classic for computer programmers: It Only Hurts When I Hit <ENTER>
Print edition: http://tinyurl.com/z8bzx2e
Kindle edition: http://tinyurl.com/zypgqa7
The hack above is an excerpt from the book: Did You Know That? Essential Hacks for Clever SAS Programmers
Print edition: http://tinyurl.com/z8bzx2e
Kindle edition: http://tinyurl.com/zypgqa7
No comments:
Post a Comment