This is very important in view of CICS. Since many have a doubt that we already have a lot of storage, so why need to get dynamic memory.
GETMAIN in CICS.
Cool. I will give an example why we need this. The purpose of Getmain is to get extra virtual storage to faster processing.
See the example code:
Working storage section. 77 INIT pic x value low-value. Linkage section. 01 DWS-work-area. 02 fild1 pic x(100). 02 fild2 pic x(200). EXEC CICS GETMAIN SET(Address of DWS-Area) FLENGTH(300) INITIMG(INIT) END-EXEC
After executing this command, it allocates 300 bytes of virtual storage and initialized with low-values.
Points to remember:
- FLENGTH is recommended option
- The expected errors are LENGERR and NOSTG
- This is one of the performance improvement criteria
- CICS always gets storage from DSA(Dynamic storage area)