Chapter Contents

Previous

Next
PRINTTO

PRINTTO



Defines destinations for SAS procedure output and the SAS log

Windows specifics: Valid values for file-specification; UNIT= option


Syntax
Details
Examples
Example 1: Redirecting SAS Log Output
Example 2: Redirecting SAS Procedure Output
Example 3: Restoring the Output Destinations to the Default
See Also

Syntax

PROC PRINTTO <option(s)>

Note:   This is a simplified version of the PRINTTO procedure syntax. For the complete syntax and its explanation, see the PRINTTO procedure in SAS Procedures Guide.  [cautionend]

option(s)

LOG=file-specification
PRINT=file-specification
can be a fileref defined in a FILENAME statement or function, a quoted Windows pathname, or an environment variable. If the file specification you use is not a fileref defined by the FILENAME statement function, the SET system option, or a Windows SET command, the destination is a file named file-specification.LST or file-specification.LOG stored in your working directory. To send your SAS output or log directly to the printer, use a FILENAME statement or function with the PRINTER device-type keyword. (See the first example in the following Examples section.)

UNIT=nn
sends your SAS procedure output to the file FTnnF001.LST, where nn represents the UNIT= value, which can range from 1 to 99. The file is located in the SAS working directory.


Details

The PRINTTO procedure defines destinations for SAS procedure output and for the SAS log.


Examples

Example 1: Redirecting SAS Log Output

The following statements redirect any SAS log entries that are generated after the RUN statement to an output file with a fileref of TEST, which is associated with the LPT1: device:

filename test printer 'lpt1:';
proc printto log=test;
run;

When these statements are issued, a dialog box is opened that informs you PROC PRINTTO is running. All SAS log entries are redirected to the TEST output file as specified; however, they are not printed on the LPT1: device until the output file is closed, either by redirecting the SAS log entries back to the default destination or to another file.

The following statements send any SAS log entries that are generated after the RUN statement to the external file associated with the fileref MYFILE:

filename myfile 'c:\mydir\mylog.log';
proc printto log=myfile;
run;

Example 2: Redirecting SAS Procedure Output

The following statements send any SAS procedure output to a file named MYPRINT.LST in your working directory (assuming MYPRINT is not a previously defined fileref or environment variable):

proc printto print=myprint;
run;

The following statements send any SAS procedure output to the printer port, which is usually defined by the system as LPT1:

proc printto print='lpt1:';
run;

Example 3: Restoring the Output Destinations to the Default

The following statements (including a PROC PRINTTO statement with no options) redirect the SAS log and procedure output to the original default destinations:

proc printto;
run;

See Also


Chapter Contents

Previous

Next

Top of Page

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