ISMGETKEYSTRUCTURE Procedure

ISMGETKEYSTRUCTURE is used to inquire on the structure of the ISAM file.

For files in which the MAXRECSIZE is not known, the file attribute DEPENDENTSPECS should be set to TRUE before calling this procedure.

The ISMGETKEYSTRUCTURE procedure uses the following parameters to return the requested key information:

ISMGETKEYSTRUCTURE (ISAMFILE, KEYINFO, OPTION, OFFSET)
  • ISAMFILE—The user's file.

  • KEYINFO—An array that contains file and key information. The meanings of the values returned in word 0 (zero) of the array are as follows:

    Field

    Value

    Meaning

    [26:01]

    Relative key option

     

    0

    No relative key

     

    1

    Relative key

    [25:01]

    Record unit

     

    0

    Words

     

    1

    Characters

    [19:04]

    Record length option

    [15:08]

    Start key pointer; index into this array for the start key

    [7:08]

    Number of keys

    The meanings of the values returned in word 1 of the array are as follows:

    Field

    Meaning

    [31:16]

    Block size

    [15:16]

    Maximum record size

    Words 2 through n+1 (1 greater than the number of keys) contain 1 word of key information for each key. See “Key Information” earlier in this section.

  • OPTION—Indicates the type of information to be returned in the KEYINFO array.

    Value

    Meaning

    0

    Get all the key structure

    1

    Get primary key information

    2

    Get relative key information

    3

    Get key located at offset

  • OFFSET—Indicates the record offset of the key to be reported on. OFFSET is only used when OPTION equals 3.

Error Results

The following results are returned by the GENERALSUPPORT procedure ISMGETKEYSTRUCTURE (note the *). Bit 0:1 also has a value of 1 and bit 26:10 has a value of 0 for these results.

  • *[2:1] 1 = OPTION was not a valid value.

  • *[5:1] 1 = The key was not found.