IDIWRITE command

The IDIWRITE command is used to pass data records from a user exit to Fault Analyzer. 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 IDIWRITE 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 IDIWRITE ?var_name
where:
var_name
The name of a variable containing the data record.

If the IDIWRITE 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 IDIWRITE 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 IDITRACE DDname.
8
Command syntax error. An explanation of the error is written to the IDITRACE DDname.

Example

Figure 2. IDIWRITE command example

/* REXX */
/* Pass records to Fault Analyzer */

/* Method 1 - plain text */
"IDIWRITE '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
"IDIWRITE"
if RC = 0 then say 'Method 2 success!'

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

/* Method 4 - letting Fault Analyzer resolve data record variable */
rec = 'This is record 4'
"IDIWRITE rec"
if RC = 0 then say 'Method 4 success!'