BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
numbergirl
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
numbergirl
Obsidian | Level 7

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

http://support.sas.com/techsup/support.html

View solution in original post

5 REPLIES 5
art297
Opal | Level 21

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

 

numbergirl
Obsidian | Level 7

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

numbergirl
Obsidian | Level 7
oh - okay, yes, good idea, i'll submit it as a possible issue with the journal style to SAS tech support. thanks again!
numbergirl
Obsidian | Level 7

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

http://support.sas.com/techsup/support.html

numbergirl
Obsidian | Level 7

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3661 views
  • 0 likes
  • 2 in conversation