To reorganize the file, 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.
rebuild infile.dat,outfile.dat /i
In addition to reorganizing the file, Rebuild displays processing information when the reorganization is complete.
rebuild infile.dat,outfile.dat /s:lii /t:lii
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.
set data=\tmp.dat rebuild data /i
Rebuild reorganizes and displays information about the file \tmp.dat.
In addition to reorganizing the file, Rebuild writes the data in the order of the third alternate key.