可以在sashelp.vmacro中查看所有存在的宏变量的scope和value等信息。
全局(global)宏变量可以通过使用%symdel来删除。
删除所有用户定义的全局宏变量,详见这里:
http://support.sas.com/kb/26/154.html
- %let x=1;
- %let y=2;
- %let z=3;
- %put &x &y &z;
- %macro delvars;
- data vars;
- set sashelp.vmacro;
- run;
- data _null_;
- set vars;
- temp=lag(name);
- if scope='GLOBAL' and substr(name,1,3) ne 'SYS' and temp ne name then
- call execute('%symdel '||trim(left(name))||';');
- run;
- %mend;
- %delvars
- %put &x &y &z;