Case statement generates EZTC0124E compiler error

book

Article ID: 16715

calendar_today

Updated On:

Products

CA PanAudit Plus CA Easytrieve Report Generator CA PAN/SQL

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 I resolve this? 

Environment

Release: EDBMSU00200-11.6-Easytrieve-Report Generator-Option for DB2-MSU
Component:

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: 
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.