PRINT

Figure 1. Syntax

1 PRINT(record,format)

Prints the record string in the specified format. The print output destination depends on how the procedure is invoked:

From an online panel:
The print output destination is determined by the value of the PRINTOUT field on the Set Print Processing Options panel.
From a batch job:
By default, report output is written to SYSPRINT. Sections of the output can be directed instead to the following ddnames:
FMNROPT
File Manager active options
FMNRPRM
$$FILEM command parameters and return codes
FMNRPRC
REXX procedure statements read from SYSIN
FMNREPT
Command reports and return codes
FMNRSUM
TALLY summary report

If FMNPRINT is present in the JCL it is used instead of SYSPRINT.

From a REXX program:
The print output destination is determined by the PRINTOUT parameter of the SET function.
Returns
0
Function was successful.
4
Function was unsuccessful and the record is not printed because either:
  • A format of SNGL or TABL was specified and File Manager cannot determine the record type.
  • A template has been specified and the record did not pass the selection criteria.
12
Function was unsuccessful and the record is not printed because either:
  • You did not provide parameters.
  • A format of SNGL or TABL was specified, but no template or copybook was provided
record
Any string or variable representing a string can be used, however, INREC or OUTREC are most commonly used in this function.
format
Can be CHAR, HEX, SNGL or TABL. If you specify TABL or SNGL format:
  • On the function or panel that you are enhancing, you must specify a copybook or template that describes the record type to be printed.
  • File Manager determines the type of the record to be printed by comparing its length with the record types in the template, and also by using any record identification criteria in the template.
  • If you are using PRINT with DSC or the Copy Utility (option 3.3) and you have specified both an input and an output copybook or template, the copybook or template used to format the printed record is determined as follows: if the value of the record to be printed matches the input record (INREC variable), the input copybook or template is used; otherwise, the output copybook or template is used.

    Ensure that the record value matches the template that File Manager uses to print the data set.

  • Only those fields that have been selected in the template are printed.
  • If the record has been reformatted by template processing, the variable INREC contains the input record value and OUTREC contains the reformatted output record.
Note: Avoid using PRINT in a REXX procedure for a:
  • DSP function
  • FCH function
  • Print Utility (option 3.2)
because output from PRINT is interspersed with their normal output, which can be confusing. Using PRINT in a REXX procedure that runs from the Find/Change Utility panel (option 3.6), does not result in this problem, because the report produced by the panel is sent to a data set, separate from print output.

Example 1

Print the first hundred records.
If PRTCOUNT() < 100 Then PRINT(inrec,'CHAR')

Example 2

Print the current input record in TABL format.
rc = PRINT(inrec,'TABL')