PreviousConverting Data Files File Conversion UtilitiesNext

Chapter 14: Rebuilding Indexed Files

This chapter describes the Fix File Index utility that Net Express provides for repairing corrupt indexed files on your PC.

For detailed information about using Fix File Index, see the Net Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, double-click Development Environment, Working with Data Files, Repairing Indexed Files.)

14.1 Overview

There are a number of reasons why an indexed file becomes corrupt. For example:

When a COBOL program tries to open a corrupt indexed file, the run time system detects that the file is corrupt and returns an extended file status code.

Fix File Index can recover corrupt indexed files for you under the following circumstances:

After you have used Fix File Index, you should reorganize the repaired file. For more information, see the section Reorganizing Indexed Files.


Warnings:


14.2 Prerequisites

Fix File Index can rebuild only those indexed files that are already in Micro Focus format, which is the format used by Net Express. Therefore, initially you should convert your LEVEL-II V2.5 COBOL files into Micro Focus format, so that you can rebuild the files in the event of corruption. To convert your files, use the Data File Converter (see the chapter Converting Data Files).

Before you rebuild a file, you should take a backup copy of both the index (.idx) and data (.dat) parts of the indexed file.

14.3 Rebuilding an Indexed File

To rebuild the index of a corrupt indexed file, you should make sure that the corrupt indexed file is not still open in the Data File Editor. Then, click Data Tools>Fix File Index on the Tools menu.

The Fix File Index dialog box opens:

A screen dump of the Fix File Index dialog box

Figure 14-1: The Fix File Index Dialog Box

You can type in the name of the corrupt indexed file or click Browse to select the file.

If the file header information is not available, Fix File Index displays a warning message. As Fix File cannot derive this information from the file header, you must select a file format and define the file keys. For more information, see the section Supplying File Header Information.

If the file header information is available, you can recreate the index file by clicking Fix File Index.

14.3.1 Supplying File Header Information

To supply a file header, click Advanced Options on the Fix File Index dialog box.

The Advanced dialog box opens:

A screen dump of the Advanced dialog box

Figure 14-2: Supplying the File Header Information

If the file format information is corrupt, Select a File Format displays as UNKNOWN. In this case, you need to specify the file format, which must be the same as the original file format of the index file before the file became corrupt.

You can ask Fix File Index to carry on processing, after finding a record with duplicate keys, by checking Continue after a duplicate key error?. In this case, Fix File Index reports any records with duplicate keys without writing those records.

You can check whether the key information is corrupt by clicking Define Keys.

14.3.2 Redefining Key Information

When you click Define Keys, the Key Information dialog box opens:

A screen dump of the Key Information dialog box

Figure 14-3: The Key Information Dialog Box

If the Key Information dialog box displays the correct key information, the key information is not corrupt and you can click Cancel and then click FixFile Index to repair the file.

Otherwise, you can click Insert Key to add the first key. At this point, the tree expands and the cursor moves to Key Offset. For each key that you add, you need to supply the following information:

For each key, you can supply additional information under Key Compression and Key Options, where relevant.

The tree structure displays key components as child items. A key may have more than one component. To insert another component, you can highlight a component in the tree and then click on either Insert Component Before or Insert Component After.

You can define more than one key for the index file. To insert another key, highlight a key in the tree and then click on either Insert Key Before or Insert Key After.

When you have finished, you can click OK. Then, to repair the corrupt index file, click Fix File Index in the Fix File Index dialog box.

14.4 Reorganizing Indexed Files

You should reorganize an indexed file after you have:

To reorganize an indexed file, use the Data File Converter and specify the same output file and format as the input file. To find out more about the Data File Converter, see the chapter Converting Data Files.


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

PreviousConverting Data Files File Conversion UtilitiesNext