Case statement generates EZTC0124E compiler error

Document ID : KB000016715
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

Programs with CASE statements that contain brackets around the associated field name fail to compile with message 

EZTC0124E >>> $ fieldname expected 

This occurs when the field names on a CASE statement are enclosed in parenthesis:

CASE (UR-LEVEL(WS-COUNTER)) 
WHEN '11' 
OFILEA-CLASS(WS-COUNTER) = 'N' 
WHEN '44' 
OFILEA-CLASS(WS-COUNTER) = 'Y' 
OTHERWISE 
OFILEA-CLASS(WS-COUNTER) = '?' 
 END-CASE

How may I resolve this? 

Answer:

Release 11.6 does adhere more to the correct syntax than the prior releases and uses a different compiler to do so. 

The documentation does support no parenthesis on the CASE statement: 
https://docops.ca.com/ca-easytrieve/11-6/en/language-reference/statements-c/case-and-end-case-statements 

The parenthesis do need to be removed.  This is the resolution to resolving the EZTC0124E error message as CA Easytrieve is parsing the code as designed.