Copyright: Copyright (C) 2002 Micro Focus International Ltd. All rights reserved.
Citation: Copyright (C) 2002 Micro Focus International Ltd. All rights reserved.


Rebuild - Overview

Rebuild is a file management utility which enables you to:

Validate an indexed file.

Reorganize an indexed file.

Recover a corrupt indexed file.

You should always take a backup copy of a file before you reorganize, rebuild or convert it. This is simply as a precaution against an incorrectly specified command line which could lead to file corruption. For indexed files, you should save both the index and data parts of the file.

Rebuild Facilities

Rebuild Command Line

Rebuild Error, Information and Warning Messages


Rebuild Facilities
Rebuild Facilities - Overview

Rebuild can be used to reorganize an indexed file, rebuild a corrupt indexed file or simply validate an indexed file.

The operation performed on a file by Rebuild depends on the options specified on the Rebuild command line.

Reorganizing an Indexed File

The format of the command line for reorganizing a file is:

rebuild in-file,out-file [/c] [/d] [/x] [/I] [/v]

Reorganizing an Indexed File

Rebuilding a Corrupt Indexed File

The format of the command line for rebuilding an index is:

rebuild in-file [/c] [/k] [/I] [/v] [/e] [/f]

Rebuilding a Corrupt Indexed File

Validating an Indexed File

The format of the command line for validating a file is:

rebuild in-file /f[c] [d]

Validating an Indexed File


Reorganizing an Indexed File

As indexed files are updated, by adding, deleting and altering records, the index and data structures become disjointed, making processing less efficient. In addition, space left by deleted records is not always reused, making the file bigger than it needs to be.

After a large number of changes have been made, it is worth reorganizing an indexed file to rebuild the data and indices in an ordered sequential fashion and to reclaim any free space. This will ensure optimum performance and data integrity.

There are other reasons why you may want to rebuild a file. For example, if a file is processed sequentially, the access time to process the file increases over time, as the records start to become out of sequence due to updates. In this situation, you can reduce access time by reorganizing the file.

Example of indexed file reorganization.


Rebuilding a Corrupt Indexed File

There are a number of reasons why an indexed file becomes corrupt, for example:

A close operation on an indexed file fails.

A power surge occurs while the indexed file is open.

The machine is rebooted or powered off while an indexed file is open.

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

Rebuild can recover corrupt indexed files for you:

If the data portion of the file is intact and only the index portion is corrupt, then Rebuild can generate a new index (.idx) file from the data file with no loss of data.

If the data portion of the file is corrupt then Rebuild can rebuild a complete new indexed file, both data and index portions, but there will be loss of data as Rebuild discards any corrupt data records that it encounters.

Note:

When you use Rebuild to generate a new index file from an existing data file, the information held in the original index about free space in the data file is lost. This means that the free space in the data file cannot be reused and the file may be bigger than is necessary. To overcome this problem, you should reorganize the file after you have rebuilt the index.

Example corrupt indexed file recovery.


Validating an Indexed File

You can use Rebuild to validate the structure of an indexed file.

A number of validation checks are performed by Rebuild and you can choose to perform all of them, or just a sub-set. Of course, the more checks you perform, the longer the validation process takes.

Example file validation.


Rebuild Command Line - Overview

The general format of the Rebuild command line is:

rebuild in-file [,out-file] [options]

Input and Output Files

Both in-file and out-file must include the filename extension. The filename of out-file must not be the same as in-file. You can use environment variables in place of in-file or out-file to implement filename mapping.

Options

The options specified on the command line define the operation to be carried out by Rebuild.

Rebuild Options

Parameter Files

An at character (@) followed by a filename indicates that parameters should be taken from the named file.

Parameter Files

Redirection of Information

All information displayed by the Rebuild utility can be redirected to a text file using standard operating system redirection:

>	Creates a new file.

>>	Extends an existing file

Example Rebuild redirection.

System Parameters

The following system parameters can be specified on the command line:

/q	prevents banners being displayed.

/v	displays the version number of the Rebuild program itself.


Rebuild Parameter Files
Parameter Files

