BookmarkSubscribeRSS Feed
den
Calcite | Level 5 den
Calcite | Level 5
Hi all,

I'm creating a table output using proc tabulate and proc template. The table is a population demographic report. The rows are the various demographics and the column has the output statistical values. See example below:

Variable Stat Value
Age n 200
mean 62.1
std 9.35

Gender n 200
female 100 (50%)
male 100 (50%)

I would like to align the values in the third column so that they appear with decimal points aligned eg

Age n 200
mean 62.1
std 9.35

Gender n 200
female 100 (50%)
male 100 (50%)

I've tried justifying the column both to the left and right neither of which aligns the decimal point. When I justify using the decimal alignment, d, all of the decimals align but this causes the (%) statistic to right align rather than the count (100) aligning with the decimal point eg

Age n 200
mean 62.1
std 9.35

Gender n 200
female 100 (50%)
male 100 (50%)

Any advice on this issue would be much appreciated.
3 REPLIES 3
ballardw
Super User
Your post got bitten by the forum options. You're going to have to work much harder to imply alignment as tabs and such don't work well and it uses a proportional font so spaces may not work quite as expected either.
Example:

111
OOO

It might help to show your table code to see which approaches you were attempting and which output destination is needed.
Ksharp
Super User
You can check format Dw.p and Bestd.



Ksharp
den
Calcite | Level 5 den
Calcite | Level 5
I got it sorted. In the end I had to create an extra column for the (%) and shorten the space between the count value and the (%) value.

Thanks

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 3 replies
  • 1518 views
  • 0 likes
  • 3 in conversation