COBOL · File status code

File Status 21

What does File Status 21 mean in COBOL?

A sequential WRITE to a file with an ascending key requirement supplied a key value out of order relative to the previous record written.

File Status 21IBM Enterprise COBOL · Micro Focus · GnuCOBOL

Condition

A sequential WRITE to a file with an ascending key requirement supplied a key value out of order relative to the previous record written.

Fix

Sort the input driving the write loop by the same key before writing, or switch to indexed/relative access if input cannot be guaranteed pre-sorted.

Pending source verification. Not yet checked against official documentation.

Related file status code