The SAS Output Delivery System and reporting techniques

PROC TABULATE COLUMNS - LEFT RIGHT JUSTIFICATION

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

PROC TABULATE COLUMNS - LEFT RIGHT JUSTIFICATION

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;

 

 


Accepted Solutions
Solution
‎09-26-2017 03:09 PM
Super User
Posts: 12,996

Re: PROC TABULATE COLUMNS - LEFT RIGHT JUSTIFICATION

[ Edited ]

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.

 

View solution in original post


All Replies
Solution
‎09-26-2017 03:09 PM
Super User
Posts: 12,996

Re: PROC TABULATE COLUMNS - LEFT RIGHT JUSTIFICATION

[ Edited ]

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.

 

Occasional Contributor
Posts: 18

Re: PROC TABULATE COLUMNS - LEFT RIGHT JUSTIFICATION

Worked for me.  Thanks so much! Cat Very Happy

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 320 views
  • 1 like
  • 2 in conversation