The SAS Output Delivery System and reporting techniques

PROC TABULATE MERGED HEADER ROW

Accepted Solution Solved
Reply
Highlighted
Occasional Contributor
Posts: 18
Accepted Solution

PROC TABULATE MERGED HEADER ROW

Hi, 

 

Clients wants a merged header row that reads "No. (%)", but I couldn't figure out how.

 SAS proc tab question3.JPG

 

Here is my code using the Shoes dataset.  Thank you!

 

proc format;
picture paren (round)
 low-high = '(009.9%)'
 ( prefix = '(' mult=1000);
run;

proc tabulate data=sashelp.shoes;  
  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 mean * f=paren.)
		;
run;

 


Accepted Solutions
Solution
3 weeks ago
Super User
Posts: 11,101

Re: PROC TABULATE MERGED HEADER ROW

Try

proc tabulate data=sashelp.shoes;  
  where region in ('Asia', 'Canada') and product in ('Boot');
  class product region;
  var sales returns stores inventory;
  table (region all),
        ALL * n
		All='No.(%)'*(sales returns inventory stores) * (sum mean * f=paren.)
		;
run;

Tabulate will require a class variable or "all" to create any outer level row or column heading.

 

View solution in original post


All Replies
Solution
3 weeks ago
Super User
Posts: 11,101

Re: PROC TABULATE MERGED HEADER ROW

Try

proc tabulate data=sashelp.shoes;  
  where region in ('Asia', 'Canada') and product in ('Boot');
  class product region;
  var sales returns stores inventory;
  table (region all),
        ALL * n
		All='No.(%)'*(sales returns inventory stores) * (sum mean * f=paren.)
		;
run;

Tabulate will require a class variable or "all" to create any outer level row or column heading.

 

Occasional Contributor
Posts: 18

Re: PROC TABULATE MERGED HEADER ROW

[ Edited ]

How are you so brilliant?? Smiley LOL  Thank you!

☑ This topic is solved.

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

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