Chapter Contents

Previous

Next
The PRINTTO Procedure

PROC PRINTTO Statement


Tip: To reset the destination for the SAS log and procedure output to the default, use the PROC PRINTTO statement without options.
Tip: To route the SAS log and procedure output to the same file, specify the same file with both the LOG= and PRINT= options.

PROC PRINTTO <option(s)>;

To do this Use this option
provide a description for a SAS log or procedure output stored in a SAS catalog entry LABEL=
route the SAS log to a permanent external file or SAS catalog entry LOG=
combine the SAS log and procedure output into a single file LOG= and PRINT= with same destination
replace the file instead of appending to it NEW=
route procedure output to a permanent external file or SAS catalog entry PRINT=


Without Options

Using a PROC PRINTTO statement with no options

Interaction: To close the appropriate file and to return only the SAS log or procedure output to its default destination, use LOG=LOG or PRINT=PRINT.
Featured in: Routing to External Files and Routing to SAS Catalog Entries


Options

LABEL='description'
provides a description for a catalog entry that contains a SAS log or procedure output.
Range: 1 to 40 characters
Interaction: Use the LABEL= option only when you specify a catalog entry as the value for the LOG= or the PRINT= option.
Featured in: Routing to SAS Catalog Entries

LOG=LOG | file-specification | SAS-catalog-entry
routes the SAS log to one of three locations:

LOG
routes the SAS log to its default destination.

file-specification
routes the SAS log to an external file. It is one of the following:

'external-file'
the name of an external file specified in quotation marks.

fileref
a fileref previously assigned to an external file.

SAS-catalog-entry
routes the SAS log to a SAS catalog entry. By default, libref is SASUSER, catalog is PROFILE, and type is LOG. Express SAS-catalog-entry in one of the following ways:

libref.catalog.entry<.LOG>
a SAS catalog entry stored in the SAS data library and SAS catalog specified.

catalog.entry<.LOG>
a SAS catalog entry stored in the specified SAS catalog in the default SAS data library SASUSER.

entry.LOG
a SAS catalog entry stored in the default SAS library and catalog: SASUSER.PROFILE.

Default: LOG.
Tip: After routing the log to an external file or a catalog entry, you can specify LOG to route the SAS log back to its default destination.
Tip: When routing the SAS log, include a RUN statement in the PROC PRINTTO statement. If you omit the RUN statement, the first line of the following DATA or PROC step is not routed to the new file. (This occurs because a statement does not execute until a step boundary is crossed.)
Interaction: The NEW option replaces the existing contents of a file with the new log. Otherwise, the new log is appended to the file.
Interaction: To route the SAS log and procedure output to the same file, specify the same file with both the LOG= and PRINT= options.
Interaction: When routing the log to a SAS catalog entry, you can use the LABEL option to provide a description for the entry in the catalog directory.
Featured in: Routing to External Files , Routing to SAS Catalog Entries , and Using Procedure Output as an Input File

NEW
clears any information that exists in a file and prepares the file to receive the SAS log or procedure output.
Default: If you omit NEW, the new information is appended to the existing file.
Interaction: If you specify both LOG= and PRINT=, NEW applies to both.
Featured in: Routing to External Files , Routing to SAS Catalog Entries , and Using Procedure Output as an Input File

PRINT= PRINT | file-specification | SAS-catalog-entry
routes procedure output to one of three locations:

PRINT
routes procedure output to its default destination. After routing it to an external file or a catalog entry, you can specify PRINT to route subsequent procedure output to its default destination.

file-specification
routes procedure output to an external file. It is one of the following:

'external-file'
the name of an external file specified in quotation marks.

fileref
a fileref previously assigned to an external file.

SAS-catalog-entry
routes procedure output to a SAS catalog entry. By default, libref is SASUSER, catalog is PROFILE, and type is LOG. Express SAS-catalog-entry in one of the following ways:

libref.catalog.entry<.LOG>
a SAS catalog entry stored in the SAS data library and SAS catalog specified.

catalog.entry<.LOG>
a SAS catalog entry stored in the specified SAS catalog in the default SAS data library SASUSER.

entry.LOG
a SAS catalog entry stored in the default SAS library and catalog: SASUSER.PROFILE.

Aliases: FILE=, NAME=
Default: PRINT
Interaction: The NEW option replaces the existing contents of a file with the new procedure output. If you omit NEW, the new output is appended to the file.
Interaction: To route the SAS log and procedure output to the same file, specify the same file with both the LOG= and PRINT= options.
Interaction: When routing procedure output to a SAS catalog entry, you can use the LABEL option to provide a description for the entry in the catalog directory.
Featured in: Using Procedure Output as an Input File

UNIT=nn
routes the output to the file identified by the fileref FTnnF001, where nn is an integer between 1 and 99.
Range: 1 to 99, integer only.
Tip: You can define this fileref yourself; however, some operating systems predefine certain filerefs in this form.


Chapter Contents

Previous

Next

Top of Page

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