Convert mainframe data files with complex record layouts using Micro Focus - AWS Prescriptive Guidance

Convert mainframe data files with complex record layouts using Micro Focus

Created by Peter West

Environment: Production

Source: Mainframe EBCDIC Data Files

Target: Micro Focus ASCII Data Files

R Type: Rehost

Workload: All other workloads

Technologies: Mainframe; Modernization

AWS services: AWS Mainframe Modernization

Summary

This pattern shows you how to convert mainframe data files with non-text data and complex record layouts from EBCDIC (Extended Binary Coded Decimal Interchange Code) character encoding to ASCII (American Standard Code for Information Interchange) character encoding by using a Micro Focus structure file. To complete the file conversion, you must do the following:

  1. Prepare a single source file that describes all the data items and record layouts in your mainframe environment.

  2. Create a structure file that contains the record layout of the data by using the Micro Focus Data File Editor as part of the Micro Focus Classic Data File Tools or Data File Tools. The structure file identifies the non-text data so that you can correctly convert your mainframe files from EBCDIC to ASCII.

  3. Test the structure file by using the Classic Data File Tools or Data File Tools.

Prerequisites and limitations

Prerequisites

Product versions

  • Micro Focus Enterprise Server 7.0 and later

Tools

Epics

TaskDescriptionSkills required

Identify source components.

Identify all possible record layouts for the file, including any redefinitions that contain non-text data.

If you have layouts that contain redefinitions, you must factor these layouts down to unique layouts that describe each possible permutation of the data structure. Typically, a data file’s record layouts can be described by the following archetypes:

  • Record layout with only text data

  • Record layout with non-text data

  • Record layout with non-text data subordinate to a REDEFINES clause

For more information on creating flattened record layouts for files that contain complex record layouts, see Rehosting EBCDIC applications on ASCII environments for mainframe migrations.

App developer

Identify record layout conditions.

For files with multiple record layouts or files that contain complex layouts with a REDEFINES clause, identify the data and conditions within a record that you can use to define which layout to use during conversion. We recommend that you discuss this task with a subject matter expert (SME) who understands the programs that process these files.

For example, a file might contain two record types that contain non-text data. You can inspect the source and possibly find code similar to the following:

MOVE "M" TO PART-TYPE MOVE "MAIN ASSEMBLY" TO PART-NAME MOVE "S" TO PART-TYPE MOVE "SUB ASSEMBLY 1" TO PART-NAME

The code helps you identify the following:

  • The "PART-TYPE" field is used to determine the record type

  • The value "M" is used for the "M-PART-RECORD"

  • The value "S" is used for the "S-PART-RECORD"

You can document the values that are used by this field to associate the record layouts with the correct data records in the file.

App developer

Build the source file.

If the file is described over multiple source files or if the record layout contains non-text data that’s subordinate to a REDEFINES clause, then create a new source file that contains the record layouts. The new program doesn’t need to describe the file using SELECT and FD statements. The program can simply contain the record descriptions as 01 levels within Working-Storage.

Note: You can create a source file for each data file or create a master source file that describes all the data files.

App developer

Compile the source file.

Compile the source file to build the data dictionary. We recommend that you compile the source file by using the EBCDIC character set. If the IBMCOMP directive or ODOSLIDE directives are being used, then you must use these directives in the source file too.

Note: IBMCOMP affects the byte storage of COMP fields and ODOSLIDE affects padding on OCCURS VARYING structures. If these directives are set incorrectly, then the conversion tool won’t read the data record correctly. This results in bad data in the converted file.

App developer
TaskDescriptionSkills required

Start the tool and load the dictionary.

  1. Choose the Windows Start menu icon, search for and choose Micro Focus Enterprise Developer, and then choose Classic Data File Tools.

  2. Choose File, and then choose Record Layout.

  3. In the Select a file to construct the layouts from dialog box, for File name, select the IDY (.idy) file that was created when you compiled the source file earlier. Then, choose Open.

  4. To confirm that Classic Data File Tools is using EBCDIC, in the Data File Tools dialog box, choose YES if the IDY file is set to EBCDIC and Datatools is set to ANSI.

App developer

Create the default record layout.

Use the default record layout for all records that don’t match any conditional layouts.

  1. In the Layout window, expand the data structure, and then locate the 01 level used for the default layout.

  2. Right-click the 01 item, and then choose New Layout.

  3. In the New Record Layout Wizard dialog box, choose Default Layout, and then choose Next.

  4. Choose Finish.

The default layout appears in the Layouts pane and can be identified by the red folder icon.

App developer

Create a conditional record layout.

