Chapter Contents


SAS Companion for the OpenVMS Operating Environment

Using SAS in Interactive Line Mode

In SAS interactive line mode, you enter SAS statements line by line in response to line prompts that are issued by the SAS System. The SAS session retains exclusive use of the terminal or terminal window.

Invoking SAS in Interactive Line Mode

To invoke SAS in interactive line mode, enter the following command at the DCL prompt:

(If your system manager has set up the SAS environment so that the NODMS system option is the default, you can omit the NODMS option.)

As explained in Starting a SAS Session, you can also specify other system options when you invoke SAS in this manner.

When SAS prompts you with the 1? prompt, enter your SAS statements. By default, both the SAS log and the procedure output files (if any) appear on your display as each step executes.

Recalling SAS Statements with CTRL-B and the Arrow Keys

Under OpenVMS you can recall SAS statements by using the CTRL-B key combination and your up arrow and down arrow keys.

Both CTRL-B and the up arrow key move you backward through SAS statements that you entered previously. For example, if you have entered four lines of code and want to recall the first line, press CTRL-B or the up arrow key four times. Each time you press CTRL-B or the up arrow key, the previous line appears after the SAS prompt. When the correct line appears, press RETURN to submit the code.

If you accidentally miss the line that you wanted, then use the down arrow key to move forward through the list of previously entered commands. Each time you press the down arrow key, the next statement appears after the SAS prompt.

Saving SAS Statements

Interactive line mode is most effective when you use the %INCLUDE statement to bring in most of your SAS statements. Using this method, the programs that you enter are not long, and you do not need to save your SAS statements. However, if you want to save your program, the best method is to write your SAS log to an OpenVMS file.

One easy way to save your SAS statements is to use the PRINTTO procedure followed by the %LIST statement after you have entered your program statements. For example:

. . . program statements
. . .
14? filename mylog '[sasdemo]program.log';
15? proc printto log=mylog;
16? run;
17? %list;

This program gives you a listing of every line you have entered during your current SAS session. The lines are saved in an OpenVMS file that is referred to by the fileref MYLOG, which was assigned in the FILENAME statement in line 14.

Note:   To redirect the log to your display, enter the following PROC PRINTTO statement with no options:

proc printto;

Ending Your SAS Session

The ENDSAS statement terminates SAS interactive line mode:

Then OpenVMS prompts you for a DCL command.

Note:   Like all SAS statements, the ENDSAS 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.