PRT_VAR

Figure 1. Syntax

1 PRT_VAR(name,format,count)

Can be used in FASTREXX condition expressions.

Prints the specified variable in the format specified.

name
The name of the variable to be printed. This must be the name of an existing character variable.
format
Format in which the output record is to be printed. Valid values are: 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 variable (record) to be printed by using the record identification criteria if present, or by comparing its length with the record types in the template.
  • When using PRT_VAR with DSC or the Copy Utility (option 3.3) and you have specified both an input and an output copybook or template, then the copybook or template used to format the printed variable is the input template for any variable other than ZOUTREC. ZOUTREC is formatted with the output record.
  • Only those fields that have been selected in the template are printed.
count
FASTREXX only. The maximum number of times this function will be performed. The default is no limit.
Note: Avoid using PRT_VAR in a REXX procedure for:
  • DSP function
  • FCH function
  • Print Utility (option 3.2)

Output from PRT_VAR is interspersed with the normal output (from DSP, FCH, or Print) which can be confusing.

Using PRT_VAR 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

Print the first 5 records in hex format and print the remainder in tabular format.
PRT_VAR('ZINREC','HEX',5)
If recsin() > 5 then PRT_VAR('ZINREC','TABL')