BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lillymaginta
Lapis Lazuli | Level 10
Patient_id  Medication_name Dispensing_Date  days_supply
1  a             1/1/2003   30
1  a             4/4/2004   60
1  b             3/4/2004   90
2  a             1/1/2003  30
2  a             4/4/2004   60
2  b             3/4/2004   90
2  c             3/15/2004  90
2  a             1/1/2002   60
2  d             1/1/2002   60
3 a              1/1/2005   30
3 b              2/2/2010    30
4  b             2/3/2009    60
4 g              4/4/2005    60
4  c             1/1/2006    60
4 e               1/1/2006   60
4  a              1/1/2004   90
4  b              1/28/2004  60
4  t               1/28/2004  60
4 o               1/15/2004  90
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

As far as I can see the only difference is 60 versus 30 days and you should be able to adjust the code for that. Have you tried replacing 30 with 60? 

https://communities.sas.com/t5/Base-SAS-Programming/frequency-of-multiple-observations-hapenning-at-...

 

I'm also assuming mono means single usage not the disease? 

 

 

Regarding the last 4 qs use either a double proc freq or proc SQl with count distinct. 

 

Proc freq data=have;

table id*drug/out = drugs_per_id;

run;

 

proc freq data=drugs_per_id;

table id/ out=distinct_coumt;

run;

 

You can then transpose this table to generate your output. 

 

Though it does appear this one was answered as well here :

https://communities.sas.com/t5/SAS-Procedures/assessing-dual-drug-use/m-p/265554#M57898

View solution in original post

3 REPLIES 3
Reeza
Super User

Didn't you ask this question a while back?

lillymaginta
Lapis Lazuli | Level 10

Hi Reeza, the other question has different assumptions. 

Reeza
Super User

As far as I can see the only difference is 60 versus 30 days and you should be able to adjust the code for that. Have you tried replacing 30 with 60? 

https://communities.sas.com/t5/Base-SAS-Programming/frequency-of-multiple-observations-hapenning-at-...

 

I'm also assuming mono means single usage not the disease? 

 

 

Regarding the last 4 qs use either a double proc freq or proc SQl with count distinct. 

 

Proc freq data=have;

table id*drug/out = drugs_per_id;

run;

 

proc freq data=drugs_per_id;

table id/ out=distinct_coumt;

run;

 

You can then transpose this table to generate your output. 

 

Though it does appear this one was answered as well here :

https://communities.sas.com/t5/SAS-Procedures/assessing-dual-drug-use/m-p/265554#M57898

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1295 views
  • 1 like
  • 2 in conversation