Import COBOL copybooks into IBM InfoSphere Data Architect

Bringing legacy data into enterprise modernization initiatives

Many organizations keep important data in mainframe data stores, such as sequential and VSAM files. This data format is often defined using data structures of a traditional programming language such as COBOL. For your enterprise modernization initiatives to be successful, it is crucial that your overall data design and integration process includes "legacy" data stored in these COBOL data structures along with information captured in more modern systems. To help towards this goal, InfoSphere™ Data Architect provides a COBOL import capability that enables you to include COBOL copybooks and source files in your data modeling efforts. This article shows you how to use InfoSphere Data Architect 7.5.2.1 to import COBOL data files into a relational data store and leverage key modeling capabilities that help you understand your existing data. The article also shows you how to create a relational database to store the content of the legacy data.

Share:

Quy On (quyon@us.ibm.com), Software Developer, IBM

photo of Quy OnQuy has been involved in database tools development for almost 10 years. His experience includes stored procedure builder and Java debugger for DB2, as well as the Integrated Query Editor for editing SQL and XQuery statements. Currently, he is working on InfoSphere Data Architect, a data modeling and integration design tool. His hobbies include traveling, tennis, and fishing.



Seeling Cheung (cheungs@us.ibm.com), Enablement Architect, IBM

Seeling Cheung photoSeeling Cheung is an enablement architect from the IBM Integrated Data Management team at IBM Silicon Valley Lab in San Jose, CA. She spends much of her time with customers and business partners helping them build solutions around the numerous integrated data management products. Previously, Seeling held other advanced technical positions, including development responsibilities for the federation technology and the pureXML capabilities on the Distributed DB2 database team. She joined IBM after finishing her Masters degree in Computer Sciences and working a couple years at Oracle.



04 February 2010

Introduction

Many organizations keep important data in mainframe data stores, such as sequential and VSAM files. This data format is often defined using data structures of a traditional programming language such as COBOL. For your enterprise modernization initiatives to be successful, it is crucial that your overall data design and integration process includes "legacy" data stored in these COBOL data structures along with information captured in more modern systems.

InfoSphere Data Architect 7.5.2.1 is a collaborative data design solution. It provides a COBOL import capability that enables you to include COBOL copybooks and source files in your data modeling efforts. This article shows you how to import COBOL data files into InfoSphere Data Architect, and how to leverage key modeling capabilities such as visualization using data diagrams and transformation of the logical data model to a number of physical data models based on deployment environments. These capabilities can be useful for understanding the existing data, or for creating a relational data store to hold the content of the data.

Create a data design project

The Eclipse workbench stores files in folders called projects. So before you can create or import any files, you must create a project to contain them.

To create a data design project with InfoSphere Data Architect, follow these steps:

  1. From the main menu, select File > New > Data Design Project. This opens the New Data Design Project wizard.
  2. In the Project Name field, enter a name your project. For example, Copybook.
  3. Click Finish.

    The Data Project Explorer displays the new data project and its initial set of folders. As shown in Figure 1, this includes folders for Mappings, XML Schemas, Data Diagrams, Data Models, and SQL Scripts.

    Figure 1. Data Project Explorer view
    Data Project Explorer view shows Copybook project with folders for Mappings, xml schemas, data diagrams, data models, sql scripts, and other files

Your environment is now prepared for importing a COBOL copybook into this data project.


Set workbench preferences

Before actually importing a COBOL copybook or source file, you should verify that your InfoSphere Data Architect settings are correct for your environment. For example, you may need to change the platform information or select the appropriate code page.

To review or modify these setting, follow these steps:

  1. Select Window > Preferences.
  2. Expand the Importer item in the navigation tree and select COBOL.
  3. Modify the preference settings to match your environment.

    In Figure 2, the target platform has been specified as Windows 32 and the desired code page and other related options are selected.

    Figure 2. COBOL import preference settings
    The options on this screen include platform, code page selection, floating point format, Endian, External decimal sign, and COBOL options such as quote, truncation, and national symbol.
  4. If you make any changes, click OK to save them.

