BookmarkSubscribeRSS Feed
emsmpa
Calcite | Level 5

Hi,

is it possible to have SAS macros in subdirectories of a directory added to SASAUTOS?

E.g.:

SASAUTOS ('/path/to/macrodir')

We want to call all macros that are saved in subdirectories, like '/path/to/macrodir/basic_macros/' or '/path/to/macrodir/specific_macros/' automatically without adding all subdirectories to the AUTOCALL facility.

Thanks in advance!

2 REPLIES 2
SASKiwi
PROC Star

Unfortunately I don't think there is a simple answer for this.

You can use a FILEREF in SASAUTOS like SASAUTOS (myfileref) and this can point to multiple directories but then you have to define the fileref in a FILENAME statement that would require you to list all of the sub-directories anyway.

One possibility might be to pipe in a list of sub-directories via an operating system command and using the PIPE option on a FILENAME statement. It looks like you are using Unix and unfortunately I don't have access to a Unix environment to test this out. Hopefully someone else can.

emsmpa
Calcite | Level 5

Thanks!

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
  • 967 views
  • 3 likes
  • 2 in conversation