![]() Chapter Contents |
![]() Previous |
![]() Next |
| SYMGET and SYMGETN |
| Category: | Macro |
| Syntax | |
| Details | |
| Examples | |
| Example 1: Using the SYMGET Function | |
| Example 2: Using the SYMGETN Function | |
| Example 3: Returning Macro Values at Program Compile Time | |
| See Also | |
Syntax |
| cval=SYMGET(macro-var); |
| nval=SYMGETN(macro-var); |
Type: Character
Type: Numeric
Type: Character
| Details |
SYMGET and SYMGETN return values of macro variables when the program executes, whereas "¯o-var" returns values when the program compiles. SYMGET returns the value of a SAS macro variable as a character value and SYMGETN returns the value as a numeric value.
| Examples |
Execute commands if the operating system is Windows:
if symget('SYSSCP') = 'WIN' then do;
rc = optsetn('xwait',0);
rc = optsetn('xsync',0);
end;
Return the value of the macro variable UNIT at program execution time:
nval=symgetn('unit');
Return the values of the macro variables UNIT and SYSJOBID at program compile time:
nval=&unit; cval="&sysjobid";
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.