On the Rebuild command line an at character (@) followed by a filename indicates that the named file contains Rebuild command line parameters.

If you use a file to supply Rebuild command line parameters, the file must be an ASCII text file (you can use Notepad to create or edit such a file).

The Rebuild parameter file must be no larger than 1024 bytes.

Within the Rebuild parameter file, spaces are non-significant, line ends are treated as spaces and any text between an asterisk (*) and the line end is treated as a comment.

Example Rebuild parameter file.


Rebuild Options - Summary

The processing performed by Rebuild is defined by the options specified on the command line. The following options are available:

/c - specifies file compression.

/d - skips corrupt data records.

/e - reports illegal duplicate keys and continues processing.

/f - validates indexed files.

/i - displays information about the files being processed.

/k - defines the key structure for an indexed file.

/n - displays information about a file (no other processing is performed).

/o - specifies the organization of the input file.

/v - displays a record count which is incremented as the file is processed.

/x - specifies the order in which data is written when reorganizing an indexed file.

Options may be placed in any order on the command line.

Options can be separated from their parameters by an optional colon (:).

Note:

To ensure that Rebuild does not use default values which conflict with your file(s), you should always make the Rebuild command as explicit as possible.


Rebuild Options -./c
Rebuild Options - /c

The /c option specifies file compression. Data compression can only be specified for an output file. Key compression can be specified for an output file or the rebuild of an existing file.

The /c option operates in a similar manner to the Compiler directives DATACOMPRESS and KEYCOMPRESS.

Parameters

dn	data compression

For data compression n must be in the range 0 to 255 where 0 denotes no compression, values of 1 to 127 are reserved, and 128 to 255 are for user-defined compression routines.

In	key compression

For key compression n must be in the range 0 to 7 where 1 denotes compression of duplicates, 2 denotes compression of leading characters, 4 denotes compression of trailing spaces and any combination of these can be specified by adding together the appropriate values. Zero denotes no key compression.

Examples

/c:d1i6

This example specifies user-defined data compression routine 1, and key compression of leading characters and trailing spaces.

/ci1

This example specifies key compression of duplicates only.

 Related Topics


Rebuild Options - /d

The /d option specifies that Rebuild should continue from the beginning of the next record if it finds that the data part of a record in an indexed file is corrupt.

Default

If the /d option is not set, Rebuild returns file status error 9/018 when it encounters a corrupted record.

 Related Topics


Rebuild Options - /e

The /e option specifies that, when rebuilding a corrupt file, or a file with a new key structure (/k option used), and a record with an illegal duplicate key is encountered, Rebuild reports the duplicate and continues to process the remaining records. (The record with the duplicate key is not written.)

Default

If the /e option is not specified, illegal duplicate keys cause Rebuild to terminate with an "Error on output file - status 22" error.

 Related Topics


Rebuild Options - /f

The /f option is used to validate an indexed file. A non-zero value is returned by Rebuild if the file is corrupt.

Parameters

c	Specifies the validation performed. You can select any combination of these checks by adding the appropriate numbers together. (The more checks you perform, the longer the validation takes.)

1	Checks the data file structure and counts the number of records.

2	Checks the structure of the free space list (FSL).

4	Checks that the FSL entries actually exist in the data file.

8	Checks the index file structure.

16	Checks index file key entries correctly locate data file records.

32	Checks that index file key values match those of the data file records.

63	All of above (default).

d	Specifies the message level. These values are cumulative, so if you select level 4, you will receive messages at levels 1, 2 and 3 as well.

0	Displays nothing.

1	Displays error messages only.

2	Displays messages showing which options you have selected.

3	Displays information about the file including key definition, record lengths, data compression, and the version of the file handler which created and updated the file.

4	Displays the different types of record present in the file:

1	IDXFORMAT"4" information record.

2	Deleted record.

3	System record.

4	Data record.

5	Data record which has been reduced in size by a rewrite.

6	Data record which has been increased in size by a rewrite and therefore cannot fit into the original record area. Instead, this record points to another record area which contains the record.

7	Record pointed to by type 6 record.

