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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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