Discussion:
Reset compiled macros
(too old to reply)
SUBSCRIBE SAS-L Katja Glaß
2006-02-03 13:04:33 UTC
Permalink
Hello,

I need to reset compiled macros and hope there is a way in SAS.

The problem is I have several folders with macros, which have different
versions. I have to switch through these versions without restarting SAS
or including the files (sometimes in these folders are also programs).

I use SASAUTOS to search for macros in my folders. At first, it should use
SASAUTOS(path.version1) and after a time, I want to use newer macros
SASAUTOS(path.version2). The problem is, that by using a macro in version1
SAS stores it. When changing the SASAUTOS to path.version2 it takes still
the version1 macro.
For this I need to reset the compiled macros, so that SAS starts searching
again from SASAUTOS. By deleting work.sasmacr SAS does also not search for
this macro.

Maybe there is a command, that SAS thinks it is restarted, without
reloading everything?

Thanks
Stéphane Colas
2006-02-03 18:46:23 UTC
Permalink
Hi ,

I found a solution, could you test it ?

I take two macros which are stored in two lib. In my opinion, the system options
will be increased with sasmstore= mylib1 and sasmstore= mylib2 after to can
change of destination.

libname mylib1 'C:\';
options mstored sasmstore=mylib1;

%macro test /store;
%put this is the first version;
%mend;


libname mylib2 'C:\SAS';
options mstored sasmstore=mylib2;

%macro test /store;
%put this is the second version;
%mend;

options mstored sasmstore= mylib1 sasautos=(mylib1);
%test;

options mstored sasmstore= mylib2 sasautos=(mylib2);
%test;

But, without sasmstore before %test, this test doesn't work, you see ?

HTH

Stéphane.
Post by SUBSCRIBE SAS-L Katja Glaß
Hello,
I need to reset compiled macros and hope there is a way in SAS.
The problem is I have several folders with macros, which have different
versions. I have to switch through these versions without restarting SAS
or including the files (sometimes in these folders are also programs).
I use SASAUTOS to search for macros in my folders. At first, it should use
SASAUTOS(path.version1) and after a time, I want to use newer macros
SASAUTOS(path.version2). The problem is, that by using a macro in version1
SAS stores it. When changing the SASAUTOS to path.version2 it takes still
the version1 macro.
For this I need to reset the compiled macros, so that SAS starts searching
again from SASAUTOS. By deleting work.sasmacr SAS does also not search for
this macro.
Maybe there is a command, that SAS thinks it is restarted, without
reloading everything?
Thanks
Richard A. DeVenezia
2006-02-04 18:49:51 UTC
Permalink
Post by SUBSCRIBE SAS-L Katja Glaß
Hello,
I need to reset compiled macros and hope there is a way in SAS.
You can simply reinclude the macro source to recompile them.

If they are automacros, use Proc CATALOG to delete the MACRO entries in the
catalog WORK.SASMACR.
You will need OPTIONS MRECALL for this to work-- NOMRECALL means you get one
chance to load an autocall macro, if its not found at invocation it won't be
autocalled
--
Richard A. DeVenezia
http://www.devenezia.com/
SUBSCRIBE SAS-L Katja Glaß
2006-02-06 09:58:49 UTC
Permalink
Hi Stéphane,

this helps me quite a lot to find a solution. By having quite a lot of
macros I can't use this way directly. The environment is a bit more
complex than having just several versions of macros. For this I can't
store all possible ways of needed macros in several libs.

With this:
options mstored sasmstore= mylib1 sasautos=('H:\temp\version1');
options mstored sasmstore= mylib2 sasautos=('H:\temp\version2');
it would be a wonderful solution, if sas would store the macros
of 'H:\temp\version1' which are not in mylib1 in mylib1. But SAS stores it
in work.

The solution I found now is to delete all entries of work.sasmacr (earlier
I tried to delete the hole catalog, which does not work the way I needed).
So switching is - with "options mstored sasautos=('H:\temp\versionX');"
and deleting - possible.

Thanks a lot for helping me.

