Hi, I'm trying to left-justify the numbers column and right-justify the percentage column. What's the best way to do that?
Here is my code using the Shoes dataset, but the alignment does not appear to change, even when I change j=l, j=c or j=r. Thanks so much!
proc format;
picture paren (round)
low-high = '(009.9%)'
( prefix = '(' mult=1000);
run;
options nocenter;
proc tabulate data=sashelp.shoes FORMAT=9.0 order=formatted;
where region in ('Asia', 'Canada') and product in ('Boot');
class product region;
var sales returns stores inventory;
table (region all),
ALL * n
(sales returns inventory stores) * (sum= {label = '' s=[just=R]} mean= {label = '' s=[just=L]} * f=paren.)
;
run;
I am not sure why using Label that way interferes with justification but try:
proc tabulate data=sashelp.shoes FORMAT=9.0 order=formatted; where region in ('Asia', 'Canada') and product in ('Boot'); class product region; var sales returns stores inventory; table (region all), ALL * n (sales returns inventory stores) * (sum='' *{ s=[just=R]} mean='' *{s=[just=L]} * f=paren.) ; run;
You may want to make the cells for the sum wider to make the justification more noticeable.
I am not sure why using Label that way interferes with justification but try:
proc tabulate data=sashelp.shoes FORMAT=9.0 order=formatted; where region in ('Asia', 'Canada') and product in ('Boot'); class product region; var sales returns stores inventory; table (region all), ALL * n (sales returns inventory stores) * (sum='' *{ s=[just=R]} mean='' *{s=[just=L]} * f=paren.) ; run;
You may want to make the cells for the sum wider to make the justification more noticeable.
Worked for me. Thanks so much!
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 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.