This doesn't work and I would appreciate it if anyone can explain the error. Note that I changed the checks to be the comparison and right hand side of an IF condition: data _null_;
length key $5 check $50;
input key check 7-50;
call symputx(key, check);
datalines;
key1 =1
key2 ="dog"
key3 in(2, 3, 4)
key4 <3 or is missing
key5 <= 5 or is missing
key6 is missing
;;;
run;
%put _all_;
GLOBAL KEY1 =1
GLOBAL KEY2 ="dog"
GLOBAL KEY3 in(2, 3, 4)
GLOBAL KEY4 <3 or is missing
GLOBAL KEY5 <= 5 or is missing
GLOBAL KEY6 is missing
*then pull in the macros to preform the check;
data want;
length key $5 stat $10 validate $10;
input key stat;
key=strip(key);
*check against macro lookup;
if (stat symget(key)) then validate ='Valid';
else validate='Invalid';
datalines;
key1 1
key2 cat
key3 5
key4 2
key5 10
key6 x
;;;;
run; 38 if (stat symget(key)) then validate ='Valid'; ______ (under symget) 22 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, LE, LT, MAX, MIN, NE, NG, NL, OR, [, ^=, {, |, ||, ~=. Thanks!
... View more