In CICS on z/OS I have some questions:
There's quite some confusion here concerning the different storage types. From a COBOL perspective you won't ever be worrying about main storage or auxiliary storage. Your COBOL-data lives in an address space made up of virtual storage which in turn is backed by main or auxiliary storage as the system sees fit.
While your program will automatically allocate memory for items defined in WORKING STORAGE or LOCAL STORAGE sections, it will not do so for anything defined in the LINKAGE SECTION. For a LINKAGE SECTION item to be usable, two things are required:
These two things can happen in different ways:
USING
of your PROCEDURE DIVISION
the memory is provided by the calling program (or some other program up the callstack) and the compiler associates the item with the respective adresses passed in the parameter list provided by the caller. In the case of DFHCOMMAREA of a top-level CICS-program the calling program that allocates the memory is CICS itself.SET ADDRESS OF
ALLOCATE
to dynamically request memory from your program and when used with a LINKAGE SECTION item it will also automatically associate the item with the memoryAs for your last question: passing parameters BY REFERENCE
from one program to another will not create extra copies of that data. Passing BY VALUE
or BY CONTENT
will duplicate the data.