8	Record pointed to by type 6 record.

5	Displays statistics about each key structure including information about how much space is being saved by key compression.

Examples

rebuild test.dat /f:c9

This example checks the structure of the data file (1) and the structure of the index file (8).

rebuild test.dat /f:c63d5

This example performs a full integrity check on the file, displaying all the information possible:

 Related Topics


Rebuild Options - /i

The /i option displays information about the input and output files, including record lengths, file type and key structure.

If you want to display this information but do not want to perform any other processing, use the /n option instead.

 Related Topics


Rebuild Options - /k

The /k option defines the key structure for an indexed file.

The key structure is used to rebuild the index of an indexed file when the original index is missing or corrupt.

If the index part (.idx) of an indexed file does not exist, it is possible to rebuild it by specifying a key structure option. This process also makes it possible to replace the key structure of an existing indexed file with an alternative structure, simply by running Rebuild in this mode with a new key specification.

Each key is defined by its starting character position within the record (the first character position in a record is 1) and its length in characters. The starting position and length are separated by a plus sign (+) or the letter L.

The definition of one key is separated from the definition of the next key by a colon (:).

Each key can be defined as a number of parts (split key), each part being separated by a comma (,).

Alternate keys (those other than the first defined) can be terminated by the parameter d, indicating WITH DUPLICATES.

Example

/k:1+20

This example defines a single key, starting at character position 1 and 20 characters in length.

/k:5+5:20+1d:40+2,43+10

This example defines three keys. The first key, the primary key, starts at character position 5 and is 5 characters in length; the second key, an alternate key allowing duplicates, starts at character position 20 and is 1 character in length; the third key, a split alternate key, has two parts, the first starting at character position 40 and 2 characters in length and the second starting at character position 43 and 10 characters in length.

 Related Topics


Rebuild Options - /n

The /n option displays the same information as the /i option but without performing any other processing.

 Related Topics


Rebuild Options - /o

The /o option specifies the organization of a file which is to be converted.

Parameters

/o:s	sequential

/o:r	relative

/o:i	indexed

By default, the output file has the same organization as the input file, but in a format suitable for this COBOL system.

However, you can create indexed files from sequential and relative files by adding the letter i after the s or r. To create an index for such a file, you must specify the key structure with the /k option.

Default

If the /o option is omitted the organization of the file to be converted is assumed to be indexed.

Example

/o:ri /k:1+2:3+10d

This example converts a relative file into an indexed file with the key structure specified by the /k option.

Notes:

Fixed length sequential and fixed length relative files do not have variable structure file headers and therefore cannot be processed by Rebuild. You can create fixed length sequential or fixed length relative files with variable structure file headers by retaining the record length information in the COBOL creating program and by adding a RECORDING MODE IS VARIABLE clause to the FD of your program.

 Related Topics


Rebuild Options - /v

The /v option causes Rebuild to display a record count which it increments as it processes the file. This is useful if you want to keep track of how Rebuild is progressing.

Warning:

Do not use the /v option if you are redirecting the output.

 Related Topics


Rebuild Options - /x

The /x option defines the key-of-reference. The key-of-reference defines the order in which data is written when an indexed file is reorganized.

Parameters

n	The number of the key to be used where the primary key is 0 and the alternate keys are numbered, starting at 1, in the order they are specified in the SELECT statement in the creating program.

Default

If no /x option is specified, the primary key (key 0) is assumed.

Example

/x:2

In this example, the data is written in the order specified by the second alternate key for the file.

 Related Topics


Rebuild Error, Information and Warning Messages

Rebuild may output error, information or warning messages when rebuilding, converting or reorganizing an indexed file.

Command Line Errors - when an error is encountered, the command line is displayed with a caret (^) symbol under the point at which the error was detected and error message is displayed.

Rebuild Errors - the program sets the return code to a value other than zero to indicate the type of error that has occurred.

Information - these messages are displayed for information only.

Warnings - depending on the operation selected, some command line options are unnecessary. In these cases, the incorrect usage will be indicated, but the option will be ignored and processing will continue. Note that the option may be correct, but omission of other information may have caused Rebuild to select the wrong process. If this is the case, correct the command line and rerun.

 Related Topics


