Hi:
Consider using ODS ESCAPECHAR, as described in these papers (some of them show 9.1.3 version of ESCAPECHAR syntax and some of them show the 9.2 ESCAPECHAR syntax):
http://www2.sas.com/proceedings/forum2007/099-2007.pdf
http://www2.sas.com/proceedings/sugi31/227-31.pdf
http://www2.sas.com/proceedings/forum2007/144-2007.pdf
http://www.nesug.org/Proceedings/nesug07/cc/cc18.pdf
https://www.abtassoc.org/presentations/lsh3_2009.pdf
http://www.nesug.org/proceedings/nesug08/np/np10.pdf
Or RTF control strings (such as \line) as shown in the example below.
to insert a LINE FEED or "return" into a character variable. In the first example below, I use a DATA step program to create a variable called STKVAR -- which contains the concatenated NAME, SEX, AGE and HEIGHT variable information from SASHELP.CLASS
Note that there are 4 "lines" in every row of the report. Example 1 uses a DATA step to build STKVAR and RTFCTL; Example 2 uses PROC REPORT and a COMPUTE block and NOPRINT variables to build VAR1 and VAR2; and both examples also show the use of RTF controls strings instead of using ODS ESCAPECHAR methods.
cynthia
[pre]
data class;
length stkvar $75 rtfctl $75;
set sashelp.class(obs=3);
stkvar = catx('~n',name,sex,put(age,2.0),put(height,5.1));
rtfctl = catt(name,'\line{',sex,'}\line{',put(age,2.0),'}\line{',put(height,5.1),'}');
run;
options nodate nonumber;
ods listing close;
ods rtf file='make_stacked_report_col1.rtf';
ods escapechar='~';
** listing individual vars here to show line feeds inserted correctly;
** cellwidth set to show effect of just=c;
proc report data=class nowd split='*';
title '1)Using ODS ESCAPECHAR To Put a Line Feed into a REPORT Column';
title2 'Also using RTF control strings to put a "\line" command into a cell';
column name sex age height stkvar rtfctl;
define stkvar / "Use ESCAPECHAR*Method"
style(column)={just=c cellwidth=1.5in};
define rtfctl / "Use RTF*Control String"
style(column)={just=c protectspecialchars=off cellwidth=1.5in};
run;
ods rtf close;
ods rtf file='make_stacked_report_col2.rtf';
ods escapechar='~';
** Using NOPRINT here to hide cols used to build col with line feed;
** kept cellwidth to show just=c;
proc report data=sashelp.class(obs=3) nowd split='*';
title '2)Making all the report columns in PROC REPORT';
title2 'All the variables used to build the new report item are NOPRINT';
title3 'But they do not need to be NOPRINT items';
column name sex age height var1 var2;
define name / order noprint;
define sex / display noprint;
define age / display noprint;
define height / display noprint;
define var1 / computed "Use ESCAPECHAR*Method"
style(column)={just=c cellwidth=1.5in};
define var2 / computed "Use RTF*Control String"
style(column)={just=c protectspecialchars=off cellwidth=1.5in};
compute var1 / character length=75;
var1 = catx('~n',name,sex,put(age,2.0),put(height,5.1));
endcomp;
compute var2 / character length=75;
var2 = catt(name,'\line{',sex,'}\line{',put(age,2.0),'}\line{',put(height,5.1),'}');
endcomp;
run;
ods rtf close;
[/pre]