The COBOL Compiler allows an optional word ARE in Relational Operators in Conditional Expressions.

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.

Cross reference information
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:

(0 users)Average rating

Add comments

Document information


More support for:

Enterprise COBOL for z/OS
Compile

Software version:

3.4, 4.1, 4.2

Operating system(s):

z/OS

Reference #:

1247876

Modified date:

2008-12-01

Translate my page

Machine Translation

Content navigation