Appendix C. Schema File Structure

Table of Contents

C.1. Schema File Structure (v7.1)
C.1.1. ODO(Occurs Depending On) Items
C.1.2. REDEFINES
C.1.3. Condition Value Type

Analyzing the structure of the original data set is most important when converting mainframe data sets to OpenFrame data sets. For the analysis, you need to create data set conversion schema file based on COBOL Copybooks or PL/I Include files.

This section describes the structure of schema file (v7.1) and other items required for data set conversion.

A schema file can be created by using the cobgensch, pligensch and sqlgensch tool.

There are two types of schemas: general schema and dynamic schema.

  • General Schema

    * Schema Version 7.1
     Label, Level, Field Name, Conversion Type, Sign Type, Length, Occurs, ODO Field
    
     * Condition
     Label, "Value", ( Label List )
  • Dynamic Schema

    Includes Redefine Group ID and Redefine Element ID in addition to the items in a general schema. The following is the structure of a schema for dynamic conversion.

    * Schema Version 7.1 - Dynamic conversion
     Label, Level, Field Name, Conversion type, Sign type, Length, Occurs, ODO Field, Redefine Group ID, Redefine Element ID
    
     * Condition
     Label, "Value", ( Label List )

Note

  1. For more information about the cobgensch, pligensch, sqlgensch tools, refer to OpenFrame Tool Reference Guide.

  2. The schema file version created by using the latest OpenFrame/Base tool, sqlgensch, is not v7.1 and therefore cannot be used for migration.

The following describes each item of the schema structure.

ItemDescription

Label

Unique field label.

Level

Level of the field.

Field Name

Name of the field.

Conversion Type

Data type of the field. The following are the available data types.

  • EBC_ASC: Single-byte Character

  • COPY: Binary

  • PACKED: Packed Decimal

  • U_PACKED: Unsigned Packed Decimal

  • ZONED: Zoned Decimal

  • U_ZONED: Unsigned Zoned Decimal

  • GRAPHIC: Double-byte Character

Sign Type

Sign type defined in the COBOL SIGN IS clause for numeric data. The default is TRAILING.

The following are the available sign types:

  • TRAILING: 2-bit sign after the data.

  • LEADING: 2-bit sign before the data.

  • TRAILING_SEPARATE: Separate 1-byte sign after the data.

  • LEADING_SEPARATE: Separate 1-bye sign before the data.

Length

Field length.

Occurs

Occurrences of Occurs

ODO Field

Field name that Occurs Depending On points to.

Redefine Group ID

Group ID of REDEFINES clause.

Redefine Element ID

ID of the element in the Redefine Group ID.

COND Section

The condition section in the schema file is generated by the $$COND statement in the Copybook. The $$COND statement structure is as follows:

$$COND : FIELD_01 : VALUE_01 (, VALUE02 … ) [: FIELD_02 : VALUE_03 (, VALUE04 ) … ] : REDEFINE_NAME [...]

When you use multiple 'FIELD_# : VALUE_#' conditions, each condition can be separated with a colon (:). In each field, you can compare multiple condition values (VALUE). If these conditions are satisfied, REDEFINES is executed.

Condition Section

The following describes the structure of the Condition statement, which corresponds to $$COND statement in the schema file.

L#1, "VALUE_01" "VALUE02" …  [, L#2, "VALUE_03" "VALUE04 … ], ( Label List )
ItemDescription

Label(L#)

Label number of the field defined in REDEFINES statement.

조건값(VALUE_#)

Values to compare with the field value of the label redefined in the REDEFINES statement. If a match is found, layout is created in the order of the label list. A field value of a label can be compared with multiple condition values connected with an OR. Condition statement of multiple labels can be compared with condition values separated by a comma (,).

Label List

Label order list to use when the label field value meet the condition values.

You must specify conditions for a data set with a layout that includes a REDEFINES statement.

The following are sample COBOL Copybook with a REDEFINES statement and schema file.

<COBOL Copybook>

01 ROOT.
   03 AAA PIC X(2).
   03 BBB PIC X(3).
   03 BBB-1 PIC S9(3) REDEFINES BBB.
   03 CCC PIC X(3).
   03 CCC-1 PIC 9(5) COMP-3 REDEFINES CCC.

$$COND : AAA : "AB" : BBB-1 ( multiple redefines can be defined here!)
$$COND : CCC : T"PACKED" : CCC-1

<Schema File>

* Schema Version 7.1
L1, 01, ROOT, NULL, NULL, 0, 1:1,
L2, 03, AAA, EBC_ASC, NULL, 2, 1:1,
L3, 03, BBB, EBC_ASC, NULL, 3, 1:1,
L4, 03, BBB-1, ZONED, TRAILING, 3, 1:1,  # REDEFINES BBB
L5, 03, CCC, EBC_ASC, NULL, 3, 1:1,
L6, 03, CCC-1, U_PACKED, NULL, 3, 1:1,  # REDEFINES CCC

* Condition
L2, "AB", ( L1 L2 L4 L5 )
L5, T"PACKED", ( L1 L2 L3 L6 )
L0, "\0", ( L1 L2 L3 L5 )

In comparing the previous Copybook with the first condition line in the schema file, REDEFINES executes if L2 (Label2) matches the field name AAA and the field value is 'AB'. This creates a layout in the order of L1, L2, L4, and L5. According to the second condition, REDEFINES executes if L5 (Label5) matches the field name CCC and the field value is 'T"PACKED"'. This creates a layout in the order of L1, L2, L3, and L6. The last label L0 specifies the default layout order.