Hi
I am new to SAS, Please hlp me in resoving a sample business problem.
I have sample records below .
I need to find the total usage of each customer for Home and roaming circle.
Thanks
Gotta say, not very clear from your subject line "Using of Group".
Here is a datastep solution, again, not tested.
proc sort data = have;
by circle;
run;
data want;
set have;
by circle;
sum = sum + minutes;
if last.circle then output;
retain sum 0;
run;
Sample Dataset is attached.
Please post your data in the form of a datastep, mush easier to help that way
This is not tested but you are probably looking for something like this
proc sql;
create table want as
select circle
,sum(minutes)
from have
group by circle;
quit;
I dont want to use proc sql.
Use proc means with a by group then.
Also, try not to limit yourself with what tools you can and can't use, they are all useful.
I am new and learning SAS, i just want to do in that way nothing else.
In what way, please be specific. You have said GROUP which indicates SQL, then you say you don't want to use that. So the next option is using a procedure designed to create means output - proc means, however this also doesn't seem to fit what you want. So please be clear in your posts exactly what it is you want so we don't go through these loops of trying to figure it out.
I am new and learning SAS, i just want to do in that way nothing else.
Thanks for nudging.
And you still have not provided example data in a usable form.
Gotta say, not very clear from your subject line "Using of Group".
Here is a datastep solution, again, not tested.
proc sort data = have;
by circle;
run;
data want;
set have;
by circle;
sum = sum + minutes;
if last.circle then output;
retain sum 0;
run;
A macro for semi-automatic conversion of a dataset to a data step can be found here.
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.