InterviewSolution
Saved Bookmarks
| 1. |
Explain what you mean by SYMGET and SYMPUT. |
|
Answer» In a data STEP, SYMGET returns a macro VARIABLE's value. Conversely, the primary FUNCTION of SYMPUT is to STORE the value of the data set in a macro variable. Syntax of Symput: CALL SYMPUT(macro-variable, value); Syntax of SYMGET: SYMGET(argument) Example: In the following PROGRAM we have created a macro variable and then we have used the symput function to put the value where our key is 'avar' and then we have used the symget function to get the micro variable value. * Create a macro variable. data dataset; set sashelp.class; if _N_ = 1 then do; call symput('avar', name); end; run; %put &avar; * Get macro variable value in a dataset; data needit; var1=symget('avar'); run; |
|