Chapter Contents

Previous

Next
SAS Companion for the OpenVMS Operating Environment

Controlling Log and Output Destinations

Each method of running the SAS System has a default destination for the SAS log and procedure output files, but you can override these defaults with either SAS system options (when you invoke the SAS System) or the PRINTTO procedure (while you are running the SAS System).

Two system options control the destination of the SAS log: LOG= and ALTLOG=. Two similar options control the destination of procedure output: PRINT= and ALTPRINT=. The LOG= and PRINT= system options change the default destination of the SAS log and procedure output; the output does not appear at the original default destination. The ALTLOG= and ALTPRINT= system options send a copy of the output to the new destination; the output also appears at the original default destination. These options can only be specified when you invoke SAS or a new SAS process.

If you want to reroute the SAS log or the procedure output after you enter your SAS session, you can use the PRINTTO procedure with the LOG= and PRINT= statement options. Unlike the ALTLOG= and ALTPRINT= system options, the PRINTTO procedure does not send the output to both the new and default destinations; only the specified destination receives output. You must use the PROC PRINTTO statement before the SAS log entries or procedure output you want to route are generated. When you want the output to revert to the default destination, use a PROC PRINTTO statement with no statement options.

The following sections describe the default destinations for the SAS log and procedure output file for each method of running the SAS System, and they explain how to send these files to a display, printer, or disk file.


Windowing Environment Mode

In the windowing environment, the SAS log is automatically routed to the LOG window, and the procedure output is automatically routed to the OUTPUT window. The LOG= and PRINT= system options are ignored in the windowing environment.

Routing the Log to a Printer

To send the SAS log to a printer from the windowing environment, choose from the following methods:

PRINT
This command, issued from the LOG window command line, sends the contents of the LOG window to the default system printer (SYS$PRINT).

You can also use the PRTFILE command, which is described in Using the PRTFILE Command.

$ SAS/ALTLOG=SYS$PRINT
This SAS command sends a copy of the SAS log to the SYS$PRINT printer queue and to the default destination (LOG window). If you want to send the copy to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO LOG=fileref;
This procedure statement sends any following SAS log entries to the default system printer during a SAS session. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing the Log to a Disk File

To send the SAS log to a disk file from the windowing environment, choose from the following methods:

FILE file-specification
This command, issued from the command line of the LOG window, sends a copy of the window's contents to the file associated with file-specification.

For more information about the FILE command, see FILE.

$ SAS/ALTLOG=file-specification
This SAS command sends a copy of the SAS log to the disk file file-specification, as well as to the default destination (LOG window). The following is an example of this command:
$ SAS/ALTLOG=MYLOG.LOG

PROC PRINTTO LOG=file-specification;
This procedure statement sends any following SAS log entries to the disk file associated with file-specification during a SAS session. The value for file-specification can be any valid external file specification discussed in Identifying External Files to the SAS System.


Routing Procedure Output to a Printer

To send the procedure output to a printer from the windowing environment, choose from the following methods:

PRINT
This command, issued from the OUTPUT window command line, sends the contents of the OUTPUT window to the default system printer (SYS$PRINT). See your system manager for the location of your default printer.

You can also use the PRTFILE command. For more information, see Using the PRTFILE Command.

P selection-field command
When issued from the OUTPUT MANAGER window, this selection-field command sends the procedure output to the default system printer. Also, you can edit your output from the OUTPUT MANAGER EDIT window and then send the modified output to the printer. For more information about the OUTPUT MANAGER window, refer to the SAS online Help.

$ SAS/ALTPRINT=SYS$PRINT
This SAS command sends a copy of the procedure output to the SYS$PRINT printer queue and to the default destination (OUTPUT window). If you want to send the procedure output to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO PRINT=fileref;
This procedure statement sends any following procedure output to the default system printer during a SAS session. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing Procedure Output to a Disk File

To send the procedure output to a disk file from the windowing environment, choose from the following methods:

FILE file-specification
When issued from the command line of the OUTPUT window, this command sends a copy of the window's contents to the file associated with file-specification. For more information about the FILE command, see FILE.

F selection-field command
When issued from the OUTPUT MANAGER window, this selection-field command brings up a requestor window that asks for the filename and allows you to specify attributes such as REPLACE or APPEND. Also, you can edit your procedure output from the OUTPUT MANAGER EDIT window and then send the modified output to a file. For more information about the OUTPUT MANAGER window, refer to the SAS online Help.

$ SAS/ALTPRINT=file-specification
This SAS command sends a copy of the procedure output to the disk file file-specification and to the default destination (OUTPUT window). The following is an example of this command:
$ SAS/ALTPRINT=MYPROG.LIS

PROC PRINTTO PRINT=file-specification;
This procedure statement sends any following procedure output to the disk file associated with file-specification during a SAS session. The value for file-specification can be any valid external file specification discussed in Identifying External Files to the SAS System.


Interactive Line Mode