Command Line Errors

If a command line error occurs, the return code will be set to 9.

***Invalid parameter combination

/k option is required for conversion to indexed file

Data compression out of range

Data compression specified more than once

Input file same as output file

Index compression out of range

Index compression specified more than once

Invalid command - /n not allowed with Microsoft format file

Invalid command - must specify output file for conversion

Invalid command line

Invalid compression choice - must be 'd' or 'i'

Invalid format

Invalid key length - cannot be zero

Invalid key specification - key not contained in record

Invalid key start - cannot be zero

Invalid key structure - '+' expected

Invalid option

Invalid organization

Invalid organization - 'i' or nothing expected

Invalid organization - must be indexed for index rebuild

Invalid organization - must be indexed for reorganization

Invalid record length - cannot be zero

Invalid record lengths - maximum must not be less than minimum

Invalid record parameter - '-' expected

Invalid record type - 'F' or 'V' expected

Invalid source format

MS2X specified for non-indexed file

Must have key definition (/k option) with MS2X

No output file specified for /t to refer to

No output file specified for data compression

Number expected

Output file was not specified for indexed output

Parameter file not found

 Related Topics


***Invalid parameter combination

The parameters specified on the command line are not compatible with each other.

Resolution

Specify valid parameters for the options you want to use.


/k option is required for conversion to indexed file

No key definition was given for the index of the file being generated from a sequential or relative file.

Resolution

Specify a key definition.


Data compression out of range

The integer you specified for data compression is not within the allowable range.

Resolution

Data compression requires an integer in the range 0 through 255.


Data compression specified more than once

You have specified the option for data compression more than once; that is, /c:[dn][dn]

Resolution

The correct format is /c:[dn][in]


Input file same as output file

You have given the output file the same name as the input file.

Resolution

The output filename must be different from the input filename.


Index compression out of range

The integer you specified for index compression is not within the allowed range.

Resolution

Index compression requires an integer in the range 0 through 7.


Index compression specified more than once

You have specified the option for index compression more than once; that is, /c[in][in].

Resolution

The correct format is /c:[dn][in].


Invalid command - /n not allowed with Microsoft format file

You have specified the /n option for a Microsoft format file which you cannot do unless the Microsoft format file has been converted into the indexed file format used by this system.

Resolution

You must either reenter the command line without the /n option, or convert the Microsoft format file to the indexed file format used by this system and enter the command line again.


Invalid command - must specify output file for conversion

You have omitted an output filename for a conversion.

Resolution

You must specify an output filename when you want to convert a file to a different format.


Invalid command line

The command line contains an error other than those described above.

Resolution

Check carefully the syntax, spelling, and spacing in the command line you are trying to enter.


Invalid compression choice - must be 'd' or 'i'

The specification of data or index compression was not correct.

Resolution

When you want to specify data or index compression, you must specify the d or i parameters.


Invalid format

The integer you specified for index file format is not within the allowable range.

Resolution

Index file formats require an integer in the range 0 through 4.


Invalid key length - cannot be zero

One of the keys you defined has a zero length, which is illegal. (This may be due to incorrect use of separator characters.)

Resolution

Make sure that any keys you define have a valid start character.


Invalid key specification - key not contained in record

One of the keys, as defined, is not wholly contained in the record. This is illegal.

Resolution

For variable length records, the key must be wholly contained in the minimum length record.


Invalid key start - cannot be zero

One of the keys defined has a start character position of zero, which is illegal. (This may be due to incorrect use of separator characters.)

Resolution

Make sure that any keys you define have a valid start character.


Invalid key structure - '+' expected

A key part parameter of the /k option is incorrect.

Resolution

It must be start character position and length separated by a plus (+) or L.


Invalid option

You have specified an invalid option.

Resolution

The options you can specify are described earlier in this chapter.


Invalid organization

The syntax of the /o option is incorrect.

Resolution

The only valid organizations you can specify with the /o option are:

s	Sequential

