Added support in ProIndexer to specify a header and trailer record when creating an index file.
Added the configuration parameter INDEXTEMPFILE=filename where filename is the name of a temporary file.
In some situations, a header record is required in an index file whose contents can only be determined after indexing the input file. An example would be the number of entries in the index file. In this situation, the output from the index driver must be written to a temporary file which is specified by the parameter INDEXTEMPFILE. When the indexing is finished, the header record is written to the file specified by the parameter INDEXFILE and the contents of the temporary file are copied to the file specified by the parameter INDEXFILE. Note that INDEXTEMPFILE is not required if the first record written is the header record.
The header record is specified with the parameter LOCATION=FILESTART in the INDEX statement which is part of ProIndexer. If a header record is created that requires the parameter INDEXTEMPFILE and nothing is specified, a critical error will be generated.
For applications generating small index files, a MEMFILE is preferable to get the best performance.
In ProIndexer added values LOCATION=FILESTART and LOCATION=FILEEND to create header and trailer index records for index files.
To create a header index record, the INDEX statement would need to include the following:
INDEX Name=headerRecord, Location=filestart, Fields=(...), Format='...', Writetrigger=..., Outformat=index;
To create a trailer index record, the INDEX statement would need to inclue the following:
INDEX Name=trailerRecord, Location=fileend, Fields=(...), Format='...', Writetrigger=..., Outformat=index;