The code below won't run properly without having to exit SAS completely and starting a new SAS session. Running the file the first time produces correct output. Running the file a second time results in the table in the attached TEMP.RTF file. Extra header and footer lines are displayed and the remaining ones are misaligned; 'Organization' should be on the same line as 'Page 1 of 1', and 'My program' should be on the same line as 'Date 1.' The SAS code used is as Follows:
title1 j=left font='Arial' 'Organization' j=right "Page ~{pageof}"; title2 j=left font='Arial' 'Study'; footnote1 j=left font='Arial' 'My program' j=right "Date 1"; footnote2 j=right font='Arial' "Date 2";
options formchar="|____|+|___+=|_/\<>*" pageno=1 nonumber nodate orientation=landscape center; ods listing close; ods rtf file="&outpath.\filename.rtf" style= journal; ods escapechar='~'; ***; proc report data=mydat nowindows split='^' style(column)={asis=on} style(report)={font=('Arial',9.5pt,bold italic) pretext="Table 1"}; column group person enrolled startdt enddt variable3 variable4 comments; define group / display center id 'group' style=[CellWidth=11%]; define person / display center id 'person' style=[CellWidth=10%]; define enrolled / display center 'enrolled' style=[CellWidth=11%]; define startdt / display center 'Study Start Date' style=[CellWidth=11%]; define enddt / display center 'Study End Date' style=[CellWidth=10%]; define variable3 / display center 'Variable 3' style=[CellWidth=10%]; define variable4 / display center 'Variable 4' style=[CellWidth=15%]; define comments / display center 'Comments' style=[CellWidth=20%]; run; ods rtf close; ods listing; title; footnote;
Thank you in advance for any ideas!
Numbergirl
This worked! Thanks, Jody!
Yes, here is another suggestion. Please insert the STYLE statement underlined below into your PROC TEMPLATE code. Please run your program again. If it doesn't help and it wasn't because of a syntax error, please send me a subset of your data that I can test with here.
Thanks!
proc template;
define style Styles.new_journal;
parent = styles.Journal;
style table from table/
prehtml='';
style SysTitleAndFooterContainer from SysTitleAndFooterContainer
/cellpadding = 0;
end;
run;
Sincerely,
Jody Carlton
SAS Technical Support
SAS Technical Support Services and Policies
I think that the problem is in the journal style and I suggest you submit the problem to SAS tech support.
If you can get away with using a different style, the following appears to work correctly:
ods rtf file="&outpath./filename.rtf" style= SAPPHIRE;
You may have to change the slash to a backslash as you originally had it. I had to use the above since I tested your code on SAS UE and it wouldn't accept the path (i.e., the one I had to use /folders/myfolders) unless I used the forward slash in the above statement.
Art, CEO, AnalystFinder.com
Thank your for your reply, Art. That's interesting, and it does fix the header-footer problems, but alas, it changes the look of the table and I it to be in journal style.
Numbergirl
This worked! Thanks, Jody!
Yes, here is another suggestion. Please insert the STYLE statement underlined below into your PROC TEMPLATE code. Please run your program again. If it doesn't help and it wasn't because of a syntax error, please send me a subset of your data that I can test with here.
Thanks!
proc template;
define style Styles.new_journal;
parent = styles.Journal;
style table from table/
prehtml='';
style SysTitleAndFooterContainer from SysTitleAndFooterContainer
/cellpadding = 0;
end;
run;
Sincerely,
Jody Carlton
SAS Technical Support
SAS Technical Support Services and Policies
Also note:
Using multiple justifications in Title and Footnote statements with Journal style (or parenting from Journal style) requires changing the Cellpadding attribute to 0 in the SysTitleAndFooterContainer.
Usage Note 57982 has details. http://support.sas.com/kb/57982
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.