ALLOCATE'INDEXED

ALLOCATE'INDEXED fspec, allocate'map

ALLOCATE'INDEXED creates a new ISAM-A file (as an alternate to using ISMUTL.LIT). The allocate'map structure contains the configuration details needed to create the file, and must be customized, based on the following:

MAP1 ALLOCATE'MAP

MAP2 ERROR'OFFSET,B,2,-1              ! Offset if error

MAP2 MAX'RECS,B,4                     ! (ignored)

MAP2 REC'SIZE,B,2                     ! total record size

MAP2 EXTRA'PCT,B,2                    ! extra IDX blocks (ignored)

MAP2 LOADING'FACTOR,B,1,100           ! loading factor (ignored)

MAP2 RESERVED0,X,11                   ! reserved for future

MAP2 VARIABLE'REC'SIZE,B,2            ! size of variable portion of rec

MAP2 PRIMARY'KEY                      ! primary key definition

<see key definition structures below>

MAP2 SECONDARY'KEY                    ! zero or more secondary key definitions

<see key definition structures below>

MAP2 ALLOCATE'END,B,2,0               ! marks end of key definitions

The layout of the PRIMARY'KEY and SECONDARY'KEY sub-structures should be mapped according to one of the following models, based on the key type:

Alphanumeric Key Definition

MAP2 KEY'ALPHANUMERIC

MAP3 KEY'TYPE,B,1,1               ! 1=alphanumeric

MAP3 KEY'RESV(3),B,1              ! reserved for expansion

MAP3 KEY'NAME,S,20                ! name of key (ignored)

MAP3 KEY'NULL1,B,2,0              ! null terminator for name

MAP3 KEY'DUP,B,1                  ! sum of 1=duplicates allowed,

                                  ! 2=compress dupes, 4=leading, 8=trailing

MAP3 KEY'CHG,B,1                  ! key change permitted (ignored)

MAP3 KEY'SIZE,B,2                 ! size of key in chars

MAP3 KEY'POS,B,2                  ! key pos (1=first byte)

Signed Integer Key Definition

MAP2 KEY'INTEGER

MAP3 KEY'TYPE,B,1,2               ! 2=integer

MAP3 KEY'RESV(3),B,1              ! reserved for expansion

MAP3 KEY'NAME,S,20                ! name of key (ignored)

MAP3 KEY'NULL1,B,2,0              ! null terminator for name

MAP3 KEY'DUP,B,1                  ! 1=duplicates allowed

MAP3 KEY'CHG,B,1                  ! key change permitted (ignored)

MAP3 KEY'SIZE,B,2                 ! size of key in bytes (2 or 4)

MAP3 KEY'POS,B,2                  ! key pos (1=first byte)

Unsigned Binary Key Definition

MAP2 KEY'BINARY

MAP3 KEY'TYPE,B,1,4               ! 4=binary

MAP3 KEY'RESV(3),B,1              ! reserved for expansion

MAP3 KEY'NAME,S,20                ! name of key (ignored)

MAP3 KEY'NULL1,B,2,0              ! null terminator for name

MAP3 KEY'DUP,B,1                  ! 1=duplicates allowed

MAP3 KEY'CHG,B,1                  ! key change permitted (ignored)

MAP3 KEY'SIZE,B,2                 ! size of key in bytes (1-5)

MAP3 KEY'POS,B,2                  ! key pos (1=first byte)

Concatenated Key Definition

MAP2 KEY'CONCAT

MAP3 KEY'TYPE,B,1,3               ! 3=concatenated

MAP3 KEY'RESV(3),B,1              ! reserved for expansion

MAP3 KEY'NAME,S,20                ! name of key (ignored)

MAP3 KEY'NULL1,B,2,0              ! null terminator for name

MAP3 KEY'DUP,B,1                  ! 1=duplicates allowed

MAP3 KEY'CHG,B,1                  ! key change permitted (ignored)

MAP3 SUBKEY(?)                    ! 1 or more subkeys

  MAP4 SUBKEY'SIZE,B,2            ! size of subkey in chars

  MAP4 SUBKEY'POS,B,2             ! subkey pos (1=first byte)

MAP3 KEY'END,B,2                  ! terminate list of subkeys