Hi,
I am trying to save my log and ouput programmitcally to a file using following codes, as this used to work just fine on PC SAS:
I don't see any error as such or notes, but still I don't see any file created at the specified location:
OUTFILE "C:\output.lst";
LOGFILE "C:\log.log";
'OUT; FILE OUTFILE';
'LOG; FILE LOGFILE';
Thanks
Aruna
Looks like part of it didn't copy over ..here is the whole code:
FILENAME OUTFILE "C:\output.lst";
FILENAME LOGFILE "C:\log.log";
DM 'OUT; FILE OUTFILE';
DM 'LOG; FILE LOGFILE';
That would only work while running interactively so that Display Manager is running. If you are running a batch program or submitting to an execution server then there is no display manager to run the DM comands.
You could use
PROC PRINTTO log = "C:\log.log" print = "C:\output.lst";
run;
But you would need to run that BEFORE the code runs, not after.
Thanks Barnipaz and Tom.
We have EG SAS on the server. Does that mean the codes I had initially won't work on the server?
Second, I tried Printto it worked 🙂
Thanks
You could check the proc printto.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.