69%macro mp_assertscope(action,
70 desc=Testing Scope Leakage,
72 scopeds=work.mp_assertscope,
74 outds=work.test_results
76%local ds test_result test_comments del add mod ilist;
77%let ilist=%upcase(&sasjs_prefix._FUNCTIONS SYS_PROCHTTP_STATUS_CODE
78 SYS_PROCHTTP_STATUS_CODE SYS_PROCHTTP_STATUS_PHRASE &ignorelist);
88%
if &action=SNAPSHOT %then %
do;
90 create table &scopeds as
91 select name,offset,value
92 from dictionary.macros
93 where scope=
"&scope" and upcase(name) not in (%mf_getquotedstr(&ilist))
96%
else %
if &action=COMPARE %then %
do;
99 create table _data_ as
100 select name,offset,value
101 from dictionary.macros
102 where scope=
"&scope" and upcase(name) not in (%mf_getquotedstr(&ilist))
103 order by name,offset;
108 base=&scopeds(where=(upcase(name) not in (%mf_getquotedstr(&ilist))))
112 %
if &sysinfo=0 %then %
do;
113 %let test_result=PASS;
114 %let test_comments=&scope Variables Unmodified;
117 proc sql noprint undo_policy=none;
118 select distinct name into: del separated by
' ' from &scopeds
119 where name not in (select name from &ds);
120 select distinct name into: add separated by
' ' from &ds
121 where name not in (select name from &scopeds);
122 select distinct a.name into: mod separated by
' '
126 and a.offset=b.offset
127 where a.value ne b.value;
128 %let test_result=FAIL;
129 %let test_comments=%str(Mod:(&mod) Add:(&add) Del:(&del));
134 length test_description $256 test_result $4 test_comments $256;
135 test_description=symget(
'desc');
136 test_comments=symget(
'test_comments');
137 test_result=symget(
'test_result');
141 proc append base=&outds data=&ds;