71%macro mp_assertscope(action,
72 desc=Testing Scope Leakage,
74 scopeds=work.mp_assertscope,
76 outds=work.test_results
85%local ds test_result test_comments del add mod ilist;
86%let ilist=%upcase(_SASJS_FUNCTIONS SYS_PROCHTTP_STATUS_CODE
87 SYS_PROCHTTP_STATUS_CODE SYS_PROCHTTP_STATUS_PHRASE &ignorelist);
90%
if &action=SNAPSHOT %then %
do;
92 create table &scopeds as
93 select name,offset,value
94 from dictionary.macros
95 where scope=
"&scope" and upcase(name) not in (%mf_getquotedstr(&ilist))
99%
else %
if &action=COMPARE %then %
do;
102 create table _data_ as
103 select name,offset,value
104 from dictionary.macros
105 where scope=
"&scope" and upcase(name) not in (%mf_getquotedstr(&ilist))
106 order by name,offset;
111 base=&scopeds(where=(upcase(name) not in (%mf_getquotedstr(&ilist))))
115 %
if &sysinfo=0 %then %
do;
116 %let test_result=PASS;
117 %let test_comments=&scope Variables Unmodified;
120 proc sql noprint undo_policy=none;
121 select distinct name into: del separated by
' ' from &scopeds
122 where name not in (select name from &ds);
123 select distinct name into: add separated by
' ' from &ds
124 where name not in (select name from &scopeds);
125 select distinct a.name into: mod separated by
' '
129 and a.offset=b.offset
130 where a.value ne b.value;
131 %let test_result=FAIL;
132 %let test_comments=%str(Mod:(&mod) Add:(&add) Del:(&del));
135 %let ds=work.%mf_getuniquename(prefix=mp_assertscope);
139 test_description=symget(
'desc');
140 test_comments=symget(
'test_comments');
141 test_result=symget(
'test_result');
144 proc append base=&outds data=&ds;