Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Routing to External Files with the PRINTTO Procedure

Using the PRINTTO procedure with its LOG= and PRINT= options, you can route the SAS log or SAS procedure output to an external file from the windowing environment or from batch mode. You can specify the name of the external file in the PROC PRINTTO statement. For example, the following statement routes procedure output to OUTPUT LISTING B:

proc printto print='output listing b' new;

The NEW option tells SAS to overwrite OUTPUT LISTING B if it already exists.

To specify print format or other characteristics for an external file, or to specify the same external file several times in your SAS program, use the FILENAME statement and the PRINTTO procedure. The following example shows how to send the SAS log to an external file that has print format. In the example, SASLOG is the name of the SAS log file, OUTLOG is the fileref of the external file, and the VA value of the RECFM= option specifies print format.

filename outlog 'SASLOG file a' recfm=va;
   proc printto log=outlog;
   run;


Rerouting to the Default Destination

To reroute the log and procedure output to their default destinations, submit the following statements:

proc printto;
run;

See Default Routings of the SAS Log and Procedure Output Files for a list of the default destinations.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.