BookmarkSubscribeRSS Feed
Velidi
Calcite | Level 5
Where
CPT_4_Procedure_Code in (‘A3789’)
And Line_item_units >4

I used above code but there are many claim lines for each beneficiary with diff dates.
I want to convert claim line from date -thru date to month so that i can know how many benes have more than 4 units for month for that code.
7 REPLIES 7
Reeza
Super User
Please post some example data that illustrates your data structure and the expected output. Then we can assist with code. If you cannot provide the real data, please make fake data that's similar. It doesn't have to be the full data set but it should replicate the data structure.
Reeza
Super User

@Velidi sorry, no data or attachments came through. You cannot attach anything via email.

 

Ideally, you can provide it as a data step following the instructions here:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

PGStats
Opal | Level 21

If your WHERE condition is part of a SQL query, it could be as simple as

 

...

Where
CPT_4_Procedure_Code in (‘A3789’)

group by intnx("month", date, 0)

having sum(Line_item_units) > 4;

PG
Reeza
Super User
Would that handle if there were repeated entries as well as crossing of month intervals?
PGStats
Opal | Level 21

@Reeza that code handles the simplest case where the data is clean and the monthly intervals correspond to calendar months.

PG

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 934 views
  • 0 likes
  • 3 in conversation