Starting in SAS 9.2, you might be able to use the new "text decoration" style attributes to put lines above and under your special text. But until then, you'd have to play around with underscores or dashes. Since you are creating a stored process for your output, a lot depends on where the users are going to be receiving stored process results.
For example, if your users were getting the stored process results in Word, you might be able to use RTF control strings to put your extra summary information in a table (which is essentially a box), but RTF control strings won't work in Web Report Studio or Excel or PowerPoint.
If you were ONLY producing LISTING output (what you see in the SAS Output Window), you could use PUT statements to write underscores and dashes to simulate a box -- however, these PUT statements also do not translate well when run as a stored process. For example...consider that you put your information into a box constructed of underscores and dashes. Then your users run that stored process and get the results in Excel. Do you really want them to see a row of underscores taking up space in Excel?
SAS creates tables that contain the same number of columns on EVERY row. So when you start off with a DETAIL report, you are making 1 table. If you write summary lines to that table, you are stuck with the boundaries and number of columns in the original detail table. PROC REPORT lets you write lines that span the columns and DATA _NULL_ lets you write table footers that would span all the columns, but essentially, what you want to do (with writing your own box at a break point) is more like the kind of report we used to produce in the mainframe days, when the printer did not have any fancy fonts or lines and we had to make all our boxes and highlights with underscores and dashes.
The whole purpose of stored processes is to allow the results to come back to the user in the best way for the client application -- so the users see the results in a way that looks nice in their client application.
You might consider contacting Tech Support with this problem, as they can collect information on exactly WHICH client apps are going to be receiving the stored process results and they may be able to come up with something that will work for those client applications. Or the other thing, you could do is experiment with giving the users something different from what they've gotten in the past, but which will, perhaps, in the long run, work better for them in what they ultimately do with the results from the stored process (print, email, etc). Run the program below and see whether something like this might work for your users. Right now, the program only shows the Chem department, but there are other things you can do with SAS Macro programming to generate this "set" of reports for every department.
** Make some data;
length Name $8. Department $20. Primary_Ethnicity_Desc $10.
Primary_Ethnicity 3 Gender $1;
infile datalines dsd;
input Name $ gender $ Department $
primary_ethnicity primary_ethnicity_desc $;
format Department $20. Primary_Ethnicity_Desc $10.;
ods listing close;
** Use PROC PRINT to get the "detail" report for everybody.;
** Use Proc Tabulate to get a "pretty" summary table in a box.;
ods html file='c:\temp\pretty_summary.html' style=egdefault;
proc print data=sfile1;
title "Chemistry Department Detail";
where department = "Chem";
var name gender primary_ethnicity_desc;
proc tabulate data=sfile1 f=comma6.;
where department = "Chem";
title "Chemistry Summary Information";
class department gender primary_ethnicity_desc ;