BookmarkSubscribeRSS Feed
dataMart87
Quartz | Level 8

Is there a way to route the SAS log to both the log window and a text file via proc printto?

6 REPLIES 6
Quentin
Super User

Don't think there is a way for PRINTTO to send the log to two places at the same time.

But, you could use -altlog to send the log to a file, and then use proc printto to turn writing log messages to the log windows on and off.

Unfortunately, -altlog can only be set at SAS invocation.  I really wish it could be turned on and off during a session.

HTH,

--Q.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Jagadishkatam
Amethyst | Level 16

i tried but i am unable to direct the log information to both the log and to an external file. it is either log or external file, but not both. Me too have a doubt on the same

Thanks,

Jag

Thanks,
Jag
Quentin
Super User

If you are using PC SAS, you could also just leave the log going to the log window, then use DM commands to copy the log window to a file.

Something like:

dm "log; file ""c:\junk\mylog.log"" replace;";

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
jakarman
Barite | Level 11

You cannot duplicate the sas-log using proc printto. Hmm the same question everytime coming back. 
My guess is there are business policies getting enforced as result of regulations. There must be en evidence who has done what when how.  This is a SIEM question.


---->-- ja karman --<-----
dataMart87
Quartz | Level 8

The external text file serves at least two purposes.  One is, yes, it is for regulatory and tracking.  Second is technical.  It's relatively easy to mine a text file.  Thanks for the responses.

jakarman
Barite | Level 11

Thanks for your confirmation on the intended goal of regulatory and tracking. You could have won a battle for going with printto.
I am convinced, with some reasons, you have lost the war by that.

---->-- ja karman --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 1344 views
  • 6 likes
  • 4 in conversation