48%macro mp_validatecol(incol,rule,outcol);
52%let tempcol=%mf_getuniquename();
54%
if &rule=ISINT %then %
do;
56 if not missing(&incol) then
do;
57 &tempcol=input(&incol,?? best32.);
58 if not missing(&tempcol) then
if mod(&tempcol,1)=0 then &outcol=1;
62%
else %
if &rule=ISNUM %then %
do;
67 &tempcol=input(&incol,?? best32.);
68 if missing(&tempcol) then &outcol=0;
72%
else %
if &rule=ISLIB %then %
do;
75 &tempcol=prxparse(
'/^[_a-z]\w{0,7}$/i');
76 if missing(&tempcol) then
do;
77 putlog
'ERR' +(-1)
"OR: Invalid expression for ISLIB";
82 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
85%
else %
if &rule=ISNAME %then %
do;
89 &tempcol=prxparse(
'/^[_a-z]\w{0,31}$/i');
90 if missing(&tempcol) then
do;
91 putlog
'ERR' +(-1)
"OR: Invalid expression for ISNAME";
96 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
99%
else %
if &rule=LIBDS %then %
do;
103 &tempcol=prxparse(
'/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}$/i');
104 if missing(&tempcol) then
do;
105 putlog
'ERR' +(-1)
"OR: Invalid expression for LIBDS";
110 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
113%
else %
if &rule=FORMAT %then %
do;
117 &tempcol=prxparse(
'/^(?:[_a-z\$]\w{0,31}|[0-9]+)\.[0-9]*$/i');
118 if missing(&tempcol) then
do;
119 putlog
'ERR' +(-1)
"OR: Invalid expression for FORMAT";
124 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;