6.6 - Output Appearance

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;

Our BASIC Data Set

Obs

subj

name

clinic

gender

no_vis

type_vis

expense

1

1024

Alice Smith

LEWN

1

7

101

1001.98

2

1167

Maryann White

LEWN

1

2

101

2999.34

3

1168

Thomas Jones

ALTO

2

10

190

3904.89

4

1201

Benedictine Arnold

ALTO

2

1

190

1450.23

5

1302

Felicia Ho

MNMC

1

7

190

1209.94

6

1471

John Smith

MNMC

2

6

187

1763.09

7

1980

Jane Smiley

MNMC

1

5

190

3567.00

Clinic ALTO = altoona, LEWN = Lewistown, MNMC = Mount Nittany

Type_vis: 101 = Gynecology, 190 = Physical Therapy, 187 = Cardiology

Gender: 1 = female, 2 = male

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 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 lines. 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 printout 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;

Our BASIC Data Set

subj

name

clinic

no_vis

type_vis

expense

1024

Alice Smith

LEWN

7

101

1001.98

1167

Maryann White

LEWN

2

101

2999.34

1168

Thomas Jones

ALTO

10

190

3904.89

1201

Benedictine Arnold

ALTO

1

190

1450.23

1302

Felicia Ho

MNMC

7

190

1209.94

1471

John Smith

MNMC

6

187

1763.09

1980

Jane Smiley

MNMC

5

190

3567.00

Launch and run  the SAS program, and review the resulting output to convince yourself that the output is double-spaced as described.