Regards
Katja
Post by Stéphane Colas
Hi ,
I found a solution, could you test it ?
I take two macros which are stored in two lib. In my opinion, the system
options
Post by Stéphane Colas
will be increased with sasmstore= mylib1 and sasmstore= mylib2 after to
can
Post by Stéphane Colas
change of destination.
libname mylib1 'C:\';
options mstored sasmstore=mylib1;
%macro test /store;
%put this is the first version;
%mend;
libname mylib2 'C:\SAS';
options mstored sasmstore=mylib2;
%macro test /store;
%put this is the second version;
%mend;
options mstored sasmstore= mylib1 sasautos=(mylib1);
%test;
options mstored sasmstore= mylib2 sasautos=(mylib2);
%test;
But, without sasmstore before %test, this test doesn't work, you see ?
HTH
Stéphane.
Post by SUBSCRIBE SAS-L Katja Glaß
Hello,
I need to reset compiled macros and hope there is a way in SAS.
The problem is I have several folders with macros, which have different
versions. I have to switch through these versions without restarting SAS
or including the files (sometimes in these folders are also programs).
I use SASAUTOS to search for macros in my folders. At first, it should
use
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
SASAUTOS(path.version1) and after a time, I want to use newer macros
SASAUTOS(path.version2). The problem is, that by using a macro in
version1
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
SAS stores it. When changing the SASAUTOS to path.version2 it takes
still
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
the version1 macro.
For this I need to reset the compiled macros, so that SAS starts
searching
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
again from SASAUTOS. By deleting work.sasmacr SAS does also not search
for
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
this macro.
Maybe there is a command, that SAS thinks it is restarted, without
reloading everything?
Thanks
toby dunn
2006-02-06 14:38:29 UTC
Permalink
Katja,

Sounds to me like you have a versioning problem namely in naming
conventions. Naming a new version the same as your old version has lead you
to need the macros in two different locations. In general I find this bad
form and only moves the problem to some other place.

I never name two macros the same name. If I come out with a new version I
delete the old version and use the new version. Where the new version
will have all the functionality of old version plus what ever updates/fixes
or enhancements I added. In one shop they did want to keep old versions
for some weird reason (we never used them they just took up space) but then
I gave the new versions a suffix of V2 denoteing that it was version 2 of
the macro. Not the best thing as you always had to update the programs that
called these macros when you created a new version, but hey it was their
idea and money not mine.



Toby Dunn





From: SUBSCRIBE SAS-L Katja Glaß <***@GMX.DE>
Reply-To: SUBSCRIBE SAS-L Katja Glaß <***@GMX.DE>
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: Reset compiled macros
Date: Mon, 6 Feb 2006 04:58:49 -0500


Hi Stéphane,

this helps me quite a lot to find a solution. By having quite a lot of
macros I can't use this way directly. The environment is a bit more
complex than having just several versions of macros. For this I can't
store all possible ways of needed macros in several libs.

With this:
options mstored sasmstore= mylib1 sasautos=('H:\temp\version1');
options mstored sasmstore= mylib2 sasautos=('H:\temp\version2');
it would be a wonderful solution, if sas would store the macros
of 'H:\temp\version1' which are not in mylib1 in mylib1. But SAS stores it
in work.

The solution I found now is to delete all entries of work.sasmacr (earlier
I tried to delete the hole catalog, which does not work the way I needed).
So switching is - with "options mstored sasautos=('H:\temp\versionX');"
and deleting - possible.

Thanks a lot for helping me.

Regards
Katja
Post by Stéphane Colas
Hi ,
I found a solution, could you test it ?
I take two macros which are stored in two lib. In my opinion, the system
options
Post by Stéphane Colas
will be increased with sasmstore= mylib1 and sasmstore= mylib2 after to
can
Post by Stéphane Colas
change of destination.
libname mylib1 'C:\';
options mstored sasmstore=mylib1;
%macro test /store;
%put this is the first version;
%mend;
libname mylib2 'C:\SAS';
options mstored sasmstore=mylib2;
%macro test /store;
%put this is the second version;
%mend;
options mstored sasmstore= mylib1 sasautos=(mylib1);
%test;
options mstored sasmstore= mylib2 sasautos=(mylib2);
%test;
But, without sasmstore before %test, this test doesn't work, you see ?
HTH
Stéphane.
Post by SUBSCRIBE SAS-L Katja Glaß
Hello,
I need to reset compiled macros and hope there is a way in SAS.
The problem is I have several folders with macros, which have different
versions. I have to switch through these versions without restarting SAS
or including the files (sometimes in these folders are also programs).
I use SASAUTOS to search for macros in my folders. At first, it should
use
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
SASAUTOS(path.version1) and after a time, I want to use newer macros
SASAUTOS(path.version2). The problem is, that by using a macro in
version1
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
SAS stores it. When changing the SASAUTOS to path.version2 it takes
still
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
the version1 macro.
For this I need to reset the compiled macros, so that SAS starts
searching
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
again from SASAUTOS. By deleting work.sasmacr SAS does also not search
for
Post by Stéphane Colas
Post by SUBSCRIBE SAS-L Katja Glaß
this macro.
Maybe there is a command, that SAS thinks it is restarted, without
reloading everything?
Thanks
Continue reading on narkive:
Loading...