Date: Wed, 14 Apr 2004 16:55:20 -0400
Reply-To: Don Stanley <don_stanley@PARADISE.NET.NZ>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Stanley <don_stanley@PARADISE.NET.NZ>
Subject: Re: PROC REPORT bug: 'automatic wrapping of column values'
revisited
Using ODS to RTF gets around this problem, but induces another one. The
labels are so long that by default they use a full page on their own, and
the header and detail are physically separated.
Its rather contrived to use labels this long, But I can see situations
where it could be useful. But probably the exception.
Don
On Wed, 14 Apr 2004 10:19:53 +0200, Groeneveld, Jim
<jim.groeneveld@VITATRON.COM> wrote:
>Hi friends,
>
>Here is another example that also shows the refusal of SAS to wrap
variable labels automatically. Even more, labels continue to be printed
next to the concerning column if it is the last one and also between
columns as you can see. I consider this a serious bug, which at least
already was present in SAS 6.12 and still is in 8.2 (but I am behind with
patching). And again even more, (other) columns may wrap (not truncate) if
FLOW is turned off (not specified), e.g. the labels of V4 and V5.
>
>The bug (or at least inability) only shows for across variables which have
nested columns (spanning multiple columns with other variables). I have
also tested this with multiple nesting (nested nesting), and that showed
the same problems even more (I do not include sample code of that). It is
very annoying; I would have to develop macro code to insert specific split
characters in variable labels, character values and character formatted
values of such variables, which I don't like at all. I hope there may be a
quick workaround, but I would like to see this solved in an 8.2 patch or
9.x.
>
>And automatic wrapping at spaces does not need to wrap at every space, but
only where the words in a label or value would otherwise be truncated. So
instead of the Flow feature at every explicit split character, it better
could be some more relaxed automatic wrapping algorithm, like it already
works now with single column variables.
>
>In my view the best way to live with this is to have relatively short
labels and values, to specify variable labels with split characters within
the DEFINE statements and to apply formatted character values (if
possible), where only the format may have to be adapted to split
characters. Cumbersome anyhow.
>
>%LET Flow = FLOW; %* experiment with Flow=empty or Flow;
>%LET Split = %STR( ); %* experiment with Split=empty/space or slash;
>%* If experimenting with a slash insert it in the non-wrapped labels;
>
>proc format;
> value _longfmt
> 1 = "this is the value 1 label, this also applies to character values"
> 2 = "this is the value 2 label, this also applies to character values"
> 3 = "this is the value 3 label, this also applies to character values"
> 4 = "this is the value 4 label, this also applies to character values"
>;
>run;
>
>data TestData;
> infile cards;
> input v0 v1 v4 v5;
> label v0 = "This is the v0 label"
> v1 = "This is the very, very, very long, so very, very, very long
v1 label"
>;
>cards;
>1 2004 11 22
>2 2004 33 44
>3 2004 55 66
>4 2004 77 88
>;
>run;
>
>PROC REPORT DATA=TestData LS=80 PS=63 HEADLINE HEADSKIP CENTER MISSING
>SPLIT="&Split";
>COLUMN ( (
>"__________________________________________________________________________
______________________"
>" " v1 v0,("__" " " v4 v5 ) ) );
>
>DEFINE v1 / GROUP FORMAT= 5. WIDTH=16 SPACING=0 &Flow LEFT ORDER=INTERNAL
>/*"This is the very, very, very long, so very, very, very long v1
label"*/ ;
>DEFINE v0 / ACROSS FORMAT=_longfmt. WIDTH=16 SPACING=1 &Flow CENTER
ORDER=INTERNAL
>"This is the very, very, very long, so very, very, very long v0 label" "--
" " ";
>DEFINE v4 / SUM WIDTH=5 &Flow FORMAT= 5.0 SPACING=2 RIGHT "Vfour FourV";
>DEFINE v5 / SUM WIDTH=5 &Flow FORMAT= 5.1 SPACING=2 RIGHT "Vfive FiveV";
>RUN;
>
>Regards - Jim.
>--
>. . . . . . . . . . . . . . . .
>
>Jim Groeneveld, MSc.
>Biostatistician
>Science Team
>Vitatron B.V.
>Meander 1051
>6825 MJ Arnhem
>Tel: +31/0 26 376 7365
>Fax: +31/0 26 376 7305
>Jim.Groeneveld@Vitatron.com
>www.vitatron.com
>
>My computer remains home, but I will attend SUGI 2004.
>
>[common disclaimer]
|