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';
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.
Hi, this works for me ...
proc printto log='z:\log.txt' print='z:\print.txt';
proc means data=sashelp.class noprint;
There's nothing in the output window, here's the LOG ...
390 proc printto log='z:\log.txt' print='z:\print.txt';
NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.