The SAS Output Delivery System and reporting techniques

Split='#' ODS RTF doesn't work

Not applicable
Posts: 0

Split='#' ODS RTF doesn't work

I am trying to use the Split='#' option in a report but when using this with the ODS RTF output it fails to work for the data within the columns. It does split the column labels correctly but it doesn't seem to recognize the split character '#' within the column.
Does anyone know if it is possible to use the split option in ODS RTF like this and if not is there another trick I can use to correctly split my data within columns?
Posts: 9,368

Re: Split='#' ODS RTF doesn't work

Posted in reply to deleted_user
PROC REPORT's SPLIT= option is intended for use with column headers (not data cells). If you want to insert a line break into a data cell, your choices are:
1) ODS ESCAPECHAR methods (either 9.1.3 method or 9.2 method)
2) RTF control string method (using \line RTF command)

The program below shows these methods in comparison to trying to use the SPLIT character in a data cell. Note that if you run this program in SAS 9.1.3, the 9.2 ESCAPECHAR method will not work for you. Also, I put the concatenated NAME variables in a DATA step program. I could just as easily have put them in a COMPUTE block, but it's easier to compare the 4 creation methods in a DATA step program.

data class;
length name1-name4 $40;
set sashelp.class;
name1 = catx(' ~n',name,put(_n_,z2.0),sex);
name2 = catx(' {\line}',name,put(_n_,z2.0),sex);
name3 = catx(' ~{newline 1}',name,put(_n_,z2.0),sex);
name4 = catx('#',name,put(_n_,z2.0),sex);
label name1='Name#Line Break#with Escapechar'
name2='Name#Line Break#with RTF control string'
name3='Name#Line Break#with 9.2 Escapechar'
name4='Try PROC REPORT Split Char in Data Cell';

ods listing close;
ods rtf file='c:\temp\test_linebrk.rtf';
ods escapechar='~';
proc report data=class nowd split='#';
title 'Show Different Methods';
column name1 name2 name3 name4;
define name1/ display;
define name2/display style(column)={protectspecialchars=off};
define name3/ display;
define name4/ display;
ods rtf close;
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation