I am working on checking the logs in SAS v9.4. There are many papers about check for issues from external files saved as *.log. But I'd like to read the SAS log of current program, and can't find any relevant papers.
What is the option or procedure to read the SAS log of my current program and check for the issues?
Thanks,
Zoe
Thank you so much, Reeza.
I just tried to use PROC PRINTTO, but it seems this statement would store the current logs in a external file, and the LOG tab of SAS would display nothing. what I expected is to keep the log message in the LOG tab of SAS, and read and check the log message and output the log summary in the LOG tab as well. For example, output the error and warning messages.
@Zoe_Steven - An alternative to PROC PRINTTO is the ALTLOG system option which creates a copy of the log in a file in addition to keeping the original log: https://documentation.sas.com/?docsetId=hostwin&docsetTarget=n02cl0iq0k1fmxn11p83yirplodk.htm&docset...
@Zoe_Steven wrote:
. For example, output the error and warning messages.
But that is already done by EG in the log summary; you try to reinvent the wheel.
Thanks, @Kurt_Bremser , but I have to reinvent, since what we are using is not EG
Yep, just saw that you use the Display Manager. That is rather rare nowadays 😉
Your SAS log has to be written to a file stored on disk before it can be read by a SAS program. Whether you save it manually or use @Reeza 's suggestion to write it automatically using PROC PRINTO the end result is a file on disk.
Many thanks, @SASKiwi .
I just found another way to output the current SAS log using DM statement.
dm 'log; file ".\xx.log" replace';
@Zoe_Steven - Great, I was aware of that one too, although that only works in the SAS Windowing Environment. It won't work if you use SAS Enterprise Guide as your user interface.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.