Thank you, @novinosrin !
I want to use your example code for e scenario where my condition to replace the values with missing observations is different. Instead of replacing missing observations with 'missing' in a character variable,
I have a list of numeric variables with a prefix var_name_: and I want to replace the existing observations which are numbers with missing . (later I want to assign other values)
I tried the following code but I think my t(i) is not connected to my conditions to assign missing.
I appreciate it if you may help me with this. Thanks
data want;
set have;
array t(*) var_name_:;
do i=1 to dim(t);
if var_1 in (2,3) and var_2 in (1,3,4,5,6,7,10,13,14,16) then t(i)=.;
end;
drop i;
run;
... View more