Automatic Segment File Removal

A new option has been added to the REFILE, ERASE and RENAME directives to allow for the automatic deletion/renaming of the related segments for multi-segmented files and C-ISAM .dat files. By including, OPT="ALLSEG" at the end of of the directive, the system will automatically process the related extended segment files.

For example, "MYDATA" is a multi-segment file with three segments MYDATA.001, MYDATA.002, MYDATA.003. Without the ALLSEG option on the ERASE directive, only the primary file would be deleted. Using the new option, not only would the primary file be deleted but all the related segments files would also be deleted.

ERASE "MYDATA",OPT="ALLSEG"

When using the OPT=”ALLSEG option with the REFILE directive, the original primary file would be initialized and all associated segment files would be deleted since they are no longer needed.

Used with C-ISAM files, the OPT="ALLSEG" will delete/re-initialize the related ".dat" file given the ".idx" file.

(Note: RENAME functionality was added with build 9161)

System Parameter:

To avoid having to code this option in all REFILE/ERASE/RENAME directives and to enable this capability on the OPEN PURGE and PURGE directives, the system parameter '+E' can be enabled. With this parameter enabled the OPT="ALLSEG" is assumed to have been specified on all directives.

Background Information:

KEYED files in PxPlus, each file is limited to 2GB. To overcome this limitation, you can have the system create a file with multiple segments by setting the 'MB' system parameter. The value in MB is used to determine the maximum size allowed for each segment created. For example, a value 2000 in MB creates files with a maximum of 2,000MB or roughly 2GB. The segments themselves are created using the same pathname as the original file name, suffixed with .001, .002, etc.

With KEYED files, setting the '+E' system parameter or adding OPT="ALLSEG" to the REFILE or ERASE directive causes the system to automatically delete the segment files.

C-ISAM files exist as two files in the system. An ".idx" file contains the keys for the data and ".dat" contains the data.

With C-ISAM, setting the '+E' system parameter or adding OPT="ALLSEG" to the REFILE or ERASE directive causes the system to automatically delete or re-initialize the ".dat" file.