Thread: COBOL

IF vs EVALUATE - which should a beginner use?

Started by Alex • user3 replies161 viewsLast activity 2 weeks ago
Post #1
0 votes
Alex
Reputation
8
Posts: 35
Joined: Jun 15, 2026, 9:20 AM
Posted: Jul 30, 2026, 9:40 AM

I can write IF/ELSE. Training also showed EVALUATE. For simple checks is IF fine or should I learn EVALUATE immediately?

Post #2
0 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Jul 30, 2026, 11:40 AM

IF is fine for two or three branches. EVALUATE is nicer when you have many distinct cases (like a status code list). Learn IF solid first, then EVALUATE. Both show up everywhere.

Post #3
0 votes
Anita
Reputation
118
Posts: 23
Joined: May 29, 2025, 12:45 PM
Posted: Jul 31, 2026, 10:40 AM

Remember END-IF and END-EVALUATE. Missing those caused my first weird bug.

You must be signed in to reply to this thread