Case statement generates EZTC0124E compiler error
search cancel

Case statement generates EZTC0124E compiler error

book

Article ID: 16715

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction



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 this be resolved? 

Environment

Easytrieve Report Generator, release 11.6

Resolution

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: 
Documentation for the CASE statement syntax 

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