Exercise 1: DELIMITED BY SIZE vs. DELIMITED BY SPACE, and Why WS-CUSTOMER-NAME Uses SPACE — Possible Solution ==================================================================== WHAT DELIMITED BY SIZE ACTUALLY DOES This chapter's own material explains that DELIMITED BY SIZE transfers the entire real sending field into the STRING result, exactly as it's declared, with no stopping point along the way. Whatever length the field actually is, that's exactly how much gets copied - every real character, including any trailing padding it happens to hold. WHAT DELIMITED BY SPACE (OR ANY OTHER VALUE) ACTUALLY DOES DELIMITED BY SPACE, by contrast, stops copying the moment a real space character is reached in the sending field, rather than continuing all the way to the field's own declared length. Anything after that first space - including further real padding - is left out of the result entirely. WHY WS-CUSTOMER-NAME SPECIFICALLY NEEDS THE SPACE FORM WS-CUSTOMER-NAME is declared as PIC X(30) back in Chapter 3, a full 30-character field. A real customer name shorter than 30 characters - which is essentially every real name - doesn't fill that whole field; the unused portion is padded out with trailing spaces. If this chapter's own STRING example used DELIMITED BY SIZE for WS-CUSTOMER-NAME, the result would genuinely include all of that trailing padding as part of the concatenated line, since SIZE copies the complete 30 characters no matter what real content is actually in them. WHY THE LITERALS IN THE SAME EXAMPLE CORRECTLY USE SIZE INSTEAD The literal pieces in this chapter's own example, like "CUSTOMER: " and " (ID: ", are exact, deliberately-sized text with no unknown trailing padding to worry about - every real character in them is genuinely meant to be part of the output. DELIMITED BY SIZE is the right real choice there specifically because there's nothing to stop early for; the whole literal is exactly what should appear. ANSWER: DELIMITED BY SIZE copies a sending field's entire real declared length with no stopping point, including any trailing padding it happens to hold, while DELIMITED BY SPACE (or another chosen value) stops copying as soon as that real delimiter is reached, leaving anything after it out of the result. WS-CUSTOMER-NAME specifically uses the SPACE form because it's declared as a full 30-character field that a real, shorter customer name only partly fills, with the unused remainder padded out in trailing spaces - using SIZE there would drag all of that trailing padding into the concatenated report line, while SPACE correctly stops right where the real name content ends. WHY THIS WORKS AS AN ANSWER ------------------------------ This correctly distinguishes the two real DELIMITED BY forms using the chapter's own definitions, and explains the specific, concrete reason (trailing padding in a fixed-width field) that makes SPACE the correct real choice for WS-CUSTOMER-NAME rather than treating the choice as arbitrary.