I have a data set in which I must pull out the observations that have been enrolled to calculate how many continuous months. See an example of what the data looks like below.
data test;
input transMonths MemberID Plan $;
datalines;
201510 00001 HMO
201601 00001 HMO
201602 00001 HMO
201603 00001 PPO
201604 00001 HMO
201605 00001 HMO
201606 00001 HMO
;
The main question: how do I get SAS to read transMonths and calculate how many continuous months with Plan_HMO per memberID has?
In the above example, memberID 00001 has only 3 continuous months from 201604 to 201606. I just need to calculate the most recent continuous months.
Any help is appreciated!