Date: Wed, 21 Aug 2002 12:26:58 -0400
Reply-To: "Huang, Ya" <ya.huang@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@PFIZER.COM>
Subject: Re: proc report ID option and ODS PDF causing column overlay - v8
.2 o n HP UX.
Content-Type: text/plain; charset="iso-8859-1"
Hi Harry,
I tested with the following code, but I did NOT see what was
described in SAS tech support note. The id columns looks fine to me.
I used SAS/Win2k/v8.2. Am I missing something or my version
is later than yours which has the bug fixed?
data xx (drop=i j);
array vv(20) $15 v1-v20;
do i=1 to 20;
do j=3 to 20;
vv(1)=put(i,z5.);
vv(2)=put(i**2,z8.);
vv(j)=repeat('x',ranuni(0)*10+5);
end;
output;
end;
options nocenter;
ods pdf file="c:\temp\junk.pdf";
proc report headline nowd;
column v1-v20;
define v1 /id;
define v2 /id;
run;
ods pdf close;
Kind regards,
Ya
-----Original Message-----
From: Droogendyk, Harry [mailto:Harry.Droogendyk@CIBC.COM]
Sent: Wednesday, August 21, 2002 7:52 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: proc report ID option and ODS PDF causing column overlay - v8.2
o n HP UX.
Listers:
I'm subscribed to the list, but not through this email address. Please
respond to the list AND this email address so I'll be able to benefit from
your wisdom. TIA
We're creating PDF reports from a dataset with roughly 35 columns of data.
In order to provide context for the columns that spill onto subsequent
pages, the first two columns are to be repeated on each page, perfect
application for the ID option in proc report.
Unfortunately, there's an acknowledged problem with combining ID and ODS
PDF. Here's what I received from SAS support:
The behavior you are seeing is caused by the use of the ID
option. The following SAS note contains detailed information:
http://www.sas.com/service/techsup/unotes/SN/007/007704.html
<http://www.sas.com/service/techsup/unotes/SN/007/007704.html>
The only circumvention at this point is to remove the ID
option.
Have any of the report / ODS gurus found a workaround for this?
Yes, I could split my output into X columns / page, generating multiple proc
report steps, each specifying only X columns, but that provides
unsatisfactory results. Similarly I could create alias columns for the two
ID columns, inserting the alias columns where appropriate and specifying the
page option. Those solutions don't work nicely because some columns are
much wider than others - both workarounds result in pages with skinny
columns having wide margins and creates a very lengthy report.
Note that the programs are run in batch mode, I don't have the option of
examining the data and tweaking the program before each run.
My code follows ( the %else the X columns / page solution that I use for
HTML to prevent horizontal scrolling ). Note that the cellwidth style
option does not fix the problem, it results in white space between the
columns and still overlays.
/************************************************************************
Let the ID option on the define statement take care of the
repeating
of the first two columns. We don't have that luxury in HTML
because
the concept of page width is kinda lost in a browser
unfortunately.
ID option repeats that column and all columns to the left in
the event
of horizontal page overflow.
*************************************************************************/
%if &dest = pdf %then %do;
proc report data=rpt_&print_ds
split="^" style(header)=[just=c]
style(column)=[just=c];
column desc_col date&lang var&min_var -- var&max_var;
define desc_col / display style=[just=l
cellwidth=2in] ;
define date&lang / display style=[just=l
cellwidth=1in] id ;
run;
%end; %else %do;
%do p = 1 %to &&&dest&l._no_prints;
proc report data=rpt_&print_ds ( keep = desc_col
date&lang &&&dest&l._print_vars&p )
split="^" style(header)=[just=c]
style(column)=[just=c];
column desc_col date&lang
&&&dest&l._print_vars&p ;
define desc_col / display style=[just=l];
define date&lang / display style=[just=l];
%if &dest = html and &p = &&&dest&l._no_prints
%then %do;
footnote1 "&f1";
footnote2 "&f2";
footnote3 "&f3";
%end;
run;
%end;
%end;