Skip to main content

Increase file sizes from within COBOL Program, rather then using rebuild.

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

How to increase filesizes with the use of IDXFORMAT-8 in a COBOL Program, rather then using rebuild. Also how to get file sizes for individual files rather than all of the files available in a program.

Resolution:

The program will look something like this:

$SET IDXFORMAT"8"                                  

      IDENTIFICATION DIVISION.                           

      PROGRAM-ID. P4010.

      ..............

      Etc.                            

     *                                                   

With the use of the Switch LOCKTYPE"2" you can increase the filesize but it will only increase to about 4GB and not more.

The documentation describes Locktype"2" as follows:

Creates a new file with the same basename as the file being opened but with a .lck extension. Any record locks are recorded in this file. This enables the File Handler to read and write to files up to 4 gigabytes in size regardless of whether the file is shared or locked. You cannot set this value for striped files.

Thus indeed here 4GB is the maximum.

The solution is to use the FILEMAXSIZE.

If you set FILEMAXSIZE to 8, IDXFORMAT 8 supports very large files with the default locking mechanism.

The result is that using the Switch FILEMAXSIZE=8 the file sizes can go beyond the 4GB.

So how can you use this for just one file and leave the other files like they are in a program?  This is handy when you have for example hundreds of different files for Products, Prices, Clients, Stock, etc,...

To increase just the files say e.g.: Customers and Prices you can simply put the $SET IDXFORMAT "8" before the actual file name in the program and then 'switch off' after that file ($SET IDXFORMAT "3" or "0") which will leave the rest as it is (default).

Old KB# 4531

#ServerExpress
#netexpress
#RMCOBOL
#COBOL
#AcuCobol