Previous Page | Next Page

Getting Started with SAS under OpenVMS

Interactive Line Mode under OpenVMS


What Is Interactive Line Mode?

In SAS interactive line mode, you enter SAS statements line by line in response to line prompts that are issued by SAS. 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:

$ SAS92/NODMS

(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 under OpenVMS, 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 (if any) appear on your monitor 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.

If you specify /termio=block when you invoke SAS, both CTRL+B and the up arrow key move you backward through SAS statements that you entered previously. However, the default is /termio=noblock , which means that you can recall only the previous command.

If you specified /termio=block when you invoked SAS, and you enter 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 ENTER 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:

. . . 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 monitor, enter the following PROC PRINTTO statement with no options:

proc printto;
run;

  [cautionend]


Ending Your SAS Session

The ENDSAS statement terminates SAS interactive line mode:

endsas;

Then, OpenVMS prompts you for a DCL command.

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

Previous Page | Next Page | Top of Page