55BY-Group Processing in the DATA Step
else output sas4_1_d;
run;
title 'Non-duplicated records';
proc print data = sas4_1_s;
run;
title 'Duplicated records';
proc print data = sas4_1_d;
run;
Output from Program 4.3:
Non-duplicated records
Obs ID SCORE
1 A01 2
2 A02 2
3 A02 4
Duplicated records
Obs ID SCORE
1 A01 3
2 A01 3
4.2.3 Obtaining the Most Recent Non-Missing
Data within Each BY Group
Longitudinal data, such as patients with repeated measurements over
time, are often encountered in the clinical eld. For example, a patient
mayhavemultiple measurements of weight, blood pressure, total cholesterol,
or blood glucose level over several medical visits, but may not have all these
values recorded every time. Researchers ma