6.2.40.3 INVALID KEY Phrases
>_Workstation_> Under AIX, OS/2, and Windows, the INVALID KEY phrase is
X not supported for line sequential files or OS/2 Btrieve files.
<_Workstation_<
>_Host_> Under OS/390, the INVALID KEY phrase is not supported for VSAM
sequential files. <_Host_<
An invalid key condition is caused by the following:
- For sequential files:
- An attempt is made to write beyond the externally defined boundary
of the file.
- For indexed files:
- An attempt is made to write beyond the externally defined boundary
of the file.
- ACCESS SEQUENTIAL is specified and the file is opened OUTPUT, and
the value of the prime record key is not greater than that of the
previous record.
- The file is opened OUTPUT or I-O and the value of the prime record
key equals that of an already existing record.
- For relative files:
- An attempt is made to write beyond the externally defined boundary
of the file.
- When the access mode is random or dynamic and the RELATIVE KEY
data item specifies a record that already exists in the file
- The number of significant digits in the relative record number is
larger than the size of the relative key data item for the file.
When an invalid key condition occurs:
- If the INVALID KEY phrase is specified, imperative-statement-1 is
executed. (See Table 36 in topic 6.1.8.9.1).
- Otherwise, the WRITE statement is unsuccessful and the contents of
record-name are unaffected (except for OS/390 QSAM files). And, the
following occurs:
- For sequential files--the status key, if specified, is updated and
an EXCEPTION/ERROR condition exists.
If an explicit or implicit EXCEPTION/ERROR procedure is specified
for the file, the procedure is executed. If no such procedure is
specified, the results are unpredictable.
- For relative and indexed files--program execution proceeds
according to the rules described under "Invalid key condition" in
topic 6.1.8.9.1.
The INVALID KEY conditions that apply to a relative file in OPEN
OUTPUT mode also apply to one in OPEN EXTEND mode.
- If the NOT INVALID KEY phrase is specified and a valid key condition
exists at the end of the execution of the WRITE statement, control is
passed to imperative-statement-4.
X As an IBM extension, you can omit both the INVALID KEY phrase and the
X EXCEPTION/ERROR procedure.
© 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.