Migration Tools

This chapter describes the tools used for processing migration-related jobs.

1. Overview

The following is a list of tools for migration to OpenFrame.

Tool Name Description

cobgensch

Creates the data set migration schema file needed for migrating a data set from a mainframe to OpenFrame. The schema file is generated from a COBOL copybook source file.

cpmmgr

Outputs or edits mapping information with given CPM data, or converts simple sentences or files.

dsmigin

Converts an EBCDIC data set to an ASCII OpenFrame data set.

dsmigout

Converts an ASCII OpenFrame data set to an EBCDIC data set and exports it to a Unix file.

pligensch

Creates the data set migration schema file needed for migrating a data set from a mainframe to OpenFrame. The schema file is generated from PL/I source files.

sqlgensch

Creates the data set migration schema file needed for migrating a data set from a mainframe to OpenFrame. The schema file is generated from SQL table generation scripts.

2. cobgensch

The cobgensch tool creates the schema files necessary for the migration of data sets from a mainframe to OpenFrame. There are two programs that create data set migration schema files: cobgensch and pligensch. cobgensch refers to COBOL Copybook source files to create a schema file, while pligensch refers to PL/I source files.

During data set migration, if multiple character sets (EBCDIC mixed with ASCII, or packed decimals and zoned decimals, for example) are used within the same record in the source file, simple record-by-record code conversion is not possible. To resolve this problem, a schema file must be created that defines exactly how characters in each record are converted.

The cobgensch tool creates a migration schema file from a COBOL source file or COBOL copybook file. Specify the directory path for schema files to be created to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject under OpenFrame Configuration.

For more information about OpenFrame Configuration, refer to OpenFrame Configuration Guide.

Usage

The cobgensch tool can be invoked as follows:

Usage: cobgensch input_file [options]
  • Parameters

    Parameter Description

    input_file

    Specifies the COBOL source file or COBOL copybook file.

  • [options]

    Option Description

    [-r rec_len]

    If you specify the record length of the data set, the record length will be checked for integrity as the schema is created.

    [-o output]

    Specifies the name of the schema file to be created. If unspecified, the input_file name will be used. If specified, the schema file will be created as <volser>_<output>.conv or <output>.conv depending on whether the volser option is specified.

    [-v volser]

    Specifies the volume name to be used within the name of the schema file. If unspecified, the schema file name will not include the volume name. If volser is specified, the schema file will be created as <volser>_<output>.conv.

    [-f format]

    Sets a Copybook file format. One of the following can be set. If this option is not set, Fixed format will be used by default.

    • F( Fixed format): Handles the columns 8-72 as the copybook source.

    • V (Variable format): .Handles the columns 8-251 as the copybook source.

    • R (Free format): Handles the columns 1-251 as the copybook source.

    [-d]

    Displays all debug messages created by the cobgensch scanner and parser.

    [-cs currency_sign]

    Specifies a currency symbol for a PICTURE clause in a COBOL source or COBOL copybook when creating a schema file. You must use the same 1 byte currency symbol that is used in the PICTURE clause. If any of the following PICTURE symbols are used, the specified symbol is ignored and schema is created according to the default conversion rule.

    • S , (comma) . (dot) 0 / + - C R D B A X 9 Z 1 G N P V

    [-p]

    Specifies the path to the directory of the library specified with COPY OF <library-name>. If unspecified, the path to the library directory is retrieved in the following order of priority.

    • The path specified to the VALUE of the COBCOPY key, in the COBGENSCH section from the dstool subject under OpenFrame Configuration. (For more information, refer to OpenFrame Configuration Guide)

    • The path specified to the ${COBGENSCH_COBCOPY} environment variable.

    • The current ${PWD} path.

    [-D]

    Creates a schema file for dynamic conversion. If this option is specified, the [-y] option must be specified for dynamic migration using dsmigin or dsmigout.

    [-V]

    Displays cobgensch version information.

Examples (1)

The following is a sample COBOL copybook file.

<COB.TESTDATA1.cpy>

FD  I-FILE
    RECORDING MODE IS F
    RECORD CONTAINS  95 CHARACTERS
    BLOCK CONTAINS 0 RECORDS
    LABEL RECORDS ARE STANDARD
    DATA RECORD ARE I-REC.

01  I-REC.
    05  I-SAGNO                   PIC  X(11).
    05  I-DAMBO                   PIC  X(02).
    05  I-PHNO                    PIC  X(03).
    05  I-BKNO                    PIC  9(03).
    05  I-BKDT                    PIC  X(10).
    05  I-BKDT-I                  PIC  X(01).
    05  I-BSGB                    PIC  X(02).
    05  I-BSHG                    PIC  X(02).
    05  I-CIGB                    PIC  X(02).
    05  I-CIHG                    PIC  X(02).
    05  I-JHGB                    PIC  X(02).
    05  I-TTJC                    PIC S9(13) COMP-3.
    05  I-TTIC                    PIC S9(13).
    05  I-NAME                    PIC  X(20).
    05  I-TEST1                   PIC  Z(10).
    05  I-TEST2                   PIC  +(10).
    05  I-TEST3                   PIC  -(10).
    05  I-TEST4                   PIC  ---------9.
    05  I-TEST5                   PIC  ----------.

The following example uses cobgensch to create a schema file.

$ cobgensch COB.TESTDATA1.cpy

A schema file is successfully created as follows:

input filename = COB.TESTDATA1.cpy
schema filename = /home/tmax/openframe/schema/COB.TESTDATA1.conv

The following example uses cobgensch and checks record length integrity.

$ cobgensch COB.TESTDATA1.cpy -r 100

An error occurs while checking the record length integrity.

input filename = COB.TESTDATA1.cpy
input record length = 100
** input record length is different from scheme record length!!!
** (input reclen = 100, scheme reclen = 130)

Failed to generate a schema file. rc - -1
schema filename = /home/tmax/openframe/schema/COB.TESTDATA1.conv

The following example executes cobgensch with a valid record length.

$ cobgensch COB.TESTDATA1.cpy -r 130

A schema file is successfully created as follows. Since the record length of 130 bytes matches with the specified value, no error occurs during the integrity check.

