HiDB Migration

This chapter describes migration procedures of IMS/DB from Mainframe environment to HiDB in an OpenFrame environment. It includes the activities required in each phase of the migration process and precautions to take.

1. Overview

The following figure shows the general migration procedure in an OpenFrame environment and the tools used in each phase of the migration process.

The rest of this chapter assumes that the DBD and PSB metatables have already been created.

figure 6 1
OpenFrame/HiDB Migration Procedure

The following are the tools used in each migration phase.

Tool Description

1

dbdgen

DBD generation tool

2

hdgensch

HiDB schema file generation tool

3

hdpcdf01

HiDB pre-conversion tool

4

dsmigin

Data set import migration tool

5

hdload

HiDB data load tool

The rest of this chapter describes the activities required in each migration phase.

2. Creating DBD

The first step of HiDB migration is to create a database description block (DBD) of the target database. You can generate DBD by using the dbdgen tool from the UNIX command line.

To generate DBD, you need a DBD creation script or JCL from Mainframe. Before creating DBD, you need to check that the default DBLIB defined by ims subject in the OpenFrame configuration or PDS data set of the user-defined DBDLIB has been created.

The following is an example of running dbdgen from the UNIX command line.

$ dbdgen TMAXDB01

In the previous example, "TMAXDB01" is the name of DBD creation script file. If the command is successfully executed, the DBD will be created in the DBD metatable with the DBD name defined in the DBD creation script, the default DBDLIB name or a user-defined DBDLIB name.

  1. For more information about how to use the dbdgen tool, refer to OpenFrame Tool Reference Guide.

  2. For more information about the ims and hidb subject, refer to OpenFrame Configuration Guide.

3. Creating HiDB Schema and Handling Copybook

To convert mainframe EBCDIC data into OpenFrame ASCII data, you typically use the dsmigin tool provided in OpenFrame. To use this tool, you first need to create a schema file, which defines properties for each data record field, and then save metadata to create a table for each segment by using user copybook (However, for index segments and variable length segments, the copybook created with the dbdcpybkgen program must be used).

In this step of creating HiDB schema and handling copybook, analyze the copybook, create a schema file for HiDB data used as input in the dsmigin tool, and save field metadata by using the hdgensch tool.

The tool reads one or more copybook files that define field structure for each segment through schema commands, internally calls the cobgensch or pligensch tool, restructures schema files as a single schema file by adding conditional statements for each segment name. It also stores field data of the copybook processed through meta commands to HiDB metadata table. Schema and metadata can be processed at the same time by using the all commands.

The following example shows how to run hdgensch.

$ hdgensch all TMAXDB01 ./cpybook

In the previous example, "TMAXDB01" is the name of DBD registered in the target database, and "./cpybook" is the name of the directory where COBOL copybook, which contains the field definitions of each segment, exists.

You need to be aware that the name of the COBOL copybook file in the directory must be the same as that specified in DBD, and the extension of the file must be '.cpy'. To execute hdgensch tool with a PL/I copybook, you must specify the -p option and the extension of the file must be '.inc'.

When the previous command is successfully completed, a schema file is created with the name of DBD and extension of '.conv' in the default schema directory specified by SCHEMA_DIR key in DATASET_DIRECTORY section of ds subject for OpenFrame configuration.

  1. For details about how to use the tools, refer to OpenFrame Tool Reference Guide.

  2. For details about ds subject, refer to OpenFrame Configuration Guide.

4. Creating Segment Tables

Create segment tables to which data for segments defined in DBD is stored. The hidbmgr tool, which manages HiDB metadata and user data, is used. The tool creates segment tables for DBD processed by dbdgen in the format of fields of copybook processed by hdgensch, by using the 'segm create' command.

The following example shows how to run hidbmgr.

$ hidbmgr segm create TMAXDB01

In the previous example, "TMAXDB01" is the name of DBD handled by dbdgen.

