Previous Page | Next Page

Getting Started with SAS under OpenVMS

Customizing Your SAS Session Using OpenVMS Logical Names


Introduction to OpenVMS Logical Names Used by SAS

The definitions for OpenVMS logical names are provided in one of the following ways:


Logical Names That You Can Define

You can use the following logical names to customize aspects of your SAS session.

SAS$ALTLOG

contains the name of the current alternate SAS log file, if one is created. SAS$ALTLOG corresponds to the ALTLOG= system option. For more information, see ALTLOG= System Option: OpenVMS.

SAS$ALTPRINT

contains the name of the current alternate SAS output file, if one is created. SAS$ALTPRINT corresponds to the ALTPRINT= system option. For more information, see ALTPRINT= System Option: OpenVMS.

SAS$CONFIG

defines to SAS the location of a configuration file. For more information, see Configuration Files and Precedence for System Option Specifications.

SAS$INIT

defines to SAS the location of an autoexec file. The AUTOEXEC= system option takes its value from SAS$INIT, if SAS$INIT is defined. For more information, see AUTOEXEC= System Option: OpenVMS.

SAS$LOG

contains the name of the SAS log. SAS$LOG corresponds to the LOG= system option. For more information, see LOG= System Option: OpenVMS.

SAS$PRINT

contains the name of the SAS procedure output file. SAS$PRINT corresponds to the PRINT= system option. For more information, see PRINT= System Option: OpenVMS.

SAS$TRANTAB

specifies the names of translation tables that are used by various parts of SAS.

SAS$WORKLIB

points to your Work subdirectory. For more information about the Work subdirectory, see The Work Library under OpenVMS.

SAS$X_STATUS

contains the OpenVMS status code that indicates whether an X command or X statement executed properly. The logical name is stored in the JOB logical name table and can be checked after the execution of any X command or statement. If the X command or statement was successful, the value is 1. Any other value indicates that the X command or statement was not successful.

The following program uses the GETLOG function to determine whether the X statement executed properly. If the X statement did execute properly, then the program continues; if it did not, then the program stops.

x 'create/dir [sasxyz.newdir]';
data _null_;
   x=getlog('sas$x_status');
   if x^="1" then do;
      put 'The directory was not created.';
      put 'The OpenVMS return code was:  ' x;
      put 'Program stopping.';
      abort return;
   end;
   else
      put 'Directory was created successfully.';
run;

libname mylib '[sasxyz.newdir]';

data mylib.test;
   input revenue expenses;
   profit=revenue-expenses;
   datalines;
39800.73 35678.93
28900.38 28456.99
40933.22 5683.33
;

Note:   The ABORT RETURN statement not only stops the program, but also ends your SAS session.  [cautionend]

Previous Page | Next Page | Top of Page