input filename = COB.TESTDATA1.cpy
input record length = 130
scheme filenama = /home/tmax/openframe/schema/COB.TESTDATA1.conv

The following is a sample schema file created by cobgensch.

<COB.TESTDATA1.conv>

* Schema Version 7.1
L1, 01, I-REC, NULL, NULL, 0, 1:1,
L2, 05, I-SAGNO, EBC_ASC, NULL, 11, 1:1,
L3, 05, I-DAMBO, EBC_ASC, NULL, 2, 1:1,
L4, 05, I-PHNO, EBC_ASC, NULL, 3, 1:1,
L5, 05, I-BKNO, U_ZONED, NULL, 3, 1:1,
L6, 05, I-BKDT, EBC_ASC, NULL, 10, 1:1,
L7, 05, I-BKDT-I, EBC_ASC, NULL, 1, 1:1,
L8, 05, I-BSGB, EBC_ASC, NULL, 2, 1:1,
L9, 05, I-BSHG, EBC_ASC, NULL, 2, 1:1,
L10, 05, I-CIGB, EBC_ASC, NULL, 2, 1:1,
L11, 05, I-CIHG, EBC_ASC, NULL, 2, 1:1,
L12, 05, I-JHGB, EBC_ASC, NULL, 2, 1:1,
L13, 05, I-TTJC, PACKED, NULL, 7, 1:1,
L14, 05, I-TTIC, ZONED, TRAILING, 13, 1:1,
L15, 05, I-NAME, EBC_ASC, NULL, 20, 1:1,
L16, 05, I-TEST1, U_ZONED, NULL, 10, 1:1,
L17, 05, I-TEST2, EBC_ASC, NULL, 10, 1:1,
L18, 05, I-TEST3, EBC_ASC, NULL, 10, 1:1,
L19, 05, I-TEST4, EBC_ASC, NULL, 10, 1:1,
L20, 05, I-TEST5, EBC_ASC, NULL, 10, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11 L12 L13 L14 L15 L16 L17 L18 L19 L20 )
Examples (2)

The following is a simple example of using a currency symbol ($) in a COBOL Copybook.

<COB.TESTDATA2.cpy>

FD  I-FILE
    RECORDING MODE IS F
    RECORD CONTAINS  95 CHARACTERS
    BLOCK CONTAINS 0 RECORDS
    LABEL RECORDS ARE STANDARD
    DATA RECORD ARE I-REC.

01  I-REC.
    05  I-TEST1                   PIC  X(11).
    05  I-TEST2                   PIC  9(03).
    05  I-TEST3                   PIC  S9(13) COMP-3.
    05  I-TEST4                   PIC  $$,$$$,$$$.99.

The following executes cobgensch on the previous copybook by specifying the currency symbol ($).

$ cobgensch -cs $ COB.TESTDATA2.cpy

The following schema file is successfully created by the previous command.

<COB.TESTDATA2.conv>

* Schema Version 7.1
L1, 01, I-REC, NULL, NULL, 0, 1:1,
L2, 05, I-TEST1, EBC_ASC, NULL, 11, 1:1,
L3, 05, I-TEST2, U_ZONED, NULL, 3, 1:1,
L4, 05, I-TEST3, PACKED, NULL, 7, 1:1,
L5, 05, I-TEST4, EBC_ASC, NULL, 13, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 L4 L5 )

The following executes cobgensch by specifying a symbol @, which does not exist in the copybook file.

$ cobgensch -cs @ COB.TESTDATA2.cpy

An error occurs as follows:

input filename = COB.TESTDATA2.cpy
Invalid PICTURE string => $$,$$$,999.99 at COB.TESTDATA2.cpy(line near 13)

The following is a COBOL Copybook that does not include a currency symbol.

<COB.TESTDATA3.cpy>

01  I-REC.
    05  I-TEST1                   PIC  X(11).
    05  I-TEST2                   PIC  9(03).

The following executes cobgensch by specifying the PICTURE SYMBOL '9', which represents an unsigned zoned decimal, as the currency symbol.

$ cobgensch -cs 9 COB.TESTDATA3.cpy

The following schema file is successfully created by the previous command.

<COB.TESTDATA3.conv>

* Schema Version 7.1
L1, 01, I-REC, NULL, NULL, 0, 1:1,
L2, 05, I-TEST1, EBC_ASC, NULL, 11, 1:1,
L3, 05, I-TEST2, U_ZONED, NULL, 3, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 )
Examples (3)

The following is a sample COBOL copybook file containing duplicate fields.

To convert a COBOL copybook with duplicate fields, the VALUE of the ALLOW_FIELD_DUP key must be set to YES, in the DATASET_DEFAULT section of the ds subject under OpenFrame Configuration. Otherwise, an error occurs during conversion.

A number in the format of "_[digit]" is attached at the end of the duplicate fields. To specify one of the duplicate fields in the $$COND statement, add a number in a certain order as follows:

<COB.TESTDATA4.cpy>

01  I-REC.
    05  I-FLD-DUP                 PIC X(02).
    05  I-FLD-DUP                 PIC X(02).
    05  I-TEST1                   PIC X(11).
    05  I-TEST2                   PIC X(11).
    05  I-TEST-DUP                PIC X(11) REDEFINES I-TEST1.
    05  I-TEST-DUP                PIC X(11) REDEFINES I-TEST2.
    05  I-TEST3                   PIC 9(02).

$$COND : I-FLD-DUP_1 : "AB" : I-TEST-DUP_1

The following example executes cobgensch to create a schema file.

$ cobgensch COB.TESTDATA4.cpy

A schema file is successfully created by the previous cobgensch command.

<COB.TESTDATA4.conv>

Schema Version 7.1
L1, 01, I-REC, NULL, NULL, 0, 1:1,
L2, 05, I-FLD-DUP_1, EBC_ASC, NULL, 2, 1:1,
L3, 05, I-FLD-DUP_2, EBC_ASC, NULL, 2, 1:1,
L4, 05, I-TEST1, EBC_ASC, NULL, 11, 1:1,
L5, 05, I-TEST2, EBC_ASC, NULL, 11, 1:1,
L6, 05, I-TEST-DUP_1, EBC_ASC, NULL, 11, 1:1,  # REDEFINES I-TEST1
L7, 05, I-TEST-DUP_2, EBC_ASC, NULL, 11, 1:1,  # REDEFINES I-TEST2
L8, 05, I-TEST3, U_ZONED, NULL, 2, 1:1,

