BookmarkSubscribeRSS Feed
XiaoGuaiShou
Obsidian | Level 7

Hello all:

 

In a project, I need to make a table in SAS, I use proc tabulate to achieve it. The structure of the table works well, unless one problem bothers me as following pictures.I want to spread the title out and reduce the title height.

Smiley Very HappyThe table I want:

Capture.PNG

Smiley IndifferentThe table I have:

Capture.PNG

It is almost there. However, I cannot come up with a solution to spread the title out, I can easily change it in Excel, but the situation is I need to make the report all completed by SAS.

 

Any help would be greatly appreciated.

 

Thanks,

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

What is your code?

Proc tabulate does not do what you showed.

data HAVE;
  do CAT='A','B';
    do WHEN='Very often','Often','Sometimes','Never';
      output;
    end;
  end;
run;
proc format ;
  value $longb 'B'='  ksdhk jskjh khsk kjhk hkh kkhkkhdkhdk hkdhkkhkhdkdfhkk';
run;
proc tabulate data=HAVE;
  class CAT WHEN;
  table n='#', CAT=' '*WHEN=' ';
  format CAT $longb.;
run;

 
  A ksdhk jskjh khsk kjhk hkh kkhkkhdkhdk hkdhkkhkhdkdfhkk
Never Often Sometimes Very often Never Often Sometimes Very often
# 1 1 1 1 1 1 1 1

 

 

XiaoGuaiShou
Obsidian | Level 7
Hi, I really appreciate your help. It works well in SAS base, but the problem above shows up in SAS/IntrNet(ods to html). The problem may happen in ods style, I will try to figure it out. Thanks all the same.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 2 replies
  • 687 views
  • 0 likes
  • 2 in conversation