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