BookmarkSubscribeRSS Feed
mano
Calcite | Level 5

Hi,

I am using ODS to produce RTF output and i am having problem with the allignment of values in each treatment groups.

Aebodys/aedecod                    trt1                trt2                 trt3

xxxxx/xxxxxxxx                      234 (100.0)     123 ( 98.0)       100 ( 79.0)

yyyy/yyyyyyyy                        98 ( 97.0)        79 ( 89.8)         3 (  7.0)

ddd//fffffffffff                              1 ( 23.0)          5 (  4.5)           23 ( 24.9)

gggggggg/hhhhhhhhh                123 ( 88.0)      111 ( 99.0)       98 ( 76.0)

I want all the values to be alligned as showned below:-

Aebodys/aedecod                    trt1                trt2                 trt3

xxxxx/xxxxxxxx                      234 (100.0)     123 ( 98.0)       100 ( 79.0)

yyyy/yyyyyyyy                        98 ( 97.0)        79 ( 89.8)          3 (  7.0)

ddd//fffffffffff                                 1 ( 23.0)          5 (  4.5)         23 ( 24.9)

gggggggg/hhhhhhhhh              123 ( 88.0)       111 ( 99.0)        98 ( 76.0)

Can any one suggest which ODS options will make my effort easier.

Thanks in advance,

mano.

3 REPLIES 3
ballardw
Super User

Since I don't see where there's much different in the alignments as shown, the source is likely at least solveable by using a non-proportional font in the output such as Courier or SAS Monospace and force an align left (I think). I cant tell if the values are going into one cell or two. If they were in two separte cells then one with left alignment and the other with right might give the appearance you're looking for. If you have built a single string then the font is about the only idea I have.

You don't say how the output is generated or the target output so there's not much else I can say at this time.

PGStats
Opal | Level 21

Which procedure did you use to build the table?

PG
PGStats
Opal | Level 21

Here is an example with proc print that might prove useful :

ods rtf file="&sasforum/Reports/textalign.rtf";

proc print data=sashelp.class;

var name / style=[textalign=center];

var age / style=[textalign=left];

var height /  style=[textalign=center];

var weight /  style=[textalign=dec];

run;

ods rtf close;

textalign=dec means align on the decimal point. Hint: it works also with strings containing a period. Style options work similarly in proc report to control alignment.

PG

PG

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