* Condition
L2, "AB", ( L1 L2 L3 L5 L6 L8 )
L0, "\0", ( L1 L2 L3 L4 L5 L8 )
Examples (4)

The following is a sample COBOL copybook file using the COPY OF statement.

<${OPEFNRAME_HOME}/COB.TESTDATA5.cpy>

01 REC.
  03 FLD-KEY PIC X(10).
  03 FLD-DAT PIC X(60).
  03 FLD-COPY.
      COPY COPY001 OF CPYDIR.

The following is a sample COBOL copybook file specified with the COPY OF statement.

<${OPENFRAME_HOME}/CPYDIR/COPY001>

05 FLD-AAA PIC X(02).
05 FLD-BBB PIC X(02).
05 FLD-CCC PIC X(02).
05 FLD-DDD PIC X(02).
05 FLD-EEE PIC X(02).

The following example executes cobgensch to create a schema file.

$ cobgensch COB.TESTDATA5.cpy

A schema file is successfully created by the previous cobgensch command.

<COB.TESTDATA5.conv>

* Schema Version 7.1
L1, 01, REC, NULL, NULL, 0, 1:1,
L2, 03, FLD-KEY, EBC_ASC, NULL, 10, 1:1,
L3, 03, FLD-DAT, EBC_ASC, NULL, 60, 1:1,
L4, 03, FLD-COPY, NULL, NULL, 0, 1:1,
L5, 05, FLD-AAA, EBC_ASC, NULL, 2, 1:1,
L6, 05, FLD-BBB, EBC_ASC, NULL, 2, 1:1,
L7, 05, FLD-CCC, EBC_ASC, NULL, 2, 1:1,
L8, 05, FLD-DDD, EBC_ASC, NULL, 2, 1:1,
L9, 05, FLD-EEE, EBC_ASC, NULL, 2, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 L4 L5 L6 L7 L8 L9 )
Configuration

Perform the following configuration in OpenFrame Configuration.

  • Specify the path of the directory for schema files to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject.

    $ ofconfig list -s ds -sec DATASET_DIRECTORY -k SCHEMA_DIR
    
    ===================================================================================
       SUBJECT   |      SECTION      |       KEY         |           VALUE
    ===================================================================================
         ds      | DATASET_DIRECTORY |     SCHEMA_DIR    | /home/tmax/oframe_7_1/schema
    ===================================================================================
  • Specify whether to allow duplicate fields in the copybook file when creating schema files, by setting the VALUE of the ALLOW_FIELD_DUP key in the DATASET_DEFAULT section of the ds subject. This value has an effect on the operation of TSAM. If set to YES, duplicate field check is omitted when creating a schema file, which is created under the format of '[field name]_[digit]'. If set to NO, an error occurs whenever duplicate fields are found.

    $ ofconfig list -s ds -sec DATASET_DEFAULT -k ALLOW_FIELD_DUP
    
    ===================================================================================
       SUBJECT   |      SECTION      |          KEY            |        VALUE
    ===================================================================================
         ds      |  DATASET_DEFAULT  |     ALLOW_FIELD_DUP     |         NO
    ===================================================================================
  • Specify whether to use 0 as the minimum value for the ODO field, to the VALUE of the ODO_MIN_ZERO_AVAILABLE key in the COBGENSCH section from the dstool subject. If set to YES, 0 is the minimum value for the ODO field, and if set to NO, the minimum value is 1. The default setting is NO.

    $ ofconfig list -s dstool -sec COBGENSCH -k ODO_MIN_ZERO_AVAILABLE
    
    ===================================================================================
       SUBJECT   |      SECTION      |          KEY            |        VALUE
    ===================================================================================
       dstool    |     COBGENSCH     | ODO_MIN_ZERO_AVAILABLE  |        DEFVOL
    ===================================================================================
  • Specify the path to the library directory, to the VALUE of the COBCOPY key in the COBGENSCH section from the dstool subject.

    $ ofconfig list -s dstool -sec COBGENSCH -k COBCOPY
    
    ===================================================================================
       SUBJECT   |      SECTION      |          KEY            |        VALUE
    ===================================================================================
       dstool    |     COBGENSCH     |         COBCOPY         |    /home/openframe
    ===================================================================================
  1. For more information about the schema file structure, refer to OpenFrame Migration Guide.

  2. For more information about OpenFrame Configuration, refer to OpenFrame Configuration Guide.

3. cpmmgr

The cpmmgr tool prints or edits mapping information with the given CPM data, as well as tests conversion of simple sentences or files.

Usage

The cpmmgr tool can be invoked as follows. Enter the commands through the command prompt after invoking the tool.

Usage: cpmmgr <file>
  • Parameters

    Parameter Description

    <file>

    Specifies a cpm file to manage as cpmmgr.

  • [options]

    Command Description

    cc (Change Code Mapping)

    Changes codes mapped to the current CPM data into a user-preferred mapping code.

    cf (Convert File)

    Converts a file with the current CPM data.

    ct (Convert Text)

    Converts a string or a hexadecimal number with the current CPM data.

    pd (Print Double-Byte Code Mapping)

    Displays mapping information of two-byte codes stored in the current CPM data.

    ps (Print Single-Byte Code Mapping)

    Displays mapping information of one-byte codes stored in the current CPM data.

    pr (Print Single/Double Byte Code Range)

    Displays a mapping range of codes stored in the current CPM data.

    pc (Print Code Not Exist in CPM)

    Displays mapping information of two-byte codes which are not stored in the current CPM data, with a file containing two-byte code information.

    pt (Print mapping Table into Text File)

    Prints mapping information in a text file.

    rr (Reset single/double byte Code Range)

    Initializes the code mapping information stored in the current CPM data.

    cr (Change single/double byte Code Range)

    Changes the code mapping information stored in the current CPM data.

Examples

The following example manages the ASCEBCKR.cpm file.

$ cpmmgr ASCEBCKR.cpm

