The following SAS program is submitted: %let a=cat; %macro animal(a=frog); %let a=bird; %mend; %animal(a=pig) %put a is &a; What is written to the SAS log?
a is pig
%let a=cat creates variable a in global symbol table; %macro animal (a=frog): as this is parameter, variable a with value of frog is created in local symbol table %put a is &a is to print variable a. As this is inside a macro, this will look at local symbol table first and take value of frog. %let a=bird looks at the local symbol table first and will find and overwrite variable a =frog with a=bird.
When the macro is called with parameter, SAS will look at local symbol table and find and overwrite variable a with a =pig
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Mangosteen_VV
1 year, 3 months ago