Dear All,
I'm pretty new to SAS and i'm having a confusion with one of my query. I have a data structure as mentioned below and need summarised output and i'm simply confused with which proc function this can be done and how.
I have below this table
Name - Prod
A1 - CC
A2 - CC
A3 - LN
A1 - CC
A3-ST
A1-CC
A2-LN
A3-CC
A1-LN
A1-CC
My output should be
Name CC LN ST
A1 4 1 0
A2 1 1 0
A3 1 1 1
Pls anyone can help me with code...
Thanks a lot...
Rgds, Anil
Either Proc freq or tabulate would do. The syntax for freq is probably simpler:
proc freq data=yourdatasetname;
tables name*prod/ norow nocol nocum nopercent;
run;
Either Proc freq or tabulate would do. The syntax for freq is probably simpler:
proc freq data=yourdatasetname;
tables name*prod/ norow nocol nocum nopercent;
run;
Shaks.. that's it.. just a single line of code and its done.. and i was breaking my head last 3 hours trying so many variations... Thanks a lot Ballard.. Now just one more small query in addition to it..
I also have one more column for LN & ST which mentions amount and i want to sum them for each name....
Thanks once again...
Rgds, Anil
Sounds like you want to include a WEIGHT statement:
proc freq ....;
WEIGHT amount;
tables ....;
run;
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.