I am struggling with macros. I have four folders having marco code in .sas file. Folder names are folder1, folder2, folder3, folder4.
I want to make macros present in these folder available in my session. I written below mentioned code. Please suggest
filename MYMACROS( 'C:\folder1', 'C:\folder2', 'C:\folder3', 'C:\folder4' );
option APPEND=SASAUTOS= (,MYMACROS);
As mutch as know there is no option APPEND;
I think you mean to:
options sasautos=(sashelp.sasmacrs , my macros);
or
%let mymacros = 'C:\folder1', 'C:\folder2', 'C:\folder3', 'C:\folder4' ;
options sasautos = (sashelp.sasmacros, &mymacros);
I didn't check it, but try those two. In case of errors I'll try to help more.
Is there any reason you require an indirect approach? You could just code:
options sasautos=('C:\folder1', 'C:\folder2', 'C:\folder3', 'C:\folder4', sasautos);
Is there any way to find out what all folders being added to SASAUTOS at any point of time?
Try run:
PROC OPTIONS; Run;
and look in log for SASAUTOS;
suppose I add some folders to SASAUTOS then execute PROC OPTIONS;RUN;
I do not see the folder name in the log .
Enter new SAS seesion and run PROC OPTIONS; RUN;
Locate SASAUTOS= in log and remeber it for comparison.
then do:
filename mymacros '... enter path to your saved macros ...';
options sasautos = (mymacros, sasautos);
PROC OPTIONS; RUN;
No locate again SASAUTOS= in log and compare it to previous one.
You will find the difference.
I got, on second run: SASAUTOS = (mymacros, sasautos);
You should see the change. You will have to post the code that you ran.
To be very specific
Proc options option=SASAUTOS;run;
What does your program contain that in any way adds your four folders to SASAUTOS?
PROC OPTIONS shows whether you have been successful or not, but it doesn't change anything.
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: