|
Jenni,
Ive been following this post for a while now and cant help be struck by
the fact that your distribution system of your macro(s) is flawed. Your
writing a macro and giving it out to a bunch of people and then having to
worry where they are storing it so you can push an update. Seems to me
you would be better served by reworking this system into one where you the
macro writer stores your macro in one location that everyone can access (
ie. a macro library). Thus, allowing you to only copy your new version
into one place and everyone has the new version.
Toby Dunn
On Thu, 21 Aug 2008 13:07:16 -0500, ./ ADD NAME=Data _null_,
<iebupdte@GMAIL.COM> wrote:
>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 -
>>
|