r	Relative

i	Indexed


Invalid organization - 'i' or nothing expected

The syntax of the /o option is incorrect.

Resolution

The only valid characters after the i, s or r are the letter i (when converting to an indexed file) or a slash (/) (when another option is specified).


Invalid organization - must be indexed for index rebuild

You have tried to rebuild the index of a file whose organization is sequential or relative.

Resolution

Make sure that the filename you enter for rebuilding is that of an indexed file.


Invalid organization - must be indexed for reorganization

You have tried to reorganize a file index for a file whose organization is sequential or relative.

Resolution

Make sure that the filename you enter for reorganization is that of an indexed file. If it is not, reorganization will fail.


Invalid record length - cannot be zero

You have specified that the length of a record is zero. This is invalid.

Resolution

When specifying record lengths, you must specify a length greater than zero which falls within the limits for record lengths for this


Invalid record lengths - maximum must not be less than minimum

The integers you have used to specify the maximum and minimum lengths of a record indicate that the maximum length is less than the minimum length. This is invalid.

Resolution

Reenter the maximum or minimum record length again, ensuring that the maximum length is greater than the minimum length.


Invalid record parameter - '-' expected

When specifying the record structure of a variable length file, you have not separated the minimum record length and the maximum record length with a hyphen (-).

Resolution

The correct format is /r:Vminreclen-maxreclen


Invalid record type - 'F' or 'V' expected

You have entered record type other than fixed or variable. This is invalid.

Resolution

Reenter the record type using either f (fixed) or v (variable).


Invalid source format

The format of the /s option is incorrect.


MS2X specified for non-indexed file

You have specified that you want to convert a Microsoft COBOL indexed file when that file is not indexed.

Resolution

Make sure that you are using the /s option and the correct parameter.


Must have key definition (/k option) with MS2X

The Microsoft key file is not present.

Resolution

You must specify the /k option to enable Rebuild to set up the keys for this file.


No output file specified for /t to refer to

You did not specify a name for the output file which was referred to with the /t option.

Resolution

Specify the name of an output file for this option.


No output file specified for data compression

You did not specify an output filename for data compression.

Resolution

Specify a valid output filename.


Number expected

You have specified another character where a number was expected.

Resolution

Specify a numeric value for this parameter.


Output file was not specified for indexed output

No name was given for the output file in conversion to an indexed file.

Resolution

Specify an output filename.


Parameter file not found

The parameter file specified on the command line cannot be found.

Resolution

Check the file exists, and the specification used on the command line is correct.


Rebuild Errors

**Error on input file - bad file structure

***Error on input file - Communications failure

***Error on input file - Disk input output error

***Error on input file - disk space exhausted

***Error on input file - duplicate key - record not written

***Error on input file - file is not a BTRIEVE indexed file

***Error on input file - file is not a C-ISAM indexed file

***Error on input file - file is not an LII indexed file

***Error on input file - file is not an MF indexed file

***Error on input file - file is not an MF4 indexed file

***Error on input file - file is not a variable relative file

***Error on input file - file is not a variable sequential file

***Error on input file - File locked

***Error on input file - file must be indexed for rebuild

***Error on input file - file must be indexed for reorganization

***Error on input file - file not found

***Error on input file - illegal filename specified

***Error on input file - invalid /x: key-of- reference

***Error on input file - no record size information

***Error on input file - not MF indexed or variable format

***Error on input file - record size >> specified

***Error on input file - status xx

***Error on input file - status 9/yyy

***Error on output file - record length << min or >> max

***Error on output file - status xx

***Error on output file - status 9/yyy

 Related Topics


***Error on input file - bad file structure

The structure of the input file is not an indexed file in the format used by this system. The return code is set to 1.

Resolution

Ensure that the parameters are correct and that the file is not corrupt.


***Error on input file - Communications failure

This error occurs if you have an Fhredir configuration which tells Rebuild to access files through Fileshare Version 2 (available as an add-on product).

Resolution

Remove this configuration.


***Error on input file - Disk input output error

This indicates a hardware fault. You should contact your system administrator if you see this error.


