@ybz12003 wrote: What is the altlog option? If using the code to put copy back in the end, I won't see anything until completing running a batch. Is there a way to monitor the log at the same time?
As Tom and Yabwon have showed, you can use PROC PRINTTO to send the log to a file, and then at the end of your code you can read that file to send the text back to your log window. That is how I do stuff like this when I'm using Enterprise Guide.
If you're using PC SAS (Display manager) in an interactive SAS session, another option is to let your log be written to the default log window, and then you can save the contents of the log file to a text file. And you can do it with code, using a DM statement with the FILE command to write the log window contents to a file:
dm "log; file ""Q:\junk\__mylog.log"" replace;";
But if you want the log messages to be written to your log window and a file at the same time, I think altlog is your best solution. I've actually never used altlog for that purpose, because I'm happy waiting for the submission to be complete before I can see the log.
I did submit a SAS ballot question years ago to recommend that SAS make it possible to turn on ALTLOG during a session, using an OPTIONS statement, but that suggestion was never implemented, and was not carried over into the new submission system. So I don't think there's much hope for that.
... View more