DATA Step, Macro, Functions and more

AUTOCALL and subdirectories

Occasional Contributor
Posts: 11

AUTOCALL and subdirectories


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


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!

Super User
Posts: 3,918

Re: AUTOCALL and subdirectories

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.

Occasional Contributor
Posts: 11

Re: AUTOCALL and subdirectories


Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation