BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi

I am using Summary table to get an output for my report.

The output of my report layout is as follows:-
Order type
Months R T
Supplier_name Value Value

XYZabcdefgh June 1000 20000
ifddjd


The problem with this output is that Supplier_name is getting wrap so can I customize the width of columns through summary table
OR
can I use the output of summary table and using proc report to generate the final
output.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
There is a way to increase the area that you describe. It is the ROW TITLE SPACE that is the leftmost area in Summary Table output -- because that is where the row dimension class values or statistic names are displayed. Usually, you will only encounter this wrapping in the LISTING destination or OUTPUT window. Wrapping is not generally a problem in the default HTML (or RTF or PDF) output produced with EG.

However, the way that you would modify the Row Title Space value would be by opening or previewing the EG code for your summary tables task, and look for the TABLE statement. It will look something like this:
[pre]
TABLE /* Row Dimension */
Region
ALL,
/* Column Dimension */
Sales* Max
Sales* ALL* Sum ;
[/pre]
Then, BEFORE the final semi-colon, you will want click on insert code gray area and add:
[pre]
/ RTS=40
[/pre]
or whatever value is long enough to keep the wrapping from happening.
So, your final TABLE statement in the above example would be:
[pre]
TABLE /* Row Dimension */
Region
ALL,
/* Column Dimension */
Sales* Max
Sales* ALL* Sum
/ RTS=40
;
[/pre]

If you use PROC REPORT for your report, then you have a few other options, such as WIDTH= or FORMAT= for LISTING output and/or CELLWIDTH for other ODS destination output, as described in this forum posting
http://support.sas.com/forums/thread.jspa?messageID=7442ᴒ because CELLWIDTH can be used to make a column WIDER, as well as make a column narrower (and thus force wrapping).

cynthia
deleted_user
Not applicable
Thanks for the solution.. but I am geting too much space between the rows and column..
In your example you have region only in rows..
But in my report I have
TABLE /* Row Dimension */
Supplier_name ALL
AGIENG ALL
/* Column Dimension */ Sales* Max
Sales* ALL* Sum ;

So when i insert RTS in code it gives width to both row dimension where i just want to give to supplier_name since it is wrapping..

Wht should i do with this..
How should I go about..
Cynthia_sas
SAS Super FREQ
Hi:
I must be missing something. I don't see a comma (,) in your TABLE statement and the only * I see is in what you say is the Column dimension. Do you have something nested in your Row dimension? Did you leave a comma out of your typing?
[pre]
** Your table statement;
TABLE /* Row Dimension */
Supplier_name ALL
AGIENG ALL <---- NO COMMA between ROW and COLUMN dimension
/* Column Dimension */
Sales* Max
Sales* ALL* Sum ;

[/pre]

compare your TABLE statement to my TABLE statement. I have a comma in my TABLE statement -- but I don't see one in your TABLE statement.

Even if you had nested variables in the row dimension: [pre]
table region*subsidiary,
sales*max sales*all*sum / RTS=50; [/pre]

The RTS specification would apply to the WHOLE area allocated to REGION*SUBSIDIARY. Or, alternately if you did have this TABLE statement
[pre]
TABLE /* Row Dimension */
Supplier_name ALL
AGIENG ALL ,
/* Column Dimension */
Sales* Max
Sales* ALL* Sum /RTS=50 ;

[/pre]

Then the RTS would apply to the ROW title area for BOTH SUPPLIER_NAME and AGIENG.

You cannot variably change the space allocated to SUPPLIER_NAME and make it different from the space allocated to AGIENG.

Take this table for an example. I have both REGION and PRODUCT in the row dimension.
[pre]

-----------------------------------------------
| | | Total Sales |
| | |---------------|
| | Total Sales | All |
| |---------------+---------------|
| | Max | Sum |
|-------------+---------------+---------------|
|Region | | |
|-------------| | |
|Asia | $149,013.00| $214,740.00|
|-------------+---------------+---------------|
|Canada | $700,513.00| $1,338,364.00|
|-------------+---------------+---------------|
|Pacific | $171,735.00| $514,315.00|
|-------------+---------------+---------------|
|All | $700,513.00| $2,067,419.00|
|-------------+---------------+---------------|
|Product | | |
|-------------| | |
|Boot | $286,497.00| $571,896.00|
|-------------+---------------+---------------|
|Slipper | $700,513.00| $1,495,523.00|
|-------------+---------------+---------------|
|All | $700,513.00| $2,067,419.00|
-----------------------------------------------
XXXXXXXXXXXXXXX@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[/pre]
The area indicated with XXXXX is the row title space area. The area with @@@@ is the "column area". This table was created by this program:
[pre]
ods listing;
options nocenter;

proc tabulate data=sashelp.shoes f=dollar15.2
formchar='|----|+|--- ';
where region in ('Asia', 'Canada', 'Pacific') and
product in ('Slipper', 'Boot');
class region product;
var sales;
table
/* Row */
region all
product all,
/* Col */
sales*max sales*all*sum / rts=15;
run;
[/pre]

If there is too much space between the row title space area and the column area, then either make the RTS value smaller or make the format for the column area smaller, or both.

If you are using ODS, then you could use CELLWIDTH to change the size of the cells, but again, you could not, in this example, make the area for Region a different "width" than the area for Product.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 740 views
  • 0 likes
  • 2 in conversation