Import a copybook

In this section you learn how to ensure you have the right input files or copybooks, and how to launch the COBOL Import wizard. Follow these steps:

  1. The COBOL import capability supports both copybooks and source files. Prepare the import files by making sure they have the correct extensions:
    • Make sure your COBOL copybooks have an extension of .cpy.
    • Make sure your COBOL source files have an extension of either .cbl or .ccp.
  2. Select File > Import > Data to launch the Import wizard.
  3. From the displayed list of import filters, expand the Data folder and select COBOL Model Import Wizard, as shown in Figure 3.
    Figure 3. Import selection dialog
    Import selection dialog with the COBOL Model Import Wizard item under Data selected.
  4. Click Next.
  5. On the Cobol Source and Target Model screen, enter appropriate values in the fields:
    • Source file — the complete path to the source file, which can be either a COBOL copybook or COBOL source file. You can use the Browse... button to search for the file.
    • Target project — the name of the project in the current workspace where you want to see the resulting logical data model. This field also has a Browse... button associated with it.
    • File name — the name of the resulting logical data model.

    For example, the values shown in Figure 4, would create a logical model named Copybook import model in a project named /Copybook.

    Figure 4. Specify the input Copybook and the name of resulting logical data model
    Screenshot of the Cobol Source and Target Model screen with values provided in the fields as described above.
  6. Click Next.
  7. On the next screen, click Finish to complete the import process.

Look at the results

Listing 1 shows a simple COBOL copybook named coboltest.cpy.

Listing 1. A copybook
        000100 01 PERSON-CREATION-REQUEST.
000200 05 PERSON-NAME-PART.
000300 10 PERSON-SALUTATION PIC X(10).
000400 10 PERSON-FIRST-NAME PIC X(20).
000500 10 PERSON-LAST-NAME PIC X(20).
000600 05 PERSON-DATE-OF-BIRTH PIC 9(08).
000700 05 PERSON-PHONE.
000800 10 PERSON-PHONE-AREA PIC X(08).
000900 10 PERSON-PHONE-NO PIC X(10).
001000 05 PERSON-ID-TYPE PIC X(06).
001100 05 PERSON-ID-DESCRIPT PIC X(25).
001200 05 PERSON-ID-VALUE PIC X(25).

Figure 5 shows the Data Project Explorer view of the logical data model named Copybook import model.ldm that results from the import of the coboltest.cpy copybook. The view is expanded to show several of the entities, attributes, and relationships of the logical data model.

Figure 5. Resulting logical data model
Screenshot of Data Project Explorer showing the logical data model created by the import of the coboltest.cpy copybook.

Work with the data diagram

Now that you have used the import process to create a logical data model in your project, you can use InfoSphere Data Architect to visualize the structure of the data. You do this by creating a data diagram to graphically depict the entities, attributes, and relationships of your model.

To create a diagram for the logical data model you just created, follow these steps:

  1. In the Data Project Explorer, expand the folder for the Package1 package.
  2. Right-click the Diagrams folder, and select New Blank Diagram from the context menu to create an empty diagram.
  3. Select the new diagram in the Data Project Explorer, and enter Copybook imported model in the Diagram name field in the General tab of the Properties view.
  4. Drag each of the entities from the Package1 package in the Data Project Explorer onto to the diagram. These entities are:
    • coboltest
    • PERSON-CREATION-REQUEST
    • PERSON-NAME-PART
    • PERSON-PHONE

    Figure 6 shows the resulting diagram.

    Figure 6. Diagram for logical data model Copybook imported model
    Person-name-part and person-phone are parallel nodes that both point to person-creation-request, which points to coboltest.

Change transformation options for supertype, subtype, and generalization relationships

