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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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