05-08-2018 03:07 PM
Some places I've seen proc printto print= option being used which sends the output to the necessary location and sometimes I've seen FILE PRINT statement being utilized. Are there any rules for when either of these are to be used?
05-08-2018 03:51 PM
Main difference is duration.
File Print output is for a single data step.
Proc Printto output continues sending all of the specified type(s) of output to the destination(s) until canceled.
05-08-2018 04:08 PM - edited 05-08-2018 04:15 PM
PROC PRINTTO controls the output for subsequent procedures, such as reports from PROC FREQ and PROC MEANS.
FILE controls messages written by subsequent PUT statements within the same DATA step. It has no impact on reports from SAS procedures.
Now that you've started me thinking, I will have to test what happens when both PROC PRINTTO and a FILE PRINT statement are in effect. Where will the PUT messages go?
************ TEST RESULTS:
When both PROC PRINTTO and FILE PRINT are used, the PUT statements in the DATA step write to the PROC PRINTTO destination.
05-08-2018 04:27 PM
In that last scenario, PROC PRINTTO and FILE PRINT are actually working together. The FILE statement can still override by specifying a different destination such as:
It's only the use of FILE PRINT that uses the PRINTTO destination.