Hello,
This is regarding the continuous enrollment. I have the initial and final datasets below and In the initial data set, even though the FEB Record is missing still it needs to come as continuous enrollment.
Could anyone of you help on this?
Initial Table | |||
mem_id | plan | bdate | edate |
123 | a | 1/1/2014 | 1/31/2014 |
123 | a | 3/1/2014 | 3/30/2014 |
123 | b | 4/1/2014 | 04/31/2014 |
123 | b | 5/1/2014 | 5/30/2014 |
123 | b | 6/1/2014 | 06/31/2014 |
123 | a | 7/1/2014 | 7/30/2014 |
123 | a | 8/1/2014 | 8/31/2014 |
123 | a | 9/1/2014 | 9/30/2014 |
Final Table | |||
mem_id | plan | bdate | edate |
123 | a | 1/1/2014 | 3/30/2014 |
123 | b | 4/1/2014 | 06/31/2014 |
123 | a | 7/1/2014 | 9/30/2014 |
Here's an easy way, as long as these are the only variables involved. Assuming that the data are properly sorted as you have illustrated:
proc summary data=have;
by mem_id plan notsorted;
var bdate edate;
output out=want (keep=mem_id plan bdate edate) min(bdate)=bdate max(edate)=edate;
run;
If you have additional variables that need to be carried through the process, it can get more complicated.
Good luck.
Thank you so much,it did worked.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.