Your sample code works. You may not have all of the array values set in you arrays. data originaldata;
input readvariable $;
cards;
a
b
c
d
f
g
aa1
aaa
aab
aac
aad
;
data categorize;
set originaldata;
category = "none";
array categoryone (50) $ ("a", "b", "c", "d");
array categorytwo (200) $ ("aaa", "aab", "aac");
if readvariable in categoryone then category = "1";
else if readvariable in categorytwo then category = "2";
run; you have a lot of ….. that were in the way which I removed.
... View more