Converting COBOL records to business objects

To convert a COBOL record to a business object, the binary host data handler loops through the attributes of the top-level business object definition. It obtains the name of the business object to create, then processes the attributes recursively, in the order in which attributes appear in the top-level business object and its children, assigning values from the binary record to the business object.

The steps the data handler takes to process the binary data into a business object are as follows:

  1. The data handler instantiates the business object specified, choosing the business object definition from the metadata library.
  2. It parses the metadata stored in the business object definition (name, type of data, length in bytes).
  3. The data handler extracts the stream of bytes based on the length and datatype information, extract the stream of bytes.

    Processing of data involves the additional transformations:

    Data Type Processing
    ASCII/EDBDIC As is
    Numeric (General) As is
    Packed Decimal Unpack the bytes
    DBCS Decode using Cp930
  4. It generates the binary stream of data with processed bytes.
  5. Finally, the data handler returns the binary stream back to the adapter.

Copyright IBM Corp. 1997, 2003