53%macro mp_validatecol(incol,rule,outcol);
57%let tempcol=%mf_getuniquename();
59%
if &rule=ISINT %then %
do;
61 if not missing(&incol) then
do;
62 &tempcol=input(&incol,?? best32.);
63 if not missing(&tempcol) then
if mod(&tempcol,1)=0 then &outcol=1;
67%
else %
if &rule=ISNUM %then %
do;
72 &tempcol=input(&incol,?? best32.);
73 if missing(&tempcol) then &outcol=0;
77%
else %
if &rule=ISLIB %then %
do;
80 &tempcol=prxparse(
'/^[_a-z]\w{0,7}\z/i');
81 if missing(&tempcol) then
do;
82 putlog
'ERR' +(-1)
"OR: Invalid expression for ISLIB";
87 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
90%
else %
if &rule=ISNAME %then %
do;
94 &tempcol=prxparse(
'/^[_a-z]\w{0,31}\z/i');
95 if missing(&tempcol) then
do;
96 putlog
'ERR' +(-1)
"OR: Invalid expression for ISNAME";
101 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
104%
else %
if &rule=LIBDS %then %
do;
108 &tempcol=prxparse(
'/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}\z/i');
109 if missing(&tempcol) then
do;
110 putlog
'ERR' +(-1)
"OR: Invalid expression for LIBDS";
115 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;
118%
else %
if &rule=ISPATH %then %
do;
125 if length(trim(&incol))>0 and anycntrl(&incol)=0 then
do;
126 %
if "%upcase(&sysscp)"=
"WIN" or
"%upcase(&sysscp)"=
"DNTHOST" %then %
do;
128 if substr(&incol,2,1)=
':' and substr(&incol,3,1) in (
'\',
'/') then
131 if substr(&incol,1,2)=
'\\' and scan(&incol,2,
'\') ne '' then
135 if &outcol=1 then do;
136 if index(substr(&incol,3),
':')>0 then &outcol=0;
137 if index(&incol,
byte(34))>0 then &outcol=0;
138 if index(&incol,
'<')>0 then &outcol=0;
139 if index(&incol,
'>')>0 then &outcol=0;
140 if index(&incol,
'|')>0 then &outcol=0;
141 if index(&incol,
'?')>0 then &outcol=0;
142 if index(&incol,
'*')>0 then &outcol=0;
146 if substr(&incol,1,1)=
'/' then &outcol=1;
150%else %if &rule=FORMAT %then %do;
154 &tempcol=prxparse('/^(?:[_a-z\$]\w{0,31}|[0-9]+)\.[0-9]*\z/i
');
155 if missing(&tempcol) then do;
156 putlog 'ERR
' +(-1) "OR: Invalid expression for FORMAT";
161 if prxmatch(&tempcol, trim(&incol)) then &outcol=1;