BookmarkSubscribeRSS Feed
xtc283x
Quartz | Level 8

Hello-

 

    I am running v9.3 TSIM1 and would like to redirect my SAS log and output to an external file using Proc Printto WITHOUT the output being automatically written to the "Results" log in PC SAS. The output being automatically directed to the "Results" log is large and slows down the performance of the SAS program dramatically. The reason for this is that I am running a SAS/STAT procedure using a "by" statement and this is useless output. 

 

   Here is the syntax I am using for the Proc Printto:

 

              proc printto new log='c:\data\logfilex.txt'    file='c:\data\logfilex.txt';
              run;

 

   The SAS log output is being successfully written out to the external file. In addition, SAS documentation recommends putting the log= and file= (or print=) options in the same Proc Printto statement. Note two things about this:

 

   - Using two Proc Printtos -- one for the log= and a second for the file= -- has no effect on the "Results" log

 

   - Using an "ODS Listing Close;" options statement also has no effect on output written to the "Results" log. 

 

Any suggestions?

4 REPLIES 4
MikeZdeb
Rhodochrosite | Level 12

Hi, this works for me ...

 

proc printto log='z:\log.txt' print='z:\print.txt';
run;

 

proc means data=sashelp.class noprint;
run;

 

proc printto;
run;

 

There's nothing in the output window, here's the LOG ...

 

390 proc printto log='z:\log.txt' print='z:\print.txt';
391 run;

NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

Reeza
Super User
What in the proc is generating the large amount of output? Perhaps it can be suppressed in the proc?
ballardw
Super User

Results output is the ODS HTML destination. You can close and open that destination as needed to avoid output.

Reeza
Super User
*Close all results;
ODS _all_ close;

code;

*reopen results;
ODS Listing;
ODS HTML;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 3498 views
  • 0 likes
  • 4 in conversation