Chapter Contents |
Previous |
Next |
SAS Companion for the CMS Environment |
The group name and variable name can be any that are valid for the CMS GLOBALV command (see the VM/ESA CMS Command Reference). If you omit the group name, the variable is extracted from the group SAS if it is found there, or else from the default group UNNAMED. If the variable has not been set by GLOBALV, SYSGET or %SYSGET returns an error.
SYSGET uses the EXECCOMM interface and therefore the length of the variable name is limited to 250 characters. GLOBALV imposes a maximum length of 255 characters on the variable's value. The full length is returned by SYSGET or %SYSGET if the SAS variable is assigned a sufficient length. Otherwise the value that is returned by SYSGET or %SYSGET is truncated to the SAS variable's length, which is 200 characters by default.
Using the SYSGET DATA Step Function |
SYSGET('group-name variable-name') |
For example, if the group name is MINE and the variable name is TIME, your DATA step might look like this:
data test; x=sysget('mine time'); . . . more data lines . . . run;
Using the %SYSGET Macro Function |
%SYSGET(group-name variable-name) |
For example, if the group name is MINE and the variable name is TIME, your code might look like this:
%let x=%sysget(mine time);
Using the SET= System Option |
The SET= system option may be used to set a system variable from within your SAS session, using the following syntax in an OPTIONS statement:
OPTIONS SET='<group-name> variable-name=value' |
options set='mine time=now'; run;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.