LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 3 Sep 1999 07:11:11 -0700
Reply-To:   "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Subject:   Re: Relative directory names from SAS
Comments:   To: "jpadilla@HOOKED.NET" <jpadilla@HOOKED.NET>
Content-Type:   text/plain; charset="windows-1252"

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


Back to: Top of message | Previous page | Main SAS-L page