BookmarkSubscribeRSS Feed
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

I need count monthly disenrollment  for 2022.

 

Data table :  

 

MEMBER_ID ENROLLMENT  DISENROLLEMNT 
A0001 2/1/2021 3/1/2021
A0001 5/29/2021 6/24/2021
A0001 7/1/2021 8/1/2021
B0001 6/3/2021 8/2/2021
B0001 10/1/2021 11/1/2021

 

How do I have the monthly disenroll , and count by member_ID: as following 

 

1. Member_ID, Disenroll_Month_Flg 

A0001             202104

A0001             202107

A0001             202209

B0001             202109

B0001             202112

 

2. Summary: disenroll by month 

month      count: 

202104      1

202107      1

202109      2

202112      1

 

3. Summery disenroll by member:

Member     Count 

A0001         3

B0001         2

 

2 REPLIES 2
Astounding
PROC Star
You don't need to change the data. You just need PROC FREQ to apply a format. For example:

proc freq data=have;
format enrollment yrmon7.;
tables member_id enrollment;
run;
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

thank you. But if I want count 2021 disenrollment, the rest of the month dose not  enrolled should be counted as disenroll, hwo could I do that   

 

similar to this ..but it is disenroll. How to ? 

https://communities.sas.com/t5/SAS-Programming/Finding-the-continous-and-discontinous-months-enrollm...

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 935 views
  • 0 likes
  • 2 in conversation