The PRINT statement prints the fields specified in the statement. You can specify up to 40 fields and literals in a PRINT statement. However, the output print line cannot exceed 132 characters.

Column headings are derived from the default headings in the data definition tables. Use the DEFINE statement to revise headers. For more information, see DEFINE Statement.

You can use multiple PRINT statements to produce multiple print lines from single records in the input file. Each PRINT statement you use adds a print line for the specified data. However, the fields you choose in the first PRINT statement set the column headings on the report.

PRINT "Parms".

Parms:

[WIDE n]
{fldname | literal | BLANK n}
[fldname | literal | BLANK n] ...
[SPACED n]
[SKIP]
  • WIDE n
    Specifies the number of spaces between each field. The default is 1.
  • fldname
    Indicates the name of a printed field. You may specify up to 40 fields.
  • SPACED n
    Indicates the line spacing: 1 (single), 2 (double), or 3 (triple). The default is 1.
  • SKIP
    Specifies that a skip to a new page is made before printing the line represented by the PRINT statement.
  • literal
    Indicates that literal values are printed in place of a field. Literals must be enclosed in single quotes.
  • BLANK n
    Puts n blank spaces before the next field or literal on the report. The BLANK value is used for only one field. Spacing reverts to the WIDE value unless you specify another BLANK value for the next field.

Examples

  • This statement puts two spaces between each field on the report. The fields on the report are VOLSER, CRTDT, CTIME, EXPDT, and LJOB:

    PRINT WIDE 2 VOLSER CRTDT CTIME EXPDT LJOB.
    Print line:
    VOLSER  CRTDT   CTIME   EXPDT   LJOB    
    VMPK02  96290   10:04   99360   FRED    
  • This statement prints "*** IS A SCRATCH TAPE ***" next to the VOLSER value

    PRINT VOLSER '*** IS A SCRATCH TAPE ***'.
    Print line:
    VMPK02 *** IS A SCRATCH TAPE ***
    
  • This statement produces the print line below:

    PRINT WIDE 2 BLANK 3 'ABC' 'DEF' BLANK 5 'GHI'.
    Print line:
       ABC   DEF     GHI