If you run your SAS program in interactive line mode, the SAS log and procedure output appear on the display by default. SAS statements from your program, the SAS log, and procedure output (if the program produces any) are interleaved on the display according to the order of DATA and PROC steps in your program.

Routing the Log to a Printer

To send the SAS log to a printer in interactive line mode, choose from the following methods:

$ SAS/NODMS/LOG=SYS$PRINT
This SAS command sends the SAS log to the SYS$PRINT printer queue instead of the default destination (the display). If you want to send the log to a different printer, you must redefine the SYS$PRINT logical name.

$ SAS/NODMS/ALTLOG=SYS$PRINT
This SAS command sends a copy of the SAS log to the SYS$PRINT printer queue and to the default destination (the display). If you want to send the log to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO LOG=fileref;
This procedure statement sends any following SAS log entries to the default system printer during a SAS session. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing the Log to a Disk File

To send the SAS log to a disk file in interactive line mode, choose one of the following methods:

$ SAS/NODMS/LOG=file-specification
This SAS command sends the SAS log to the disk file file-specification instead of the default destination (the display). The following is an example of this command:
$ SAS/NODMS/LOG=MYLOG.LOG

$ SAS/NODMS/ALTLOG=file-specification
This SAS command sends a copy of the SAS log to the disk file file-specification and to the default destination (the display). The following is an example of this command:
$ SAS/NODMS/ALTLOG=MYLOG.LOG

PROC PRINTTO LOG=file-specification;
This procedure statement sends any following SAS log entries to the disk file associated with file-specification during a SAS session. The value for file-specification can be any valid external file specification discussed in Identifying External Files to the SAS System.


Routing Procedure Output to a Printer

To send the procedure output to a printer in interactive line mode, choose from the following methods:

$ SAS/NODMS/PRINT=SYS$PRINT
This SAS command sends the procedure output to the SYS$PRINT printer queue instead of to the default destination (the display). If you want to send the procedure output to a different printer, you must redefine the SYS$PRINT logical name.

$ SAS/NODMS/ALTPRINT=SYS$PRINT
This SAS command sends a copy of the procedure output to the SYS$PRINT printer queue and to the default destination (the display). If you want to send the procedure output to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO PRINT=fileref;
This procedure statement sends any following procedure output to the default system printer during a SAS session. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing Procedure Output to a Disk File

To send the procedure output to a disk file in interactive line mode, choose from the following methods:

$ SAS/NODMS/PRINT=file-specification
This SAS command sends the procedure output to the disk file file-specification instead of to the default destination (the display). The following is an example of this command:
$ SAS/NODMS/PRINT=MYPROG.LIS

$ SAS/NODMS/ALTPRINT=file-specification
This SAS command sends a copy of the procedure output to the disk file file-specification and to the default destination (the display). The following is an example:
$ SAS/NODMS/ALTPRINT=MYPROG.LIS

PROC PRINTTO PRINT=file-specification;
This procedure statement sends any following procedure output to the disk file associated with file-specification during a SAS session. The value for file-specification can be any valid external file specification discussed in Identifying External Files to the SAS System.


Noninteractive Mode

In noninteractive mode, the default destination for the log is the disk file program-name.LOG, where program-name is the name of the file that contains the submitted SAS statements. The default destination for the procedure output is a disk file named program-name.LIS. For example, if you run your SAS program in noninteractive mode using the following command, the SAS log is automatically directed to a file named PROGNAME.LOG and the procedure output is written to a file named PROGNAME.LIS:

$ SAS PROGNAME

Both files are written in the default directory.

Routing the Log to a Display

To send the SAS log to a display in noninteractive mode, choose from the following methods:

$ SAS/LOG=SYS$OUTPUT program-name
This SAS command sends the SAS log to your display instead of the default destination (program-name.LOG file).

$ SAS/ALTLOG=SYS$OUTPUT program-name
This SAS command sends a copy of the SAS log to your display and to the default destination (program-name.LOG file).

PROC PRINTTO LOG=fileref;
This procedure statement sends the SAS log to your display during a noninteractive job. You must have defined fileref in a FILENAME statement or function with the TERMINAL device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing the Log to a Printer

To send the SAS log to a printer in noninteractive mode, choose from the following methods:

$ SAS/LOG=SYS$PRINT program-name
This SAS command sends the SAS log to the SYS$PRINT printer queue instead of the default destination (program-name.LOG file). If you want to send the log to a different printer, you must redefine the SYS$PRINT logical name.

$ SAS/ALTLOG=SYS$PRINT program-name
This SAS command sends a copy of the SAS log to the SYS$PRINT printer queue and to the default destination (program-name.LOG file). If you want to send the log to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO LOG=fileref;
This procedure statement sends the SAS log to a printer during a noninteractive job. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.

You can also use the DCL PRINT command to send the program-name.LOG file to the printer after a noninteractive job finishes.

Routing the Log to a Disk File

To send the SAS log to a disk file in noninteractive mode, choose one of the following methods:

