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 (December 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Dec 2010 18:24:28 -0500
Reply-To:     Kim Brown <kibrown@LADHS.ORG>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Kim Brown <kibrown@LADHS.ORG>
Subject:      merge within 30 days by id

Hi all I'm working with version 9.1 in XP pro platform. I have the following code, it's not working

data A; input id fac :$ admdate :mmddyy10.; format admdate mmddyy10.; datalines; 001 15 6/3/2010 002 15 2/16/2010 003 25 11/10/2010 ; run;

data B; input id fac :$ admdate :mmddyy10.; format admdate mmddyy10.; datalines; 001 54 11/12/2010 002 23 3/8/2010 003 23 10/8/2008

; run;

I'm trying to merge to dataset if ReAdm4 is within 30 day for ReAdm5 dataset; ; Proc sort data=A out=readm4 (keep=pat_id disch_date); by pat_id disch_date; run;*facility A;

Proc sort data=B out=readm5 (keep=pat_id disch_date); by pat_id disch_date; run;*facility B;

*Merge if within 30 days after their discharge date; data final; merge reAdm4 (in=a) and reAdm5 (in=b); by pat_id; if (A.disch_date <= ( Intnx( 'Month' , B.disch_date , 1 , 'E' ) ); run;

Any help is appreciated. Thanks, Kim


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