Date: Mon, 18 Oct 2004 04:55:51 -0700
Reply-To: RolandRB <rolandberry@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: RolandRB <rolandberry@HOTMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Line in proc report...
Content-Type: text/plain; charset=ISO-8859-1
Amit.Dhameja@I3STATPROBE.COM (Dhameja, Amit) wrote in message news:<DDC8472D4746174E98E10DE38232B083946F49@clxms02.clxms02.lx.statprobe.com>...
> Hi all,
>
> I had a quick question:
> For most clinical reports, we need to print a horizontal line at the end of
> each page that proc report outputs (above various footnotes). This line
> should have the same width as the one generated by the 'headline' option.
>
> Currently I do it with a compute block:
>
> compute after _page_ ;
> line 150*"_";
> endcomp;
>
> 150 here is calculated by adding column widths specified in the 'width='
> option in the define statement, and adding corresponding 'spacing=' values.
> And it takes some time to compute that number and it changes with macro
> statements in & around proc report.
>
> Has anyone out there found a better way to do this?
I have to put out two ending lines. One after the report data has
finished on a page and one just above the footnotes. As for calclating
the report width, then I have a routine that does this. Something
along these lines:
/**************************************
Calculate report width
**************************************/
%*- calculate the report width -;
%let repwidth=%eval(&catwidth + (&_trtnum_+1)*(&spacing+&strlen));
I have something like the above in every reporting program I write so
calculating the width of the report is no big deal. For the line after
the data I set up a noprint variable named page and have a compute
block like you do that uses this report width. But note that this goes
after the end of the data and not at the bottom of the page. I need
another line for that. It would be nice if this report width were an
automatic variable you could use created by proc report but then it
would be only available after the report had been produced so you can
forget about that. I suppose you could save the dataset coming out of
proc report and use that but that is no good if you have a "by"
variable.
Ss for the long line before the footnotes then for me this has to span
the width of the page. Getting the page width is easy using
%sysfunc(getoption(ls))
Of course, it would be a lot easier if people didn't insist on
"beautifying" these reports with extra lines and other things.
Pleasing to the eye but heavy on the code.