BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sjmosiman
Fluorite | Level 6

Hey all,

I'm trying to create basic proc freq 2-way tables that include row and column percent's.  The output includes these, however they are not labelled which means manually including row and column percent labels for every table I make.  Is there a way using proc templates or something to set labels on so that  frequency, row, and col % will be labeled whenever I make a table?  I've included the output I want and the output type I'm currently getting (without freq, row or col labels)

 

Thanks

sjmosiman_0-1632488559235.png

sjmosiman_1-1632488570905.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
sjmosiman
Fluorite | Level 6
Figured it out. Was running a different proc freq template.
Used this:

proc template;
delete base.freq.crosstabfreqs;
run;

and now I get the correct labels

View solution in original post

4 REPLIES 4
Ksharp
Super User

Why not try PROC TABULATE ?

 

proc tabulate data=sashelp.heart;
class status sex;
table status=' '*(n rowpctn colpctn) ,sex all='Total';
keylabel n='Frequency' rowpctn='Row Pct' colpctn='Col Pct';
run;

Ksharp_0-1632489319447.png

 

sjmosiman
Fluorite | Level 6
I appreciate the response, and that's what I've been using. But there must be some sort of setting that does it automatically. For your example, my coworker can do:
proc freq data=sashelp.heart;
table status*sex;
run;
and it will return the exact same table that you got. It's not a huge deal but the more efficient I can be with code the better.
sjmosiman
Fluorite | Level 6
Figured it out. Was running a different proc freq template.
Used this:

proc template;
delete base.freq.crosstabfreqs;
run;

and now I get the correct labels
sbxkoenk
SAS Super FREQ

Hello,

 

I thought it was related to the template used (or not used).

 

If it's solved indeed, it's better to mark this as solved.

That way people are not needlessly opening up this topic anymore in an attempt to give an answer.

 

Thanks,

Koen

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2344 views
  • 0 likes
  • 3 in conversation