I have an issue with finding out the missing months from the data set in SAS. Since I am new to SAS, I need some help on working on it. I have a data set which is shown as below: In the below example I took the date range from 201810 to 201906 (which is 8 months sample data but need to have 15 months to check the missing data). I want to do this in SAS
+----+------------+
| ID | Elig Month |
+----+------------+
| 1 | 201810 |
| 1 | 201811 |
| 1 | 201901 |
| 1 | 201902 |
| 1 | 201903 |
| 1 | 201904 |
| 1 | 201905 |
| 1 | 201906 |
| 2 | 201811 |
| 2 | 201901 |
| 2 | 201903 |
| 2 | 201904 |
| 2 | 201905 |
| 2 | 201906 |
| 3 | 201901 |
| 3 | 201902 |
| 3 | 201903 |
| 3 | 201904 |
| 3 | 201905 |
| 3 | 201906 |
| 4 | 201810 |
| 4 | 201903 |
| 4 | 201904 |
| 4 | 201905 |
| 4 | 201906 |
| 5 | 201906 |
| 6 | 201810 |
+----+------------+
I want to see if that data is present for all the months between 15 months date range. I have date format as 201901 (yearmonth). I want to check if the data is missing and create groups based on the missing number of months say 1. if only one month is missing then I want to group as "1 month missing" 2. if two months missing consecutively then name the group as " 2 month missing" 3. if 3 months then "3 month missing" 4. if 4 - 6 months missing then "4-6 months missing" 5. if missing months alternatively like available in one month and not available in next month and then available in next two months then I want to group them as "Chaos" 6. if missing more than 7-12 months then "7-12 months missing" 7. if missing more than 12 months then "12+ months missing" 8. if can be seen only once in ending periods name as "reborn" 9. If seen in the start of the period and never see any data set f or 15 moths then "dead"
The expected result is show as below:
+----+-------+--------------------+
| ID | Group | Group description |
+----+-------+--------------------+
| 1 | 1 | 1 months missing |
| 2 | 5 | choas |
| 3 | 2 | 2 months missing |
| 4 | 4 | 4-6 months missing |
| 5 | 8 | Reborn |
| 6 | 9 | Dead |
+----+-------+--------------------+