Chapter 13: Converting Data Files

This chapter describes the graphical Data File Converter that Mainframe Express provides for converting data files on your PC.

For detailed information about using the Data File Converter, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, click Development Environment, Working with Data Files, Converting Data Files.)

13.1 Overview

You can use the Data File Converter to convert data files between file organizations and formats. You can:

13.2 Converting Mainframe-style Files

Since mainframe-style files are catalogued, the conversion process is different from that for PC-style files.

13.2.1 Opening the Data File Converter

To convert a mainframe-style file:

  1. First of all, make sure that the Use Catalog setting in the Data Tools dialog box is selected. To access this setting, click Data Tools on the Options menu.

  2. Go into Catalog View and highlight the data file that you wish to convert.

  3. Open the Data File Converter by clicking Data Tools > Convert on the Tools menu.

    The Dataset Convert dialog box opens:



    Figure 13-1: The Dataset Convert Dialog Box

13.2.2 Specifying the Input File

The Data File Converter displays the name of the file that is highlighted in the catalog and extracts file information about the input file from the catalog entry.

13.2.3 Specifying the Output File

For the output file, the Data File Converter picks up record lengths and key information from the input file's catalog.You can change the settings for the output file.

If you specify indexed organization for the output file, you also need to define the keys for the new file. For more information, see the section Defining Keys for Indexed Files in the chapter Editing Data Files.

For a definition of organization codes and record format codes, see the chapter Advanced Data Set Information in your IDE Technical Guide.


Note: If you request a conversion of a sequential file to an indexed file with unique keys and some of the records contain duplicate key values, Data File Converter ignores these records and does not convert them. At the end of the conversion, Data File Converter informs you of the number of records rejected.


13.3 Converting PC-style Files

Since PC-style files are not catalogued, the conversion process is different from that for mainframe-style files.

When you convert PC-style files, the Data File Converter presents conversion options based on PC file handling. In addition, there are options to convert file types not available for mainframe-style files.

13.3.1 Opening the Data File Converter

To convert a PC-style file:

  1. First of all, make sure that the Use Catalog setting in the Data Tools dialog box is not selected. To access this setting, click Data Tools on the Options menu.

  2. Then, open the Data File Converter by clicking Data Tools > Convert on the Tools menu.

    The Data File Convert dialog box opens:



    Figure 13-2: The Data File Convert Dialog Box

13.3.2 Specifying the Input File

First of all, you select the input file. Mainframe Express must be able to identify the input file's type and record length. This information is stored either in the data file's header or in a profile (.pro) file. For more information, see the section File Headers in the chapter Editing Data Files.

If the file does not have a file header, you need to specify the file organization and record length. You can choose one of the following file organizations:

13.3.3 Specifying the Output File

You need to specify the output file's name. If the Data File Converter does pick up a default organization and record format for the output file, you can change these values. Otherwise, if the Data File Converter does not offer any output file details, you need to supply this information.

You can select one of the following file formats:

File Format Purpose
C-ISAM Emulates files from old systems
ESDS Emulates VSAM ES files
IDXFORMAT(4) When converting an input file that has many duplicate keys
IDXFORMAT(8) For very large files
Level-II Emulates files from old systems
Micro Focus In all other cases

Available file organizations from which you can select are:

For a definition of the record format codes and organization codes, see the chapter Advanced Data Set Information in your IDE Technical Guide.

If you specify indexed organization for the output file, you also need to define the keys for the new file. For more information, see the section Defining Keys for Indexed Files in the chapter Editing Data Files.


Note: If you request a conversion of a sequential file to an indexed file with unique keys and some of the records contain duplicate key values, Data File Converter ignores these records and does not convert them. At the end of the conversion, Data File Converter informs you of the number of records rejected.


13.4 Changing the Record Length

You can increase or decrease the minimum and maximum record length for the new file. If you:

13.5 Converting between EBCDIC and ANSI

When converting between EBCDIC and ANSI, you can use record layouts to control which fields are converted. When you create a record layout, you can alter the setting of the Convert field in the Properties dialog box. By default, the Convert field is switched on for all fields, except for the following types of field:

You can change the setting of the Convert field for an individual field for one or more records. To find out more, see the chapter Using Record Layouts with Data Files and, in particular, the section Converting Between EBCDIC and ANSI.

13.6 Transferring a Mainframe File to the PC

As an alternative to looking at mainframe-style files from your PC through a project, you can also transfer mainframe files to your PC and work on them as PC-style files.

You should transfer mainframe files to the PC in binary format. If a mainframe file is variable length, read the section Variable Length Files.

13.6.1 Variable Length Files

If a file is initially a variable length file, you should ask your administrator to use the mainframe program VRECGEN to perform an initial reformat of the file on the mainframe. You can then use the Data File Converter to convert the file from the VRECGEN format (see the section Converting PC-style Files).

When you want to upload the file to the mainframe, use the Data File Converter to convert the file to VRECGEN2 format. Then, ask your administrator to use the mainframe program VRECGEN2 to reformat the data for the mainframe.

For more information about using VRECGEN, VRECGEN2 and the command line interface, see the chapter File Conversion Utilities in your Administrator's Guide.

13.6.2 Mainframe Report Files

You may need to convert report files that have been produced on the mainframe and then either downloaded to the PC or created by a mainframe application run on the PC.

Mainframe report files can only be converted to PC print files. Similarly, a PC print file can only be converted to a mainframe report file. The mainframe report file should be an EBCDIC-encoded file and the PC print file should be ANSI-encoded.

A mainframe report file contains carriage control characters that the Data File Converter converts to PC-printable formats. When the output file is the mainframe file, the record length includes the carriage control character. When the output file is the PC print file, the record length is solely the data length.

If you specify the input file as a mainframe print format file but it was created on the PC, you may receive error message 139 ("Input file not 'real' mainframe report format"). You can prevent this by ensuring that you use normal mainframe dialects to create an EBCDIC report file.


Copyright © 2002 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.