LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 3 Oct 2006 16:38:16 -0700
Reply-To:   Vijay <vijayvijay@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Vijay <vijayvijay@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   how to initialize for every id the date as 0
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

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


Back to: Top of message | Previous page | Main SAS-L page