Rational Developer for System z

Initializing data items in the COBOL application's input data structure

This topic describes two initialization options that are available when you generate a Web service in a single-service project using both the bottom-up method and compiled XML conversion.

When you enable either of these two initialization options, VALUE clauses in the request language structure that you specified for the new Web service are given effect by initialization code that is executed before the new Web service invokes the existing COBOL application (service provider application or service requester application).

One of these options enables initialization for data items in the request language structure that you have included in the Web service input data structure. The other option enables initialization for data items in the request language structure that you have excluded from the Web service input data structure.

This option is available both in the Create New Service Interface (bottom-up) wizard (see Setting preferences for COBOL XML converters) and in the command-line batch processor (see the properties INIT_EMPTY_ITEMS_IN_INTERFACE and INIT_OMITTED_ITEMS_IN_INTERFACE in CodegenProperty).

This option is available only when you use the compiled conversion option.

Description

The COBOL request language structure that you specify for the new Web service may contain VALUE clauses that define the initial values for data items in the request language structure (for more information about the request language structure see Language structures page for the wizard interface and InputMessage for the batch processor command-line interface).

However, in the source code that is generated for the new Web service, these VALUE clauses are not included in the LINKAGE section that defines the input data structure that the new Web service passes to the existing COBOL data application (service provider application or service requester application). The reason is that the COBOL compiler ignores VALUE clauses in a LINKAGE section.

Therefore, to allow you to give effect to these unincluded VALUE clauses if you wish to do so, the two options described in this help topic cause the Enterprise Service Tools source code generator to add initialization source code to the new Web service driver. This initialization source code initializes data items in the input data structure that is passed to the existing COBOL application with the same initial values that would have existed if the VALUE clauses had been processed.

Note: This option requires that the VALUE literal be defined on one line (no continuation lines).

For information about how to specify these options see the relevant section of the online help either for the Create New Service Interface (bottom-up) wizard (Setting preferences for COBOL XML converters) or for the command-line batch processor (CodegenProperty).

The difference between the two options is as follows:
  • The INIT_EMPTY_ITEMS_IN_INTERFACE option enables initialization for data items in the request language structure that you have included in the Web service input data structure.
    • Even when this option is enabled, it does not affect a particular COBOL data item unless the corresponding XML element in the request XML schema definition is empty.
      • An element is empty if contains no information other than the name of the data item. Examples of empty elements:
        <element name="userName"></element>
        <element name="Department"/>
      • For example:
        • Suppose the following:
          • In the original COBOL data structure the data item Department is initialized to 044 by means of a VALUE clause.
          • The option INIT_EMPTY_ITEMS_IN_INTERFACE is enabled.
          • A request is received in which the XML element corresponding to the COBOL data item Department is empty.
        • The result is that Enterprise Service Tools initializes the corresponding data item (Department) in the input data structure that is passed to the existing COBOL application to the same value (044) that would have existed if the VALUE clause had been processed.
    • Otherwise (that is, if the option is not enabled, or if the option is enabled but the XML element in the request XML schema definition is not empty) if the XML element does not specify a value for the data item, then Enterprise Service Tools sets the corresponding data item in the input data structure that is passed to the existing COBOL application to:
      • Blanks if the data item is alphabetic or alphanumeric.
      • 0 if the data item is a numeric data item.

  • The INIT_OMITTED_ITEMS_IN_INTERFACE option enables initialization for data items in the request language structure that you have excluded from the Web service input data structure.
    Note: If an excluded data item is not initialized using this option, then its contents are undefined.

For more information about included and excluded data items see Language structures page for the wizard interface or InputMessage for the batch processor command-line interface.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)