x******n 发帖数: 173 | 1 8 %let a=cat;
9
10 %macro animal(a=frog);
11 %let a=dog;
12 %mend;
13 %animal(a=pig)
14 %put a is &a;
a is cat
15 %let a=cat;
16
17 %macro animal;
18 %let a=dog;
19 %mend;
20 %animal
21 %put a is &a;
a is dog;
why the results from the two programs are different? Thanks. | w***z 发帖数: 28 | 2 in first macro, a is local
%let a=dog;
inside the macro will only update the local variable a.
in the second macro, as there is no variable a in the local table
%let a=dog;
inside the macro will update a in the globle table... | x******n 发帖数: 173 | 3 get it thanks
【在 w***z 的大作中提到】 : in first macro, a is local : %let a=dog; : inside the macro will only update the local variable a. : in the second macro, as there is no variable a in the local table : %let a=dog; : inside the macro will update a in the globle table...
|
|