Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

4.2.10 ALTERNATE RECORD KEY Clause



The ALTERNATE RECORD KEY clause (Format 2) specifies a data item within the record that provides an alternative path to the data in an indexed file.

data-name-3
An ALTERNATE RECORD KEY data item. It must be described as an alphanumeric item within a record description entry associated with the file.


X As an IBM extension, data-name-3 can be a numeric, numeric-edited,
X alphanumeric-edited, alphabetic, floating-point (both external and
X internal), or DBCS data item. The key is treated as an alphanumeric
X item for the input and output statements for the file named in the
X SELECT clause.

Data-name-3 must not reference a group item that contains a variable occurrence data item. Data-name-3 can be qualified.


X As an IBM extension, if the indexed file contains variable-length
X records, data-name-3 need not be contained within the first "x"
X character positions of the record, where "x" equals the minimum record
X size specified for the file. That is, data-name-3 can be beyond the
X first "x" character positions of the record, but this is not
X recommended.


X Data-name-3 cannot be a windowed date field.

If the file has more than one record description entry, data-name-3 need be described in only one of these record description entries. The identical character positions referenced by data-name-3 in any one record description entry are implicitly referenced as keys for all other record description entries of that file.

The data description of data-name-3 and its relative location within the record must be the same as those used when the file was defined. The number of alternate record keys for the file must also be the same as that used when the file was created.

The leftmost character position of data-name-3 must not be the same as the leftmost character position of the RECORD KEY or of any other ALTERNATE RECORD KEY.

If the DUPLICATES phrase is not specified, the values contained in the ALTERNATE RECORD KEY data item must be unique among records in the file.

If the DUPLICATES phrase is specified, the values contained in the ALTERNATE RECORD KEY data item can be duplicated within any records in the file. In sequential access, the records with duplicate keys are retrieved in the order in which they were placed in the file. In random access, only the first record written of a series of records with duplicate keys can be retrieved.

For EXTERNAL files, all file description entries in the run unit that are associated with the EXTERNAL file must specify the same data description entry for data-name-3, the same relative location within the associated record, the same number of alternate record keys, and the same DUPLICATES phrase.


X The requirement for identical data description entries is not enforced,
X but the key must have the same relative location in the records, as well
X as the same length.

Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.