Handling Variable Arrays in WSDL and JSON - CICS COBOL

When a WSDL file or JSON schema has variable-sized (commonly unbounded) arrays, the size of the interface structures in the generated service or client might be large and could exceed allowable compiler limits, especially when such arrays are nested. The solution is to configure array handling to dynamically allocate these variable-sized arrays at run time. For CICS Web service generation, when a variable array has been specified for dynamic allocation, the generated enclosing interface structure does not contain the variable array, but instead uses a COBOL string to identify the name of a separate CICS container where the variable array is stored. A numeric field located immediately before the COBOL string indicates the size of the array. The Inline-Array-Size-Limit field on the Generate Web Service dialog box enables you to specify a numerical value, from 0 (zero) to 32767 inclusive, that specifies the minimum size at which a variable array is generated in a CICS container for dynamic allocation. For example, if your generated service or client program with copybooks becomes impractically large or uncompilable when generated with the default Inline-Array-Size-Limit of 0, meaning no arrays are dynamically allocated, then try generating with Inline-Array-Size-Limit set to 1 or 2. See the Generate Web Service dialog box for additional details.

Note: The imtkmake command's inlineoccurslimit parameter is the command-line equivalent of the Inline-Array-Size-Limit field on the Generate Web Service dialog box. See the imtkmake command topic for details.

Examples

WSDL
<element name="in_0_5" minOccurs="1" maxOccurs="5">
   <simpleType>
      <restriction base="string">
         <length value="8"/>
      </restriction>
   </simpleType>
</element>
JSON
{
   "in_0_5":
   {
      "type": "array",
      "maxItems": 5,
      "minItems": 1,
      "items":
      {
         "type": "string",
         "maxLength": 8
      }
   }
}
Generated data structures
Default generation:
All array structures are generated into the main structure.
05 in-0-5-occurs   pic 9(9) comp-5.
05 in-0-5          pic x(8) occurs 1 to 5
                   count in in-0-5-occurs
                   of op1
                   of op1-input-parms.
Dynamic allocation generation:
Structures for the array size and a COBOL string that identifies a container are generated into the main structure:
05 in-0-5-occurs   pic 9(9) comp-5.
05 in-0-5-cont0001 pic x(16).

The array is generated into a separate group structure:

01 cont0001-in-0-5.
  03 in-0-5        pic x(8) occurs 1.