Exercise 2: Why ROUNDED and ON SIZE ERROR Don't Do the Same Job — Possible Solution ==================================================================== The colleague's claim treats both clauses as solving the same "doesn't fit" problem, but this chapter's own real material describes them handling two genuinely different situations that both happen to involve a result exceeding what the receiving field can hold. WHAT ROUNDED ACTUALLY HANDLES This chapter describes ROUNDED as rounding a result to fit the receiving field's own PICTURE clause, specifically in place of silently truncating extra decimal places. This addresses a normal, expected, everyday situation: a calculation genuinely producing more decimal precision than the destination field is defined to hold - not an error condition at all, just an ordinary rounding decision that has to be made one way or another. WHAT ON SIZE ERROR ACTUALLY HANDLES This chapter describes ON SIZE ERROR as running a real block of statements specifically when a result doesn't fit at all - genuine overflow, or division by zero. This is a fundamentally different, genuinely exceptional situation: the result is too large in magnitude to fit in the receiving field's own real digit capacity, or the calculation itself is mathematically undefined (division by zero) - not merely a matter of excess decimal precision needing to be rounded away. WHY THESE ARE GENUINELY DIFFERENT KINDS OF PROBLEMS Rounding excess decimal places is an ordinary, expected part of normal arithmetic - it happens routinely and doesn't represent anything going wrong. Overflow or division by zero represents a genuine, real problem with the calculation itself, serious enough that this chapter describes ON SIZE ERROR as running a specific block of corrective or diagnostic statements in response - the kind of response an everyday rounding decision would never need. WHY BOTH CAN APPLY TO THE SAME STATEMENT AT ONCE This chapter's own worked COMPUTE example shows both clauses used together on a single statement - ROUNDED handling the ordinary decimal-precision question, and ON SIZE ERROR separately standing by in case the result is also too large to fit at all. If they did the same job, there would be no reason to combine them; they combine precisely because they're each covering one of two genuinely different real possibilities. ANSWER: ROUNDED and ON SIZE ERROR don't do the same job because they handle two different situations. ROUNDED addresses a normal, everyday case - a result with more decimal precision than the receiving field holds, rounded rather than silently truncated. ON SIZE ERROR addresses a genuine error condition - real overflow or division by zero, serious enough to trigger a dedicated block of corrective statements. This chapter's own worked example uses both together on one statement specifically because they cover two separate real possibilities, not because they're redundant with each other. WHY THIS WORKS AS AN ANSWER ------------------------------ This distinguishes the specific real situation each clause is designed to handle (ordinary rounding vs. genuine overflow/error), and uses the chapter's own combined worked example as evidence that the two clauses are complementary rather than duplicative.