Hi!
I wondering if there is a way to calculate the number of days between first jr test and second test, and between second and third, etc. Knowing that some jrtest will be ".".
data have;
input cow$ jrtest:ddmmyy10. scc;
cards;
daisy 10/7/2017 200
maggy 10/7/2017 120
lily 10/7/2017 98
daisy . 89
maggy 11/8/2017 120
lily 11/8/2017 98
daisy 13/9/2017 102
maggy 13/9/2017 154
lily 13/9/2017 232
;
Not sure if it helps, but after that I'm transposin my jrtest and I don't want to keep the dates so I'm going with this
proc sort data=have;
format jrtest date9.;
by cow jrtest;
run;
data want;
set have;
by cow jrtest;
retain no_test;
if first.cow then no_test=1;
else no_test+1;
run;
So, I want to know how many days are between test 1 and test 2, test 2 and test 3 etc.....
Thanks!