DATA Step, Macro, Functions and more

allignement of values in ODS output

Reply
Contributor
Posts: 28

allignement of values in ODS output

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.

Super User
Posts: 11,343

Re: allignement of values in ODS output

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.

Respected Advisor
Posts: 4,920

Re: allignement of values in ODS output

Which procedure did you use to build the table?

PG
Respected Advisor
Posts: 4,920

Re: allignement of values in ODS output

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
Ask a Question
Discussion stats
  • 3 replies
  • 196 views
  • 0 likes
  • 3 in conversation