In this lesson you will learn how to specify titles and footnotes, change titles and footnotes, and delete titles and footnotes.
Perhaps you’ve already noticed that, by default, all the reports you create using SAS include the title,
“The SAS System” centered at the top of the report.
And in certain file formats there is a date-time stamp and page number in the top right hand corner of the report.
But, often times adding a title of your choosing to your reports can make them more
meaningful, and can help you stay better organized.
You can easily add your own titles and footnotes to reports in SAS.
In your SAS reports, you can specify up to 10 titles and 10 footnotes.
To specify a title you use the title statement.
To specify a footnote you use the footnote statement.
Other than the keyword at the beginning, the title and footnote statements share the same general form.
Following the keyword, you specify a value for n.
A number from 1 to 10 that indicates the line on which you want the title or footnote to appear.
If you don’t specify a number, then SAS assumes you are referring to line one.
Finally, within quotation marks, you specify the text of the title or footnote you want to appear.
In this example, the title statement specifies the title “North Texas Regional Health Department.”
Question: On which line with this title appear?
The title statement does not specify a line number, so SAS will display this title on line 1.
In this example, the footnote statement specifies the number 3,
so the word “Confidential” will appear on the third footnote line.
You can specify only one title or footnote in a single statement.
To specify multiple titles or multiple footnotes, you must use multiple statements.
Remember that the title and footnote statements are global statements,
so they can stand alone outside a step.
Additionally, notice that this footnote statement specifies line 3, but there are not footnote statements specifying lines 1 and 2.
So, in this report, what do you think will appear in footnote lines 1 and 2?
If you skip a footnote or title number, SAS leaves the skipped line blank.
In this example, notice that the title and footnote statements appear within the PROC PRINT step.
However, this program is identical in effect to the previous program.
Importantly, however, whether you specify titles and footnotes outside or inside a step,
they remain in effect until you change them, cancel them, or close SAS.
So take a look at this program.
Question: What will be the title of the contents report created in this PROC CONTENTS?
The report created by PROC CONTENTS will display the same titles and footnotes as the list report created by PROC PRINT.
But, what if you don’t want both reports to have the same titles and footnotes?
Well, to change a previously specified title or footnote,
you add a another title or footnote statement that has the same line number as the one you want to replace.
In this example, the PROC CONTENTS report now has new titles and a new footnote.
Redefining a title or footnote also cancels any higher numbered title or footnote lines respectively.
To illustrate this last point, let’s look at a slightly different example.
In this program, the PROC PRINT step has a title1 and title3 statement.
The PROC CONTENTS step has a title2 statement.
Here’s a question for you: Does the title3 statement display in the PROC CONTENTS report?
The title3 statement does not display in the PROC CONTENTS report.
The title1 statements display in both reports.
However, the title2 statement in the PROC CONTENTS step cancels any higher numbered titles,
such as the title specified in the title3 statement.
And finally, what if you want to cancel titles and footnotes entirely?
To cancel a title or footnote on a particular line, you specify a title or footnote statement with the same line number and no text.
This also cancels any titles or footnotes on higher numbered lines.
For example, the title and footnote statements in the PROC CONTENTS step shown here cancels all titles and footnotes.
Equivalently, you could also specify the null title and footnote statement shown in this example.
As a side note, it’s good practice to cancel all titles and footnotes at the end of your programs
so that no unexpected titles or footnotes appear on output that you generate later in your session.
Now that you know how to use titles and footnotes, you can use them in the reports you create in this class and beyond.
Doing so should help you stay organized and more efficiently use your time when interpreting SAS output.