DATA Step, Macro, Functions and more

Autoexec

Accepted Solution Solved
Reply
Contributor
Posts: 43
Accepted Solution

Autoexec

Hello Everyone,

Is there any way to create a macro variable with the name of the autoexec, which is being called by a program at run time.

Thanks


Accepted Solutions
Solution
‎03-06-2014 11:03 AM
Super User
Posts: 10,500

Re: Autoexec

 

proc sql;

select setting into: autoexec

from dictionary.options

where optname='AUTOEXEC';

QUIT;

%PUT &AUTOEXEC;

View solution in original post


All Replies
Solution
‎03-06-2014 11:03 AM
Super User
Posts: 10,500

Re: Autoexec

 

proc sql;

select setting into: autoexec

from dictionary.options

where optname='AUTOEXEC';

QUIT;

%PUT &AUTOEXEC;

Regular Contributor
Posts: 198

Re: Autoexec

These statements do the same as ballarw.

%let filename=%sysfunc(getoption(autoexec));

%put filename:&filename;

I use a configuration file to set the value of autoexec; which shows as:

filename:!projects_root\SAS-site\autosite.sas

projects_root is an environment variable

Depending on how you start sas the option sas.initial.folder may have a path worth knowing

%put sasinitialfolder:%sysfunc(getoption(sasinitialfolder));

Ron Fehd  macro maven

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 382 views
  • 7 likes
  • 3 in conversation