split character option in proc tabulate?

Accepted Solution Solved
Reply
Contributor
Posts: 57
Accepted Solution

split character option in proc tabulate?

Can anyone tell me if there is an equivalent of the split character option from proc report in proc tabulate to break header labels at predefined characters in proc tabulate?

For example, in proc report you could write something like proc report data=mydata split="*"; and then when you specified a column header as "This is*my column*header" the column would appears as follows:

This is
my column

header

Thanks for your help.


Accepted Solutions
Solution
‎01-14-2015 03:52 AM
Grand Advisor
Posts: 9,596

Re: split character option in proc tabulate?

Can't use ods escapechar ?

options nodate;

  data fundrais;

   length name $ 8 classrm $ 1;

   input @1 team $ @8 classrm $ @10 name $

         @19 pencils @23 tablets;

   sales=pencils + tablets;

   datalines;

BLUE   A ANN       4   8

RED    A MARY      5  10

GREEN  A JOHN      6   4

RED    A BOB       2   3

BLUE   B FRED      6   8

GREEN  B LOUISE   12   2

BLUE   B ANNETTE   .   9

RED    B HENRY     8  10

GREEN  A ANDREW    3   5

RED    A SAMUEL   12  10

BLUE   A LINDA     7  12

GREEN  A SARA      4   .

BLUE   B MARTIN    9  13

RED    B MATTHEW   7   6

GREEN  B BETH     15  10

RED    B LAURA     4   3

;

run;

 

  proc format;

   picture pctfmt low-high='009.99 %';

run;

ods escapechar='~';

ods html file='c:\temp\rename_across_headers_with_report.html';

  proc tabulate data=fundrais  format=9.;

  title '1) TABULATE';

     class team classrm;

     var sales;

     table (team all),

       classrm='Classroom ~n  tabulate'*sales=' '*(sum colpctsum*f=pctfmt.)

       all*sales*sum=' ';

run;

ods html close;

Xia Keshan

View solution in original post


All Replies
Solution
‎01-14-2015 03:52 AM
Grand Advisor
Posts: 9,596

Re: split character option in proc tabulate?

Can't use ods escapechar ?

options nodate;

  data fundrais;

   length name $ 8 classrm $ 1;

   input @1 team $ @8 classrm $ @10 name $

         @19 pencils @23 tablets;

   sales=pencils + tablets;

   datalines;

BLUE   A ANN       4   8

RED    A MARY      5  10

GREEN  A JOHN      6   4

RED    A BOB       2   3

BLUE   B FRED      6   8

GREEN  B LOUISE   12   2

BLUE   B ANNETTE   .   9

RED    B HENRY     8  10

GREEN  A ANDREW    3   5

RED    A SAMUEL   12  10

BLUE   A LINDA     7  12

GREEN  A SARA      4   .

BLUE   B MARTIN    9  13

RED    B MATTHEW   7   6

GREEN  B BETH     15  10

RED    B LAURA     4   3

;

run;

 

  proc format;

   picture pctfmt low-high='009.99 %';

run;

ods escapechar='~';

ods html file='c:\temp\rename_across_headers_with_report.html';

  proc tabulate data=fundrais  format=9.;

  title '1) TABULATE';

     class team classrm;

     var sales;

     table (team all),

       classrm='Classroom ~n  tabulate'*sales=' '*(sum colpctsum*f=pctfmt.)

       all*sales*sum=' ';

run;

ods html close;

Xia Keshan

Contributor
Posts: 57

Re: split character option in proc tabulate?

Yes, I forgot about the ods escapechar option.  Thanks so much!

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 884 views
  • 0 likes
  • 2 in conversation