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.)
You can use the Data File Converter to convert data files between file organizations and formats. You can:
Converting files from one format to another enables you to restructure data. For example, you can convert a data file from sequential organization to indexed or you can add extra secondary indices.
The Data File Converter provides an easy method for data conversion between EBCDIC and ANSI, thereby removing the need to recreate data already produced or to write special conversion programs. You can also convert internal floating-point formats between S/370 format and IEEE format.
For non-variable length records, you can specify a new record length. For variable length records, you can change the minimum length and maximum length.
You can convert mainframe-style files which are catalogued on your PC.
Alternatively, you can download mainframe files to your PC and convert them as uncatalogued PC-style files. To work this way, you can convert from:
Since mainframe-style files are catalogued, the conversion process is different from that for PC-style files.
To convert a mainframe-style file:
The Dataset Convert dialog box opens:
Figure 13-1: The Dataset Convert Dialog
Box
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.
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.
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.
To convert a PC-style file:
The Data File Convert dialog box opens:
Figure 13-2: The Data File Convert Dialog
Box
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:
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.
You can increase or decrease the minimum and maximum record length for the new file. If you:
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.
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.
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.
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.