Information Catalog Manager Administration Guide

Extracting descriptive data from other sources

The easiest way to fill your information catalog with descriptive data is to use existing descriptions of your organization's information. Many databases and desktop applications already contain valuable descriptive data that you can transfer to your information catalog.

Using the Information Catalog Manager tag language, you can:

Extracting descriptive data also makes updating or refreshing your information catalog easier. You can edit the tag language files by using any word processing program that can import and export ASCII text files.

Extracting descriptive data with the information catalog extract programs

The Information Catalog Manager comes with a set of programs that can extract descriptive data from various sources. You can install these extract programs when you install the Information Catalog Manager or at any time. The Information Catalog Manager for Windows places them in \SQLLIB\SAMPLES\DGEXTxxx subdirectories.

To use the extract programs, you must be familiar with the specific operating environments in which they run. See Appendix A, Information Catalog Manager extract programs for information on running the specific extract programs you need.

Writing customized descriptive data extract programs

You might need to write an extract program if you want to copy data from existing catalogs other than the ones for which the Information Catalog Manager provides extract programs. Your extract program must translate this descriptive data into the Information Catalog Manager tag language. You can then import your descriptive data directly into the Information Catalog Manager as object types and objects.

Planning your extract program input and output

The format of your existing data is the default input format. Your extract program must produce a tag language file as output. However, the properties you decide to include about your information source determine the tag language output your extract program needs to produce.

This output tag language file can contain some or all of the following tags:

:DISKCNTL.
Identifies the sequential number of the current diskette, and specifies whether this file continues on more diskettes

:ACTION.
Specifies that an action (add, update, delete, append, or merge) occurs involving an object type, object, or relationship

:OBJECT.
Identifies an object type and its properties

:PROPERTY.
Identifies a property for the object type that you are defining

:INSTANCE.
Identifies an object or relationship

:RELTYPE.
Identifies the type of relationship that you are adding or deleting

:COMMIT.
Identifies an information catalog database commit point

:COMMENT.
Allows you to add comments to the tag language file

:NL.
Allows you to include multi-line property values (for non-UUI properties)

:TAB.
Allows you to insert tabs in non-UUI property values

For detailed information about the Information Catalog Manager tag language, see Appendix D, Tag language and Appendix E, What a tag language file should look like.

Formatting your output tag language file

If you store your tag language file on one or more diskettes, your extract program must place a :DISKCNTL. tag at the beginning of the tag language file so that the Information Catalog Manager knows how many diskettes contain your file.

For example, on the first diskette, specify:

:DISKCNTL.SEQUENCE(1, +)

The :DISKCNTL. tag must be the first tag in the file on each diskette.

Creating object types and objects with an extract program

In the Information Catalog Manager, descriptive data is stored as properties of an object. An object type describes a set of properties that each object has. If you extract descriptive data that includes a set of undefined properties, your extract program must produce tag language that creates an object type.

For example, the database catalog of your database might describe several tables in the database. This catalog contains the following properties that you want to store in your information catalog:

To produce an object type that contains these properties, your extract program must produce a tag language file that contains the tags that are shown in Figure 11.

Figure 11. Tag language output from an extract program to create an object type

:ACTION.OBJTYPE(ADD)
:OBJECT.TYPE(MYTABLE)
        CATEGORY(GROUPING)
        EXTNAME(The tables on my data source)
:PROPERTY.EXTNAME(Data source name)
          DT(C) DL(8) SHRTNAME(DSNAME) UUISEQ(2) NULLS(N)
:PROPERTY.EXTNAME(Name of the table)
          DT(C) DL(10) SHRTNAME(TABNAME) UUISEQ(1) NULLS(N)
:PROPERTY.EXTNAME(Description of table)
          DT(V) DL(80) SHRTNAME(TABDESC) NULLS(Y)
:PROPERTY.EXTNAME(Owner of table)
          DT(V) DL(8) SHRTNAME(TABOWNER) NULLS(Y)

When you generate a new object type, you must specify at least one property that has the UUISEQ option with a value of 1. You can specify up to four additional properties that have the UUISEQ option with a value of 2, 3, 4, or 5. UUISEQ specifies the position of the property in the UUI that uniquely identifies an object to an information catalog.

The database catalog might have descriptive data for three tables that you want to store in your information catalog. Your extract program can read the descriptive data for these three tables from your database catalog, and write the tag language file to generate three objects of the MYTABLE object type.

Suppose that your tables have the following properties:
Source name Table name Table description Owner
MYDATA EMPLOYEE Personnel information about company employees LONGO
MYDATA SALES Data about 2000 sales-to-date VALDEZ
MYDATA CUSTOMER Shipping information about customers MARSH

Your extract program must produce the tags that are shown in Figure 12, which you must insert in the tag language file following the tags that define the object type.

Figure 12. Tag language output for the object type MYTABLE

