File migration

Top  Previous  Next

VSAM and sequential files coming from the mainframe may be converted using procedure described hereafter.

The conversion of each file always follows this flow:

1.translation of the COBOL record into an XML description using "cpy2xml"
2.creation of the conversion code using  "xmlconverter", which automatically generates a COBOL program to convert the file, according to the structure described by the previously generated XML file
3.(optional) coding of a COBOL copybook, containing the structure and/or redefines branch identification rules
4.compiling and running the conversion program to translate  the file

Basically, you may distinguish four different categories of files:

single record structure without critical redefines
multiple record structures without critical redefines
single record structures with critical redefines
multiple record structures with critical redefines

Critical redefines are such data redefinition that lead to an uncompatible conversion, like shown in the following table:

picture

usage

X

DISPLAY

9

DISPLAY

S9

DISPLAY

S9

COMP

S9

COMP-3

G

X

DISPLAY

-

-

critical

critical

critical

critical

9

DISPLAY

-

-

critical

critical

critical

critical

S9

DISPLAY

critical

critical

-

critical

critical

critical

S9

COMP

critical

critical

critical

-

critical

critical

S9

COMP-3

critical

critical

critical

critical

-

critical

G

critical

critical

critical

critical

critical

-

Single record structures without critical redefines

The file contains only one record structure without critical redefines.

I.e.

01  FILE-REC.
03  NAME.
05  SURNAME        PIC X(40).
05  FIRST-NAME     PIC X(20).
03  ADDRESS.
05  CITY           PIC X(20).
05  STREET         PIC X(20).
03  INFO.
05  CODE           PIC S9(8) COMP.
05  SALARY         PIC S9(8) COMP.
05  DATE-OF-BIRTH  PIC X(8).
05  FILLER REDEFINES DATE-OF-BIRTH.
07  DATE-YYYY  PIC X(4).
07  DATE-MM    PIC X(2).
07  DATE-DD    PIC X(2).

This is the simplest file type to convert: XCONV toolkit is able to generate everything is required for the conversion.

Multiple record structure without critical redefines

The file contains more than one well-defined record structure each one without critical redefines. Programs accessing the file, recognize the proper structure according to information contained in the record itself.

I.e.

01  FILE-REC.
03  RECORD-TYPE    PIC X.
03  NAME.
05  SURNAME        PIC X(40).
05  FIRST-NAME     PIC X(20).
03  ADDRESS REDEFINES NAME.
05  CITY           PIC X(20).
05  STREET         PIC X(20).
03  INFO REDEFINES NAME.
05  CODE           PIC S9(8) COMP.
05  SALARY         PIC S9(8) COMP.

 

In this case the record structure should be divided in different record structures, one for each sub-type (3 in the example above).

The generated converter will contain the code to convert each different record structure. You have to code a copybook containing the rules to recognize, for each record processed, the correct structure to convert it.

Single record structures with critical redefines

The file contains only one record structure with critical redefines.

I.e.

01  FILE-REC.
03  SURNAME              PIC X(40).
03  FIRST-NAME           PIC X(20).
03  CITY                 PIC X(20).
03  STREET               PIC X(20).
03  CODE                 PIC S9(8) COMP.
03  OTHER REDEFINES CODE PIC X(8).

 

In this situation, the record contains one single record structure, but contains one or more redefines clauses that lead to a critical situation.

The record may be left as is: the converter program will contain the code to handle all the different branches (caused by redefines clauses)of the record. You have to provide a copybook with the rules to recognized, for each record processes, the correct conversion branch to use.

Multiple record structures with critical redefines

The file contains only more than one record structures with critical redefines.

I.e.

01  FILE-REC.
03  RECORD-TYPE    PIC X.
03  NAME.
05  SURNAME                PIC X(40).
05  FIRST-NAME             PIC X(20).
03  ADDRESS REDEFINES NAME.
05  CITY                   PIC X(20).
05  STREET                 PIC X(20).
03  INFO REDEFINES NAME.
05  CODE                   PIC X(8) COMP.
05  SALARY REDEFINES CODE  PIC S9(8) COMP.

 

The record structure should be divided in different record structures, one for each sub-type (3 in the example above).

The generated converter will contain the code to convert each different record structure and, for each one of these, it will contain the code to handle the different branches of the structures.

You have to code a copybook containing the rules to recognize, for each record processed, both the correct structure and the correct branches to convert it.