DATA Step, Macro, Functions and more

Find the filerefs/directories added to sasautos

Reply
Contributor
Posts: 65

Find the filerefs/directories added to sasautos

Hi,

I need to find the filerefs' or the directory location, that are assigned to option sasautos for the sas session thats already executing.

Please let know if there is any option or macro statement to find that.

Regards,

Moovendhan Devaraj

Regular Contributor
Posts: 227

Re: Find the filerefs/directories added to sasautos

Posted in reply to DMoovendhan

do you just want to see the list?

*list directory specifications in sasautos;

*list values of environment variables;

*sasroot is your installation folder;

%put %sysget(sasroot);

*environment variable references are preceeded by bang (!);

%put %cmpres(%sysget(sasautos));

*instantiate fileref sasautos;

%include sasautos(af)/nosource2;

filename sasautos list;

*check the option;

*is autocall option true? false::NoMautosource;

%put %sysfunc(getoption(mautosource));

proc options define value option=mautosource;

*what are the filerefs to search  see getoption above.

%put %sysfunc(getoption(sasautos)));

proc options define value option=sasautos;

*get list;

proc sql; describe table dictionary.extfiles;

         *create table list_filerefs_sasautos as;

          select * from dictionary.extfiles

          where fileref eq 'SASAUTOS';

          quit;

*the pair for compiled and stored macros is;

%put %sysfunc(getoption(mstored));

%put %sysfunc(getoption(sasmstore));

Here are some pages with background information.

http://www.sascommunity.org/wiki/SASautos_Companion_Reusing_Macros

Listing Macros in SASautos - sasCommunity

Super User
Posts: 10,207

Re: Find the filerefs/directories added to sasautos

Posted in reply to DMoovendhan

Check dictionary EXTFILES

proc sql;

select *

from dictionary.EXTFILES ;

quit;

Super User
Super User
Posts: 7,259

Re: Find the filerefs/directories added to sasautos

Posted in reply to DMoovendhan

The GETOPTION() function can return the value of an option. You can use %SYSFUNC() to call it with macro code.

%put %sysfunc(getoption(sasautos)) ;

If you see that there are FILEREFS used then you can use the PATHNAME() function to get the path(s) that the filerefs refer to.

%put %sysfunc(pathname(sasautos));

Contributor
Posts: 65

Re: Find the filerefs/directories added to sasautos

Thank you all, All the replies helped

Ask a Question
Discussion stats
  • 4 replies
  • 357 views
  • 3 likes
  • 4 in conversation