Hi all,
I'm fairly new to proc printto and was wondering if I could use the print= statement multiple times in order to have files made at multiple places.
Here's what I want:
- I'd like to have 1 file that includes my log and my proc outputs in one single stream and have been doing that by setting the log= statement and print= statement to the same file location.
- I'd also like a separate file made that only includes my proc outputs.
From playing around with SAS, it seems that proc printto will only utilize the last print= statement. I was wondering if there were an option I could use where I could get both at the same time or if there was a different procedure I could use. I could just use an ods rtf/excel/pdf each time, but I'm wondering how to keep this as a SAS .lst file.
Many thanks!
For those interested, it would seem that short of using 3rd party software I have to make due with using ods rtf/pdf/excel to create an output only file in this case. I appreciate the replies here and we may have possibly found a new feature that SAS could work on implementing.
Like this?
ods listing file="%sysfunc(pathname(WORK))\outputs.lst";
> will negate the proc printto print=; statement
Oh no. Then the only way that I can think of in order to achieve your described goal is that you post-process the file with log+output to remove the log lines and create a second, output-only, file.
You will probably need to use the ALTPRINT option. This needs to be specified when you call/launch SAS.
sas -altprint "output_only.lst" -altlog "log_only.log" myprogram.sas
For those interested, it would seem that short of using 3rd party software I have to make due with using ods rtf/pdf/excel to create an output only file in this case. I appreciate the replies here and we may have possibly found a new feature that SAS could work on implementing.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.