Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
eLink Information Integrator Doc Home | eLink Information Integrator User Guide | Previous Topic | Next Topic | Contents | Index

eLink Information Integrator COBOL Copybook Importer

This section provides an overview of eLink Information Integrator COBOL Copybook Importer (hereafter referred to as eLink II CCBI). The following topics are discussed:

- BEA eLink II CCBI Overview

- Using eLink II CCBI

- Importing the Converted File

- Supported COBOL Data Types

BEA eLink II CCBI Overview

The eLink II CCBI is a command-line utility that you can use to parse COBOL copybook files to Extensible Markup Language (XML) files. Used in conjunction with the BEA eLink Information Integrator, eLink II CCBI enables you to perform data translation and integrate the result into your eLink application development project.

The process includes two steps. The first step is to convert the COBOL copybook into a Message Formatting Language (MFL) document. (This is a type of XML document.) The second step is to load the XML document into the eLink Information Integrator database.

The following definitions give you a basic understanding of the components with which you will be working:

ccbparse

  This is the eLink II CCBI parsing command that transforms the COBOL copybook input into an XML document. Endian order, data type, and data size are handled by command line options. The ccbparse command has the following format:

  ccbparse [options] inFileName [options] [outFileName] [options]

  where:

  ccbparse

    Is the parsing command.

  [options]

    Define integer order, data type, and data size. The options can be entered anywhere on the command line and have the following values:

    BigEndian specifies that the highest order bit is stored first (default).

    LittleEndian specifies that the lowest order bit is stored first.

    EBCDIC specifies that the host data type is EBCDIC (default).

    ASCII specifies that the host data type is ASCII (default).

  inFileName

    Is the name of the input COBOL copybook file (required).

  outFileName

    Is the name of the output XML file (default is stdout).

Message Formatting Language (MFL)

  This is a specific type of XML format containing instruction that can be used by eLink Information Integrator for converting data. These MFL documents can be imported into eLink Information Integrator using the MsgDefAdmin utility. The eLink II CCBI generates MFL documents from COBOL copybooks, thus eliminating the need to manually design the data conversion formats with the eLink Information Integrator GUI.

MsgDefAdmin

  This is a utility that loads an MFL file into the eLink Information Integrator database.

Using eLink II CCBI

The following steps demonstrate how to use eLink II CCBI. The Java runtime environment must be available and you must know the location of the installed Information Integrator files.

1. Change to your <installation directory>\bin directory.

2. Set a path to your Java runtime environment, for example:

   set path = jdk1.2.2\bin:%path%

3. Convert the COBOL copybook file. For example, to convert the copybook named cobol2 from an EBCDIC host with BigEndian order into an MFL file named star, enter the following:

   ccbparse cobol2 star

4. Import the converted file into the eLink Information Integrator database. Refer to Importing the Converted File for more information.

Importing the Converted File

The following steps import a converted MFL file into the eLink Information Integrator database. The eLink Information Integrator must be running and the imported file must be available in the local directory structure. It may be necessary to transfer the imported file from the directory where it was created in the previous procedure. Refer to the BEA eLink Information Integrator User Guide and the BEA eLink Information Integrator Installation and Administration Guide for details about installing and using that product.

1. Open a DOS command-prompt window.

2. Change to the directory where the eLink Information Integrator MsgDefAdmin utility is installed (for example, C:\BEAII). Type MsgDefAdmin and press Enter. The MsgDefAdmin importer utility appears as shown in Listing 7-33.

   Listing 7-33 Listing 3-2 MsgDefAdmin

   >        - Copyright (c) 2000 BEA Systems, Inc.
   >        All Rights Reserved.
   >        Distributed under license by BEA Systems, Inc.
   >        BEA eLink Information Integrator is a registered trademark.
   >        This product includes software developed by the Apache Software Foundation (http://www.apache.org/).
   >        - - - BEA eLink Information Integrator 1.0 - - -
   >        - - - Message Definition Importer Tool - - -
   >        Enter choice:
   >        1) Add Message Definition
   >        2) Get Message Definition
   >        3) Delete Message Definition
   >        4) List Message Definitions
   >        Q) Quit >

3. Type 1 to select Add Message Definition and press Enter. An additional prompt displays asking you to specify the name of the file containing the MFL message definition.

4. Type the name of the message file you created in the previous procedure and press Enter. MsgDefAdmin processes the file, stores the message definition in the iiDatabase, and returns a message that the definition was successfully created.

5. Type Q at the prompt and press Enter to quit MsgDefAdmin.

6. Use the imported MFL file in your application program as needed.

Supported COBOL Data Types

The COBOL Copybook Importer does not recognize all extensions to standard (ANSI) COBOL and data type size information. As a result, Copybooks that make use of non-supported extensions may not get translated correctly.

In addition, Information Integrator does not support 8 byte integer or floating point data types, and the MFL parser identifies some date fields as character. For this reason, the MFL parser includes both the original copybook entry and the results of the XML parsing in the source element for each field. You can use this information to guide you in editing the MFL data to better represent the original Copybook.

For example, if your original copybook entry appears as follows:

>     05  birth-date          pic xx/xx/xx.

The XML translation appears as follows:

>     <field name="birth-date"
>     type="alphanum"
>     length="8"
>     picture="xx/xx/bx" align="n"/>

The MFL translation appears as follows:

>     <FieldFormat name='birth-date'  type='EBCDIC' length='8'
>     source='pic   xx/xx/xx.(alphanum)'/>

If you review the source element in the MFL document, you will find that the appropriate Information Integrator data type is either Smmddyy or Sddmmyy. You can decide which data type is most appropriate for the specific data.

Table F-1 lists the COBOL data types supported by the parser. Unsupported data types cause an error in the parser. All errors encountered by the parser are noted with a message that includes the line numbers in question. Since the parser generates an empty MFL document on any error, the lines containing unsupported types should either be commented out or deleted prior to running the parser.

####

Table F-1 COBOL Data Types

COBOL Type | Support
--- | ---
COMP, COMP-4, BINARY (integer) | supported
COMP, COMP-4, BINARY (fixed) | supported
COMP-3, PACKED-DECIMAL | supported
COMP-5, COMP-X | supported (note 1)
DISPLAY numeric (zoned) | supported
BLANK WHEN ZERO (zoned) | supported
SIGN IS LEADING (zoned) | supported
SIGN IS LEADING SEPARATE (zoned) | supported
SIGN IS TRAILING (zoned) | supported
SIGN IS TRAILING SEPARATE (zoned) | supported
edited numeric | supported
COMP-1, COMP-2 (float) | supported
edited float numeric | supported
DISPLAY (alphanumeric) | supported
edited alphanumeric | supported
INDEX | supported
POINTER | supported
PROCEDURE-POINTER | supported
JUSTIFIED RIGHT | ignored
SYNCHRONIZED | ignored
REDEFINES | supported
66 RENAMES | not supported
66 RENAMES THRU | not supported
77 level | supported
88 level (condition) | ignored
group record | supported
OCCURS (fixed array) | supported
OCCURS DEPENDING (variable-length) | supported
OCCURS INDEXED BY | ignored
OCCURS KEY IS | ignored

Support for the following data types is limited. The following formats will be converted to an unsigned 4 byte integer type:

>     05 pic 9(5) comp-5

>     05 pic 9(5) comp-x

The following formats will generate errors:

>     05 pic X(5) comp-5

>     05 pic X(5) comp-x

In these samples, pic 9(5) could be substituted for pic x(5).

Note: Some unsupported types can be changed to a supported type with little loss of accuracy. In the formats shown above, you could change a pic X() statement to pic 9() statement.

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.