:ACTION.OBJINST(ADD)
:OBJECT.TYPE(MYTABLE)
:INSTANCE.NAME(Personnel information)
          DSNAME(MYDATA)
          TABNAME(EMPLOYEE)
          TABDESC(Personnel information about company employees)
          TABOWNER(LONGO)
:INSTANCE.NAME(Annual sales information)
          DSNAME(MYDATA)
          TABNAME(SALES)
          TABDESC(Data about 1997 sales-to-date)
          TABOWNER(VALDEZ)
:INSTANCE.NAME(Customer shipping information)
          DSNAME(MYDATA)
          TABNAME(CUSTOMER)
          TABDESC(Shipping information about customers)
          TABOWNER(MARSH)

Reusing existing object type definitions: The tag language used to produce the object type definitions shipped with the Information Catalog Manager is available for you to copy or include in your own extract programs. The tag language is in the SQLLIB\DGWIN\TYPES directory located on the drive where you installed the DB2 Universal Database. For information on other metadata templates included with the Data Warehouse Center, see the Data Warehouse Center Application Integration Guide.

Merging object types and objects

You will probably use your extract program many times to extract descriptive data for refreshing your information catalog. In this case, it is important to merge your object types and objects so that you do not add new objects every time you import the tag language file.

If two information catalogs contain the same object types, you must merge the object types before you can merge any objects. You should also merge object types if you are not sure whether the information catalogs contain the same object types.

For example, you want to import the contents of an information catalog (the source) that contains a Table object type into another information catalog (the target) that also contains a Table object type. You are not sure if the object types have the same properties. Object-type definitions must be alike for you to merge objects. If the object types have the same properties, you can merge them without problems. If they don't, the UUI properties must be identical, and all the properties of the object type in the source information catalog must match properties of the object type in the target information catalog.

If the object type in the source information catalog has more properties than the object type in the target information catalog, you can update the object type in the target information catalog before you merge the two.

Your extract program must create tags to merge object types and objects, as shown in Figure 13. The Information Catalog Manager does not update an object type's external name or its icon in the process of merging.

Figure 13. Tag language output for merging object types

:ACTION.OBJTYPE(MERGE)
:OBJECT.TYPE(short_name_of_object_type)
     CATEGORY(category_of_object type)
     EXTNAME(extended_name_of_object_type)
     ICOFILE(OS/2_icon_file_name)
     ICWFILE(Windows_icon_file_name)
:PROPERTY.SHRTNAME(short_name) DT(data_type) DL(size)
     UUISEQ(position_in_UUI) NULLS(y_or_n) EXTNAME(extended_name)

Restriction

You cannot merge the Programs or the Comments object types.

To merge objects, your extract program must create the tags that are shown in Figure 14.

Figure 14. Tag language output for merging objects

:ACTION.OBJINST(MERGE)
:OBJECT.TYPE(short_name_of_object_type)
:INSTANCE.NAME(extended_name_of_object)
     UUI_short_name(value_for_property)
     .
     .
     short_name(value_for_property)
     .
     .

Committing changes to the information catalog database

When the Information Catalog Manager imports a tag language file, it stores the descriptive data defined in the tag language file in the information catalog database. However, the Information Catalog Manager does not automatically commit these additions to its database until it reaches the end of a tag language file. The Information Catalog Manager looks for a checkpoint tag (:COMMIT.), which tells it to issue a commit call to the database. If the tag language file is long, your extract program should place :COMMIT. tags at regular intervals in the tag language file. Each checkpoint tag should have an identifier that is unique in your tag language file.

For example, you might want your extract program to include a :COMMIT. tag after the complete specification of an :ACTION. tag (following all the information that must be specified for an action). Your program can place a :COMMIT. tag in the tag language file after it generates all the tags to create an object type or an object.

If the Information Catalog Manager fails to import part of your tag language file, you need to import the rest of your file, starting at a successful checkpoint. The Information Catalog Manager issues a rollback to the database to the point of the last checkpoint. When you try to import this file again, the Information Catalog Manager starts from the checkpoint that matches the ID of the last committed checkpoint. For example, you might want your program to put the following checkpoint into the tag language file after the tags that create the object type:

:COMMIT.CHKPID(objtype1)

Restrictions on extract programs

When your extract program generates values for the properties, the Information Catalog Manager does not remove leading blanks. For example, if your program generates TABNAME( EMPLOYEE) instead of TABNAME(EMPLOYEE) for a property defined to contain only 8 bytes, the Information Catalog Manager returns an error message because the value is 10 bytes long instead of the 8 bytes defined for the TABNAME property in the object type definition.

If your extract program generates tag language for values containing parentheses, it must enclose the parentheses with single quotation marks. Otherwise, the parentheses are considered delimiters. For example, if the value is a telephone number (800) 555-1234, then your extract program needs to represent this value as PHONENUM('('800')' 555-1234).

When the Information Catalog Manager imports a tag language file, it ignores any characters with a hexadecimal value less than X'20'. Your descriptive data can contain only alphanumeric characters or timestamps.


[ Top of Page | Previous Page | Next Page ]