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

Hi There,

 

I was trying to create a RTF file with below code. I'd like to put two titles on the same line. one with just=left, the other one with just=right.

However, it doesn't work in my program with bodytitle option was specified.

 

ODS RTF FILE= "X:\temp\myfile.rtf" style=styles.threelines keepn startpage=YES bodytitle;

title1 j=l "Company"  j=r "Page x of N";
title2 "My title";

PROC REPORT DATA=rep NOWD HEADLINE HEADSKIP SPLIT='#' SPACING=1 MISSING 
  style(lines) = [  borderbottomcolor=white];

  column  txt ("_Total" ob cfb);  

  define txt / style(header)=[just=left asis=on]
               style(column)=[just=left asis=on cellwidth=30% ] 'Visit';

  define ob /  style(header)=[just=center asis=on bordertopcolor=black bordertopwidth=0.5pt] 
                style(column)=[vjust=top just=center cellwidth=33% ] 
                "Observed" ;

  define cfb /  style(header)=[just=center asis=on bordertopcolor=black bordertopwidth=0.5pt] 
                style(column)=[vjust=top just=center cellwidth=33% ] 
                "CFB" ;

  COMPUTE AFTER _PAGE_/ LEFT;
     LINE @1 "Program: temp.sas                                                                               Created on: &sysdate9."; 
  ENDCOMP;
run;

The report procedue works well, except for the title1, two titles aligns at right.

Anyone can help me on this? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Coooooo_Lee
Obsidian | Level 7

Thanks for providing your suggestion.

Finally, I got this resolved by ODS RTF with bodytitle_aux option.

 

 

View solution in original post

7 REPLIES 7
Coooooo_Lee
Obsidian | Level 7

Subject updated: "Titles alignments in ODS RTF with bodytitle"

BrunoMueller
SAS Super FREQ

Have a look at this SAS Note https://support.sas.com/kb/13/608.html and see if this helps.

Coooooo_Lee
Obsidian | Level 7

Hi Burno,

 

Thanks for your help.

Is there a corresponding option of KEEPN in ods.tagsets?

BrunoMueller
SAS Super FREQ

As far as I know, this option does not exist for tagsets.rtf. You can display all the options available for tagsets.ods like so:

ods tagsets.rtf file= "c:\temp\myfile.rtf"   options( doc="help");

ods tagsets.rtf close;

Also tagsets.ods does the "measurements" differently, so maybe KEEPN is not necessary.

Ksharp
Super User

Or you coould try this workaround way.

 

ODS RTF FILE= "C:\temp\myfile.rtf" style=journal bodytitle;
ods escapechar='~';
title1  "Company  %sysfunc(repeat(~_,100))  Page x of N";
title2 "My title";

PROC REPORT DATA=sashelp.class NOWD;
run;
ods rtf close;

Ksharp_0-1642507995102.png

 

Coooooo_Lee
Obsidian | Level 7

Thanks for providing your suggestion.

Finally, I got this resolved by ODS RTF with bodytitle_aux option.

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 4028 views
  • 3 likes
  • 3 in conversation