$ SAS/LOG=file-specification program-name
This SAS command sends the SAS log to the file file-specification instead of the default destination (program-name.LOG file). The following is an example of this command:
$ SAS/LOG=MYLOG.LOG PROG1

$ SAS/ALTLOG=file-specification program-name
This SAS command sends a copy of the SAS log to the disk file file-specification and to the default destination (program-name.LOG file). The following is an example of this command:
$ SAS/ALTLOG=MYLOG.LOG PROG1

PROC PRINTTO LOG=file-specification;
This procedure statement sends any following SAS log entries to the disk file associated with file-specification during a noninteractive job. The value for file-specification can be any valid external file specification, as discussed in Identifying External Files to the SAS System.


Routing Procedure Output to a Display

To send the procedure output to a display in noninteractive mode, choose from the following methods:

$ SAS/PRINT=SYS$OUTPUT program-name
This SAS command sends the procedure output to your display instead of the default destination (program-name.LIS file).

$ SAS/ALTPRINT=SYS$OUTPUT program-name
This SAS command sends a copy of the procedure output to your display and to the default destination (program-name.LIS file).

PROC PRINTTO PRINT=fileref;
This procedure statement sends the procedure output to your display during a noninteractive job. You must have defined fileref in a FILENAME statement or function with the TERMINAL device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.


Routing Procedure Output to a Printer

To send the procedure output to a printer in noninteractive mode, choose from the following methods:

$ SAS/PRINT=SYS$PRINT program-name
This SAS command sends the procedure output to the SYS$PRINT printer queue instead of the default destination (program-name.LIS file). If you want to send the procedure output to a different printer, you must redefine the SYS$PRINT logical name.

$ SAS/ALTPRINT=SYS$PRINT program-name
This SAS command sends a copy of the procedure output to the SYS$PRINT printer queue and to the default destination (program-name.LIS file). If you want to send the procedure output to a different printer, you must redefine the SYS$PRINT logical name.

PROC PRINTTO PRINT=fileref;
This procedure statement sends the procedure output to a printer during a noninteractive job. You must have defined fileref in a FILENAME statement or function with the PRINTER device-type keyword. For more information, see the procedure PRINTTO and Device-Type Keywords in the FILENAME statement.

You can also use the DCL PRINT command to send the program-name.LIS file to the printer after a noninteractive job finishes.

Routing Procedure Output to a Disk File

To send the procedure output to a disk file in noninteractive mode, choose one of the following methods:

$ SAS/PRINT=file-specification program-name
This SAS command sends the procedure output to the disk file file-specification instead of the default destination (program-name.LIS file). The following is an example of this command:
$ SAS/PRINT=MYPROG.LIS PROG1

$ SAS/ALTPRINT=file-specification program-name
This SAS command sends a copy of the procedure output to the file file-specification and to the default destination (program-name.LIS file). The following is an example of this command:
$ SAS/ALTPRINT=MYPROG.LIS PROG1

PROC PRINTTO PRINT=file-specification;
This procedure statement sends any following procedure output to the disk file associated with file-specification during a noninteractive job. The value for file-specification can be any valid external file specification discussed in Identifying External Files to the SAS System.


Batch Mode

The default for handling output in batch mode is similar to noninteractive mode. When you invoke SAS in batch mode, the SAS log is written to a file with OpenVMS file type .LOG, and the procedure output is written to a file with OpenVMS file type .LIS in the default directory of the command procedure within which SAS was invoked. Typically, the default directory for a batch job is the SYS$LOGIN directory. You can change the default by using a SET DEFAULT command in the BATCH command file. The filename for the .LOG and .LIS files is the name of the SAS program file that you specified in the SAS command.

In addition to the .LOG and .LIS files that are created for SAS output, the OpenVMS system also creates an OpenVMS log file in batch mode. The OpenVMS batch log is named command-file.LOG, where command-file is the command procedure that you submitted for execution. Do not confuse the OpenVMS log with the SAS log. Both have the OpenVMS file type .LOG, but the OpenVMS log contains commands and messages that are generated by OpenVMS when it processes any batch job, including a SAS batch job. The SAS log contains statements and messages that are generated by the SAS System.

CAUTION:
Do not give your SAS program and the command procedure the same name. This causes confusion when the OpenVMS and SAS logs are created. If this does occur, the OpenVMS log is created first (for example MYPROG.LOG;1) and the SAS log is created second (MYPROG.LOG;2). If you cannot keep more than one version of a file, the OpenVMS batch log is overwritten with the SAS log.  [cautionend]

You can send the SAS log and procedure output to a printer instead of to the default .LOG and .LIS files. To redirect the SAS log and procedure output to the system printer, use SYS$PRINT as the value for the LOG=, ALTLOG=, PRINT=, and ALTPRINT= system options, where appropriate. You can also use the DCL PRINT command to send the .LOG and .LIS files to the printer after a batch job has finished.


Chapter Contents

Previous

Next

Top of Page

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