So far, we've focused on how to alter the content and structure of our PRINT procedure's output. Now, we'll focus a bit on how to "prettify" our output using TITLE and FOOTNOTE statements and the DOUBLE option.
Example 6.16 Section
The following PRINT procedure merely prints our basic data set, but this time with helpful TITLE and FOOTNOTE statements:
OPTIONS LS = 72 PS = 20 NODATE NONUMBER; PROC PRINT data = basic; title 'Our BASIC Data Set'; footnote1 'Clinic: ALTO = altoona, LEWN = Lewistown, MNMC = Mount Nittany'; footnote3 'Type_vis: 101 = Gynecology, 190 = Physical Therapy, 187 = Cardiology'; footnote5 'Gender: 1 = female, 2 = male'; RUN; footnote;
The TITLE and FOOTNOTE statements contained within the PRINT procedure are fairly self-explanatory. In general, though, the TITLE and FOOTNOTE statements can appear anywhere in your code, as they are global statements. As such, they each work as a "toggle" statement: once you specify a title and footnote, they are used for all of the subsequent output your program generates until you define another title and footnote or cancel them with empty TITLE and FOOTNOTE statements. The last footnote statement in the above code is an empty footnote statement that just "turns off" the previously specified footnotes.
You can have up to ten titles and ten footnotes appearing in a single SAS program, each denoted by a number: title1, title2, ..., title10 and footnote1, footnote2, ..., footnote10. The number tells SAS on which often lines you'd like the title or footnote printed. The footnotes in the above program tell SAS to print the footnotes on the first, third, and fifth footnote line. That's why there is a blank line between each of the footnotes.
Launch and run the SAS program, and review the resulting output to convince yourself that the title and footnotes are displayed as described. Note too that titles and footnotes are centered by default.
To make sure you understand the global nature of the TITLE and FOOTNOTE statements, you might want to try submitting another simple PRINT procedure:
PROC PRINT; RUN;
to see what happens. In the output window, you should see another print-out of the basic data set having no footnotes but having the same title as the previous output.
Example 6.17 Section
If you want to make your output more readable by double-spacing it, you can use the PRINT procedure's DOUBLE option. The following SAS program prints six variables in the basic data set using double-spacing:
OPTIONS PS = 58 LS = 72; PROC PRINT data = basic NOOBS DOUBLE; title 'Our BASIC Data Set'; var subj name clinic no_vis type_vis expense; RUN;
Launch and run the SAS program, and review the resulting output to convince yourself that the output is double-spaced as described.