45%macro mp_validatecol(incol,rule,outcol);
49%let tempcol=%mf_getuniquename();
51%
if &rule=ISINT %then %
do;
53 if not missing(&incol) then
do;
54 &tempcol=input(&incol,?? best32.);
55 if not missing(&tempcol) then
if mod(&tempcol,1)=0 then &outcol=1;
59%
else %
if &rule=ISNUM %then %
do;
64 &tempcol=input(&incol,?? best32.);
65 if missing(&tempcol) then &outcol=0;
69%
else %
if &rule=ISLIB %then %
do;
72 &tempcol=prxparse(
'/^[_a-z]\w{0,7}$/i');
73 if missing(&tempcol) then
do;
74 putlog
'ERR' +(-1)
"OR: Invalid expression for ISLIB";
79 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
82%
else %
if &rule=LIBDS %then %
do;
86 &tempcol=prxparse(
'/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}$/i');
87 if missing(&tempcol) then
do;
88 putlog
'ERR' +(-1)
"OR: Invalid expression for LIBDS";
93 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
96%
else %
if &rule=FORMAT %then %
do;
100 &tempcol=prxparse(
'/^[_a-z\$]\w{0,31}\.[0-9]*$/i');
101 if missing(&tempcol) then
do;
102 putlog
'ERR' +(-1)
"OR: Invalid expression for FORMAT";
107 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;