Hello,
I need some help with the following code. The first five columns are vaccinations given, and the last column is a concatenation of ID and date of visit. If someone is given the same vaccine on the same day it shouldn't count twice. Line 1 and line 4 both have Dtap observations, for the same ID/date. I can't delete the 4th observation because there's also a new vaccination there. If a patient has the same vaccine tagged as "1" on the same date, is there any way I can turn that second occurrence to "0"?
data SAMPLE;
infile datalines dsd truncover;
input DTAP:32. polio:32. MMR:32. HiB:32. HepB:32. ID_VaxDate:$19.;
datalines;
1 1 0 0 1 154548,2015-04-30
0 0 0 0 0 154548,2015-04-30
0 0 0 1 0 154548,2015-04-30
1 0 1 0 0 154548,2015-04-30
0 0 0 0 1 154548,2018-09-04
Thank you!