Types of access Schema DDL
92 U929-J-Z125-9-76
Defining secondary keys for conversion by hash routine
SEARCH KEY IS item-name,... USING CALC[ hash-routine]
DUPLICATES ARE[ NOT] ALLOWED
A key declared by SEARCH KEY IS... is a SEARCH key or secondary key. It may consist of
more than one item (compound key).
item-name specifies the item(s) comprising the key. All items must be part of the corre-
sponding record type.
DUPLICATES ARE[ NOT] ALLOWED specifies whether UDS/SQL is to accept or reject
duplicate key values.
hash-routine denotes the name of a module which converts the secondary key to a 4-byte
binary number. This binary number is subsequently converted into a relative page number
by UDS/SQL. The corresponding page contains a pointer to the reco rd (see the section
“Indirect CALC page” on page 213).
The hash routine does not compute the record address direc tly, as it is up to the user to
place the record either via the primary key or by means o f SSL statements.
Note that hash areas placed with SSL statements must be assigned names (see page 107).
If hash-routine is omitted, UDS/SQL uses the same standard hash routine as for conversion
of the primary key. (For programming a hash routine and running the standard hash routine,
refer to “Defining a primary key for conversion by hash routine” on page 87.)
More than one secondary key can be defined for one record typ e.
Example
RECORD NAME IS ARTICLE
.
.
.
SEARCH KEY IS ART-NO-AVAIL, COLOR- NO-AVAIL, SIZE USING CALC.....
SEARCH KEY IS ARTICLE-NAME USING CALC.....
01 ART-NO-AVAIL PICTURE IS 9(4).
01 COL-NO-AVAIL PICTURE IS 99.
01 SIZE PICTURE IS 99.
01 ARTICLE-NAME TYPE I S CHARACTER 40.