|
Jan-
Move the TRIM() inside the CALL SYMPUT. The length of the &CURRPATH macro
variable is getting set to the original length of the variable REVERSE.
Trimming REVERSE inside the CALL SYMPUT sets the length to the trimmed
value.
currpath=reverse(substr(reverse,tempstrt+1));
call symput('currpath',TRIM(currpath));
Pete Lund
WA State Caseload Forecast Council
(360) 902-0086 voice
(360) 902-0084 fax
peter.lund@cfc.wa.gov
-----Original Message-----
From: jpadilla@HOOKED.NET [mailto:jpadilla@HOOKED.NET]
Sent: Friday, September 03, 1999 6:26 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Relative directory names from SAS
Rather that use fully qualified directory names from SAS, I'd like to make
them
relative to the directory from which I submitted a batch SAS job in Unix. I
tried
the macro below, but need help in stripping the trailing blanks.
Alternatively, is there a simpler way of doing this?
2 option mprint;
3 %let temp=%sysget(PWD);
4 data _null_;
5 reverse = reverse("&temp");
6 tempstrt=index(reverse,'/');
7 currpath=trim(reverse(substr(reverse,tempstrt+1)));
8 call symput('currpath',currpath);
9 run;
NOTE: DATA statement used:
real time 0.190 seconds
cpu time 0.058 seconds
10 %put &currpath=;
/proj/nonmon/OnlineBalXfer =
11
12 libname data "&currpath./data";
NOTE: Library DATA does not exist.
Jan Padilla
Information Management and Development Group
(925) 603-2189
---------------------------------------------------------
Making the simple complicated is commmonplace; making the
complicated simple, awesomely simple, that's creativity.
--Charles Mingus
---------------------------------------------------------
"Salsa" Jan Padilla
jpadilla@hooked.net
http://www.hooked.net/~jpadilla
|