Previous Page | Next Page

Routing the SAS Log and SAS Procedure Output

Routing Output in Batch Mode

Default Output Destination in 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 SAS.

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 (perhaps because file version limits are in effect), the OpenVMS batch log is overwritten with the SAS log.  [cautionend]

Routing Log and Procedure Output to a Printer

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 queue of 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.

Previous Page | Next Page | Top of Page