Exercise 2: Why a Plain WORKING-STORAGE Field Loses Its Value Between Screens, and What COMMAREA Does Differently — Possible Solution ==================================================================== WHAT GENUINELY HAPPENS TO A TRANSACTION INSTANCE AFTER RETURN This chapter's own material establishes that a real RETURN ends the transaction completely, releasing every resource it was holding - including, genuinely, all of its own WORKING-STORAGE. Once that instance has ended, nothing about it - the values sitting in its own fields, its own internal state - continues to exist anywhere. WHAT HAPPENS WHEN THE USER'S NEXT RESPONSE TRIGGERS A NEW INSTANCE This chapter's own finding-box states plainly that when the user does respond, CICS starts a genuinely fresh instance of the same transaction from scratch. "From scratch" is the real, load-bearing detail here - this new instance has its own brand-new WORKING-STORAGE, entirely unconnected to whatever the previous, now-ended instance's own fields once held. There is no real link between the old instance's memory and the new one's. WHY A PLAIN WORKING-STORAGE VALUE IS GENUINELY LOST, NOT JUST HARD TO REACH Because the earlier instance's own storage was released along with everything else at RETURN, a value that existed only in an ordinary WORKING-STORAGE field genuinely no longer exists anywhere by the time the new instance begins - it isn't sitting somewhere inaccessible; it has actually ceased to exist along with the ended transaction that held it. WHAT COMMAREA GENUINELY DOES DIFFERENTLY This chapter's own material describes COMMAREA as a real data area that RETURN explicitly hands off, and which the next instance receives back automatically. Unlike ordinary WORKING-STORAGE, a value placed into COMMAREA before RETURN is deliberately preserved outside the ending transaction instance itself, specifically so the next instance - genuinely separate as it is - can receive that exact data back as part of how it starts up. ANSWER: A value stored only in an ordinary WORKING-STORAGE field is genuinely lost because RETURN ends the transaction instance completely, releasing all of its resources including that WORKING-STORAGE - and the next instance CICS starts when the user responds is a genuinely fresh one, starting from scratch with its own unconnected WORKING-STORAGE, not a continuation of the previous one. COMMAREA works differently because it's a real data area explicitly handed off by RETURN and automatically received back by the next instance - a value placed there before RETURN is deliberately carried forward outside the ending instance, specifically so it survives to be available in the new one, unlike anything left only in ordinary WORKING-STORAGE. WHY THIS WORKS AS AN ANSWER ------------------------------ This correctly explains that WORKING-STORAGE is destroyed along with the ending transaction instance while COMMAREA is deliberately carried forward by RETURN, grounding the distinction directly in this chapter's own stated mechanism for both.