BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lin39
Obsidian | Level 7

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

2 REPLIES 2
ballardw
Super User

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.

 

lin39
Obsidian | Level 7

Worked for me.  Thanks so much! Cat Very Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 3334 views
  • 1 like
  • 2 in conversation