Hello all,
I have below dataset
subjid |
col1 |
col2 |
col3 |
col4 |
col5 |
col6 |
col7 |
col8 |
1 |
A |
A |
B |
B |
B |
B |
C |
|
2 |
A |
A |
B |
B |
C |
A |
B |
|
3 |
A |
B |
A |
B |
B |
A |
C |
C |
4 |
G |
D |
F |
F |
|
K |
|
|
I need to populate for subjects if any of the values from col1-col8 are "A" or "B" or "C" as valid ,if not as invalid
In the above dataset, subjects ,1,2 & 3 are valid and 4 is invalid as per the above condition.
I have tried the below code , but it's not giving desired result
data test;
set dsn;
array num(*) $ COL1_COL8;
do i= 1 to dim(ses);
if num(i) in ("A","B","C") then t="Valid";
else t="Invalid";
end;
run;
Appreciate your response!
Regards