The SAS Output Delivery System and reporting techniques

Table options

Reply
Occasional Contributor
Posts: 8

Table options

Hello.

I am trying to create a table where every 10 row is seperated by a thick line.

Do anyone have ideas how to do this?

Thank you in advance!

HanJoe.
SAS Super FREQ
Posts: 8,864

Re: Table options

Posted in reply to HanJoeKim
Hi:
When you say you want to create a TABLE -- do you mean you want to create a DATASET??? Or, do you mean that you want to create a REPORT table???

If you are creating or want a REPORT table, then do you know what procedure you will be using??? Or, do you know what type of ODS output (HTML, PDF, RTF) that you will need??

When you say you want every 10th row to be separated by a thick line -- what do you mean?? A thick black line? A thick red line? Is the thick line a reader break???

Have you looked at PROC PRINT??? There is a new option in 9.2 that inserts a 'reader break" into PROC PRINT output. The option is the BLANKLINE option.

cynthia
Occasional Contributor
Posts: 8

Re: Table options

Posted in reply to Cynthia_sas
Cynthia,
I'm sorry for being so ambiguous.

I was talking about creating a 'report table'.
For example, when I use PROC TABULATE and want to obtain a PDF file.
Also, I want a 'thick black line' that can distinguish every 10 observations.

Thank you for your help.

HanJoe.
SAS Super FREQ
Posts: 8,864

Re: Table options

Posted in reply to HanJoeKim
Hi:
PROC TABULATE is creating a summary report table -- usually a cross-tabular table -- there are no "observations" -- per se -- in a PROC TABULATE report table. Your observations go "into" TABULATE and what comes out of TABULATE is a summarized table. It would be hard to insert "reader breaks" into a PROC TABULATE report table in the same way that the BLANKLINE option works with PROC PRINT. There are other ODS techniques that you can use with TABULATE (such as banding -- discussed below).

As an example, consider this table created by PROC TABULATE for the SASHELP.PRDSALE dataset:
[pre]
+----------------------------------------+-----------------------------------------------------------------------------+------------+
| | Region | |
| |--------------------------------------+--------------------------------------| |
| | EAST | WEST | |
| |--------------------------------------+--------------------------------------| |
| | Actual Sales | Actual Sales |Actual Sales|
| |------------+------------+------------+------------+------------+------------+------------|
| | Min | Mean | Max | Min | Mean | Max | Sum |
|-------------------+--------------------+------------+------------+------------+------------+------------+------------+------------|
|Country |Product | | | | | | | |
|-------------------+--------------------| | | | | | | |
|CANADA |BED | 42.00| 566.58| 993.00| 13.00| 427.77| 957.00| 47729.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |CHAIR | 14.00| 525.00| 995.00| 21.00| 521.65| 1000.00| 50239.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |DESK | 20.00| 521.25| 997.00| 35.00| 565.98| 990.00| 52187.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |SOFA | 5.00| 502.58| 999.00| 3.00| 541.90| 958.00| 50135.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |TABLE | 43.00| 540.52| 968.00| 6.00| 432.40| 971.00| 46700.00|
|-------------------+--------------------+------------+------------+------------+------------+------------+------------+------------|
|GERMANY |BED | 15.00| 490.35| 962.00| 3.00| 470.77| 916.00| 46134.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |CHAIR | 13.00| 484.94| 951.00| 28.00| 496.42| 986.00| 47105.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |DESK | 14.00| 529.23| 996.00| 22.00| 481.23| 991.00| 48502.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |SOFA | 30.00| 546.13| 996.00| 41.00| 600.96| 996.00| 55060.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |TABLE | 33.00| 544.08| 1000.00| 25.00| 480.85| 983.00| 49197.00|
|-------------------+--------------------+------------+------------+------------+------------+------------+------------+------------|
|U.S.A. |BED | 9.00| 482.02| 926.00| 18.00| 521.60| 984.00| 48174.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |CHAIR | 54.00| 570.38| 964.00| 31.00| 490.79| 960.00| 50936.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |DESK | 41.00| 483.19| 984.00| 6.00| 528.13| 955.00| 48543.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |SOFA | 4.00| 463.81| 895.00| 22.00| 440.21| 961.00| 43393.00|
| |--------------------+------------+------------+------------+------------+------------+------------+------------|
| |TABLE | 14.00| 463.71| 956.00| 56.00| 500.94| 972.00| 46303.00|
+-------------------+--------------------+------------+------------+------------+------------+------------+------------+------------+

[/pre]

What you see in this table are not "observations" -- it is summarized information based on this code:
[pre]
proc tabulate data=sashelp.prdsale;
class region product country;
var actual;
table country*product,
region*(actual*(min mean max)) actual*sum;
run;
[/pre]

If I needed to make this table smaller or more readable, I'd consider these things:
1) using the PAGE dimension to put every country on a different page

2) using BY group processing to put every country on a different page

3) using "banding" techniques with ODS to make every country's rows a different color (see this Tech Support example)
http://support.sas.com/kb/25/addl/fusion25401_1_odstab10.htm (where all the NC rows are green and all the NE rows are white, etc)
http://support.sas.com/kb/25/401.html


4) Create an output data set with PROC TABULATE and then use that dataset with PROC PRINT and the BLANKLINE option.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 137 views
  • 0 likes
  • 2 in conversation