>> help

 help
 cc     - change code mapping.
 cf     - convert file.
 ct     - convert text.
 pd     - print double byte code mapping.
 ps     - print single byte code mapping.
 pr     - print single/double byte code range.
 pc     - print code which is not inside in *.cpm file.
 pt     - print mapping table into text file.
 rr     - reset single/double byte code range.
 cr     - change single/double byte code range.
 quit

>>

4. dsmigin

The dsmigin tool converts the EBCDIC data sets used within a mainframe into ASCII-encoded data sets used in OpenFrame. The following are general steps of migrating these data sets.

  1. Using an FTP program, download the mainframe data set to the Unix system (be sure to use the binary transfer mode of the FTP program).

  2. If a schema file is needed for data set migration, create it by referring to COBOL or PL/I source file using the data set.

  3. With the dsmigin tool and the schema file, import the downloaded file to UNIX into an OpenFrame data set.

A related tool program is dsmigout.

Usage

The dsmigin tool can be invoked as follows:

Usage: dsmigin <src_file> <dest_file | dataset_name> [options]
  • Parameters

    Parameter Description

    <src_file>

    Specifies the name or path of the Unix source file to migrate.

    <dest_file | dataset_name>

    Specifies the file or data set name to create.

  • [options]

    Option Description

    [-C]

    Converts a file from EBCDIC to ASCII without importing the file into OpenFrame. The output file must be a general text file, not an OpenFrame data set. The Tmax server is not used when only file conversion is performed.

    [-I]

    Imports a file directly into OpenFrame without conversion.

    [-S]

    Sets the record format (RECFM) to L-type. This option is used when the data given as the input file is a source code file.

    [-m member_name]

    Specifies the member name (for a PDS) or the relative generation number (for a GDG) of the data set to be created.

    • Specify only the <dataset_name> when creating an SDS (Sequential Data Set).

    • Specify both the <dataset_name> and [member_name] when creating a PDS (Partitioned Data Set).

    • Set the <dataset_name> and specify a generation number (+1, +2, …​) with [member_name], when creating a GDS (Generation Data Set). To re-register the existing GDS with the -R (recatalog) option, the generation number must be specified with a negative number or 0.

    [-u unit]

    Specifies the UNIT group name where the data set will be created.

    [-v volume]

    Specifies the volume where the data set will be created. If unspecified, the data set will be created in the default volume whose serial number is specified to the VALUE of the DEFAULT_VOLSER key, in the DATASET_DEFAULT section of the ds subject under OpenFrame Configuration. However, if the -F option is specified and -v is not, the volume can be determined according to the catalog when the data set is already registered in the catalog.

    [-c user_catalog]

    Specifies the catalog where the data set will be registered. If not specified, the data set is registered in a master catalog or user’s catalog, whose name is identical to the qualified entry name by alias setting.

    [-e encoding_code]

    Specifies what ASCII characters the EBCDIC two-byte data is to be converted to. By an encoding_code value, EBCDIC data is converted as follows:

    • US: English (Default)

    • KR: Korean (EUC-KR)

    • JP: Japanese (Shift-JIS)

    • JAK: Japanese (JEF - Fujitsu Mainframe)

    • KEIS: Japanese (Hitachi Mainframe)

    As well as the encoding_code option provided by OpenFrame, user-created encoding_code options can be used as follows:

    • Both the file for converting EBCDIC to ASCII and the file for converiting ASCII to EBCDIC are required.

    • The name of the file for converting EBCDIC to ASCII must be "EBCASC + <encoding name>.cpm".

    • The name of the file for converting ASCII to EBCDIC must be "ASCEBC + <encoding name>.cpm".

    • Specify the following to use values corresponding to the SO/SI of existing encoding_code.

      encoding_code with SO/SI to use:user-created encoding_code

    [-s schema]

    Specifies the schema file to be used. If multiple character sets are used within the same record in the Unix source file (e.g. if EBCDIC and ASCII codes are mixed together, or two-byte characters, packed decimal, and zoned decimal are used), simple code conversion is impossible. In this case, a schema file should be created with cobgensch or pligensch and specified here.

    If no file name is specified, a schema file that matches the source file name will be chosen from the directory specified to the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject under OpenFrame Configuration.

    [-t]

    Specifies the CUSTOM file that contains the list of codes to be converted from EBCDIC fullwidth characters to ASCII halfwidth characters. If not specified, EBCDIC fullwidth characters will be converted to ASCII fullwidth characters.

    The file has the following format.

    ____,__ => [EBCDIC fullwidth hexadecimal code],[ASCII halfwidth hexadecimal code]
    EBC1,A1
    EBC2,A2
    EBC3,A3
    ...

    [-um usermap]

    Specifies the name of the file containing the user-defined conversion map.

    [-cob cobol_type]

    Specifies the type of the COBOL language used. Set the COBOL type to one of the following:

    • MF (MicroFocus COBOL)

    • NET (Net COBOL)

    If unspecified, the default value is specified as follows:

    If no option has been specified, the VALUE specified to the COBOL_COMPILER key is used, in the COMPILER section of the ofsys subject under OpenFrame Configuration. If the COBOL_COMPILER key is not found in the ofsys subject under OpenFrame Configuration, MF is used by default.

    [-map]

    Converts the BMS map. If a two-byte string surrounded by SO and SI is too long, and is divided into two different lines; a line including SO and the other line including SI, this option enables such strings to be recognized. This option will be ignored, unless it is used with the [-S] option.

    [-dpl]

    Specifies whether to use DPL for VSAM data sets.

    [-o dsorg]

    Specifies the DSORG of the data set to be created. DSORG can contain one of the following values.

    • PS (Default value)

    • PSU

    • DA

    • DAU

    • IS (Currently not supported)

    [-k keylen]

    Specifies the key length for ISAM data sets. DSORG must be set to IS. (Currently not supported)

    [-p keypos]

    Specifies the key position for ISAM data sets. DSORG must be set to IS. (Currently not supported)

    [-l rec_len]

    Specifies the record length of the data set. For a fixed-length record, the actual record length of the data set to migrate can be checked whether it matches with the specified length. For a variable-length record, the maximum record length is specified. If not specified, the record length fetched from the schema file is used by default.

    [-b blksize]

    Specifies the block size of the data set (BLKSIZE).

    [-f recfm]

    Specifies the record format (RECFM) of the data set. The record format can be one of the following.

    • F (Fixed)

    • FB (Fixed Blocked)

    • V (Variable)

    • VB (Variable Blocked)

    • L (Line)

    [-d delimiter]

    Specifies the delimiter that separates records in the Unix source file. To use the newline or tab characters, specify "\n" or "\t" respectively.

    [-i]

    Proceeds migration while ignoring records that fail to be converted during the migration. Information about such records is output to the standard output stream (stdout). When the program is terminated, the number of failed records is displayed.

    [-w lockwait]

    If the data set to be imported is locked, dsmigin waits until the lock is lifted and then completes the task. If this option is unspecified and the data set to be imported is locked, an error message will be displayed and the job will be stopped.

    [-n]

    If a file is converted without being imported into OpenFrame, this option attaches a new line character to each record as a delimiter.

    [-y]

    Checks the conditional statements of a schema during migration and selects migration targets. If not specified, targets must be selected for each record before starting the migration. If specified, the -D option must be specified when creating the schema using cobgensch.

    [-a]

    Processes the 7th and 8th types of SOSI if an ASA control character is included in the first column of each record.

    [-sosi sosi_type]

    When two-byte characters are used within a record field, a SOSI character is used to differentiate them from one-byte characters. The SOSI type has four settings. The first option is the default - it keeps the SOSI without modification.

    [SOSI type]

    • 1 = so[EBC]si → so[ASC]si

      Does not convert SOSI. (Default)

    • 2 = so[EBC]si →_[ASC]_

      Converts SOSI to space.

    • 3 = so[EBC]si → [ASC]

      Deletes a SOSI and pads the deleted SOSI area in the right side of the field to convert with space characters.

    • 4 = so[JEF]si → so[ASC]si

      Converts JEF SOSI to ASCII SOSI.

    • 5 = BMS map conversion

      Converts non-mapped characters into '0x2E' instead of '0x00'. This option is useful to migrate the BMS map. It is used when a two-byte character without SOSI is displayed as a value of the original BMS map INITIAL statement.

      [Note]

      When migrating the BMS map, the mscadjust tool, used after dsmigin, may abnormally operate if '0x00' is included within a result file, and so this option can be used to enable the mscadjust tool to normally work for the file.

    • 6 = No SOSI conversion

      Considers data as an one-byte character regardless of the existence of SOSI values, and converts it.

    • 7 = so[EBC]si → [ASC] __

      Deletes SOSI and pads the deleted SOSI area in front of the column 72 with space characters. Like a COBOL application, columns from 72, a comment area, are used for resource migration.

    • 8 = so[EBC]si → __ [ASC]

      Deletes SOSI and pads the deleted SOSI area in the back of column 7 with space characters. Like a COBOL application, columns1 to 7, which are comment areas, are used for resource migration.

    • 9 = so[EBC]si → ?[ASC]?

      Converts SOSI characters using SOSI characters registered in CPM.

    [-ef error_format]

    Sets the error display format either to LINE or HEX. The default value is LINE.

    [-ep error_partial]

    Prints only the first 100 errors for each field and ignores the rest.

    [-ed error_detection]

    For EBCDIC to ASCII conversion, detects conversion error in (un)signed packed/zoned decimal type fields with only Low (0x00), High (0xFF), and Space (0x40) characters. This option cannot be used in conjunction with -z option, and -i option takes precedence over this option.

    [-z zero]

    For EBCDIC to ASCII conversion, converts (un)signed packed/zoned decimal type field values with only Low (0x00), High (0xFF), and Space (0x40) characters into a zero (0x30). This option cannot be used in conjunction with -ed option

    [-psmsb]

    For EBCDIC to ASCII conversion, changes the sign bit of a packed decimal from the least significant byte (LSB) to the most significant byte (MSB).

    • unsigned: replaces the F in the last 4 bits to a zero in the MSB.

    • signed: replaces the C in the last 4 bits to a zero in the MSB, and D in the last 4 bits to a one in the MSB.

    [-N]

    The data set will not be registered to the catalog during migration. If the specified data set name is already registered in the catalog, the catalog item will not be updated.

    [-R]

    Re-catalogs a data set that is registered to the catalog. If this option is set, the unit (-u) and volume (-v) parameters will be ignored. The registration information of the data set within the catalog is searched for and the data set will be imported to the volume. Registration information such as the unit and volume will be kept, but other DCB information will be renewed.

    If this option is not specified and the data set to be imported is already registered in the catalog, an error message will be displayed and the job will be stopped.

    [-F]

    If the data set is already registered in catalog, the existing data set and catalog item will be deleted, data will be re-imported, and the data set will be re-registered. As the result, existing registration information (such as the unit, volume, and creation date) will be overwritten. If [-N] is specified, the catalog item will not be processed.

    If this option is not specified and the data set to be imported is already registered in the catalog, an error message will be displayed and the job will be stopped.

    [-D]

    Displays detailed information about the EBCDIC to ASCII conversion and abnormal data that is found during the PACKED DECIMAL or ZONED DECIMAL field value conversion. Also shows debugging information useful to analyze migration issues. A value between 1 and 3 can be specified.

    • 1: Displays some important information while performing migration.

    • 2: In addition to the option1, displays error information that occurs when converting codes.

    • 3: In addition to the option2, displays data before and after record conversion.

    [-P]

    Displays the progress status.

    [-V]

    Displays version information about dsmigin.

