I would like to automatically save the overall project log for a SAS EG project to the folder in which the project is saved.
I can obviously point and click my way to the folder when exporting the log, but I would like to avoid these steps. I also have parallel execution of several programs so I cannot simply output the log for each program to the same file (i.e. proc printto log = "&path.\projectLog.log"; run;)
If you want one log for program. you could do something like:
proc printto log = "&path.\&program..log";
run;
I think EG might create an automatic macro variable similar to &program with the name of the current program. If not, there are ways find out.
This solution does not solve my problem - i.e. there are multiple programs running in parallel so printing to the same log file within each proc printto fails.
The variable &_ClientProjectPath has the name of the egp including full path, enclosed in single quotes. To get the path only, you can use something like:
data _null_;
path = substr(&_ClientProjectPath, 1, findc(&_ClientProjectPath, '/\', 1, 'b') -1);
call symputx('cpp', path);
run;
This is helpful as the first step, but I still can't figure out how to programmatically access the project log. Right now I right click on the last program in the process flow, choose "Share" . . . "Export as a step in the project", choose the "Project Log", and then manually point and click to the desired save location. I would like to just have a program I could place at the end of a process flow to save off the log.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.