Hello,
It is possible to reroute the sas log using this statement.
proc printto log='alternate-log-file' new;
run;
But by doing that, in SAS EG, we are loosing the log into the various tabs.
Is there a way to keek the log in SAS EG as it is and to make a copy of it somewhere else for documentation per say.
See the approaches in this thread: https://communities.sas.com/t5/SAS-Programming/Print-the-same-SAS-Log-to-BOTH-the-log-window-and-ext...
Hi,
You can try using the ALTLOG System Option; from the documentation:
Specifies a location to write a copy of the SAS log.
Valid in: | Configuration file, SAS command, SASV9_OPTIONS environment variable |
Category: | Environment Control: Files |
PROC OPTIONS GROUP= | ENVFILES, LOGCONTROL |
Default: | None |
Note: | This option cannot be restricted by a site administrator. For more information, see Restricted Options. |
Thanks & kind regards,
Amir.
Alternatively, you can use the built-in Project Log feature w/o the need for adding any coding.
The Project Log feature can keep a running log for each project including the logs created for your code as well as the logs created by EG tasks.
Tools > Options > Project and Process Flows > then select "Enable project log for new projects" > OK to close/save.
This will add a "Project Log" tab from which you can choose
Share > Export (or Export as a Step) based on when you want to write the Project Log to disk.
Regards,
Bill
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.