Thread: COBOL

IF / ELSE / END-IF - do I need periods or not?

Started by Alex • user3 replies278 viewsLast activity 1 week ago
Post #1
0 votes
Alex
Reputation
8
Posts: 35
Joined: Jun 15, 2026, 9:20 AM
Posted: Aug 4, 2026, 12:37 PM

Old code has periods everywhere. New examples use END-IF and almost no periods.

Which style should a beginner use? I keep breaking IF blocks.

Post #2
0 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Aug 4, 2026, 1:37 PM

Use explicit scope terminators: END-IF, END-READ, END-PERFORM. One period at the end of the paragraph is enough.

Periods inside IF logic are a classic way to accidentally end the IF early. That is why old code is scary.

Post #3
1 votes
Anita
Reputation
118
Posts: 23
Joined: May 29, 2025, 12:45 PM
Posted: Aug 4, 2026, 6:37 PM

Shop standard here bans periods except end of paragraph / sentence where required. Reviews catch it.

You must be signed in to reply to this thread