Hi All, I am facing a bit of dead end with the logic. Thought to post in on the forum to seek help. I have the following datasets. data have1; input case action_in_date action_out_date priority; cards; 100 28-MAY-2015 29SEP2015 02 100 04-SEP-2015 27NOV2015 03 100 27-NOV-2015 17SEP2016 04 ; run; data have2; input case post_date amount; cards; 100 18-SEP-2015 250 100 19-SEP-2015 100 100 30-NOV-2015 300 ; run; Now, the post date in first 2 rows (18-SEP-2015 and 19-SEP-2015) in have2 dataset have a post date which falls between two date ranges in have1 dataset. i e. between 28-MAY-2015 and 29SEP2015 and 04-SEP-2015 and 27NOV2015. But i want the money to be allocated to highest priority. ie between 04-SEP-2015 and 27NOV2015 which has a priority 03. The output i am looking for is below /*output;*/ 100 04-SEP-2015 27NOV2015 03 350 100 27-NOV-2015 17SEP2016 04 300 Any help is highly appreciated.
... View more