Hi, Anita:
As with all things ODS, "it depends". First, with ODS RTF, you can do this:
[pre]
ods rtf file='c:\temp\head_foot.rtf';
proc report data=sashelp.shoes nowd;
title 'SAS Title Goes into Header';
footnote 'SAS Footnote Goes into Footer';
where Region = 'Asia';
column region subsidiary product sales;
run;
proc freq data=sashelp.shoes;
table Region;
run;
ods rtf close;
[/pre]
and the SAS title and SAS footnote will be placed in the header and footer area of the RTF document. Note that the above technique has nothing to do with PROC REPORT. It is the SAS Title and Footnote statements that are working with RTF control strings. So, the technique will work with any procedure that sends output to ODS destinations -- not just PROC REPORT.
HTML and PDF output files do NOT have header and footer areas, like RTF output files. A SAS title or SAS footnote will go into the document at the appropriate place in the document. So, for PDF output from ODS, the SAS title and SAS footnote will appear on every page. For HTML output, the SAS title will appear at the top of the procedure output in the HTML file and the SAS footnote will be at the end of the procedure output in the HTML file. If the procedure produces HTML output that spans more than 1 printed page, then the SAS title is on printed page 1 and the SAS footnote is on the last printed page of the HTML file.
This syntax, using the TITLE= suboption, places a text string into the browser top navigation area (top browser title bar):
[pre]
ods html file='c:\temp\something.html' (title='HTML Title');
. . . SAS Code . . .
ods _all_ close;
[/pre]
With some browsers, this suboption MIGHT put the browser bar title "HTML Title" into the header area of the printed HTML file -- but this really is more dependent on the type of browser you are using and whether that browser has a printer interface that uses the browser bar title in this manner. Again, this is not procedure-dependent -- this capability is a feature of ODS that might be interpreted by a browser the way you want when the HTML file is printed (using the browser).
Since you asked specifically about PROC REPORT, there is, within PROC REPORT, the ability to write text to the output file (RTF, PDF or HTML) based on a COMPUTE BEFORE _PAGE_ or COMPUTE AFTER _PAGE_ block of code. However, if you use these kinds of compute blocks to write text, the text goes into the document itself, (and if you're creating RTF -- this means NOT in the header/footer area) If you knew RTF control string syntax, you might be able to write some code that would go into the Header area of the RTF file, but since the SAS title will go there automatically, that seems the easiest way to go with RTF.
Let's say you wanted to do a report for every Region and that you wanted the Region name to be in the header area of the resulting RTF document. Rather than using PROC REPORT capabilities, you might consider using BYGROUP processing like this:
[pre]
option nobyline;
ods rtf file='c:\temp\head_foot_by.rtf';
proc report data=sashelp.shoes nowd;
title 'SAS Title Goes into Header';
title2 'For #byval(region)';
footnote 'SAS Footnote Goes into Footer';
by Region;
where Region = 'Asia' or Region = 'Canada';
column region subsidiary product sales;
run;
ods rtf close;
options byline;
title; footnote;
[/pre]
When SAS encounters the #byval(region) reference, it substitutes the value of the current BYGroup value into the SAS title. If you are creating RTF output, then this information goes into the header area of the RTF output file.
If you need to create an output file other than RTF or HTML, then, there is only one other ODS destination that puts information into a "header" area. That is TAGSETS.EXCELXP -- by default, it places the SAS Title into the Header area of the Excel Workbook and the SAS Footnote into the Footer area of the Excel Workbook. Again, this capability has nothing to do with a specific procedure, but is the default way that the ExcelXP tagset treats the SAS title unless you do something other than the default.
cynthia