Date: Mon, 12 Jul 2010 08:56:17 -0400
Reply-To: saigovind chenna <saigovind.chenna@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: saigovind chenna <saigovind.chenna@GMAIL.COM>
Subject: Merging
Content-Type: text/plain; charset=ISO-8859-1
Hello All
I have two datasets one is A and another is B
*Dataset A*
sid start end start(ampm) end(ampm)
dose
1050 03/17/06 03/23/06 am pm
5
1050 03/24/06 03/30/06 am pm
10
1050 03/31/06 04/07/06 am pm
10
1050 04/08/06 04/28/06 am pm
10
1050 04/08/06 04/28/06 am pm
10
1050 04/08/06 04/28/06 am pm
10
1050 04/29/06 am
10
1050 04/29/06 am
10
1050 04/29/06 am
10
*Dataset B*
sid sample date flag
1050 04/07/06 Y
1050 04/27/06
1050 04/30/06
1050
I want to get the correct dose information (from dataset A) to the dataset B
according to corresponding date.
For example
in the above case sample date in dataset B is 04/07/06...this falls in
between the dates (03/31/06-04/07/06) so should have a dose of
10 corresponding to that.
And also if you have another date like 04/30/06..it doesn't fall on or
between any dates so it should have a dose with closest date to that sample
date which is 04/29/06 in this case.
Can anyone help me here with sas code?
appreciate ur help.
Thanks
Sai