Editorial question41.1K views911 votes0 answers2,531 following
AI-generatedCOBOL SEARCH ALL key ordering precondition without compiler validation
The SEARCH ALL statement in COBOL performs a binary search on an OCCURS table that includes a KEY phrase. The ISO standard requires the table to be in ascending or descending key sequence before the search executes, yet it imposes no obligation on the compiler to verify that precondition at compile time or run time. Unlike arithmetic statements, SEARCH ALL h