Created On:  8 June 2010

Problem:

An application defines multiple ISAM files some of which are in the default format of IDXFORMAT"3" and some of which are in the large format of IDXFORMAT"8". How does one specify multiple IDXFORMAT file types within a single application?

Resolution:

Multiple IDXFORMAT file types can be specified within a single application either in the file handler configuration file, EXTFH.CFG or within the application source code itself using the IDXFORMAT compiler directive.

Example:

Program source code is as follows:

     id division.
     program-id.   testfile.
     file-control.
         select default-isam1 assign to "DISAM1.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is dkey1.

         select large-isam1 assign to "LISAM1.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is lkey1.

         select default-isam2 assign to "DISAM2.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is dkey2.
-----------------------
To specify default-isam1 and default-isam2 as IDXFORMAT"3" and large-isam1 as IDXFORMAT"8" place the IDXFORMAT directive before the select statement for the appropriate file like:

     id division.
     program-id.   testfile.
     file-control.
    $set IDXFORMAT"3"
         select default-isam1 assign to "DISAM1.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is dkey1.
    $set IDXFORMAT"8"
         select large-isam1 assign to "LISAM1.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is lkey1.
    $set IDXFORMAT"3"
         select default-isam2 assign to "DISAM2.DAT"
                                        organization is indexed
                                        access is dynamic
                                        record key is dkey2.
-----------------------
You could also create a file handler configuration file called EXTFH.CFG and set the EXTFH environment variable to point to the configuration file containing the following:

[XFH-DEFAULT]
[DISAM1.DAT]
IDXFORMAT"3"
[LISAM1.DAT]
IDXFORMAT"8"
[DISAM2.DAT]
IDXFORMAT"3"

Incident #2219638