Examples

The following example creates a PDS member.

$ dsmigin OFR.DATA.PDSEXAM01.TXT OFR.DATA.PDSEXAM01 -m MEMBER1

The following example creates an SDS.

$ dsmigin OFR.DATA.SDSEXAM01.TXT OFR.DATA.SDSEXAM01

The following example creates a GDS.

$ dsmigin OFR.DATA.GDGEXAM01.TXT OFR.DATA.GDGEXAM01 -m +1

The following is a sample schema file.

<DSI.TESTDATA1.conv>

############################
# conversion schema sample #
############################

* Schema Version 7.1
L1, 01, A-REC, NULL, NULL, 0, 1:1,
L2, 03, FIELD1, EBC_ASC, NULL, 80, 1:1,
L3, 03, FIELD2, U_PACKED, NULL, 3, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 )
############################

The following example imports a Unix file into a data set.

$ dsmigin DSI.TESTDATA1.txt DSI.TESTDATA1 -s DSI.TESTDATA1.conv -l
80 -v 100000 -e KR

The result of the previous example is as follows:

=====< DSMIGIN START >=====
source file : DSI.TESTDATA1.txt
dataset name: DSI.TESTDATA1
member name :
unit:
volume: 100000
schema file  : DSI.TESTDATA1.conv
encoding type: KR
record length: 80
record format: F
dsorg:
delimiter:

