Skip to content

Input/Output Buffers

All COBOL-to-XML copybooks place a REQUEST-BUFFER and a RESULT-BUFFER data structure in your COBOL program’s working storage section. These data structures organize the COBOL variables of the copybook for I/O processing.

The REQUEST-BUFFER data structure formats your populated COBOL variables into a Serena XML Services request message. Included in REQUEST-BUFFER are control variables for the XML <header> data structure, content variables for the XML <request> data structure, and appropriate XML tags coded as literals in VALUE clauses. Your program passes the populated REQUEST-BUFFER to program SERXMLCC, the COBOL batch subroutine client for Serena XML Services.

The RESULT-BUFFER data structure contains a parsed XML reply message that is returned to your program by SERXMLCC. The RESULT-BUFFER contains up to four subordinate data structures.

This subordinate data structure is included in all reply messages.

STATUS-MESSAGES — Contains COBOL variables for return code, reason code, and message (i.e., the parsed contents of the Serena XML Services <response> tag). STATUS-MESSAGES is always present in a reply.

These three subordinate structures appear only if a Serena XML Services <result> is expected.

RESULT-TAGS — Contains Serena Services XML tag names and their internal lookup codes for all permitted subtags in the <result> type expected for a particular COBOL copybook. These are literals provided for XML reply processing, and they provide no information that you can use in your COBOL user program.

RESULT-COUNT — Control variable populated with the number of XML <result> data structures returned by Serena XML Services. RESULT-COUNT provides the maximum value of a table index for the RESULT-AREA data structure below. If XML Services returns no XML <result> data structure, then RESULT-COUNT is zero.

RESULT-AREA — An table of parsed XML <result> data structures. Each table row contains the populated COBOL content variables that correspond to the subtags in a single instance of an XML <result> data structure returned by Serena XML Services.

The subtags are not included in a RESULT-AREA table row. The number of populated table rows in RESULT-AREA is indicated in RESULT-COUNT.