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 (August 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 21 Aug 2008 13:07:16 -0500
Reply-To:     "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject:      Re: How to determine a macro file's location
Comments: To: jliu1971@yahoo.com
In-Reply-To:  <687d99e1-5b31-4ae5-a0bb-118fc6040bea@b1g2000hsg.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

You said the user %INCs as follows or where ever the macro was stored.

%include "c:\mymacro.sas";

that action causes SAS to create a fileref with the name #LN000nn. You can add code to your macro like the SQL I provided that will cause the macro to self report the location were it was %included. Have it send you an e-mail if you like.

The users change nothing, except to receive a new version of your macro.

If this is not what you wanted to do then please explain in more detail.

On 8/21/08, jliu1971@yahoo.com <jliu1971@yahoo.com> wrote: > ADD NAME: > > Thanks for your insight. That sure would have worked. However, my > users rejected the use of a fileref, which put me in this quandary. > > Thanks, > Jenni > > > > On Aug 21, 9:55 am, iebup...@GMAIL.COM ("./ ADD NAME=Data _null_,") > wrote: > > Very limited testing appears to show that a fileref #LN000nn is > > generated for each %INC. Using one of the variants of > > dictionary.extfiles you should be able to obtain the path. > > > > This code was %INC 'whoAmI.sas'; and the macro variable is populated > > with the full path. I expect there will be situations where the > > #LN000nn fileref may not be correct, but it will probably work the > > common usage you describe. > > > > %let includePath=; > > proc sql outobs=1 nowarn; > > select xpath into :includePath > > from dictionary.extfiles > > where fileref eqt '#LN' > > order by fileref descending; > > quit; > > run; > > %put INCLUDEPATH=&includepath; > > > > On 8/21/08, jliu1...@yahoo.com <jliu1...@yahoo.com> wrote: > > > > > > > > > We have a macro that's distributed to different users. Typically they > > > put it anywhere on their drive C, D, E... and use a %include > > > statement. I need to determine where they have put the macro inside > > > the macro. Using a sasauto call or a fileref has been suggested but > > > was nixed by the user. Is there a system function that does what I > > > need? > > > > > For example, my macro: > > > %mymacro(); > > > ... > > > %mend mymacro; > > > is stored as mymacro.sas and user A puts it on drive C and has a > > > statement %include "c:\mymacro.sas" in his program; user B put is on > > > drive D and has a statement %include "d:\mymacro.sas" in his program. > > > I need to know, in mymacro, where the macro is "included" from. > > > > > Thanks in advance for your help! > > > > > Jenni- Hide quoted text - > > > > - Show quoted text - >


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