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

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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