DSMIGIN: (record count = 100, conversion error count = 0)
=====< DSMIGIN FINISH >====

The following example checks the data set registration information after executing dsmigin.

$ tjesmgr psds DSI.TESTDATA1

The result of the previous command is as follows:

  Data Set Name . . . : DSI.TESTDATA1
  Data Set Type . . . : NONVSAM
  Catalog Name  . . . : SYS1.MASTER.ICFCAT

  Management Class  . : MCLAS001
    Creation Date . . : 2019/01/29      Data Set Owner  . : OpenFrame
    Expiration Date . : 9999/12/31

  Storage Class . . . :
    Volume Serial . . : 100000          Device Type . . . : 3380

  Data Class  . . . . :
    Organization  . . : PS              Record Format . . : F
    KEYLEN  . . . . . : 0               Record Length . . : 80
    KEYPOS  . . . . . : 0               Block Size  . . . : 80

  Current Allocation
    Primary Space . . : N.A.            Number of Extents : N.A.
    Secondaty Space . : N.A.            Data Set Size . . : 16700

  Last Access Date
    Last Access Date  : 2019/01/29      Last Access Time  : 12:08:47
Configuration

Perform the following in OpenFrame Configuration.

  • Specify the default volume serial number to the VALUE of the DEFAULT_VOLSER key, in the DATASET_DEFAULT section of ds subject. This value is used if the [-v volume] option is unspecified.

    $ ofconfig list -s ds -sec DATASET_DEFAULT -k DEFAULT_VOLSER
    
    ===================================================================================
       SUBJECT   |      SECTION      |          KEY            |        VALUE
    ===================================================================================
         ds      |  DATASET_DEFAULT  |     DEFAULT_VOLSER      |        DEFVOL
    ===================================================================================
  • Specify the default schema directory to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject. If the relative path of a schema file is specified with the [-s schema] option, the file will be searched for in the default schema directory. If the absolute path is specified, the schema file will be searched in the specified path rather than in the default schema directory.

    $ ofconfig list -s ds -sec DATASET_DIRECTORY -k SCHEMA_DIR
    
    ===================================================================================
       SUBJECT   |      SECTION      |       KEY         |        VALUE
    ===================================================================================
         ds      | DATASET_DIRECTORY |      SCHEMA_DIR   |/home/tmax/oframe_7_1/schema
    ===================================================================================
  • Specify the default COBOL type to the VALUE of the COBOL_COMPILER key, in the COMPILER section of the ofsys subject. This value is used if the [-cob cobol_type] option is unspecified. If COBOL_COMPILER is specified as NETCOBOL, NET is used, Otherwise, MF is used.

    $ ofconfig list -s ofsys -sec COMPILER -k COBOL_COMPILER
    
    ===================================================================================
       SUBJECT   |      SECTION     |          KEY           |         VALUE
    ===================================================================================
        ofsys    |     COMPILER     |     COBOL_COMPILER     |         OFCOBOL
    ===================================================================================
  • Specify whether to generate an error when a code conversion that is not defined in the conversion map, to the VALUE of the IGNORE_MAPPING_ERROR key in the DSMIGIN section of the dstool subject. This value is used if [-i] option is unspecified.

    $ ofconfig list -s dstool -sec DSMIGIN -k IGNORE_MAPPING_ERROR
    
    ===================================================================================
       SUBJECT   |      SECTION      |            KEY           |        VALUE
    ===================================================================================
       dstool    |      DSMIGIN      |   IGNORE_MAPPING_ERROR   |        YES
    ===================================================================================

For more information about OpenFrame Configuration, refer to OpenFrame Configuration Guide.

5. dsmigout

The dsmigout tool converts ASCII-encoded OpenFrame data sets into EBCDIC-encoded Unix files. When data sets with variable length records are exported, a Record Descriptor Word (RDW) must be added to each record. Additionally, when L-type data sets are exported, a newline character must be used as the delimiter.

A related tool program is dsmigin.

Usage

The dsmigout tool can be invoked as follows:

