Help using Base SAS procedures

Wrapping long row headers in tabulate

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 129
Accepted Solution

Wrapping long row headers in tabulate

I'm tabulating something like:

class catvar1 catvar2;

var contvar;

label contvar "A very very very very long label";

table mean*contvar*catvar1,catvar2;

Can I get the long label to wrap? I'm currently outputing to ODS RTF, where it doesn't wrap. I know that I can output to ODS markup tagset=excelXP and open the sheet up in Excel (where the labels will wrap). However, I have a lot of tables, and would prefer to go (almost) straight from SAS to a Word (or RTF) file.


Accepted Solutions
Solution
‎10-10-2014 08:11 AM
SAS Super FREQ
Posts: 683

Re: Wrapping long row headers in tabulate

Hi

Have a go at using inline formatting, see example below:

ods escapechar="~";
proc tabulate data=sashelp.cars;
  class origin type;
  table
    type, origin
  ;
  label
    type =
"Type of the cars~{NEWLINE}as specified by~{NEWLINE}the car manufacturer"
    origin =
"Origin of the cars~{NEWLINE}where most parts are~{NEWLINE}made and assembled"
  ;
run;

View solution in original post


All Replies
Solution
‎10-10-2014 08:11 AM
SAS Super FREQ
Posts: 683

Re: Wrapping long row headers in tabulate

Hi

Have a go at using inline formatting, see example below:

ods escapechar="~";
proc tabulate data=sashelp.cars;
  class origin type;
  table
    type, origin
  ;
  label
    type =
"Type of the cars~{NEWLINE}as specified by~{NEWLINE}the car manufacturer"
    origin =
"Origin of the cars~{NEWLINE}where most parts are~{NEWLINE}made and assembled"
  ;
run;
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 188 views
  • 0 likes
  • 2 in conversation