DB2/400 Import Utility
The DB2/400 Import Utility

Obsydian Information Guide

The DB2/400 Import Utility enables you to rapidly describe your AS/400 physical tables to an Obsydian Model.  It will eliminate a great deal of keying and thus will eliminate a potential source for errors.  In a matter of minutes, you can populate an Obsydian model with thousands of objects and triples, complete with necessary implementation names and a proper association with objects in the Obsydian class libraries.

Overview

DB2-400 Import features

Tasks

Display Libraries

Display Tables

Go To Library

Display Fields

Import Options

AS/400 and DB2/400 are registered trademarks of IBM Corporation.


Go To Library

This dialog box allows you to display the tables from a specific library.  If you know the name of the AS/400 library, using this dialog box can save you some time.

Options

Library


GME Field Limit

This field shows the maximum number of fields a table can have in order to inherit from OBASE/Grid Maintained Entity (GME).  Any table with a single key field and more fields than this limit inherits from OBASE/User Maintained Entity.  The default is 5.

Tables with more than one key field inherit from OBASE/Business Entity.


Name
Names

A name triple is generated for each field.  The target name object is the field name itself.


Label
Labels

A label triple is generated for each field.  The target label object is the field name itself. Depending on how you set the Import Options, you can get Left Label, Right Label, and Top Label triples.


Limits

A limits triple is generated for each field.  The target system value ALL is used.


Right Label

A right label triple is generated for each field.  It comes from the Text keyword in the field's DDS.


Top Label

A top label triple is generated for each field.  It is used for the column heading for grids and comes from the COLHDG keyword in the field's DDS.  If no COLHDG keyword exists, the name from the TEXT keyword is used.


Left Label

A left label triple is generated for each field.  Its value comes from the Text keyword in the field's DDS.


Replacement Character

This character replaces invalid characters found in table and field names.  Invalid characters for Obsydian include the following:  < > / . , :

The default replacement character is an underscore _.


Folder
Import File Location (Library or Folder)

This is the location of the Import File or Document on the AS/400.  The name of this field changes depending on what you select for the Generate Output As: option.

• 	If you are generating an Import File, this field contains the Library that the File will be placed in.

• 	If you are generating a Document, this is the Folder that the Document will be placed in.

No validation is performed.  The Folder must exist already on the AS/400.  If not, no Document will be created.  If the Library does not exist, the File will be created and will be found in the DB2-400 Import Utility product library.


Document

The name of an AS/400 document in a shared folder.  You can import this file directly into Obsydian by selecting it from the "I:" drive (although on your PC, the drive may be given a different name).

The maximum length of the file name (without the extension) is 8.  If you do not enter an extension (.xxx), an extension of .4MP is added.  If you do not want an extension, end the file name with a period.


Import File

The import data is generated to an AS/400 physical file that you name, in the library containing the DB2/400 Import Utility program.

If you create a file instead of a document in a shared folder, you need to use a file transfer utility to move the file to your PC before executing the Import tool within Obsydian.


Import options
Import Generation Options

This dialog box allows you to select certain options before generating the Import File.

• 	You can indicate whether the Import File should be a physical file or a document in an AS/400 shared folder.  You can give the file or document a meaningful name (up to 10 and 8 characters, respectively). If you chose to use a physical file, it should either be one that was created by the DB2/400 Import Utility or it should not exist.

• 	If a file or field name contains a character which is invalid in Obsydian, it will be replaced by the character indicated on this panel.

• 	Finally, you can control which triples should be created upon import.

Options

AS400 import file

Document

Library or Folder

Replacement character

GME field limit

Left label

Top label

Right label

Limits

Label

Name


Field Type

The Field Type is the AS/400 data type.  Types of data include character, packed, signed, binary, etc.


Field Text

This is the DDS text name of the field.  If no Text exists for the field, the field's DDS name is used.


Field
Field Name

This is the DDS field name.


Display Fields

This window displays the fields and their attributes for the table you selected.

 Columns

Field

Field text

Field type


Browse Files
Display Tables

This window displays the tables in the library you selected.  Choose Select Table from the Select menu or double-click the Selected column to select one or more tables for import.

When you have selected all the tables you need, choose Create File from the Select menu.

To see a list of the fields in a table and their attributes select a table and choose Display Fields from the Select menu.

Columns

Table


Std File name
Table

An AS/400 physical file or SQL table.  Only physical files, SQL tables, and source files are displayed in the Display Tables window.


Std Library name
Library

An AS/400 library.  Only libraries with tables in them are displayed in the Display Libraries window.


Browse Libraries
Display Libraries

This window displays the libraries on your AS/400 that contain one or more tables.  Select one of the libraries and choose Display Tables from the Select menu.  Only one library at a time can be processed.

Columns

Library

Table


DB2-400 Import features
Using the DB2/400 Import Utility

License information.

The DB2/400 Import Utility is a licensed product and it  is checked each time the utility is used. The system you run the utility from must have a current Obsydian license installed. The first time it is run a dialog panel is displayed: Display license path,  asking you to enter the directory where you have the Obsydian product installed.

The Import process.

Importing AS/400 tables into an Obsydian model is a two step process:

• 	Build an import file (the same one Obsydian uses to import Synon/2 objects).

• 	Import the file into Obsydian.

To build an import file:

1.	Choose Display Libraries from the Select menu.  This list displays all the libraries on your AS/400 that contain a table.

2.	Select a library and choose Display Tables from the Select menu to see the tables in that library.

3.	Choose Display Fields from the Select menu to see all of the fields in a table and their properties.

4.	Double-click the Selected column for each table you want to process.

5.	Choose Create File from the Select menu to generate the import file. The Import Options dialog box is displayed asking you if you want to:

• 	Generate a physical file (you can use file transfer utilities to copy it to your PC), or

• 	Generate a PC file (in a shared folder on the AS/400).

• 	Generate triples for left, right, and top labels, limits, name and label.

The build of the import file happens on the AS/400.  It generates objects and triples for each table selected, along with the fields from those tables.

To import the file into Obsydian:

1.	Start Obsydian and create a local model.

2.	Extract the OBASE and OBJECTS class libraries into your local model.

3.	From  the Tools menu, choose DB2/400 from the Import sub-menu.

4.	Select the import file you just created, then click OK.

Once you do the import in Obsydian, you will notice:

• 	A Subject Area is created which includes all tables selected.

• 	Each entity 'is a' User Maintained Entity, Grid Maintained Entity, or Business Entity based upon rules defined in the .INI file.

• 	Each table includes 'file name', 'impl name', 'record', 'column', and '..impl' triples.

• 	Primary key fields are identified by looking at existing AS/400 access paths, and defined with 'known by' triples.

• 	All other fields are defined by 'has' triples.

• 	Each field 'is a' class library field like Code, Status, Narrative, Quantity, Price, Percent, Numeric, Value, etc. It matches the field attribute with the class library properties to determine which object it inherits from.

• 	For each field, additional triples can be created based on the options selected at generation time.

• 	Invalid characters in names have been replaced by the character you specified in the Generation Options dialog (the default is '_').


DB2/400 Import Utility
License path

Type in the location of the Obsydian product.

Use the following format:  "<Drive>:\<Directory name>\Obsydian.exe"