For details about how to use the hidbmgr tool, refer to OpenFrame Tool Reference Guide.

5. Creating DLI Library

Create a DLI library file to be used for data loading and user programs by using dligen command of hidbmgr tool. It is required only for DBD in data loading but also necessary for PSB so that HiDB commands of user programs can be executed. The library file is created in the directory specified by HIDB_OBJECT_DIR in HIDB_DEFAULT section of hidb subject for OpenFrame configuration.

The following example shows how to run hidbmgr.

$ hidbmgr dbd dligen TMAXDB01

In the previous example, "TMAXDB01" is the name of DBD handled by dbdgen.

For details about how to use the hidbmgr tool, refer to OpenFrame Tool Reference Guide.

6. Converting to OpenFrame/HiDB Standard Data Format

To load data into HiDB, the format of the source data must be as defined in HiDB.

The data format specified by HiDB is called HiDB standard data format, and is shown in the following figure.

figure 6 2
OpenFrame/HiDB Standard Data Format

If Mainframe data is already in this format, you can directly load it into HiDB without additional processing. However, some Mainframe data may need to be converted into this format before data loading.

To unload data from Mainframe IMS/DB, you typically use the DFSURGU0 utility provided by IMS/DB. HiDB provides the hdpcdf01 tool that converts the unload data set, which is created by DFSURGU0, into the HiDB standard data format. Hence, data can be unloaded using DFSURGU0 without additional processing on mainframe, and the data can be converted into the HiDB standard data format by using hdpcdf01 in OpenFrame.

The following example shows how to run hdpcdf01.

$ hdpcdf01 if=tmaxdb01.dat of=tmax01db.hdb dbd=TMAX01DB

In the previous command call, "if" means the input file and is set to the name of the unload data set created by DFSURGU0 in Mainframe IMS/DB. "of" is set to the name of the output file that stores the data converted into the HiDB standard format, and "dbd" is set to the name of the DBD that defines the source database.

  1. For details about how to use the hdpcdf01 tool, refer to OpenFrame Tool Reference Guide.

  2. For details about how to use the DFSURGU0 utility, refer to OpenFrame Utility Reference Guide.

7. Migrating Source Code

Mainframe stores data in EBCDIC while OpenFrame stores data in ASCII. Therefore, code migration is required when mainframe data sets are migrated into OpenFrame in a UNIX environment. The code migration in OpenFrame is performed using the dsmigin tool.

To use dsmigin, you need the source file and schema file, which contains definitions of each field in the data set. For the migration, you need the source file in the HiDB standard format and the schema file created through hdgensch.

The following example shows how to run dsmigin to migrate to HiDB.

$ dsmigin MYDATA MYHIDBDATA -s MYSCHEMA.conv -C -f V

In the previous command call, "MYDATA" is the name of the input file that contains the HiDB standard format data, and "MYHIDBDATA" is the name of the output file that stores the converted data. "MYSCHEMA.conv" followed by the [-s] option is the name of the HiDB schema file created by hdgensch. The [-C] option specifies to only perform code conversion without any additional processing such as cataloging. The [-f V] option means the format of the input file is variable.

For details about how to use the dsmigin tool, refer to OpenFrame Tool Reference Guide.

8. Loading Data

In this phase, you load the converted data in the HiDB standard format into HiDB using the hdload tool. Before loading the data, you need to make sure that the target segment table is empty.

The following example shows how to run hdload.

$ hdload TMAX01DB tmax01db.hdb

In the previous command call, "TMAX01DB" is the name of the DBD that defines the source database. "tmax01db.hdb" is the name of the data file in the HiDB standard format.

If you forcibly suspend loading the data by pressing <Ctrl>+C, the lock on the data set may not be released. If you attempt to reload the data in such state, an error may occur. You must release the lock on the data set before reloading the data.

For details about how to use the hdload tool, refer to OpenFrame Tool Reference Guide.