BookmarkSubscribeRSS Feed
BlackTea
Calcite | Level 5

Hi there,

I tried to get character data decimal aligned in rtf output. I tried to do this here:

24045 - In ODS RTF, can I modify the alignment from always being centered on the decimal?

data test;

  x='1.9'; output;

  x='1.91'; output;

  x='1.'; output;

  x='12.'; output;

  run;

  ods rtf file='c:\file.rtf';

  proc report data=test nowindows split="|" headline headskip;

  columns x;

  define x / display"Dose 1|(n=457)" width=15

  style(column)=[protectspecialchars=off pretext="\tqdec\tx500 "];

  run;

  ods rtf close;

In the first place it didn't work. Then I finally got the idea that it does not work because of the german installation of my MS Word. So, with the values comma-separated it worked fine!

But, I have to produce the output with decimal points. Therefore, my question is: how can I tell Word that it shall use the decimal point and not the comma for the decimal alignment?

Is there a possibility? Can I do this within the pretext-option or do I have to modify my rtf template or...?

Thanks very much in advance,

Daniela

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

Please try the below code,

check the bold code and make sure that you pass the numeric data for proper alignment in proc report.

data test;

  x=1.9; output;

  x=1.91; output;

  x=1.; output;

  x=12.; output;

  run;

ods rtf file='E:\source\test.rtf';

  proc report data=test nowindows split="|" headline headskip;

  columns x;

  define x / display"Dose 1|(n=457)" width=15

  style(column)=[just=d];

  run;

  ods rtf close;

Thanks,

Jagadish

Thanks,
Jag
BlackTea
Calcite | Level 5

Hi Jagadish,

Thanks! But with just=d I got same results regardless of whether I use values with decimal point or with decimal comma: it's not aligned. I wonder why just=d isn't working even with the comma.

Daniela

Jagadishkatam
Amethyst | Level 16

Please find below the output of the rtf file i got, here the decimal places are aligned by the usage of [just=d]. The values passed are with decimal points.

Thanks,

Jagadish

Thanks,
Jag
Cynthia_sas
Diamond | Level 26

Hi:

  You have a fairly specific usage question. And as you can see, using JUST=D does work for ODS RTF. Since you suspect your issue is Microsoft Word and/or possibly with the Word German version interpreting the RTF file created by SAS, your best bet for help is to open a track with Tech Support. For example, if there IS an issue with the JUST=D style override and ODS RTF and MS Word in German, then the ONLY people who can open a defect with the developers to fix this are the people in Tech Support. So while it might be useful for you to post a question here, just to get a general sense of whether any one else has encountered tis issue, to really determine whether this is a defect and to get the defect reported so it can be fixed, you need to work with Tech Support.

  To open a track with Tech Support, you can send email to support@sas.com , or you can fill out the form at this link: http://support.sas.com/ctx/supportform/createForm or you can call them at 919-677-8008 to open a track.

Cynthia

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
  • 4 replies
  • 2607 views
  • 1 like
  • 3 in conversation