sas >> How are Process IDs (_TDnnnnn) of User Work Folders Assigned?

by aaronevans » Tue, 02 Jun 2009 03:11:55 GMT

Hi,

How are the process IDs of SAS sessions assigned for user work folders? Is
it a random number or is some other process used?


Thanks in advance.
EP


sas >> How are Process IDs (_TDnnnnn) of User Work Folders Assigned?

by michaelraithel » Tue, 02 Jun 2009 21:54:00 GMT


Dear SAS-L-ers,

Ernie P. posted the following:

Ernie, the PID's of the SAS Work Folders incorporate the PID of the executing SAS process. That is, if you see a SAS work folder named ..._TD2516 on Windows and then:

1. Invoke the Windows Task Manager

2. Click on the Processes tab

... you will see that SAS.exe has a PID of 2516. So, Windows picks the PID and SAS uses it when creating the SAS work folder. This fact allows you to correlate a running SAS session with its temporary work folder. I have put this very fact to very good use on other very interesting operating systems with very good results.

Ernie best of luck in all of your SAS endeavors!

I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail: XXXX@XXXXX.COM

Author: Tuning SAS Applications in the MVS Environment

Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition

http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172

Author: The Complete Guide to SAS Indexes

http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Force is all-conquering, but its victories are short-lived. - Abraham Lincoln
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Similar Threads

1. How to assign a different directory for the work folder

Hello Everyone!

I want to change the directory of the work folder from the default
directory (/usr/tmp/SAS_workB91900004B5A_Evs01Sas03) to a new one. Is it
possible in SAS9.1.3. We work on SAS using the linux server platform.

Regards,
Ankur Shanker
________________________________



The information in this e-mail is the property of Evalueserve and is confidential and privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and will be unlawful. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

2. Unix Process and Associated Work Folder

3. libref for "work" data sets (one level name): WORK vs USER vs User= option

I thought there was an easy way to determine the libref for "work"
data sets (i.e. those that can be accessed via a one level name), but
I could not find anything on SAS-L or in the on-line doc. Of course,
searching for WORK USER LIBREF can provide a number of non-related
hits (see additonal slightly off topic question at bottom).
 
I ended up writing the code included below to determine the libname
and memname for one level data set names.
(I need the two level name to extract info from the dictionary tables)

Is there an easier way to figure out the two level name?
=============================================================
%*** get lib & mem;
%macro libmem(in=,lib=_lib,mem=_mem);
  %if %scan(&in,2,.)>' ' %then %do;
     %*** two level names are easy;
     %let &lib=%scan(&in,1,.);
     %let &mem=%scan(&in,2,.);
  %end;
  %else %do;
     %*** one level names are more challenging;
     %*** if USER option is set, then use it;
     %let &lib=%sysfunc(getoption(USER));
     %if "&&&lib"="" %then %do;
        %*** if no USER option, check USER libref, if there use it;
        proc sql noprint;
         select distinct libname into :&lib from DICTIONARY.MEMBERS
          where libname='USER';
        quit;
        %*** if no USER libref defined then it must be WORK;
        %if "&&&lib"="" %then %let &lib=WORK;
     %end;
     %let &mem=∈
  %end;
  %*** upcase for use with dictionary tables; 
  %let &lib=%upcase(&&&lib);
  %let &mem=%upcase(&&&mem);
%put &lib is &&&lib  &mem is &&&mem;
%mend;

%libmem(in=sashelp.prdsale);
data prdsale; set sashelp.prdsale(obs=1); run;
%libmem(in=prdsale);

libname USER 'c:\DeleteThisFolder';
data prdsalU; set sashelp.prdsale(obs=1); run;
%libmem(in=prdsalU);

libname altUser 'c:\DeleteThisOneToo';
options user=altUser;
data prdsalO; set sashelp.prdsale(obs=1); run;
%libmem(in=prdsalO);
=============================================================

While looking at the on-line doc I found these:

Files in UNIX System Services can also be specified without a libref.
The following example specifies an HFS file using a relative path:
data 'saswork/two'; x=2; run;

I do not currently have access to a UNIX or OS/390 box, but was
wondering, do data sets accessed in this way show up in the dictionary
tables? And, if so, what do they look like? Just curious. No real need
to know.

Thanks for any assistance or advice,
Tammie

4. I am getting ERROR : Unable to clear or re-assign the library

5. How do detect that I am processing the first of nth

Hi,

FIRST. and LAST. come in very handy when
you want to identify the first of a value
group or the last of a value group.  For
example, you have a BY statement with DATE.
When a BY statement is used with your SET
statement you will have the first.date and
last.date flags set depending upon each of
the distinct sets of unique values found in
the DATE variable.

If I am not mistaken, you are asking for the
first observation, not the first of every
group of values.

There are two way that come to mind. You could:
data d8;
        set d7;
        by date;
        retain cash;
        if _N_ eq 1 then cash = 0;
        else cash=cash+tot_Div+tot_purchase+tot_sales;
run;

However, most of us use the default value argument
to the RETAIN statement:
data d8;
        set d7;
        by date;
        retain cash 0;
        cash=cash+tot_Div+tot_purchase+tot_sales;
run;




Hope this is helpful.


Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group


Russell
Global Leaders in Multi-Manager Investing






-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of
Airungao
Sent: Thursday, July 21, 2005 2:15 PM
To:  XXXX@XXXXX.COM 
Subject: How do detect that I am processing the first of nth
observation?


Dear all,

I am writing the first SAS program in my life.  I am sure many of you
can give me a quick answer pretty fast.  Thanks in advance.

data d8;
        set d7;
        by date;
        retain cash;
        if first.obs then  <-  HERE IS WHERE I NEED THE HELP, if I am at
the first obs, I need to set cash to 0
        cash = 0;
        else
        cash=cash+tot_Div+tot_purchase+tot_sales;

run;

6. ODS HTML - Assigning an id attribute to a table

7. Assigning unique IDs

Dear all,

I have a list of names which I am trying to assign unique IDs to the
same person. However the names are pretty messy. Thus, I matched the
list of names to itself and am able to come up with a set of possible
matches for each name. The below is a part of my resulting dataset
after having matched the list of names with itself:

Obs	NAME	               MatchingName
1	ADERHOLD, A	ADERHOLD, AB
2	ADERHOLD, A	ANDERHOLD, A
3	ADERHOLD, AB	ADERHOLD, A
4	ANDERHOLD, A	ADERHOLD, A
5	KLINEFELLER	KLINEFELTER
6	KLINEFELLER	KLINEFELER
7	KLINEFELTER	KLINEFELLER
8	KLINEFELTER	KLINEFELER
9	KLINEFELER	KLINEFELTER
10	NDERHOLD, A	ANDERHOLD, A

I would like to assign observation 1, 2, 3, 4, and 10 to one ID and
5,6,7,8,9 to another ID. I am not able to figure out how to do so,
since the matching is not symmetrical. Any help would be much
appreciated. Thank you and have a good weekend!

Regards,
Angie

8. assign the same ids for the same by variables