Technote (troubleshooting)
Problem(Abstract)
The following syntax is not documented:
IF operand-1 ARE NOT GREATER THAN operand-2...
However, it is not flagged as a compiler error.
Cause
Using IBM Enterprise COBOL for z/OS, the compiler fails to flag the word ARE as an optional keyword in a Relation Condition if it used instead of IS.
For example:
IF DATA-CODES ARE EQUAL TO VALID-CODE1.....
The documented syntax would allow
IF DATA-CODES IS EQUAL TO VALID-CODE1.....
or
IF DATA-CODES EQUAL TO VALID-CODE1.....
The Enterprise COBOL Language Reference Manual shows a syntax diagram similar to this:
6.1.6.5 General relation conditions
__ Format 1: general relation__________________
|>>_operand-1________________GREATER_______ _ __>
| |_IS_| | |_NOT_| | |_THAN_|
| | |_ > ______________|
| | |_LESS__ _____ ____|
| | | |_THAN_| |
| | |_ < ______________|
| | |_EQUAL______ _____|
| | | |_TO_| |
| | |_ = ______________|
| |_GREATER_ ______ _OR EQUAL__ ____ _
| | |_THAN_| |_TO_|
| |_ >= ______________________________
| |_LESS__ _____ __OR EQUAL__ ____ ___
| | |_THAN_| |_TO_|
| |_ <= ______________________________
|>_operand-2_______________________________________><|
Resolving the problem
Allowing ARE in place of IS in this and other situations is an undocumented IBM extension. It is valid at this time and has been accepted for several previous COBOL releases.
However, we recommend that it is best to use documented formats.
| Segment | Product | Component | Platform | Version | Edition |
|---|---|---|---|---|---|
| Software Development | COBOL for VSE/ESA | Compile | VSE/ESA | 1.1 | |
| Software Development | COBOL for OS/390 & VM | VM/ESA | 2.1.2, 2.1.1 |
Historical Number
PMR14619_487_000
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.