Author: Roland Rashleigh-Berry Updated: 11 Dec 2011
Introduction
This page is about how best to define solid lines to "proc report" output
as a "top line" or as a first footnote. It is only applicable to sas
9.2 and higher.
The Problem
The problem you have is that is you use underscores to give you a solid
line in "proc report" output then the line is too low and to make your
report look right you have to skip a line underneath it. This wastes one
of the lines on your page that you could be using to display data. But
if you used a line of dashes (miinus signs or hyphens) then the line is
in the right positions but it is not solid. You see the gaps between the
dashes.
What you would like is the line that "proc report" gives you if you
use the option headline. This gives you a solid line in the middle
height of the row which is perfect. This is the line that looks like "fffffffff"
when you copy and paste to Notepad.
The Solution
The solution is to understand that "proc report" is using a special character
that you can use as well. It is neither a hyphen (minus sign) nor an underscore.
You can find out which character this is using my %hexchars macro
if you coopy and paste into Notepad and save the file somewhere. %hexchars
will reveal that this character is "83"x (hexadecimal) and 131
as decimal. Knowing that you can use it in your code.
How to code it
There are two ways of using it in your code. Either direct as the "83"x
hex character (suitable for a top line in proc report) or as %sysfunc(byte(131))
in macro code (suitable for use in a footnote).
Here is how to use it in your code:
proc report etc........; *- a list of column veriables with a top line defined at
the start -; columns ( "8383"x var1 var2 var3 etc. );
*- a footnote that is a solid line the width of the report -; footnote1 "%sysfunc(repeat(%sysfunc(byte(131)),%eval(&repwidth-1)))";
Conclusion
You have seen how to use the "83"x (decimal 131) character
to create solid lines in proc report that are shown at mid-row height.
Use the "Back" button of your browser
to return to the previous page