Usage: dsmigout <dataset_name> <dest_file> [options]
  • Parameters

    Parameter Description

    <dataset_name>

    Specifies the name of the data set to be exported. The data set must be registered in the catalog.

    <dest_file>

    Specifies the name of the file to be created.

  • [options]

    Option Description

    [-X]

    Used to export an ASCII OpenFrame data set without conversion to EBCDIC code.

    [-S]

    It is used when the data given as the input file is a source file loaded to OpenFrame. If this option is set, the L type specified when loaded will be converted to an F type record format (RECFM) for output. At this time, the record length follows the record length information registered when loaded.

    [-U]

    This option is used when the input file is not a source file loaded to OpenFrame but a regular Unix source file. If this option is set, the L type record for (RECFM) will be converted to the F type and the record length will be fixed to 80.

    [-m member]

    Set this when the input file is a PDS member.

    [-v]

    Specifies the serial number of the volume where the data set to be exported is located. If the data set does not exist in the specified volume, an error will be displayed and the conversion will be aborted.

    [-c user_catalog]

    Used if a data set to be updated is registered in the user catalog. If its alias is specified in the user catalog, and the data set can be found only with its name, it is not necessary to specify this option.

    [-e encoding_code]

    Specifies what EBCDIC characters that 2-byte ASCII characters are to be converted into. The different values are as follows:

    • US: English (default)

    • KR: Korean (EUC-KR)

    • JP: Japanese (Shift-JIS)

    • JAK: Japanese (JEF - Fujitsu Mainframe)

    • KEIS: Japanese (Hitachi Mainframe)

    [-s schema]

    If multiple character sets are used within the same record in the Unix source file (e.g. if EBCDIC and ASCII codes are mixed together, or two-byte character, packed decimal, and zoned decimal are used), simple code conversion is impossible. In this case, a schema file must be generated by either cobgensch or pligensch. Specify the generated schema file.

    [-um usermap_file]

    Used when the user-specified cpm file is used.

    [-cob cobol_type]

    Specifies the COBOL language type. One of the following.

    • MF (MicroFocus COBOL)

    • NET (Net COBOL)

    If this option is not specified, the default value set to the VALUE of the COBOL_COMPILER key is used, in the COMPILER section of the ofsys subject under OpenFrame Configuration. For more information, refer to Configuration. If the COBOL_COMPILER key is not found in the ofsys subject under OpenFrame, the default value is MF.

    [-sosi sosi_type]

    When the dsmigin tool converts an EBCDIC string to an ASCII string, a SOSI character is used to differentiate two-byte characters from one-byte characters.

    On the other hand, the dsmigout tool can distinguish two-byte characters from one-byte characters without SOSI, when it converts ASCII to EBCDIC. If this option is not specified, the tool performs the conversion only with the cpm code table.

    [SOSI type]

    • 1 = so[ASC]si → so[EBC]si

      Uses SOSI to converts an ASCII string to an EBCDIC string. The SOSI value remains the same. If the dsmigin tool did not convert SOSI, but converted a string part only, this option can be used to reverse the string as keeping SOSI.

    • 2 = _[ASC]_ → so[EBC]si

      Converts an ASCII string to an EBCDIC string through the ASCII code values without using SOSI. Space characters on both sides of the ASCII string are restored to SOSI. If the dsmigin tool converted SOSI to space characters, this option can be used to restore the space characters to SOSI.

    • 3 = [ASC]__ → so[EBC]si

      Converts an ASCII string to an EBCDIC string through the ASCII code values without using SOSI. Restores SOSI on both sides of the string. If the dsmigin tool deleted SOSI, and filled the last part of the string with spaces in order to keep the length of the conversion result field, this option can be used to restore the SOSI.

    • 4 = ?[ASC]? → so[EBC]si

      Converts SOSI characters using SOSI characters registered in CPM.

    [-sp]

    Same as specifying -sosi 2. dsmigout -h does not display this option any longer.

    [-i]

    Proceeds the migration even when a record fails to be converted. The information about the conversion failed record will be displayed as a standard output stream (stdout). The number of conversion-failed records will be displayed when the program exists.

    [-ef error_format]

    Sets the error display format either to LINE or HEX. The default value is LINE.

    [-ep error_partial]

    Prints only the first 100 errors for each field and ignores the rest.

    [-znpsign zoned_positivesign]

    Specifies the positive sign (A/C/E/F) for zoned decimals.

    [-psmsb]

    For ASCII to EBCDIC conversion, changes the sign bit of a packed decimal from the least significant byte (LSB) to the most significant byte (MSB).

    • unsigned: replaces the zero in the MSB to the F in the last 4 bits.

    • signed: replaces the zero in the MSB to the C in the last 4 bits, and the 1 in the MSB to the D in the last 4 bits.

    [-y]

    Checks the conditional statements of a schema during migration and selects migration targets. If not specified, the targets must be selected for each record before starting the migration. If specified, the -D option must be specified when creating the schema using cobgensch.

    [-ftpb]

    When converting a VB data set, a 3-byte FDB type B header is assigned to a record instead of RDW.

    [-D]

    Displays detailed information about the EBCDIC to ASCII conversion and abnormal data that is found during the PACKED DECIMAL or ZONED DECIMAL field value conversion. Also displays debugging information useful to analyze migration issues. A value between 1 and 3 can be specified.

    • 1: Displays some important information while performing migration.

    • 2: In addition to the option1, displays error information that occurs when converting codes.

    • 3: In addition to the option2, displays data before and after record conversion.

    [-V]

    Displays version information about dsmigout.

Examples

The following is a sample schema file.

<DSI.TESTDATA1.conv>

############################
# conversion schema sample #
############################

* Schema Version 7.1
L1, 01, A-REC, NULL, NULL, 0, 1:1,
L2, 03, FIELD1, EBC_ASC, NULL, 80, 1:1,
L3, 03, FIELD2, U_PACKED, NULL, 3, 1:1,

* Condition
L0, "\0", ( L1 L2 L3 )
############################

The following exports a data set into a Unix file.

$ dsmigout DSI.TESTDATA1 DSI.TESTDATA1.out -e KR -s DSI.TESTDATA1.conv

The result of the previous command is as follows:

DSMIGOUT: (record count = 100, conversion error count = 0)

After the conversion from ASCII to EBCDIC, records from DSI.TESTDATA1 are exported to DSI.TESTDATA1.out.

Configuration

Perform the following in OpenFrame Configuration.

  • Specify the default schema directory to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject.

    $ ofconfig list -s ds -sec DATASET_DIRECTORY -k SCHEMA_DIR
    
    ===================================================================================
       SUBJECT   |      SECTION      |        KEY        |        VALUE
    ===================================================================================
         ds      | DATASET_DIRECTORY |     SCHEMA_DIR    |/home/tmax/oframe_7_1/schema
    ===================================================================================
  • Specify whether to generate an error when a code conversion that is not defined in the conversion map, to the VALUE of the IGNORE_MAPPING_ERROR key in the DSMIGIN section of the dstool subject. This value is used by default if the [-i] option is unspecified.

    $ ofconfig list -s dstool -sec DSMIGIN -k IGNORE_MAPPING_ERROR
    
    ===================================================================================
       SUBJECT   |      SECTION      |          KEY             |        VALUE
    ===================================================================================
       dstool    |      DSMIGIN      |   IGNORE_MAPPING_ERROR   |        YES
    ===================================================================================

For more information about OpenFrame Configuration, refer to OpenFrame Configuration Guide.

6. pligensch

The pligensch tool creates a data set migration schema file used to migrate a mainframe data set to an OpenFrame data set.

Like cobgensch, the pligensch tool creates a schema file, but while cobgensch reads COBOL copybook files, pligensch reads PL/I source files to create a schema file after understanding the record structure of mainframe data set. The directory path where created schema files will be saved is specified to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject under OpenFrame Configuration.

The following figure shows how a PL/I schema file and OpenFrame data set are created.

