SYSGET Function: z/OS

Returns the value of the specified operating-environment variable.
Category: Special
z/OS specifics: operating-environment-variable
See: SYSGET Function in SAS Functions and CALL Routines: Reference

Syntax

SYSGET(operating-environment-variable)

Required Argument

operating-environment-variable
is the name of one of the parameters defined in the CLIST by which SAS was invoked.

Details

If the specified variable was not included in the SAS invocation, the error message “NOTE: Invalid argument to the function SYSGET” is generated and _ERROR_ is set to 1.
Although z/OS does not have native environment variables, you can use the SET option to define environment variables that are valid in your SAS session. SYSGET lets you retrieve these environment variables. If you are in interactive mode, SYSGET returns CLIST parameters. If you are in line mode, SYSGET returns the environment variables that are valid in your SAS session.

Example: Example

The following example returns the system options that are specified in the OPTIONS parameter of the SAS CLIST and prints to the specified log:
data _null_;
  optstr=sysget('OPTIONS');
  if _ERROR_ then put 'no options supplied';
  else put 'options supplied are:' optstr;
run;