The SAS Output Delivery System and reporting techniques

Proc Report

Reply
N/A
Posts: 0

Proc Report

Hi all,
I need some help with Proc Report. I am using ODS PDF along with Proc Report. I am trying to create an ODS PDF page but I have to use more then one Proc Report to create the page. My problem is that each of the reports I run are of different widths on the page. I need to find a way to size each report to the same size for this page of my over all PDF file. Does any one know how do this?

Thanks for any help you all can give me on this one.
SAS Super FREQ
Posts: 8,868

Re: Proc Report

Posted in reply to deleted_user
Hi:
Depending on your version of SAS, you might want to try:
[pre]
** SAS 9.1.3 and earlier, also 9.2;
proc report data=xxx nowd
style(report)={outputwidth=100%};

...OR...

** SAS 9.2 width= is an alternative;
proc report data=xxx nowd
style(report)={width=100%};
[/pre]
cynthia
N/A
Posts: 0

Re: Proc Report

Posted in reply to Cynthia_sas
I have a similar problem. I'm using SAS 9.1, also using PROC REPORT and ODS PDF. Each of my DEFINE statements specifies a WIDTH and FORMAT. However, the column widths on the PDF appear to be controlled by the width of the values within the column. For example, when my JAN column has values in the thousands, the width is wider than when the values are in the hundreds. How do I get SAS to apply the WIDTHs and FORMATs that were specified in the DEFINE statement so all my reports have a consistent layout? I'm using a modified version of the barrettsblue template in case there's something in the template that overrides the WIDTH and FORMAT settings. Thanks in advance for any help you can give.
Frequent Contributor
Posts: 102

Re: Proc Report

Posted in reply to deleted_user
I think you will have to apply a CELLWIDTH in the style for the column.
N/A
Posts: 0

Re: Proc Report

Posted in reply to deleted_user
Thanks for responding. I can see I need to experiment with the CELLWIDTH style more. I applied the % approach but the spacing between the columns expanded (which I didn't want) and the width of the headers didn't change to match the column widths (which I did want) . I guess I have my work cut out for me!
SAS Super FREQ
Posts: 8,868

Re: Proc Report

Posted in reply to deleted_user
Hi, Virginia:
Generally, if I use CELLWIDTH, I do not use OUTPUTWIDTH and vice versa. Basically, OUTPUTWIDTH tells ODS PDF to go ahead and stretch (usually it's stretch) the table from margin to margin to the percent width you specify, in which case, ODS PDF wants to be in control of the CELLWIDTHS. If you specify OUTPUTWIDTH and then only SOME CELLWIDTHS, PDF could mis-calculate. I've seen instances where gaps occur, as you describe.

In addition, WIDTH and FORMAT only control width in the LISTING destination. Those particular PROC REPORT options are basically ignored by ODS PDF, RTF and HTML (along with HEADLINE, HEADSKIP, SKIP, DOL, DUL, SPACING, OL, UL, etc, etc). You may also have noticed that ODS PDF, RTF and HTML ignore Linesize and Pagesize -- although they do honor CENTER/NOCENTER.

Here are some things to try for ODS PDF:
1) take out all outputwidth and cellwidth and try this:

ODS PDF file='uniform.pdf' UNIFORM;

which attempts to determine the max variable value in every column and set the table width on every page accordingly

2) try OUTPUTWIDTH --only--

3) try CELLWIDTH --only- on both the header and column of your variable
DEFINE myvar /style(header)={cellwidth=.75in} style(column)={cellwidth=.75in};


4) use OUTPUTWIDTH & CELLWIDTH together, but make sure that you don't have an outputwidth of 100% for example, but your cellwidths add up to more or less than 100%. In this instance, I prefer to try something like this:
[pre]
options orientation=landscape topmargin=.5in bottommargin=.5in leftmargin=.5in rightmargin=.5in;

proc report data=xxx nowd
style(report)={outputwidth=10in};
. . . more code . . .
define var1 /
style(header)={cellwidth=20%}
style(column)={cellwidth=20%};
define bigvar /
style(header)={cellwidth=30%}
style(column)={cellwidth=30%};
define var2 /
style(header)={cellwidth=20%}
style(column)={cellwidth=20%};
define var3 /
style(header)={cellwidth=20%}
style(column)={cellwidth=20%};
define smallvar/
style(header)={cellwidth=10%}
style(column)={cellwidth=10%};
run;

[/pre]

On a landscape piece of paper with .5in margins on both sides, the available "real estate" is 10 inches. So I split that in percents for my 5 variables, being sure
that the cellwidth is the same for the HEADER and the COLUMN for every variable and that the total percent values add up to 100. It's probably overkill to specify the same cellwidth for HEADER and COLUMN, since I believe that the HEADER width wins, but I tend toward over-explicitness in this regard.

cynthia
N/A
Posts: 0

Re: Proc Report

Posted in reply to Cynthia_sas
Cynthia, the style(header) and style(column) with the cellwidth settings worked like a charm. I cannot thank you enough for your help with this!!
Ask a Question
Discussion stats
  • 6 replies
  • 399 views
  • 0 likes
  • 3 in conversation