BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
solfay243
Obsidian | Level 7

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!

1 ACCEPTED SOLUTION

Accepted Solutions
solfay243
Obsidian | Level 7

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.

View solution in original post

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

Like this?

ods listing file="%sysfunc(pathname(WORK))\outputs.lst";

 

solfay243
Obsidian | Level 7
While this is a great suggestion, it seems that using ods listing file=; will negate the proc printto print=; statement and I end up with just two files with separate log and output results rather than the file results I desire.
ChrisNZ
Tourmaline | Level 20

> 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. 

Tom
Super User Tom
Super User

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
solfay243
Obsidian | Level 7

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.

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1641 views
  • 0 likes
  • 3 in conversation