BookmarkSubscribeRSS Feed
☑ This topic is solved. 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.

 

 

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
  • 7 replies
  • 1259 views
  • 3 likes
  • 3 in conversation