Exercise 1: Why IF WS-STATUS-ACTIVE Beats IF WS-ACCOUNT-STATUS = "A" — Possible Solution ==================================================================== This chapter's own finding-box names a specific, real reason condition names are preferable that goes beyond brevity - maintainability when the underlying stored value changes. WHAT BOTH VERSIONS ACTUALLY CHECK Both IF WS-STATUS-ACTIVE and IF WS-ACCOUNT-STATUS = "A" test the exact same real condition - whether the account's status field currently holds the value "A". Functionally, at the moment this specific code runs, they produce identical results. The real difference isn't in what they check right now, but in what happens later. WHY READABILITY MATTERS FIRST IF WS-STATUS-ACTIVE reads as an actual business concept - "is this account active?" - directly in the code, without requiring the reader to already know that "A" is the specific literal code meaning "active." IF WS-ACCOUNT-STATUS = "A" requires that same knowledge to be held separately, in the reader's own head or in outside documentation, since the code itself only shows a raw literal comparison. THE MORE IMPORTANT REAL ADVANTAGE: MAINTAINABILITY This chapter's own finding-box makes the more significant point directly: if the underlying stored code for "active" ever needed to change - say, from "A" to "1" as part of some real system update - only the 88-level's own VALUE clause in the DATA DIVISION would need updating. Every single IF WS-STATUS-ACTIVE check throughout the entire program would continue working correctly, unchanged, because they never referenced the literal "A" directly in the first place. WHY THE ALTERNATIVE IS GENUINELY RISKIER If the program instead used IF WS-ACCOUNT-STATUS = "A" throughout, that same real code-value change would require finding and updating every single individual comparison against the literal "A" scattered across the program - a real, error-prone process where missing even one occurrence would leave a genuine bug behind, silently checking for the old, no-longer-valid code. ANSWER: IF WS-STATUS-ACTIVE is genuinely preferable to IF WS-ACCOUNT-STATUS = "A" for two real reasons: it reads as an actual business concept rather than a raw literal comparison, and - more importantly - if the underlying stored code for "active" ever changed, only the 88-level's own VALUE clause would need updating in one place, while every IF WS-STATUS-ACTIVE check throughout the program would keep working correctly unchanged. Using the literal comparison instead would require finding and updating every individual occurrence of "A" scattered across the program, a real, error-prone process risking missed instances. WHY THIS WORKS AS AN ANSWER ------------------------------ This identifies the chapter's own specific real advantage (maintainability under a future code-value change) rather than stopping at the surface-level readability point, and explains concretely why the literal-comparison version is riskier to maintain over time.