DATA Step, Macro, Functions and more

Add macro code available to the session

Accepted Solution Solved
Reply
Regular Contributor
Posts: 241
Accepted Solution

Add macro code available to the session

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

 

 

 


Accepted Solutions
Solution
‎09-27-2016 03:41 AM
Trusted Advisor
Posts: 1,375

Re: Add macro code available to the session

Try run:

 

PROC OPTIONS; Run;

 

and look in log for SASAUTOS;

View solution in original post


All Replies
Trusted Advisor
Posts: 1,375

Re: Add macro code available to the session

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.

Super User
Posts: 5,082

Re: Add macro code available to the session

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

 

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

Regular Contributor
Posts: 241

Re: Add macro code available to the session

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

Solution
‎09-27-2016 03:41 AM
Trusted Advisor
Posts: 1,375

Re: Add macro code available to the session

Try run:

 

PROC OPTIONS; Run;

 

and look in log for SASAUTOS;

Regular Contributor
Posts: 241

Re: Add macro code available to the session

[ Edited ]

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

I do not see the folder name in the log .

Trusted Advisor
Posts: 1,375

Re: Add macro code available to the session

[ Edited ]

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

Super User
Posts: 5,082

Re: Add macro code available to the session

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

Regular Contributor
Posts: 241

Re: Add macro code available to the session

To be very specific

Proc options option=SASAUTOS;run;

Super User
Posts: 5,082

Re: Add macro code available to the session

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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