RPG (IBM i / AS/400) · File status code
What does Status Code 01021 mean in RPG (IBM i / AS/400)?
A WRITE tried to add a record whose key duplicates one already in the file, or tried to write to a relative record number that's already occupied, and the file doesn't allow duplicates.
A WRITE tried to add a record whose key duplicates one already in the file, or tried to write to a relative record number that's already occupied, and the file doesn't allow duplicates.
CHAIN for an existing record with that key before the WRITE when a duplicate is possible, and decide whether the correct operation is UPDATE rather than WRITE.