Use the conditional record layout when there is more than one record layout in a file.

  1. In the Layouts pane, expand the data structure, and then locate the 01 level used for the conditional layout.

  2. Right-click the 01 item, and then choose New Layout.

  3. In the New Record Layout Wizard dialog box, choose Conditional Layout, and then choose Next.

  4. Choose Finish. The conditional layout appears in the Layouts pane and can be identified by the yellow folder icon.

  5. Expand the conditional layout, right-click the field where you must place a condition, and then choose Properties.

  6. In the Field Properties dialog box, enter the condition. Confirm that the character set is set to EBCDIC, and then choose OK. A checkmark appears next to the field that has a condition set.

  7. Repeat steps 5–6 for any other fields that require conditions for this layout.

  8. Repeat steps 1–6 for any other conditional layouts that must be added.

  9. Choose File, choose Save As, and then save the structure file to disk.

App developer
TaskDescriptionSkills required

Start the tool and load the dictionary.

  1. Choose the Windows Start menu icon, search for and choose Micro Focus Enterprise Developer, and then choose Data File Tools.

  2. Choose File, New, Structure File

  3. In the Open dialog box, for File name, select the IDY (.idy) file that was created when you compiled the source file earlier. Then, choose Open.

  4. To confirm that Data File Tools is using EBCDIC, confirm that the drop-down menu in the Debug File section is set to EBCDIC.

App developer

Create the default record layout.

Use the default record layout for all records that do not match any conditional layouts.

  1. In the Available Layouts section on the left pane, expand the data structure, and then locate the 01 level used for the default layout.

  2. Right-click the 01 item, and then choose Create Default Layout.

The default layout appears in the Layouts pane and can be identified by the blue “D” icon.

App developer

Create a conditional record layout.

Use the conditional record layout when there is more than one record layout in a file.

  1. In the Selected Layouts section on the right pane, expand the data structure, and then locate the 01 level used for the conditional layout.

  2. Right-click the 01 item, and then choose Create Conditional Layout. The conditional layout appears in the Layouts pane on the right side and can be identified by the green "C" icon.

  3. Expand the conditional layout, right-click the field where you must place a condition, and then choose Properties.

  4. In the Field Properties dialog box, enter the condition. Confirm that the character set is set to EBCDIC, and then choose OK. A red “IF” icon appears next to the field that has a condition set.

  5. Repeat steps 3–4 for any other fields that require conditions for this layout.

  6. Repeat steps 1–4 for any other conditional layouts that must be added.

  7. Choose File, choose Save As, and then save the structure file to disk.

App developer
TaskDescriptionSkills required

Test an EBCDIC data file.

Confirm that you can use your structure file to view an EBCDIC test data file correctly.

  1. Choose the Windows Start menu icon, find and choose Micro Focus Enterprise Developer, and then choose Classic Data Tools.

  2. Choose File, and then choose Open.

  3. In the Open dialog box, for File name, select the EBCDIC dataset, and then choose Open.

  4. Choose File, Data File Editor, Load Record Layouts.

  5. In the Open dialog box, for File name, select the structure file, and then choose Open.

  6. To confirm that the character set mode is set to EBCDIC, confirm that the drop-down menu is set to EBCDIC. You can see the raw record data in the left pane and the formatted data in the right pane.

  7. Choose various records to ensure that all formats are rendered with the correct layout.

App developer
TaskDescriptionSkills required

Test an EBCDIC data file.

Confirm that you can use your structure file to view an EBCDIC test data file correctly.

  1. Choose the Windows Start menu icon, find and select Micro Focus Enterprise Developer, and then choose Data File Tools.

  2. Choose File, Open, Data File.

  3. In the Open Data File dialog box, on the Local tab, for Filename, choose Browse to find the location of the EBCDIC test file.

  4. For Structure File (optional), choose Browse to find the location of the structure file.

  5. In the File Details section, enter the details of the file and confirm that Encoding is set to EBCDIC.

  6. Choose either Open Shared or Open Exclusive mode depending on your requirements.

  7. Confirm that the drop-down menu in the Appearance section of the toolbar is set to EBCDIC. You will see the raw record data in the left pane and the formatted data in the right pane.

  8. Choose various records to ensure that all formats are rendered with the correct layout.

App developer
TaskDescriptionSkills required

Test the conversion of an EBCDIC file.

  1. Choose the Windows Start menu icon, find and select Micro Focus Enterprise Developer, and then choose Classic Data Tools.

  2. Choose Tools, and then choose Convert.

  3. In the Data File Convert dialog box, in the Input file section, for Filename, choose Browse to find and select the EBCDIC input file. Confirm that Character set is set to EBCDIC.

  4. In the Character Set Conversion section, select the Convert character set and Records contain non-text data items check boxes. Choose Select layout for conversion, and then choose Browse to find and select the structure file.

  5. In the New file section, for Filename, enter the path and file name of the ASCII output file that you want to create. By default, the conversion tool defaults to the same format as the input file. For testing, leave the options set to their default values.

  6. Choose Convert.

  7. Follow the steps in either the (Option A) Test the structure file using Classic Data File Tools or (Option B) Test the structure file using Data File Tools section, but load the ASCII output file instead of the EBCDIC file.

  8. Load both the EBCDIC and ASCII files into the Data File Editor, and then compare the files side by side to check the accuracy of the conversion.

App developer

Related resources