***Error on input file - disk space exhausted

File processing cannot continue because there is insufficient disk space to do so.

Resolution

Ensure that the input file is not corrupt. The output file is closed and should be usable, if not complete.


***Error on input file - duplicate key - record not written:

The duplicate key was not written to the output file as this would have created an invalid duplicate.


***Error on input file - file is not a BTRIEVE indexed file

The file specified by /s:btrv was not recognized as a Btrieve indexed file. The return code is set to 1.

Resolution

Make sure that the file you specify is a Btrieve indexed file.


***Error on input file - file is not a C-ISAM indexed file

The file specified by /s:c-isam was not recognized as a C-ISAM indexed file. The return code is set to 1.

Resolution

Make sure that the file you specify is a C-ISAM indexed file.


***Error on input file - file is not an LII indexed file

The file specified by /s:lii was not recognized as a LEVEL II V2.5 COBOL indexed file. The return code is set to 1.

Resolution

Make sure that the file you specify is a LEVEL II V2.5 COBOL indexed file.


***Error on input file - file is not an MF indexed file

The file specified by /s:mf was not recognized as an mf indexed file. The return code is set to 1.

Resolution

Make sure that the file you specify is an mf indexed file.


***Error on input file - file is not an MF4 indexed file

The file specified by /s:mf4 was not recognized as an mf4 indexed file. The return code is set to 1.

Resolution

Make sure that the file you specify is an mf4 indexed file.


***Error on input file - file is not a variable relative file

The file specified by /o:r is not recognized as a variable relative file. The return code is set to 1.

Resolution

Specify a variable relative file.


***Error on input file - file is not a variable sequential file

The file specified by /o:s was not recognized as a variable sequential file. The return code is set to 1.

Resolution

Specify a variable sequential file.


***Error on input file - File locked

The file you specified as your input file is locked by another process.

Resolution

Try again when the file is free to be accessed.


***Error on input file - file must be indexed for rebuild

You have chosen to rebuild the index of an indexed file that is in the format used by this COBOL system. The file is in the correct format but it is not an indexed file. The return code is set to 1.

Resolution

Check that you have the correct file and have selected the correct action.


***Error on input file - file must be indexed for reorganization

The input file is not an indexed file in the format used by this system. The return code is set to 1.

Resolution

Check that you have the correct file, and that you mean to do a reorganization.


***Error on input file - file not found

The input file cannot be found. The return code is set to 1.

Resolution

Check that the filename you entered is correct, and the file does actually exist. For reorganization or index rebuild ensure that the index file (.idx) exists for the given indexed data file.


***Error on input file - illegal filename specified

A filename contains an illegal character. This could be any character that is not part of the permitted character set or it could be the system-dependent delimiter, which on most systems is the space.

Resolution

Try the file operation again using the correct filename.


***Error on input file - invalid /x: key-of- reference

The number specified in the key-of-reference option (/x) exceeds the number of keys for the given file. The return code is set to 1.

Check the key required, and try again.


***Error on input file - no record size information

You have specified the <F1>/r<F255> option without specifying record lengths.

Resolution

Make sure that you specify record lengths when you specify the /r option.


***Error on input file - not MF indexed or variable format

The input file is not an indexed file, or a variable format file in the format used by this system. The return code is set to 1.

Resolution

Make sure that the file you specify is either an indexed file, or a variable file whose format is recognized by this COBOL system.


***Error on input file - record size >> specified

The record sizes specified in the /r option do not match those in the file.

Resolution

Correct the /r option and try the operation again.


***Error on input file - status xx

***Error on input file - status 9/yyy

An error, other than one of the above input file errors, has occurred while processing the input file.

Resolution

Possible causes are:

- the file does not exist

- a hardware error has occurred opening or reading the file

- the file is corrupt

The status xx is an ANSI'85 file status. If the first byte is a 9, then the status yyy is a COBOL run-time error number. The output file is closed, and should be usable, if not complete. The return code is set to 1.


***Error on output file - record length << min or >> max

The record length of the output file is less than the minimum or greater than the maximum length you specified.

