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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 576 views
  • 1 like
  • 2 in conversation