Previous Topic: INREC FormatNext Topic: Usage


OUTREC Format

The format is identical for RHDCUF00 and RHDCMT00.

Field

Length

Type

return-area-length:*

Length of the returned-text-area allocated by the calling program at the end of OUTREC. The calling program must specify this value. If return-area-length and output-code are set to zero, all DCMT/DCUF text output is discarded. DCMT VARY and DCUF SET commands are still performed.

4 bytes

Binary

return-code:**

  • 0—Request accepted and processed
  • 4—Invalid syntax
  • 8—Invalid request (for example, SHUTDOWN, ABORT)
  • 12—Security violation
  • 16—Processing error
  • 20—The output-code is 0 or 2 and the return-area-length is less than output-length. All complete lines whose total length (including a one-byte line-length indicator for each line) is less than or equal to return-area-length are stored in returned-text-area. The value of output-code determines how any remaining output lines are handled. If output-code = 0, the lines are discarded. If output-code = 2, the lines are written to scratch.

2 bytes

Binary

output-code:*

Halfword code indicating DCMT output target as follows:

  • 0—The returned-text-area at the end of OUTREC.
  • 1—The scratch area with a scratch ID of "DCMT" or "DCUF" depending on the called program. Each line is written as a separate scratch record.
  • 2—Any complete lines of output whose total length (including a one-byte line-length indicator per line) is less than or equal to return-area-length are written to returned-text-area. Remaining output is written to the scratch area with a scratch ID of "DCMT."

2 bytes

Binary

output-length:**

Total length required for DCMT/DCUF output. It includes the total length all text lines plus one byte (line-length indicator) for each line.
Note: Each line-length indicator byte is counted as part of the output-length regardless of whether the record is written to the returned-text-area, written to scratch, or discarded.

The line-length indicator byte is inserted before each text line written to the returned-text-area. The line-length indicator is not written into scratch records. Using the #GETSCR or GET SCRATCH command with the appropriate parameters, you can determine the length of a individual scratch record.

4 bytes

Binary

returned-output-length:**

Total length of text lines inserted into the returned-text-area. The length includes a one-byte line-length indicator for each text line.

4 bytes

Binary

returned-text-area:**

Area where the DCMT/DCUF is to return text output. Each text line is preceded by a one-byte field which contains the length of the text line (excluding the line-length indicator) as a hexadecimal value. Only lines whose total length is less than return-area-length are written into the returned-text-area. Other lines are discarded or written to the scratch area depending on the value of output-code.

DCMT/DCUF prefills this field with blanks up to the lesser value of the length specified in return-area-length or 256 bytes. If return-area-length is greater than 256 bytes, and returned-output-length is less than return-area-length any remaining storage in returned-text-area is not updated and remains as it was when RHDCMT00/RHDCUF00 was called.

Note: To avoid storage overlays, the number of bytes allocated for the returned-text-area must be greater than or equal to the value assigned to return-area-length.

Variable

Character

 

Notes:

*—Information supplied by the calling program.

**—Information supplied by RHDCMT00/RHDCUF00.