To conform to my companies output layout, I have been putting titles on my tables using the PRETEXT= option in the PROC REPORT statement instead of a TITLE statement. I have noticed, however, that whenever I use this option, my titles always have exactly 17 underscores after it. Can anyone see in my code below why that would be the case and/or how I can get rid of it?
options formchar="|____|+|___+=|_/\<>*" pageno=1 nonumber nodate orientation=portrait center;
ods listing close;
ods rtf file="D:\ Laboratory Changes - 8APR2013.rtf" style=journal;
ods escapechar='~';
%let user=%sysfunc(upcase(&sysuserid.));
%let proddt=%sysfunc(date(),worddate.);
title1 j=left font='Arial' 'Endocyte, Inc.' j=right "Page ~{pageof}";
title2 j=left font='Arial' "Protocol: EC20";
footnote1 j=left font='Arial' "Program: Merge_EC20_Labs.sas by &user." j=right "Date Produced: &proddt.";
proc report data=changes nowindows split='^' style(column)={asis=on}
style(report)={font=('Arial',9.5pt,bold italic) pretext="Number (%) of Patients with a Laboratory Changes from Baseline Exceeding Defined Limits of Change"};
column labtest limit patcnt percent;
define labtest / display left 'Assay' style=[CellWidth=25%];
define limit / display center 'Defined Limit of Change (from baseline)' style=[CellWidth=20%];
define patcnt / display center 'Patient Count' style=[CellWidth=8%];
define percent / display center 'Patients Meeting Criteria' style=[CellWidth=10%];
run;
ods rtf close;
ods listing;
title; footnote;
?>
Tech support was able to help me out. Here is their solution:
ods path(prepend) work.templat(update);
proc template;
define style Styles.test;
parent = styles.Journal;
style table from table/
prehtml='';
end;
run;
ods rtf file='test.rtf' style=test;
proc report data=sashelp.class nowd style(report)=[pretext='this is some text'];
run;
ods rtf close;
If you open the RTF in an editor you will see the underscores are actually hex nulls '00'x. I don't know why they are there. If you change ODS style to unspecified. So it seems to be associated with style=journal .
Hi:
This might also be a question for Tech Support. When I use ODS TEXT= instead of the PRETEXT style attribute, there aren't any characters appended to the end of the string. So it's a puzzle.
cynthia
Tech support was able to help me out. Here is their solution:
ods path(prepend) work.templat(update);
proc template;
define style Styles.test;
parent = styles.Journal;
style table from table/
prehtml='';
end;
run;
ods rtf file='test.rtf' style=test;
proc report data=sashelp.class nowd style(report)=[pretext='this is some text'];
run;
ods rtf close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.