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%)
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.
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.
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
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.
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.