SetBufferSize( ) and SetIndexSize( ) are subroutines that allow you to modify the buffers used by the File I/O Input subroutines to keep track of the number of lines in a file. These two modifications allow you to adjust the sizes of the buffers to optimize the speed at which the file is read, while keeping the buffer sizes as small as possible.
Program speed can be improved in some cases by increasing the buffer size or the index buffer size for one or more files. Conversely, the amount of memory needed can be reduced by decreasing the buffer size or the index buffer size for one or more files. The default values for both parameters are 1K. If you choose to resize the buffers, make the modifications only once, just after opening the file.
Note, however, that decreasing the buffer size can cause a degradation of response time. Since the buffer fills up more often, the Input subroutines must scan the file multiple times. If the buffer is sized to less than the length of a line, the Input subroutines will attempt to increase the buffer to the next larger increment of 1K. If unsuccessful, the line will not be read.
Buffer size also affects WriteRecord( ), which first collects all of the fields of the record in the buffer, and then writes the buffer's contents all at once. If the buffer is too small to hold the whole record, WriteRecord( ) will attempt to increase the buffer to the next larger increment of 1K. If unsuccessful, the record will not be written.
Increasing the buffer size will improve speed, but always increase the buffer size to a multiple of 1K, or response time may actually be slowed.
Decreasing the index size can be beneficial if you are using the sequential Input subroutines, since they do not use the index. Once the index has been reduced, however, some degradation in speed can result that cannot be recovered by increasing the index. Reducing the index size results in fewer "place markers", which are used by ReadLineNumber( ). This means that typically more scanning must be done to satisfy a ReadLineNumber( ) request, which slows response time. Increasing the index size, conversely, will shorten the typical scanning time, and thus speed up response time. Although index size is in bytes, an index entry takes four bytes, so the number of lines that can be "remembered" equals the index size divided by four.
The SetTabSize( ) subroutine allows you to control the number of columns between tab stops. The default is 8. The tabs are especially important in records as the layout of the line is specific, and how any tabs present are translated into blanks can be crucial. Although tab sizes of up to 64K are supported, we do not recommend such large tab sizes. To switch-off the conversion of tabs to spaces, set the tab size to zero.
The SetEBCDICCodePage( ) subroutine allows you to control the code page conversion tables used whilst processing EBCDIC file. Default conversion tables are used, if this routine has not been called successful prior to processing an EBCDIC file.