![]() Chapter Contents |
![]() Previous |
![]() Next |
| The PRINT Procedure |
| Procedure Output |
PROC PRINT always produces a printed report. You control the appearance of the report with statements and options. See Examples for a sampling of the types of reports that the procedure produces.
| Page Layout |
By default, PROC PRINT uses an identical layout for all observations on a page of output. First, it attempts to print observations on a single line (see Printing Observations on a Single Line).
Printing Observations on a Single Line
If PROC PRINT cannot fit all the variables on a single line, it splits the observations into two or more sections and prints the observation number or the ID variables at the beginning of each line. For example, in Splitting Observations into Multiple Sections on One Page, PROC PRINT prints the values for the first three variables in the first section of each page and the values for the second three variables in the second section of each page.
Splitting Observations into Multiple Sections on One Page
If PROC PRINT cannot fit all the variables on one page, the procedure prints subsequent pages with the same observations until it has printed all the variables. For example, in Splitting Observations across Multiple Pages, PROC PRINT uses the first two pages to print values for the first three observations and the second two pages to print values for the rest of the observations.
Splitting Observations across Multiple Pages
Note: You can alter the page layout with the ROWS= option in the PROC PRINT statement (see the discussion of
ROWS= ).
Note: PROC PRINT may produce slightly different output if the
data set is not RADIX addressable. Version 6 compressed files are not RADIX addressable, while Version 7 compressed files are RADIX addressable. (The integrity of the data is not compromised; the
procedure simply numbers the observations differently.)
By default, spacing dictates whether PROC PRINT prints column headings horizontally or vertically. Printing Observations on a Single Line, Splitting Observations into Multiple Sections on One Page, and Splitting Observations across Multiple Pages all illustrate horizontal headings. Using Vertical Headings illustrates vertical headings.
Note: If you use LABEL and at least one variable has a label, PROC PRINT prints all column headings horizontally unless you specify
HEADING=VERTICAL.
By default, PROC PRINT uses a variable's formatted width as the column width. (The WIDTH= option overrides this default behavior.) If the variable does not have a format that explicitly specifies a field width, PROC PRINT uses the widest data value for that variable on that page as the column width.
If the formatted value of a character variable or the data width of an unformatted character variable exceeds the linesize minus the length of all the ID variables, PROC PRINT may truncate the value. Consider the following situation:
When PROC PRINT prints these three variables on a line, it uses 14 print positions for the two ID variables and the space after each one. This leaves 80-14, or 66, print positions for COMMENT. Longer values of COMMENT are truncated.
WIDTH= controls the column width.
Note: Column width is
affected not only by variable width but also by the length of column headings. Long column headings may lessen the usefulness of
WIDTH=.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.