Results: Print Procedure


Procedure Output

PROC PRINT always produces a printed report. You control the appearance of the report with statements and options. See Examples: PRINT Procedure on page 739 for a sampling of the types of reports that the procedure produces.

Page Layout

Observations

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 Figure 35.2 on page 736).

click to expand
Figure 35.2: 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 Figure 35.3 on page 737, 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.

click to expand
Figure 35.3: 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 Figure 35.4 on page 737, 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.

click to expand
Figure 35.4: 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= on page 726).

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, beginning with Version 7, compressed files are RADIX addressable. (The integrity of the data is not compromised; the procedure simply numbers the observations differently.)

Column Headings

By default, spacing dictates whether PROC PRINT prints column headings horizontally or vertically. Figure 35.2 on page 736, Figure 35.3 on page 737, and Figure 35.4 on page 737 all illustrate horizontal headings. Figure 35.5 on page 738 illustrates vertical headings.

click to expand
Figure 35.5: Using 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.

Column Width

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:

  • The linesize is 80.

  • IdNumber is a character variable with a length of 10. It is used as an ID variable.

  • State is a character variable with a length of 2. It is used as an ID variable.

  • Comment is a character variable with a length of 200.

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=.




Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net