HFZWRITE command

The HFZWRITE command is used to pass data records from a user exit to Z Abend Investigator. It can only be used in a Compiler Listing Read, Message and Abend Code Explanation, Formatting, or Notification user exit. The type of data that can be provided via the HFZWRITE command is subject to the type of the user exit from which it is used. For more information, see the general section about each of the user exit types.

Figure 1. Syntax

1 HFZWRITE ?var_name
where:
var_name
The name of a variable containing the data record.

If the HFZWRITE command is used without var_name, data records must be passed using the exit-specific data area as described for the relevant exit types.

Return codes

The HFZWRITE command provides the following return codes:
0
The record was written successfully.
2
Writing of records has been disabled due to previous errors.
4
The record was not written due to errors. An explanation of the error is written to the HFZTRACE DDname.
8
Command syntax error. An explanation of the error is written to the HFZTRACE DDname.

Example

Figure 2. HFZWRITE command example

/* REXX */
/* Pass records to Z Abend Investigator */

/* Method 1 - plain text */
"HFZWRITE 'This is record 1'"
if RC = 0 then say 'Method 1 success!'

/* Method 2 - using LST data area (Compiler Listing Read user exit) */
rec = 'This is record 2'
LST.DATA_LENGTH = length(rec)
LST.DATA_BUFFER = rec
"HFZWRITE"
if RC = 0 then say 'Method 2 success!'

/* Method 3 - letting REXX resolve data record variable */
rec = 'This is record 3'
"HFZWRITE '"rec"'"
if RC = 0 then say 'Method 3 success!'

/* Method 4 - letting Z Abend Investigator resolve data record variable */
rec = 'This is record 4'
"HFZWRITE rec"
if RC = 0 then say 'Method 4 success!'