|
Dear All
The output gives the number of days starting form some 15000 +
number . It doesnt initialize it to zero for everr distinct id.. What
can we do to solve this.
This place is amazing a greta resource for learning sas.. Please tell
me what should I do.
proc sort data=Anew;
by WL_ID ASCITES_DATE;
run;
data d2;
set Anew;
by wl_id;
retain dt -1;
if first.id then do;
days=0;
dt =ASCITES_DATE ;
end;
else do;
days = ASCITES_DATE - dt;
end;
drop dt;
run;
proc print; run;
Any mistake I am responsible idea from Jai..
This is how the output look like now..
MELD_OR_ ASCITES_ MELD_PELD_
Obs WL_ID PELD DATE
LAB_SCORE days
675234 425844 MELD .
10 .
675235 425844 MELD 06/29/06 8
16982
675236 425844 MELD 06/29/06 8
16982
675237 425850 MELD 07/14/06 8
16997
675238 425850 MELD 07/14/06 8
16997
675239 425850 MELD 07/14/06 8
16997
675240 425850 MELD 07/14/06 8
16997
675241 425850 MELD 07/14/06 8
16997
675242 425850 MELD 07/14/06 8
16997
675243 425850 MELD 08/19/06 13
17033
675244 425851 MELD 07/06/06 12
16989
675245 425851 MELD 07/06/06 12
16989
675246 425856 MELD 07/14/06 38
16997
675247 425856 MELD 07/14/06 38
16997
675248 425856 MELD 07/14/06 27
16997
675249 425858 MELD 07/14/06 26
16997
675250 425858 MELD 07/14/06 26
16997
675251 425858 MELD 07/17/06 37
17000
675252 425858 MELD 07/17/06 37
17000
675253 425866 MELD 07/13/06 22
16996
675254 425866 MELD 07/13/06 22
16996
675255 425866 MELD 07/13/06 22
16996
675256 425869 MELD .
13 .
675257 425869 MELD 06/30/06 11
16983
675258 425869 MELD 06/30/06 11
16983
675259 425870 MELD 07/14/06 36
16997
675260 425870 MELD 07/14/06 36
16997
We are able to get teh days, But it doesnt initialize it for every
distinct WL_ID.. So the days are like 15345 , 15347 and all..
What we can do to take the first date for that id as initial date 0
and start from there,
Thanks
Vijay
|