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
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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