Chapter Contents


SAS Companion for the OpenVMS Operating Environment

Using SAS in Noninteractive Mode

In SAS noninteractive mode, OpenVMS retains exclusive use of the terminal as the noninteractive SAS job executes. However, if your SAS program invokes windowing procedures, you can interact with the program during program execution. Your SAS program is read from a file that you specify by including the filename in the SAS command.

Note:   Noninteractive mode is similar to batch mode: statements are usually not expected to come from the terminal, and the SAS log and procedure output are routed to files with .LOG and .LIS file types by default.  [cautionend]

Invoking SAS in Noninteractive Mode

To invoke SAS in noninteractive mode, enter the SAS command followed by the name of the SAS program file that you want to execute. For example, suppose you have stored SAS statements and data lines in a program file named [HOME.SUBDIR]MYPROG.SAS. At the DCL prompt, enter the SAS command and the name of the file as follows:


You do not need to include the file type in the filename because the SAS command uses the .SAS file type by default. If [HOME.SUBDIR] is your current default directory, then you can omit the directory name from the file specification as follows:


In either case, SAS executes the statements in MYPROG.SAS and creates two files in the default directory: MYPROG.LOG contains the SAS log output and MYPROG.LIS contains the output from any SAS procedure that produces output.

To print one or both of these files, use the PRINT DCL command. To view these files at your terminal, use the EDIT or TYPE command. Note that if you use the TYPE command to list a SAS log that contains errors, overprinting obscures the line containing the error unless the OVP system option was set to NOOVP during your SAS session. (For a description of the OVP system option, see SAS Language Reference: Dictionary.)

Recalling SAS Statements

In noninteractive mode, the %INCLUDE statement serves two purposes. You can use it to include SAS statements that are stored in an external file, or you can issue the following form of the statement to allow input from your current terminal:

%include *;

Program execution pauses as you are prompted for input from the terminal. The prompt is a line number and an asterisk (*). Although this input method simulates SAS interactive line mode (because you are prompted for statements line by line), the statements are not interpreted line by line. This means that syntax errors are not detected until you terminate input and return to noninteractive processing.

To terminate input and resume noninteractive processing, press CTRL-Z or enter a %RUN statement:


Note:   Like all SAS statements, the %RUN statement must be followed by a semicolon (;).  [cautionend]

Chapter Contents



Top of Page

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