Thread: COBOL

EVALUATE TRUE with 88-level conditions - readability concern

Started by Marty • user4 replies189 viewsLast activity 4 weeks ago
Post #1
0 votes
Marty
Reputation
412
Posts: 15
Joined: Aug 12, 2024, 9:14 AM
Posted: Jun 12, 2026, 12:18 PM

Hello,

A developer on my team proposed replacing nested IF statements with EVALUATE TRUE and multiple 88-level conditions. I have attached a simplified excerpt below.

cobol
01  WS-STATUS-CODE         PIC 9(02).
    88  STATUS-APPROVED    VALUE 01.
    88  STATUS-PENDING     VALUE 02 THRU 05.
    88  STATUS-REJECTED    VALUE 99.

EVALUATE TRUE
    WHEN STATUS-APPROVED
        PERFORM 3000-POST-APPROVED
    WHEN STATUS-PENDING
        PERFORM 3100-HOLD-PENDING
    WHEN STATUS-REJECTED
        PERFORM 3200-LOG-REJECTION
    WHEN OTHER
        PERFORM 3900-INVALID-STATUS
END-EVALUATE.

I am not opposed in principle, but I am concerned about onboarding developers who are more familiar with explicit relational conditions. Does your organization standardize on this pattern for multi-branch business rules?

Thank you,
Marty

Post #2
0 votes
James
Reputation
524
Posts: 8
Joined: May 2, 2024, 8:00 AM
Posted: Jun 12, 2026, 3:18 PM

We permit EVALUATE TRUE when all branches are 88-levels on the same field. The condition names must be defined in the copybook, not locally in the paragraph, so the business meaning is visible at the data definition.

For cross-field logic, we require explicit EVALUATE or IF with named conditions documented in comments.

Post #3
0 votes
Subrata
Reputation
41
Posts: 3
Joined: Feb 14, 2025, 10:08 AM
Posted: Jun 12, 2026, 9:18 PM

From a junior perspective, the 88-level names in the copybook helped me more than nested IFs. Would it be acceptable to add a short comment block above the EVALUATE listing each status code value?

Post #4
0 votes
Marty
Reputation
412
Posts: 15
Joined: Aug 12, 2024, 9:14 AM
Posted: Jun 13, 2026, 1:18 PM

Yes, we can require a comment block for any EVALUATE TRUE with more than three branches. I will update the team checklist accordingly.

You must be signed in to reply to this thread