Previous Page | Next Page

Macro Facility under OpenVMS

Automatic Macro Variables under OpenVMS

The following automatic macro variables have aspects that are specific to the OpenVMS operating environment:

SYSCC

contains the current SAS condition code that SAS will return to the OpenVMS operating environment when SAS exits. Upon exit, SAS translates this condition code to a return code that has a meaningful value for the operating system. For OpenVMS, a successful completion returns a code of $STATUS=1.

Note:   When the value of the ERRORCHECK= option is NORMAL, then the return code will be 0 even if an error exists in a LIBNAME or FILENAME statement, or in a SAS/SHARE LOCK statement. Also, the SAS job or session will not terminate when the %INCLUDE statement fails due to a nonexistent file. For more information, see ERRORCHECK= System Option in SAS Language Reference: Dictionary.  [cautionend]

SYSDEVIC

gives the name of the current graphics device.

SYSENV

is provided for compatibility with SAS running on other operating environments, but it is not relevant in the OpenVMS operating environment. In the OpenVMS environment, its value is always FORE .

SYSJOBID

lists the OpenVMS process ID (PID) of the process that is running SAS (for example, 27A0D1D2 ).

SYSPARM

specifies a character string that can be passed to SAS programs. By default, the value of SYSPARM is in uppercase in the OpenVMS operating environment. To preserve the case of the string, enclose it in double quotation marks.

SYSRC

holds the OpenVMS status of DCL commands that were issued during your SAS session. The variable holds a character string that is the text form of the decimal value of the OpenVMS command status. For example, consider the following statements:

x 'dirf'; /* an invalid OpenVMS command */
%put This OpenVMS status is &sysrc;

x 'dir'; /* a valid OpenVMS command */
%put The corrected OpenVMS status is &sysrc;
When these statements are issued, the following lines are written to the SAS log:
This OpenVMS status is 229520
The corrected OpenVMS status is 0
SYSSCP

in the OpenVMS operating environment, SYSSCP returns the value VMS ITAN .

SYSSCPL

returns the value OpenVMS for the OpenVMS operating environment.

SYSSESID

returns the client name of an application. The client name of a SAS session consists of either the value of the xresources="name" or the word SAS plus the SAS session ID. SAS is the default. The SAS session ID is incremented once for each concurrent session that is started. For example, if you start a second SAS session without ending the first session, then the default client name for the second session is SAS2 .

VMSSASIN

contains the value of the SYSIN= system option and provides you with the name of the SAS job that is currently being run. When SAS is run in interactive mode, the value of VMSSASIN is SYS$INPUT.

The following is an example using this macro variable:

data test;
   infile '[school]roster.dat';
   input name $ age grade $;
run;

proc print data=test;
   title "Output generated by &vmssasin program.";
run;

Alternatively, you could put the value of the VMSSASIN macro variable into a variable in your data set:

data test;
   infile '[school]roster.dat';
   input name $ age grade $;
   job=symget("vmssasin");
run;

Previous Page | Next Page | Top of Page