Hi:
Perhaps I'm dense or inexperienced, but having a line feed stored in the data doesn't make sense to me. As far as I know, there's no "universal" carriage return/line feed character that would work the same in operating systems like Unix, Windows, z-OS, Linux, or destinations like PDF, Word, HTML and Excel or applications like PowerPoint or PaintShop Pro or Adobe PageMaker.
So from a SAS standpoint, the ability to insert a line feed character into a text string or character variable depends on the destination that you are going to use to display the data -- because every different destination -might- use a different line feed character -- when you use a procedure or program that writes the data to the appropriate destination.
For example, RTF might use the \line RTF control string; HTML might use the <br> tag; some other destination might use '0D0A'x. The nice thing about ODS ESCAPECHAR is that, for RTF, PDF and HTML destinations, you can use an ODS ESCAPECHAR (such as '~' -- tilde) and then use ~n or ~2n to insert an escape character string which will be interpreted by the rendering viewer as a line feed. In SAS 9.2, the Escapechar syntax has a function-like way to insert a newline -- it is the ESCAPECHAR + the newline function: ~{newline}.
However, the LISTING destination is NOT one of the destinations that supports the insertion of LINE FEEDS, except in very controlled locations (such as with the split character) in PROC PRINT and PROC REPORT.
SAS is not WYSIWYG -- the data, as stored, is not the same as the displayed data. You could have a title on one report -- the data doesn't have a title or a footnote. In the data, dates are stored as just the number of days since Jan 1, 1960, but when you DISPLAY the date, you can display it on one report with mmddyy format and on another report with MONYY format....just to name a few of the differences.
For example, compare the LISTING output against the RTF, PDF and HTML output. You will see the ~n in the LISTING output, but the RTF, PDF and HTML will have line breaks in the "displayed" output.
cynthia
[pre]
data poem;
length pline $100;
infile datalines dsd;
input pline $;
return;
datalines;
"Twas brillig and the slithy toves~nDid gyre and gimble in the wabe,"
"All mimsy were the borogroves~nAnd the mome rathes outgrabe."
;
run;
ods listing;
ods html file='uself.html' style=sasweb;
ods rtf file='uself.rtf';
ods pdf file='uself.pdf';
ods escapechar='~';
proc print data=poem;
title 'Jabberwocky -- by Lewis Carroll';
run;
ods _all_ close;
[/pre]