COBOL · File status code

File Status 22

What does File Status 22 mean in COBOL?

A WRITE to an indexed or relative file attempted to add a record whose primary key duplicates an existing record.

File Status 22IBM Enterprise COBOL · Micro Focus · GnuCOBOL

Condition

A WRITE to an indexed or relative file attempted to add a record whose primary key duplicates an existing record.

Fix

Decide whether the intent was an update. If so, use REWRITE against an existing key instead of WRITE. If not, check the upstream process generating duplicate keys.

Pending source verification. Not yet checked against official documentation.

Related file status code