figure 3 1
Process of Creating PL/I Schema File and OpenFrame Data Set

First, PL/I source is interpreted by pligensch and rewritten as a schema file. Then, by using the schema file and the mainframe data set as parameters, an OpenFrame data set can be created with dsmigin. This is essentially the same process that cobgensch uses, but with PL/I source code instead of COBOL.

Usage

The pligensch tool can be invoked as follows:

Usage: pligensch [options] file...
  • [options]

    Option Description

    [-h]

    Displays the help screen for pligensch.

    [-y]

    Displays the debug messages generated by the parser.

    [-l]

    Displays the debug messages generated by the scanner.

    [-d]

    Displays all debug messages that are generated by either the scanner or parser.

    [-I dir]

    Specifies the location of the PL/I 'include' files.

    [-r reclen]

    If you specify the record length of the data set, the record length will be checked for integrity as the schema is created.

    [-o output]

    Specifies the name of the schema file to be created. If unspecified, the original file name will be used and .conv will be appended to it. If the output file name is specified, the schema file will be created as <volser>_<output>.conv or <output>.conv, depending on whether or not the volser element is specified.

    [-v volser]

    Specifies the volume name to be used within the name of the schema file. If unspecified, the schema file name will not include the volume name. If this option is specified, schema file will be created as the name of <volser>_<output>.conv.

    [-s]

    This option is only used if the input file includes sub-structures.

    [-f aix]

    Specifies that the PL/I source to be read is AIX PL/I. AIX PL/I is the default source.

    [-f liant]

    Specifies that the PL/I source to be read is Liant Open PL/I.

    [-V]

    Displays version information.

  • Parameters

    Parameter Description

    file

    Specifies a PL/I source file name.

Examples

The following is a sample PL/I 'include' file.

<PLI.TESTDATA1.inc>

    3   TEST1                    CHAR(02)   ,
    3   TEST2                    CHAR(05)   ,
    3   TEST3                               ,
    5   TEST4                    PIC ‘(03)9’ ,
    5   TEST5                    PIC ‘(03)X’ ,
    3   TEST6                    FIXED DEC (3, 0);

The following example executes pligensch to create a COBOL schema file. Since the previous 'PL/I include' file does not start with the DECLARE statement and contains sub-structures only, the -s option must be specified.

$ pligensch –s PLI.TESTDATA1.inc

The results of the previous command are as follows:

input filename = PLI.TESTDATA1.inc
Schema filename = /home/tmax/openframe/schema/PLI.TESTDATA1.conv - created

The following example executes pligensch to create a PL/I schema file, and performs integrity check.

$ pligensch -r 10 –s PLI.TESTDATA1.inc

As the result of the previous command, an error occurs during the integrity check for the record length.

input filename = PLI.TESTDATA1.inc
input record length = 10
** input record length is different from schema record length!!!
** (input reclen = 10, schema reclen = 15)

Failed to generate a schema file. rc=-1

The following example executes pligensch after specifying a correct record length.

$ pligensch -r 15 –s PLI.TESTDATA1.inc

As the result of the previous command, a schema file is successfully created. No error occurs during integrity check, since the record length of 15 bytes matches the specified value.

input filename = PLI.TESTDATA1.inc
input record length = 15
Schema filename = /home/tmax/openframe/schema/PLI.TESTDATA1.conv - created

The following is a schema file created by pligensch.

<PLI.TESTDATA1.conv>

* scheme
L1, 01, TEST1_STRUCTURE, NULL, 0, 1,
L2, 03, TEST1, EBC_ASC, 2, 1,
L3, 03, TEST2, EBC_ASC, 5, 1,
L4, 03, TEST3, NULL, 0, 1,
L5, 05, TEST4, ZONED, 3, 1,
L6, 05, TEST5, EBC_ASC, 3, 1,
L7, 03, TEST6, PACKED, 2, 1,

* condition
L0, "\0", ( L1 L2 L3 L4 L5 L6 L7 )
Configuration

Specify the directory path for schema files to the VALUE of the SCHEMA_DIR key, in the DATASET_DIRECTORY section of the ds subject under OpenFrame Configuration.

  1. For more information about the schema file structure, refer to OpenFrame Migration Guide.

  2. For more information about OpenFrame Configuration, refer to OpenFrame Configuration Guide.

The following is an example of OpenFrame Configuration.

$ ofconfig list -s ds -sec DATASET_DIRECTORY -k SCHEMA_DIR

====================================================================================
   SUBJECT   |       SECTION       |       KEY         |          VALUE
====================================================================================
     ds      |  DATASET_DIRECTORY  |     SCHEMA_DIR    |/home/tmax/oframe_7_1/schema
====================================================================================

7. sqlgensch

By using the DDL (Data Definition Language) file of the database used by a mainframe, the sqlgensch tool creates the schema, copybook, and the DDL for Tibero, as well as the control file for importing to Tibero, all of which are needed for migrating a database from mainframe to OpenFrame.

Usage

The sqlgensch tool can be invoked as follows:

Usage: sqlgensch <src_file> ... [options]
  • Parameters

    Parameter Description

    src_file

    Specifies the DDL file name for the database used in the mainframe.

  • [options]

    Option Description

    [-c]

    Creates a COBOL copybook.

    [-s]

    Creates a schema file. The schema file created using this option is same as the one created using pligensch. This is not the latest schema file version. For the latest version, use the cobgensch tool.

    [-t]

    Creates a control file for Tibero Import.

    [-q]

    Creates a DDL statement to create database tables.

    [-y symfoware]

    Supports SYMFOWARE SQL. (Default value)

    [-b db2]

    Supports DB2 SQL.

    [-d debug]

    Runs in debug mode.

    [-V]

    Displays sqlgensch version information.

Examples

The following example creates a COBOL copybook with sqlgensch.

$ sqlgensch –c dbddl.txt

The following example creates a schema with sqlgensch.

$ sqlgensch -s dbddl.txt

The following example creates a control file for Tibero Import with sqlgensch.

$ sqlgensch -t dbddl.txt

The following example creates a DDL statement for Tibero with sqlgensch.

$ sqlgensch -q dbddl.txt

For more information about the schema file structure, refer to OpenFrame Migration Guide.