BookmarkSubscribeRSS Feed
newsas007
Quartz | Level 8

Hi all, 

I am trying to get a formatted frequency table and I tried PROC freq and tabulate but i can't seem to figure it out. Here is my dataset: I will need the output in a 3 dimensional table. I only need the count and respective totals and in the specific format as shown below.

Thanks,

Item Code Category
A H Tar
B H IO
C L End
D L IO
A H End
B H Tar
C H IO
D L End
A L IO
B L End
C H Tar
A L IO
B H End
C L IO
D H End

 

Want:

Item Code Tar IO End Total
A          
  H 1   1 2
  L   2   2
B          
  H 1 1 1 3
  L     1 1
C          
  H 1 1   2
  L   1 1 2
D          
  H     1 1
  L   1 1 2
Total   3 6 6 15
4 REPLIES 4
ballardw
Super User

Totals of what? I don't see anything to total. Do you mean count?

 

When specifying a "must look like this" you really should place the values you need in the body of the example table from the example data. Otherwise you get lots of guesses as to what might work.

newsas007
Quartz | Level 8
Sorry: I have edited the table with numbers. Hope this makes more sense now.
Cynthia_sas
SAS Super FREQ

Hi:

  Both PROC REPORT and PROC TABULATE will create this type of table for you. There are other procedures, as well but the report format would be slightly different (PROC MEANS). You could do more cosmetic tweaking and ordering once you're comfortable with the procedures.

Cynthia_sas_0-1610125478043.png

 

 

Cynthia

newsas007
Quartz | Level 8
Hi @Cynthia_sas,
This works! Thanks so much. The cosmetic tweaking and ordering is tricky and i am trying to learn. Thanks again!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 606 views
  • 0 likes
  • 3 in conversation