Global symbol table and llocal symbol table

Reply
Occasional Contributor
Posts: 17

Global symbol table and llocal symbol table

%let Mv=shoes;
%macro PRODUCT(Mv=bicycles);
%let Mv=clothes;
%mend;
%PRODUCT(Mv=tents)
%put Mv is &Mv;

 

Why is the value o MV is shoes?? Please explain

Grand Advisor
Posts: 17,428

Re: Global symbol table and llocal symbol table

Because you have both global and local variables. 

 

Since the macro is finished when you request a PUT it uses the global version - which is the first assignment. 

Grand Advisor
Posts: 9,593

Re: Global symbol table and llocal symbol table

Yeah. The local symbol table would be destroied after running the macro.

So you only get the global symbol value.

Ask a Question
Discussion stats
  • 2 replies
  • 238 views
  • 0 likes
  • 3 in conversation