The DIRCONV statement REORGANIZE-DIRECTORY enables directory and repository files to be reorganized.
In this case empty data records which may have been created by deleting save versions are removed (with //MODIFY-ARCHIVE ... SAVE-FILE=*DELETE). This is necessary to prevent the maximum number of sets for one file and/or job variables (JV) from being exceeded. When the maximum number (256) for a file or JV is reached, no further information can be written to the directory for this file and/or job variable, which is displayed by the message ARC0176.
The maximum number can in particular be reached when the same files are repeatedly saved to the same archive. If old save versions are regularly deleted in this case, the reorganization of the directory file can significantly reduce the number of data records and thus prevent the directory file from overflowing.
It is consequently recommended that reorganization be performed regularly using the DIRCONV statement REORGANIZE-DIRECTORY.
When reorganization takes place, a copy of the original directory file is created. Following successful reorganization, this copy can be used in place of the original directory file.