ISMREWRITE rewrites the record specified by the primary key. If a serial rewrite is done, the next record specified by the current record pointer is rewritten. If a random rewrite is done, the primary key specifies the record to be rewritten. ISMREWRITE does not affect the current record pointer.
The ISMREWRITE procedure requires the following parameters to return a REWRITE result:
ISMREWRITE (ISAMFILE, OPTION, RECORD)
-
ISAMFILE—The user's file.
-
OPTION—Specifies whether a serial or random rewrite is to be done.
Value
Meaning
0
Serial rewrite.
1
Random rewrite.
-
RECORD—The user's record area.
The REWRITE result values are listed in the following table. The results with an asterisk (*) are returned by the GENERALSUPPORT procedure ISMREWRITE. The other results are returned by KEYEDIO.
Field |
Value |
Result [26:10] |
Mnemonic |
Meaning |
---|---|---|---|---|
[0:1] |
0 |
No errors |
||
1 |
99 |
LASTIOMUSTBEREAD |
The last I/O was not a READ. A random I/O was attempted when the ACCESSMODE was SEQUENTIAL. |
|
*[2:1] |
1 |
0 |
NOERROR |
The value in OPTION was not valid. Bit 0 is also equal to 1. |
[6:1] |
1 |
96 |
PRIMARYKEYSNOTEQUAL |
The primary key was changed. Only alternate keys and data can be changed with ISMREWRITE. Bit 0 is also equal to 1. |
[9:1] |
1 |
95 |
RECORDNOTFOUND |
The record was not found. No record met the key conditions. Bit 0 is also equal to 1. |
98 |
KEYSINVALID |
The key is invalid. The KEYFLAGF was 0 indicating a relative key, but the file was not a relative file. Bit 0 is also equal to 1. |