Overview (PRINT EJECT command)
PRINT EJECT displays specified information at the top of a new page of the output.
Each time that it is executed, PRINT EJECT causes a page ejection. If not used in a DO IF-END IF structure, PRINT
EJECT is executed for each case in the data, and each
case is displayed on a separate page.
PRINT EJECT is
designed to be used with the PRINT command to insert titles and column headings above the values that
are displayed by PRINT. PRINT can also generate titles and headings,
but PRINT cannot be used to control
page ejections.
PRINT EJECT and PRINT can be used for writing simple reports.
Options
The options that
are available for PRINT EJECT are identical to the options that are available for PRINT:
- You can specify formats for the variables.
- You can specify string
values within the variable specifications. With
PRINT EJECT, the strings are usually used as titles or column headings and often include a specification for column location. - You can use the
RECORDSsubcommand to display each case on more than one line. - You can use the
OUTFILEsubcommand to direct the output to a specified file. - You can use the
TABLEsubcommand to display a table that summarizes variable formats. - You can use
ENCODINGto specify the file encoding. If there is noOUTFILEsubcommand, theENCODINGsubcommand is ignored.
For additional information,
refer to PRINT.
Basic Specification
The
basic specification is a slash followed by a variable list and/or
a list of string values that will be used as column headings or titles.
The values for each variable or string are displayed on the top line
of a new page in the output. PRINT EJECT is usually used within a DO IF-END IF structure to control the page ejections.
Operations
-
PRINT EJECTis a transformation and is not executed unless it is followed by a procedure or theEXECUTEcommand. - If
not used within a
DO IF-END IFstructure,PRINT EJECTis executed for each case in the data and displays the values for each case on a separate page. - Values are displayed with a blank space between them. However, if a format is specified for a variable, the blank space for that variable’s values is suppressed.
- Values are displayed in the output as the data are
read. The
PRINToutput appears before the output from the first procedure. - If
more variables are specified than can be displayed in 132 columns
or within the width that is specified on
SET WIDTH, the program displays an error message. You must reduce the number of variables or split the output into several records. - User-missing values are displayed exactly like valid values. System-missing values are represented by a period.