Expected output for edit routines

The edit routines return different output depending on whether the input row is in the coded or decoded form.

Begin program-specific programming interface information.
If EDITCODE contains 0, the input row is in decoded form. Your routine must encode it.
  • In that case, the maximum length of the output area, in EDITOLTH, is 10 bytes more than the maximum length of the record. In counting the maximum length for a row in basic row format, "record" includes fields for the lengths of varying-length columns and for null indicators. In counting the maximum length for a row in reordered row format, "record" includes fields for the offsets to the varying length columns and for null indicators. The maximum length of the record does not include the 6-byte record header.
If EDITCODE contains 4, the input row is in coded form. Your routine must decode it.
  • In that case, EDITOLTH contains the maximum length of the record. In counting the maximum length for a row in basic row format, "record" includes fields for the lengths of varying length columns and for null indicators. In counting the maximum length for a row in reordered row format, "record" includes fields for the offsets to the varying-length columns and for null indicators. The maximum length of the record does not include the 6-byte record header.

In either case, put the result in the output area, pointed to by EDITOPTR, and put the length of your result in EDITOLTH. The length of your result must not be greater than the length of the output area, as given in EDITOLTH on invocation, and your routine must not modify storage beyond the end of the output area.

Required return code: Your routine must also leave a return code in EXPLRC1 with the following meanings:
Table 1. Required return code in EXPLRC1
Value Meaning
0 Function performed successfully.
Nonzero Function failed.
If the function fails, the routine might also leave a reason code in EXPLRC2. DB2® returns SQLCODE -652 (SQLSTATE '23506') to the application program and puts the reason code in field SQLERRD(6) of the SQL communication area (SQLCA).
End program-specific programming interface information.