DATA Step, Macro, Functions and more

continuous Enrollment

Reply
New Contributor
Posts: 4

continuous Enrollment

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_idplanbdateedate
123a1/1/20141/31/2014
123a3/1/20143/30/2014
123b4/1/201404/31/2014
123b5/1/20145/30/2014
123b6/1/201406/31/2014
123a7/1/20147/30/2014
123a8/1/20148/31/2014
123a9/1/20149/30/2014
Final Table
mem_idplanbdateedate
123a1/1/20143/30/2014
123b4/1/201406/31/2014
123a7/1/20149/30/2014
Super User
Posts: 5,084

Re: continuous Enrollment

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.

New Contributor
Posts: 4

Re: continuous Enrollment

Thank you so much,it did worked.

Ask a Question
Discussion stats
  • 2 replies
  • 304 views
  • 4 likes
  • 2 in conversation