BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wlierman
Lapis Lazuli | Level 10

I have written the following short query

 

proc sql noprint;

CREATE table aqc_puds.data_count_claim AS

SELECT

              claimtypedesc,

              claimtype,

              Count(claim)

FROM aqc_puds.base_yr_pudset

GROUP BY claimtypedesc;

quit;

 

Desired output data (hypothetical numbers):

Claimtypedesc           count

dental                         1534236

inpatient                   22342522  

professional             44999900  

 

        ....... and so on ......

there should be about 10 rows - one for every claimtype - with claims counted over each claimtype

 

actual output data

Claimtypedesc              count

dental                            15151016

dental                            15151016

   .                                       .

   .                                       .

   .                                       .

 

and so on for each dental claim

 

So the dilemma is to obtain the first hypothetical table rather than the erroneous actual table.

 

This is likely a pretty straightforward solution.  However, I haven't been able to crack the code and

so your expertise is very appreciated.

 

Walt Lierman 

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

HI , Wouldn't you need to include claimtype in

 GROUP BY claimtypedesc,claimtype

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

HI , Wouldn't you need to include claimtype in

 GROUP BY claimtypedesc,claimtype
wlierman
Lapis Lazuli | Level 10

Hi,

 

Thank you very much.

 

You nailed it. Exactly what I was looking for.

 

Walt Lierman

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
  • 2 replies
  • 1128 views
  • 1 like
  • 2 in conversation