Table definition parameter description

A table definition and a table are required parameters for each call to TBACC. The table definition consists of several fields, some of which you have to specify before calling TBACC, while TBACC will enter information in other fields.

The following fields comprise TBACC-DEF.

  1. NO-OF-ROWS (fullword binary)
    Number of valid rows in the table (Maximum 2,147,483,648).

    This field is maintained by TBACC. As rows are inserted by TBACC, it increments this count.

  2. ROW-SIZE (fullword binary)
    Specify the number of bytes in each row (Maximum 32,767).

  3. KEY-SIZE (fullword binary)
    Specify the number of bytes in the key (Maximum 256).

  4. KEY-LOCATION (fullword binary)
    Specify the number of bytes to left of the key in a row.

  5. MAX-ROWS (fullword binary)
    Specify the maximum number of rows which can fit into the table (Maximum 2,147,483,648).

  6. SUBSCRIPT (fullword binary)
    Set by the programmer before the call or by TBACC as a result of the call.

    After a search, whether by means of an S command or by means of a U, R, or F command, the value of SUBSCRIPT will be set by TBACC.

    If the row was found, SUBSCRIPT will be the subscript of the found row. If more than one row in the table has the required key, the first row in the group will be the one indicated by the value of SUBSCRIPT.

    If the row was not found, SUBSCRIPT will point to the position in the table at which this row may be inserted:

    1. For a randomly organized table, SUBSCRIPT will always equal one more than the number of rows in the table.
    2. For a sequential table, SUBSCRIPT will point to the next higher row in the table. If there is no row, then SUBSCRIPT will equal one more than the number of rows in the table.
    3. For a descending sequential table, SUBSCRIPT will point to the next lower row in the table. If there is no row, then SUBSCRIPT will equal one more than the number of rows in the table.
    4. For a hash table, SUBSCRIPT will point to an empty space in the table into which the row may be inserted.
    5. For a user controlled sequence, SUBSCRIPT will always equal one more than the number of rows in the table.
  7. TABLE-ORG (1 byte)
    Specify S, D, H, R, or U.

    Where,

    S = Sequential ascending
    D = Descending sequential
    H = Hash
    R = Random
    U = User controlled

  8. FOUND-CODE (1 byte)
    Code returned after Search—Y = found, N = not found
    Code returned after Put—Y = successful, N = failed
    Code returned after Take—Y = successful, N = failed

  9. OVERFLOW-CODE (1 byte)
    Code returned after Insert—Y = overflow, N = no overflow

  10. ACTION (1 byte)
    Specify the function to be performed.
    S, I, D, U, R, P, T, F, A, or C.

  11. SEARCH-METHOD (1 byte)
    Specify S, Q, B, C, or H.

    Where,

    S = Sequential
    Q = Queued Sequential
    B = Binary
    C = Bounded Binary
    H = Hash

  12. WORK-FIELD (3 bytes) Default = LOW-VALUES

    This is used by TBACC.

  13. WORK-AREA (n bytes) Default = LOW-VALUES
    Required only when METHOD= C or H
    If METHOD = H, n = 12
    If METHOD = C, n = 132.

    (See Warning 5 below.)