PreviousUsing Record Layouts with Data Files Rebuilding Indexed FilesNext

Chapter 13: Converting Data Files

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

For detailed information about using the Data File Converter, see the Net 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:


Note: If you need to convert Btrieve files, use the command line version of Rebuild instead. For more information, see the Net Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, double-click Reference, Command Line Reference, Rebuilding Indexed Files.)


13.2 Opening the Data File Converter

You can open the Data File Converter by clicking Data Tools > Convert on the Tools menu. The Data File Convert dialog box opens:



Figure 13-1: The Data File Convert Dialog Box

13.3 Specifying the Input File

First of all, you select the input file. Net 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.4 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:

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.

By default, the Data File Converter adds the new file to the current project. To avoid adding the new file to the current project, uncheck Add file to project.


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.5 Changing the Record Length

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

13.6 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.7 Transferring a Mainframe File to the PC

You can 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.7.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.

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.

13.7.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 © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousUsing Record Layouts with Data Files Rebuilding Indexed FilesNext