allowmissing (default no)

For the situation where the document does not have sufficient items for the subfields of an RPG data structure, you can use the allowmissing option to indicate whether this is considered an error. Data is considered to be missing in the following circumstances:
  • For an item matching an RPG data structure (including a data structure subfield), if the item in the document does not have child items for all RPG subfields.
  • For data matching an array subfield of an RPG data structure, if the number of items in the document is less than the dimension of the RPG subfield array.

If expected data is not found, and 'allowmissing=yes' is not specified, the operation will fail with status 00353 (XML does not match the RPG variable) or status 00356 (The document for DATA-INTO does not match the RPG variable).

Tip: The countprefix option can also be used to handle the situation where the document might not have sufficient data for every subfield in the data structure.

To allow fewer array elements for the array specified on the XML-INTO or DATA-INTO operation, it is not necessary to specify 'allowmissing=yes'. If the document contains fewer elements than the RPG array, the operation will not fail. The "Number of Elements" subfield in positions 372 - 379 of the PSDS can be used to determine the number of elements successfully set by the operation.

  • no indicates that data must be present for every subfield of a data structure (including subfields of data structure subfields), and data must be present for every element of every subfield array.
  • yes indicates that when data is not present for every subfield and subfield array element, the operation will not fail. If a variable is specified as the first operand of XML-INTO or DATA-INTO, the unset subfields will hold the same value they held before the operation. If %HANDLER is specified as the first operand of XML-INTO or DATA-INTO, the unset subfields of the array passed to the handling procedure will have the default value for the type (zero for numeric values, *LOVAL for date values and so on).