Search code examples
macrossassas-studio

Refreshing the macro library


I've been using a macro library so that I can use macros without compiling them first. The problem is that when I change the macro and save it, then refresh my filename for the macro lib, this is not enough to update and use the new macro?

Anyone have any ideas why it is still using and compiling the old macro before it was saved?


Solution

  • The first time a macro is called, if it hasn't already been defined, SAS will check your autocall path and iterate through those locations trying to find it.

    When it finds the macro in your autocall library it compiles it and saves the compiled version to your work folder. Subsequent calls to the macro will result in SAS using the compiled version of the macro.

    In order for it to be refreshed (if you have made changes since it was compiled) you need to open the code to the macro and submit it again. That will redefine/recompile it for you.

    Alternatively, you could also find the catalog in your work folder that contains the compiled versions of the macros and delete it from there (typically work.sasmacr).