| SAS Companion for the OpenVMS Environment |
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 must 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.
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.
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). The PRINT command must be followed by the FREE command; otherwise, the window contents will not be printed until the end of your SAS
session.
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.
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=filename
-
This SAS command sends a copy of the SAS log to the disk file filename, 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.
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.
The PRINT command must be followed by the FREE command; otherwise, the window contents will not be printed until the end of your SAS session.
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.
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=filename
-
This SAS command sends a copy of the procedure output to the disk file filename 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.
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.
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.
To send the SAS log to a disk file in interactive line mode, choose one of the
following methods:
-
$
SAS/NODMS/LOG=filename
-
This SAS command sends the SAS log to the disk file filename instead of the default destination
(the display). The following is an example of this command:
$ SAS/NODMS/LOG=MYLOG.LOG
-
$
SAS/NODMS/ALTLOG=filename
-
This SAS command sends a copy of the SAS log to the disk file filename 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.
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.
To send the procedure output to a disk file in interactive line mode, choose from
the following methods:
-
$
SAS/NODMS/PRINT=filename
-
This SAS command sends the procedure output to the disk file filename instead of to the default
destination (the display). The following is an example of this command:
$ SAS/NODMS/PRINT=MYPROG.LIS
-
$
SAS/NODMS/ALTPRINT=filename
-
This SAS command sends a copy of the procedure output to the disk file filename 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.
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.
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.
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.
To send the SAS log to a disk file in noninteractive mode, choose one of the following
methods:
-
$ SAS/LOG=filename
program-name
-
This SAS command sends the SAS log to the file filename instead of the default destination
(program-name.LOG file). The following is an example of this command:
$ SAS/LOG=MYLOG.LOG PROG1
-
$ SAS/ALTLOG=filename
program-name
-
This SAS command sends a copy of the SAS log to the disk file filename 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.
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.
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.
To send the procedure output to a disk file in noninteractive mode, choose one of the
following methods:
-
$
SAS/PRINT=filename program-name
-
This SAS command sends the procedure output to the disk file filename instead of the default
destination (program-name.LIS file). The following is an example of this command:
$ SAS/PRINT=MYPROG.LIS PROG1
-
$
SAS/ALTPRINT=filename program-name
-
This SAS command sends a copy of the procedure output to the file filename 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.
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.
![[cautend]](../common/images/cautend.gif)
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.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.