no need to create and use macro variables: data rules; length condition $25 description $200; rule="RULE1"; condition="COL1 < 0"; description="'Warning, COL1 CANT BE NEGATIVE (current value = '||STRIP(PUT(COL1,BEST.))||')'"; output; rule="RULE2"; condition="COL1 + COL2 > 100"; description="'Warning, THE SUM COL1+COL2 IS INVALID (current values: '||STRIP(PUT(COL1,BEST.))||' + '||STRIP(PUT(COL2,BEST.))||' > 100)'"; output; run; data _null_; set rules end=eof; if (_n_=1) then call execute('data output; set evnt;'); call execute(rule||'=ifn('||strip(condition)||',1,0);'); /* call execute(desc||'=ifn('||strip(rule)||','||desc||',ok);');*/ call execute(rule || "_description = ifc(" || strip(condition) || "," || strip(description) || ",'Ok');"); if eof then call execute('run;'); run;
... View more