Note: This version is a simplified
version of the PRINTTO procedure syntax. For the complete syntax and
its explanation, see
PRINTTO Procedure in Base SAS Procedures Guide.
The following statements
send any SAS log entries that are generated after the RUN statement
to the external file that is associated with the fileref
myfile
:
filename myfile '/users/myid/mydir/mylog';
proc printto log=myfile;
run;
If
myfile
has
not been defined as a fileref, then PROC PRINTTO creates the file
myfile.log
in
the current directory.
The following statements
send any procedure output that is generated after the RUN statement
to the file
/users/myid/mydir/myout
:
proc printto print='/users/myid/mydir/myout';
run;
The following statements
send the procedure output from the CONTENTS procedure directly to
the system printer:
filename myfile printer;
proc printto print=myfile;
run;
proc contents data=oranges;
run;
To redirect the SAS
log and procedure output to their original default destinations, run
PROC PRINTTO without any options:
proc printto;
run;
If filerefs
myprint
and
mylog
have
not been defined, then the following statements send any SAS procedure
output to
myprint.lst
and any log output
to
mylog.log
in the current directory:
proc printto print=myprint log=mylog;
run;
If filerefs
myprint
and
mylog
had
been defined, the output would have gone to the files associated with
these filerefs.