|ACCESS Procedure Reference|
|Applies to:||access descriptor or view descriptor|
|KEY<=> column-identifier-1 <...column-identifier-n>;|
A BY key, which is an optional set of match variables, is used only when the interface view engine must examine additional ADABAS records in order to add a new periodic group occurrence. The engine uses the BY key variables in temporary WHERE clauses that are designed to locate a record for modification. Examining the additional ADABAS records is required only if data is changed above the periodic group level from one observation to the next in a view descriptor with a selected periodic group. It is suggested that you use BY key variables even if they are not always needed.
A data field is a good candidate for a BY key variable if it uniquely identifies a logical record. The incoming values of the data fields in a BY key variable are matched to existing values in order to locate a position in which to insert new periodic groups. (A BY key variable is similar to a BY group or a BY variable in SAS.)
An editing statement, such as KEY, must follow the CREATE statement and the database-description statements when you create a descriptor. See CREATE Statement for more information about the order of statements.
You do not have to issue a SELECT statement in a view descriptor for the columns included in the KEY statement. The KEY statement selects the columns. When you use the KEY statement with an access descriptor, the KEY statement reselects columns that were previously dropped with the DROP statement.