BookmarkSubscribeRSS Feed
RobP
Quartz | Level 8

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.

2 REPLIES 2
Tom
Super User Tom
Super User

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;
ballardw
Super User

@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 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.


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

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!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 1426 views
  • 0 likes
  • 3 in conversation