When creating a macro, it should be saved in "work.sasmacr", but I do not have it and are wondering how I can find out where they are saved.
I am using SAS EG.
If no macros have been defined, then work.sasmacr does not exist. As soon as you define a macro (or call one from the AUTOCALL library) then work.sasmacr is created for you.
If you have defined a macro and it doesn't show in work.sasmacr (or work.sasmacr doesn't exist) then please explain in a lot more detail what you did, and SHOW US your code.
@SasStatistics wrote:
When creating a macro, it should be saved in "work.sasmacr", but I do not have it and are wondering how I can find out where they are saved.
I am using SAS EG.
What do you mean by "created"? To define a macro you run code that includes %MACRO and %MEND statements.
Do you have that code saved somewhere? If so just re-run it.
Note also that if you are using Enterprise Guide or SAS/Studio or some other tool to submit your SAS code then the catalog name where compiled macros are stored will have a slightly different name: WORK.SASMAC1
Catalogs will not show up in the server list's library listing.
Run PROC DATASETS on WORK to see the contents.
Later versions of SAS EG have a built-in SAS Catalog Viewer. Check the menu options - I think it is under Tools. You should be able to find WORK.SASMACR there.
Fun Fact: The SASMACRO name is a relic from early versions of SAS where SAS file names were limited to 8 characters.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.