BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

 Hello ALL,

 

A macro named test666 stored at "D:\MYSAS\sasmacro\test666.sas"

   content of test666.sas :

        %macro test666;
             %put 111;
             %put 222;
        %mend test666;

 

The option in config file:  OPTIONS SASAUTOS=("D:\MYSAS\sasmacro");

 

Here is my question:

         After I open a new windows SAS session, I want to display the definition of macro test666.what I should do?

 

Thanks!

2 REPLIES 2
Tom
Super User Tom
Super User

Make a fileref that mimics the search path you have for your SASAUTOS setting and use that.

filename sa ("D:\MYSAS\sasmacro") ;

Then if you want to dump it to the log.

data _null_;
  infile sa('test666.sas');
  input;
  put _infile_;
run;

Or if you want to complile (or re-compile) it.

%include sa('test666.sas') / source2;

Or use the INCLUDE editor command.

include sa('test666.sas')
Reeza
Super User

Why wouldn't just go the D location and open the file?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 749 views
  • 1 like
  • 3 in conversation