DATA Step, Macro, Functions and more

Text alignment in Proc Report to PDF

Reply
Contributor
Posts: 32

Text alignment in Proc Report to PDF

Now, the PDF output using ODS + Proc Report,  is like this (textalign=r):

      Name

      100 (100.0)

             5 (3,8)

Is there a way that I can align the column like this?

       Name

      100 (100.0)

          5 (   3.8)

Thanks.

Sandy

   

SAS Super FREQ
Posts: 8,743

Re: Text alignment in Proc Report to PDF

Hi:

  Is your NAME variable a character variable? And if so, do you have a leading space(s) in front of the 3.8? With the code below, I find that the first 3 obs, that are "padded" or the right number of characters, does work correctly in PDF. But the last obs doesn't look right, even with Courier New font, because the (3.8) isn't as wide as the (100.0).

cynthia

ods _all_ close;

data testit;
  infile datalines;
  input @1 Name $char11.;
  obsnum=_n_;
return;
datalines;
100 (100.0)
  5 (  3.8)
12 (999.9)
15 (3.8)
;
run;

  

ods pdf file='c:\temp\testits.pdf';

proc report data=testit;
   column obsnum Name;
   define obsnum / order;
   define Name / display
          style(column)={just=r font_face='Courier New' font_weight=bold};
run;
ods pdf close;


pad_with_blanks.pngoutput_and_code.png
Ask a Question
Discussion stats
  • 1 reply
  • 174 views
  • 0 likes
  • 2 in conversation