What is GETMAIN and FREEMAIN? What are the restrictions while using GETMAIN and FREEMAIN?

Questions by Suganj   answers by Suganj

Showing Answers 1 - 3 of 3 Answers


  • Sep 16th, 2007

What is GETMAIN and FREEMAIN? Get named specified amount of main storage -storage is held until freed or transaction ends)Freemain the named main storage What are the restrictions while using GETMAIN and FREEMAIN? Getmain - the amount of main storage available for program useFreemain - must be a named storage area named in a getmain request

  Was this answer useful?  Yes

The concept of CICS GETMAIN is simply to provide the programmer the capacity of obtaining additional storage to augment storage acquired automatically by his program (e.g., WORKING-STORAGE in a COBOL program). The programmer may define certain fields (01 Levels) in the LINKAGE SECTION that may require the use of a GETMAIN to obtain the storage. These fields are usually output fields that are not passed to the program by another program (caller).

In the case of input fields, the use of the SET can be used to point to the acquired area or a calling program can pass the address to the called program. The acquired area from a GETMAIN can be above or below the line. In addition, storage acquired by a normal GETMAIN can be explicitly released by a FREEMAIN or automatically released when the task ends by CICS. However, a program can acquire SHARED storage that comes out of the SDSA/ESDSA that requires an explict FREEMAIN as this type of storage is not automatically released at task end. The use of shared storage requires more control as incorrect use can quickly deplete the (E) DSA storage available.

This is a brief explanation but if you have any additional questions let me know.

They GET and FREE MAIN memory.

These are rarely used as the system takes care of memory needs far more efficiently than you can code.

NEVER use these without the advice of a senior CICS sysprog.? The reason is that you will be carving out huge hunks of memory in a very dynamic system.? You will certainly get yourself in trouble by causing trouble for others.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions