On UNIX systems, Rebuild options must be preceded by a hyphen (-) character rather than a slash (/) character.
The section provides examples of using Rebuild.
The following example 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 infile.dat,outfile.dat /i
The following example reorganizes the file. The data is written in the order of the third alternate key.
rebuild infile.dat,outfile.dat /x:3
The following example rebuilds the indexed file (assuming that the index (.idx) file is still present, and the key information held therein is not corrupt).
With C-ISAM and Level 2 files that do not have index files, use the /r and /s options to specify the record information and file format. The following example converts a C-ISAM format index file into the format used by this system and compresses the data part of the file.
rebuild infile.dat,outfile.dat /s:c-isam /c:d1 /t:mf
The following example generates an index, with key compression, for a fixed-length relative file.
rebuild infile.dat,outfile.dat --o:rel,ind /k:1+2:3+10d /c:i7 /r:f10
The following example reorganizes a LEVEL II V2.5 COBOL format file and retains the LII structure on the output file. It is possible to combine /s and /t with other formats in a similar manner.
rebuild infile.dat,outfile.dat /s:lii /t:lii
The following example reorganizes and displays information about the file /tmp.dat.
set data=/tmp.dat rebuild data /i