Hi there, For your kind information, I am trying to create a flag based on multiple observations for each subject. For example, multiple observations for a subject, if any observation value is missing, one missing flag will be created as well as if any of the value is invalid, an invalid flag will be created. In my example given bleow, valid range of values for category are AAA, BBB and CCC. So, if category contains DDD must be flagged as invalid. data have;
length id $3. category $3. ;
infile datalines TRUNCOVER;
input id $ category $;
datalines;
101 AAA
101 BBB
101 CCC
201 AAA
201
201 BBB
301 AAA
301
301 DDD
;
run;
data want;
length id $3. missing_flag $1. invalid_flag $1;
infile datalines TRUNCOVER;
input id $ missing_flag $ invalid_flag $ ;
datalines;
101 0 0
201 1 0
301 1 1
;
run; Thank you in advance for your kind guidance. Regards,
... View more