4
votes

I'm using Proc Printto to save the log & output to a directory, which it does quite nicely, however the log is no longer printed in the log window. I still prefer to use the log for debugging.

proc printto 
    print='<directory>\output.lst' 
    log = '<directory>\log.log'
    new; 
run; 

(The new option replaces any existing log - works same as replace in other procs)

Many thanks.

3
I mean to ask: Is it possible to use this proc and still have the log printed in the log window?Murray

3 Answers

2
votes

You can use the -ALTLOG option when launching SAS (e.g. in the shortcut) to divert the entire session log to a specified file.

Example shortcut target: "C:\Program Files\SAS\SAS 9.1\sas.exe" -AUTOEXEC "c:\autoexec.sas" -CONFIG "z:\sas\temp\sasv9.cfg" -ALTLOG "c:\altlog.txt"

There maybe an option for the output also.

1
votes

-ALTPRINT would do it for the listing output. However if you are in interactive SAS, ODS HTML will generate output if you are using the HTML output window, so it is usually unnecessary. In some operating system, e.g UNIX, LINUX you are able to browse/search the output as it is being written. That is typically the way I do it when working in those OS's.

0
votes

This article gives a macro that answers my question. http://www.lexjansen.com/pharmasug/2002/proceed/coders/cc10.pdf