Resolution

Change the record lengths specified in the /r option.


***Error on output file - status xx

***Error on output file - status 9/yyy

An error has occurred processing the output file. Possible causes are that the file cannot be created, or a hardware error has been encountered on opening or writing the file, or the parameters specified are incorrect.

Resolution

The status xx is an ANSI'85 file status. If the first byte is a 9, then the status yyy is a COBOL run time error number. The return code is set to 2.


Information Messages

Converting file

The file you specified is being converted from one format to another.

Rebuild aborted

You will receive this error followed by one of the errors given in the section Command Line Errors.

Rebuild successful

The file you specified has been successfully rebuilt.

Rebuilding file

The file you specified is being rebuilt.

Rebuilding index

The index of the file you specified is being rebuilt.

Records processed

The indicated number of records were processed when the file was converted, rebuilt or reorganized.

Reorganization successful

The file you specified has been successfully reorganized.

Reorganizing file

The file you specified is being reorganized.

 Related Topics


Warning Messages

Option ignored - /k option not needed for a reorganization

A key definition option has been used when an indexed file reorganization operation has been requested. The option is ignored.

Option ignored - /k option not needed with /n

A key definition option has been used when an indexed file reorganization operation has been requested. The option is ignored.

Option ignored - /k option not needed for ms2 conversion.

A key definition option has been used when you have requested a Microsoft COBOL V2.2 conversion. This is not required since the key information is held in the data file of a Microsoft V2.2 indexed file.

Option ignored - /r option not needed for a reorganization

A record structure for a reorganization has been used when only the /n (information only) option was specified.

Option ignored - /x option not needed for index rebuild

A key-of-reference option has been used when an action other than indexed file reorganization has been selected. The option is ignored.

Option ignored - /x option not needed for ms2 conversion.

A key-of-reference option has been used when you have requested a Microsoft COBOL V2.2 conversion. This is not required since the key information is held in the data file of a Microsoft V2.2 indexed file.

 Related Topics


Rebuild Examples

rebuild badms001.dat,ms001.dat/i

Reorganizes the file. The data is written in the order of the prime record key, and processing information displayed when the reorganization is complete.

rebuild badms001.dat,ms001.dat/x:3

Reorganizes the file. The data is written in the order of the third alternate key.

rebuild ms001.dat

Rebuilds the indexed file (assuming that the index (.idx) file is still present, and the key information held therein is not corrupt).

rebuild ms001.dat/k:1+20/i

Rebuilds the indexed file. The index (.idx) file does not need to exist, and is ignored if it does. It will be completely recreated using the key definition specified (which need not correspond to the key definition used when the file was created). Processing information will be displayed when the rebuild is complete.

rebuild infile.dat,outfile.dat /o:ri /k:1+2:3+10d /c:i7

Generates an index, with key compression, for a relative file.

set data=\tmp.dat

rebuild data /i

Reorganizes and displays information about the file \tmp.dat.


Example Indexed File Reorganization

rebuild infile.dat,outfile.dat

In this example Rebuild reads the data file (infile.dat) using the index file (infile.idx) and then creates the output file (outfile.dat). The deleted records in infile.dat are not written to the output file.

Note:

You cannot use the same filename for the input file and the output file.


Example Corrupt Indexed File Recovery

rebuild infile.dat

In this example Rebuild reads the .idx file to get the key information, and a new index file is created, by reading the data file, infile.dat, sequentially.

If the index file is not present, you must supply information about the key structure using the /k option.


Example File Validation

rebuild test.dat /f:c63d5

In this example Rebuild performs a full integrity check on the file, displaying full information.


Example Rebuild Parameter File

rebuild badms001.dat, ms001.dat @ms001.par

In this example, ms001.par is an ASCII text file containing the following line:

/k:1+20,25+5:40+12:60+3,85+10d


Example Rebuild Redirection

rebuild oldms001.dat,ms001.dat /k:1+20<N>/i >> rebuild.prt

In this example the output from Rebuild is redirected to the existing file rebuild.prt.

Note:

You must not use the /v option when you are redirecting output.