BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RahulG
Barite | Level 11

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);

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Try run:

 

PROC OPTIONS; Run;

 

and look in log for SASAUTOS;

View solution in original post

9 REPLIES 9
Shmuel
Garnet | Level 18

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.

Astounding
PROC Star

Is there any reason you require an indirect approach?  You could just code:

 

options sasautos=('C:\folder1', 'C:\folder2', 'C:\folder3', 'C:\folder4', sasautos);

RahulG
Barite | Level 11

Is there any way to find out what all folders being added to SASAUTOS at any point of time?

Shmuel
Garnet | Level 18

Try run:

 

PROC OPTIONS; Run;

 

and look in log for SASAUTOS;

RahulG
Barite | Level 11

suppose I add some folders to SASAUTOS then execute PROC OPTIONS;RUN; 

I do not see the folder name in the log .

Shmuel
Garnet | Level 18

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);

Astounding
PROC Star

You should see the change.  You will have to post the code that you ran.

RahulG
Barite | Level 11

To be very specific

Proc options option=SASAUTOS;run;

Astounding
PROC Star

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 2080 views
  • 2 likes
  • 3 in conversation