BookmarkSubscribeRSS Feed
vuyv
Calcite | Level 5

Hi, everyone.

The table below is the sample that I want my output looks like, please notice the percentages have extra space so the numbers and percents all line up nicely and right-aligned. Is there a way to update the  layout so it looks like this?Thanks.

   xxxx     n (   4.9%)          n ( 7.0%)       nn ( 5.9%)

   xxxx     n (   0.0%)          n ( 0.0%)         n ( 0.0%)

   xxxx   nn (24.6%)         nn (21.7%)       nn(23.2%)

   xxxx    nn (100%)         nn ( 100%)       nn ( 100%)

3 REPLIES 3
ballardw
Super User

How are you creating the output? Methods can make a difference as well as fonts used by any current style. If you read your post, which the formum may have turned a monospace font into proportional, your parantheses and percents do not line up well.

vuyv
Calcite | Level 5

I am sorry my post does not look well. (I tried to attach a file, but failed. )

The parantheses and percents should line up well. The contents inside of the parantheses have a fixed length and right-aligned too. nn and n also right-aligned. There has one space between nn/n and the parantheses.

Cynthia_sas
Diamond | Level 26

Hi:

  The fact is that SAS, by default, will not "like" to put 2 numbers (like N and PCTN) into 1 cell with punctuation (parentheses and %). So usually, when you do a report like this you are capturing the N and the PCTN by creating an output dataset and then you concatenate the 2 numbers together into a character string with the appropriate punctuation and then you use PROC PRINT or PROC REPORT or the DATA step to display the numbers.

  I have 3 different examples of creating a report similar to this in my "Creating Complex Reports" paper. You can find the paper by searching on support.sas.com or in the forum for previous postings of the link.

There are a couple of other things that you could do, too. The bottom line is that, as BallardW pointed out, depending on the ODS destination you choose, the spacing may be problematic, since only the LISTING (monospace) destination will "line up" the way you want.

cynthia


outfreq_char.png

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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