The SAS Output Delivery System and reporting techniques

Decimal alignment in rtf output with german MS Word

Reply
Occasional Contributor
Posts: 10

Decimal alignment in rtf output with german MS Word

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

Trusted Advisor
Posts: 1,137

Re: Decimal alignment in rtf output with german MS Word

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
Occasional Contributor
Posts: 10

Re: Decimal alignment in rtf output with german MS Word

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

Trusted Advisor
Posts: 1,137

Re: Decimal alignment in rtf output with german MS Word

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
SAS Super FREQ
Posts: 8,814

Re: Decimal alignment in rtf output with german MS Word

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

Ask a Question
Discussion stats
  • 4 replies
  • 676 views
  • 1 like
  • 3 in conversation