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 (August 1997, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 15 Aug 1997 08:35:23 PDT
Reply-To:   TWB2%Rates%FAR@BANGATE.PGE.COM
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Tim Berryhill 3rd time <TWB2%Rates%FAR@BANGATE.PGE.COM>
Subject:   Re: Crack this
Comments:   To: Henrik.Forsman@HASSLE.SE.ASTRA.COM

Something like: DATA DIFF0 DIFF1 DIFF2 DIFF3 DIFF4 DIFF5 DIFF6 DIFF7; SET PATEVENT(KEEP=PATID EVENTDAT); BY PATID EVENTDAT; RETAIN PREVDATE; IF FIRST.PATID THEN PREVDATE=EVENTDAT; ELSE SELECT(EVENTDAT-PREVDATE); WHEN(0) OUTPUT DIFF0; WHEN(1) OUTPUT DIFF1; ... OTHERWISE; END; RUN;

Then SORT NODUPKEY by PATID to remove duplicates. NOTE: EVENTDAT is not required in the BY statement in the main datastep--I just coded it so that mis-sorted files would generate an error. Cheap insurance.

Tim Berryhill - Contract Programmer and General Wizard TWB2@PGE.COM or http://www.aartwolf.com/twb.html Frequently at Pacific Gas & Electric Co., San Francisco The correlation coefficient between their views and my postings is slightly less than 0 ----------------------[Reply - Original Message]---------------------- I have a number of patients with a number of event dates. I would like to create datasets with patients who have more than one event at the same date, more than one event within 1, 2, 3, 4, 5, 6, 7 days.


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