home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!SALT.RA.ANL.GOV!SPARAPAN
- Message-ID: <9301061845.AA16502@salt.ra.anl.gov>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 6 Jan 1993 12:45:57 CST
- Reply-To: RA Sparapani RA/208/xxx gwing <sparapan@SALT.RA.ANL.GOV>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: RA Sparapani RA/208/xxx gwing <sparapan@SALT.RA.ANL.GOV>
- Subject: SAS Program_Name in DATA _NULL_ Step Under SunOS
- Comments: To: sas-l@uga.cc.uga.edu
- Lines: 73
-
- SAS-L:
-
- There was a recent discussion on SAS-L with regard to recovering the
- name of the SAS program running within the program. Here is an
- operating system dependent solution we have implemented in a DATA
- _NULL_ step. The code is 22 lines long which may be longer than
- most people would like, but almost half the lines are dedicated to
- character input so if someone knew a more pleasing character
- solution the code could be cut down considerably. The log file
- from a run follows. The program name is "pid".
-
- Rodney
-
- NOTE: Copyright(c) 1989 by SAS Institute Inc., Cary, NC USA.
- NOTE: SAS (r) Proprietary Software Release 6.07 TS203
-
- NOTE: SAS initialization used:
- real time 1.279 seconds
- cpu time 0.560 seconds
-
- NOTE: Libname GDEVICE0 refers to the same physical library as SASUSER.
- NOTE: Libref GDEVICE0 was successfully assigned as follows:
- Engine: V607
- Physical Name: /home/flash1/sparapan/sasuser
-
- NOTE: AUTOEXEC processing completed.
-
- 1 %global sys_sas;
- 2 %let columns=80;
- 3 filename pid pipe "ps | grep -e 'sas[ ]'";
- 4 data _null_;
- 5 format line $char&columns..;
- 6 infile pid missover;
- 7 do i=1 to &columns;
- 8 input @i char $char1. @;
- 9 if i=1 then line=char;
- 10 else line=char||line;
- 11 end;
- 12 line=reverse(trim(line));
- 13 put line;
- 14 if scan(line,1," ")=&sysjobid then do;
- 15 i=2;
- 16 do while(scan(line,i," ")^="sas");
- 17 i=i+1;
- 18 end;
- 19 call symput("sys_sas",scan(line,i+1," "));
- 20 end;
- 21 input;
- 22 run;
-
- NOTE: The infile PID is:
- Pipe command="ps | grep -e 'sas[ ]'"
-
- 16355 p0 TW 0:01 sas -fsd ascii -nonews
- 16487 p0 S 0:00 sas pid -nonews
- NOTE: 2 records were read from the infile PID.
- The minimum record length was 35.
- The maximum record length was 42.
- NOTE: Character values have been converted to numeric values at the places given
- by: (Number of times) at (Line):(Column).
- 2 at 14:4
- NOTE: DATA statement used:
- real time 1.497 seconds
- cpu time 0.270 seconds
-
-
- 23 %put &sys_sas;
- pid
- NOTE: The SAS System used:
- real time 3.420 seconds
- cpu time 1.060 seconds
-
- NOTE: SAS Institute Inc., SAS Circle, PO Box 8000, Cary, NC 27512-8000
-