Previous Page | Next Page

Macros under z/OS

Automatic Macro Variables


Portable Macro Variables That Have Host-Specific Values

The following automatic macro variables are portable, but their values are host-specific:

SYSCC

contains the current SAS condition code that SAS translates into a meaningful return code for z/OS at the conclusion of the SAS session.

Note:   When the value of the ERRORCHECK= option is NORMAL, then the return code is 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 does not terminate when the %INCLUDE statement fails because of a nonexistent file. For more information, see ERRORCHECK= System Option in the SAS Language Reference: Dictionary.  [cautionend]

SYSDEVIC

contains the name of the current graphics device. The current graphics device is determined by the SAS option DEVICE=. (See DEVICE= System Option: z/OS.) Ask your on-site SAS support personnel which graphics devices are available at your site.

SYSENV

is provided for compatibility with SAS software on other operating environments. Under z/OS, its value is FORE if you are running SAS under TSO. Otherwise, its value is BACK. You cannot change the value of this variable.

SYSJOBID

contains the job name of the batch job that is currently executing, or the user ID that is associated with the current SAS session. SAS obtains this value from the TIOCNJOB field of the TIOT control block, except in the case of SAS/SESSION. With SAS/SESSION, SAS obtains the value from the User_id field that is returned by the Get_TP_Properties service of APPC/MVS. You cannot change the value of this variable.

SYSMAXLONG

returns the maximum long integer value allowed by z/OS, which is 2,147,483,647.

SYSRC

contains the return code from the most recent operating environment command that was issued from within a SAS session. The default value is 0.

SYSSCP

contains the operating environment abbreviation OS. You cannot change the value of this variable.

SYSSCPL

contains the operating environment name. For systems before OS/390 Release 1, SYSSCPL contains the value MVS. For OS/390 releases, SYSSCPL contains the value OS/390. For z/OS releases, SYSSCPL contains the value z/OS. You cannot change the value of this macro variable.


Macro Variables Available Only under z/OS

The following macro variables are available only under z/OS:

SYSDEXST

contains the value that is returned by the DSNEXST statement. (See DSNEXST Statement: z/OS.) SYSDEXST has a value of 1 if the data set specified in the DSNEXST statement is currently available, or a value of 0 if the data set is not currently available.

SYSJCTID

contains the value of the JCTUSER field of the JCT control block as mapped by the IEFAJCTB macro. It is a 7-byte character value.

SYSJMRID

contains the value of the JMRUSEID field of the JCT control block as mapped by the IEFAJMR macro. The value is a 7-byte character. This field is blank unless an installation exit or another program product populates it. This field is left blank by IBM for the installation to use.

SYSUID

contains the value of the TSO user ID that is associated with the SAS session, regardless of whether the session is a batch job, a remote connect session, a SAS/SESSION connection, or a TSO session. SAS obtains this value from the ACEEUSRI field of the ACEE control block.

Four additional automatic macro variables that are available only under z/OS can be used to help diagnose failures in dynamic allocation. Their values are updated each time SAS does a dynamic allocation as a result of a FILENAME or LIBNAME statement (or their equivalent DATA step or SCL functions). They are undefined until the first dynamic allocation is performed. These macro variables are:

SYS99ERR

contains the error reason code that was returned in the SVC 99 request block.

SYS99INF

contains the information reason code that was returned in the SVC 99 request block.

SYS99MSG

contains the text of the message that is associated with the reason code.

SYS99R15

contains the return code that was returned in R15 from SVC 99.

Note:   The %PUT statement can be used to display the contents of these variables in the SAS log. For example,

%put_automatic_;

  [cautionend]


Names to Avoid When Defining Automatic Macro Variables

When you define automatic macro variables, do not use names taken up by z/OS reserved words (see Reserved z/OS ddnames), names of SAS files, or names beginning with &SYS. The prefix &SYS has been reserved for future use.

Previous Page | Next Page | Top of Page