hello,
I have a data set with variables: clientID, ProviderID, and servicesID. like this:
clientID ProviderID ServiceID
1 2 8
1 2 4
1 3 8
1 3 2
1 4 1
I want to create a summarized data set per client and per provider . the final table should like this:
clientID ProviderID
1 2
1 3
1 4
I used the following sas code but I don't know it is not working:
proc sql ;
create table test as
select clientid, providerid
from xx
group by clientid, providerid;
quit;
Hello @juliajulia
Are you asking for
proc sql ;
create table test as
select distinct clientid, providerid
from xx;
quit;
Your desired output looks like you just want to find the distinct combinations of CLIENTID and PROVIDERID, and this ignores SERVICEID. Is that what you want? That doesn't usually fit what I think of when I hear the word "summarize". Can you clarify this?
If that's what you want, then
proc sql;
create table want as select distinct clientid,providerid from xx;
quit;
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!
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.