I would like to see the results of the autoexec log in SAS Studio. My normal autoexec file in SAS Studio simply looks like this:
%include "/folder/location/my_real_autoexec.sas";
I thought I'd be sneaky and just wrap it in a "proc printto" to redirect the log like this:
proc printto log="~/autoexec.log";
%include "/folder/location/my_real_autoexec.sas";
proc printto;run;
It created the file ~/autoexec.log, but when I open it, it only contains the following:
NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.02 seconds cpu time 0.02 seconds
Is there a place I can see the autoexec log somewhere else? A configuration option I can specify somewhere? Or a better way to use proc printto?
EDIT - Just to be clear, I want to see what GLOBAL/AUTOMATIC macro variables are available at the time autoexec runs vs at the time you can submit code manually. So I can't use the 'run' feature that is supplied within SAS Studio.
If you want to see the source for your included file then either set the SOURCE2 option or add the /SOURCE option to the %INCLUDE statement.
%include "/folder/location/my_real_autoexec.sas" / source;
@RobP wrote:
I would like to see the results of the autoexec log in SAS Studio. My normal autoexec file in SAS Studio simply looks like this:
%include "/folder/location/my_real_autoexec.sas";
I thought I'd be sneaky and just wrap it in a "proc printto" to redirect the log like this:
proc printto log="~/autoexec.log"; %include "/folder/location/my_real_autoexec.sas"; proc printto;run;
It created the file ~/autoexec.log, but when I open it, it only contains the following:
NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.02 seconds cpu time 0.02 secondsIs there a place I can see the autoexec log somewhere else? A configuration option I can specify somewhere? Or a better way to use proc printto?
EDIT - Just to be clear, I want to see what GLOBAL/AUTOMATIC macro variables are available at the time autoexec runs vs at the time you can submit code manually. So I can't use the 'run' feature that is supplied within SAS Studio.
You might look into the options for the %PUT statement also. You can specify lists of variables such as _all_ , _automatic_ , _global_ , _user_ , _readonly_ , _writable_ and/ or _local_ (though _local_ generally doesn't mean much outside of a running macro).
%put _global_;
will show the current list of defined global macro variables and their values
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.