BookmarkSubscribeRSS Feed
sandyming
Calcite | Level 5

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

   

1 REPLY 1
Cynthia_sas
Diamond | Level 26

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

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
  • 1 reply
  • 1966 views
  • 0 likes
  • 2 in conversation