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 (November 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 5 Nov 2003 11:54:57 -0500
Reply-To:     Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Subject:      Re: Retain statment
Comments: To: jannickei@HOTMAIL.COM

Hi here is an example using retain. To watch the movement of the diab_found status, comment the drop statement.

data resolved; set <your sas data set>; by patient ; /* declared: sorted by patient and date*/ if first.patient then do; diab_found =0 ; inf_diab =0 ; end; retain diab_found inf_diab ; drop diab_found ; if not inf_diab then do; if diagnose = 410 then do; if diab_found >0 then inf_diab = 1; else diab_found= -1; /* too late*/ end; else if diagnose = 250 and not diab_found then diab_found = 1; end; run;


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