1.

What will be the output of the code below?

Answer»

Let suppose we have a table admit in sasuser library and we have to fetch the student who has age GREATER than the average age then this can be code like the one below using symget.

%macro ch;  proc sql;                                                                                                                    SELECT AVG(age) into:avg_age from sasuser.admit;                                                                              quit;                                                                                                                          data x;                                                                                                                        set sasuser.admit;                                                                                                            ageif=symget('avg_age');                                                                                                       if age gt ageif;                                                                                                              run;                                                                                                                          %mend ch;                                                                                                                      %ch;


Discussion

No Comment Found