The data diagram in Figure 6 shows that the logical data model captures an example of supertype, subtypes, and generalization relationship as supported in InfoSphere Data Architect. PERSON-CREATION-REQUEST is the supertype, and PERSON-NAME-PART and PERSON-PHONE are subtypes. InfoSphere Data Architect supports three possible transformations of the generalization relationship:

  • Roll down
  • Roll up
  • Separate table

To change the transformation options, follow these steps:

  1. From either the Copybook imported model data diagram (Figure 6) or the Data Project Explorer (Figure 5), select one of the generalization relationship links. For example, select the link between PERSON-PHONE and PERSON-CREATION-REQUEST.
  2. On the Properties tab, select General, and click on the Transform As drop-down list to review the three supported options as shown in Figure 7.
    Figure 7. Change transformation options for generalization relationships from the data diagram Properties tab
    Screenshot of General view on Properties tab showing three available transform options on drop-down list: separate table, roll up, and roll down.

Use new ILOG diagram layout options

Because the ability to visualize data using diagrams is so critical, InfoSphere Data Architect 7.5.2.1 includes new diagram layout options that give you greater flexibility and control over the objects on the diagrams. This capability is made possible by new built-in integration with ILOG.

Although a detailed description of these capabilities is beyond the scope of this article, you can view the new layout options by selecting the data diagram, going to the properties tab, and selecting the Layout view, as shown in Figure 8. Explore the various layout options to determine which choice works best for your specific data diagram.

Figure 8. ILOG diagram layout options
Layout view showing diagram layout type options, layout link type, layout direction, space between nodes, objects arrangement

Transform the logical data model to a physical data model

InfoSphere Data Architect also provides you the ability to create a relational database that you can use to store the content of the legacy data. You can leverage the process of forward engineering to derive a number of physical data models from the imported logical data model for various target deployment environments. This capability is possible because of how InfoSphere Data Architect maintains logical and physical data models in separate files.

To transform a logical data model to a physical data model, follow these steps:

  1. From the Data Project Explorer, select a logical data model. For example, select the model that you named Copybook imported model.
  2. Navigate to Data > Transform > Physical data model. This opens the Transform to Physical Data Model wizard.
  3. Keep Create New Data Model checked, and click Next. This takes you to the Options screen of the wizard as shown in Figure 9.
    Figure 9. Transformation wizard Options screen
    Screenshot of Transform to Physical Data Model wizard Options screen with the Generate traceability item checked and highlighted.
  4. Ensure that the Generate traceability check box is selected. This adds a dependency to each column on the physical data model so that you can use the Analyze Impact feature. This feature visually lists and reports on the dependent objects that could be impacted by a change. For example, in a physical model this analysis helps to identify objects such as foreign keys, primary keys, or indexes that could be affected by a change to a column.
  5. Click Next.
  6. On the next screen, click Finish. This completes the transformation process and generates the physical data model.
  7. In the Data Project Explorer, go to the Data Models folder and expand your physical data model to see all the tables, as shown in Figure 10.
    Figure 10. Physical data model created by the transform
    Screenshot of Data Project Explorer. Cobol item under Copybook import model.dbm is expanded to show tables in physical data model.

Summary

Many businesses have a critical need to be able to continue using legacy data. This article showed you how to use InfoSphere Data Architect to import COBOL data files in several easy steps. This enables architects and developers to include this information in their overall data modeling and design process. The article demonstrated some of the key modeling capabilities of InfoSphere Data Architect that can be useful for visualizing and understanding the legacy data, and showed you how to create a relational store for the data.

InfoSphere Data Architect provides many other advanced capabilities in addition to those discussed here. Refer to the Resources section below for links to other related articles and additional information.


Acknowledgments

The authors would like to thank Davor Gornik, who wrote the original article published in 2006 upon which this article was based and that contained the example used in this article. The authors would also like to thank Kathryn Zeidenstein for editing and reviewing this article.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, Rational
ArticleID=466283
ArticleTitle=Import COBOL copybooks into IBM InfoSphere Data Architect
publish-date=02042010