data have; infile cards dsd; informat ANIMAL_BIRTH_DATE mmddyy10.; format ANIMAL_BIRTH_DATE mmddyy10.; input Animal DAM ANIMAL_BIRTH_DATE; cards; 6191,5495,7/26/2007 6191.1,5495,7/26/2007 6393,5501,8/15/2007 6394,5501,8/15/2007 6563,5501,8/5/2008 6564,5501,8/5/2008 6844,5501,10/10/2009 6845,5501,10/10/2009 7361.1,5501,1/4/2012 7362,5501,1/4/2012 6463.1,5757,7/24/2008 6843.1,5757,10/10/2009 6843,5757,10/10/2009 ; run; proc sort data=have;by dam animal_birth_date animal; data want; set have; by dam animal_birth_date animal; if first.animal_birth_date then count +1; if first.dam then count = 1; run;
... View more