%DATA and %XML options for DATA-GEN, DATA-INTO, and XML-INTO

Several options are available for customizing the DATA-GEN, DATA-INTO, and XML-INTO operations. The options are specified as the second parameter of the %DATA or %XML built-in function. The parameter can be a constant or a variable expression. The options are specified in the form 'opt1=val1 opt2=val2'.

See %XML (xmlDocument {:options}) and %DATA (document {:options}) for more information on how to specify the options.

  • The allow extra option specifies how the RPG runtime should handle the situation when the document has additional information that is not needed to set the RPG variable.

    This option is used for DATA-INTO and XML-INTO.

  • The allow missing option specifies how the RPG runtime should handle the situation when the document does not have enough information to provide data for all the RPG subfields of a data structure.

    This option is used for DATA-INTO and XML-INTO.

  • The case option specifies the way that DATA-INTO or XML-INTO should interpret the element and attribute names in the document when searching for names that match the the RPG field names and the names in the path option.

    This option is used for DATA-INTO and XML-INTO.

  • The ccsid option specifies the CCSID to be used to parse the document document.

    This option is used for DATA-INTO and XML-INTO.

  • The count prefix option specifies the prefix for the names of the additional subfields that receive the number of RPG array elements set by the DATA-INTO or XML-INTO operation. It specifes the prefix for the names of the additional subfields that indicate the number of RPG array elements that are generated by the DATA-GEN operation.

    This option is used for DATA-GEN, DATA-INTO, and XML-INTO.

  • The data subfield option specifies the name of the extra subfield used to handle the situation where there is text data for an RPG data structure. (Normally, the data for a data structure is only provided for the subfields of a data structure.)

    This option is used for DATA-INTO and XML-INTO.

  • The doc option specifies whether the first parameter of the %DATA or %XML built-in function refers to the contents of a document or has the name of a file containing the contents of the document.

    This option is used for DATA-GEN, DATA-INTO, and XML-INTO.

  • The output option specifies the CCSID to be used if the output file for the DATA-GEN operation does not exist.

    This option is used for DATA-GEN.

  • The namee option specifies option specifies the name to be used for the top-level of the generated document.

    This option is used for DATA-GEN.

  • The output option specifies whether the output variable or file should be cleared before data is generated, or new data should be appended to the existing data.

    This option is used for DATA-GEN.

  • The namespace option controls how XML-INTO handles XML names with a namespace when it is matching XML names to the names in the path option or the subfield names of a data structure.

    This option is used for XML-INTO.

  • The namespace prefix option allows your RPG program to find out the values of the namespaces that were removed from the XML names when the namespace option was used to remove the namespace from the names.

    This option is used for XML-INTO.

  • The path option specifies where to locate the desired element within the document.

    This option is used for DATA-INTO and XML-INTO.

  • The count prefix option specifies the prefix for the names of the additional subfields that specify the name to be generated for a subfield instead of the name of the subfield itself.

    This option is used for DATA-GEN.

  • The trim option specifies whether you want blanks, tabs and line-end characters to be trimmed from the data before it is assigned to your RPG variables for the DATA-INTO or XML-INTO operation. It specifies whether you want blanks to be trimmed from the data before it is passed to the generator for the DATA-GEN operation.

    This option is used for DATA-GEN, DATA-INTO, and XML-INTO.