Search code examples
sassas-macro

Converting autocall libraries to stored compiled macros


We have hundreds of macros across several autocall libraries that I'd like to compile using the MSTORE facility.

The problem is that some of those libraries are used on other sites - and we don't want to add /STORE to every definition, as then it is required to use the MSTORED option.

I guess the answer is to add /* /STORE */ at the end of every %macro statement, so that the .sas program files can be updated with a regular expression (or some other text replacement technique) on every redeploy, but this seems like a messy workaround.

Is it possible / in some way supported, to compile regular (unmodified) autocall macros and store the definitions? Eg by %inc'ing each one and saving the work macro catalog, or something like that?


Solution

  • I won't say definitively that this isn't possible, but I can report that I tried to do the same thing some time ago and got stuck on the same point. I was also unable to find any way of doing this other than adding /store to every %macro statement.

    I vaguely remember that I was able to upload the work.sasmacr catalogue from one session to another on the same machine (after first compiling a few autocall macros to populate it), but the other session didn't recognise the macro definitions from transferred catalogue even though the appropriate options were set for using stored compiled macros.

    My motivation was different from yours - I was looking for a way to define a macro in one session and execute it in another without saving it in an autocall folder or %including it in both sessions - but the conclusion was the same.