Use a GETMAIN command.
GETMAIN gets a main storage area of the size that is indicated by the LENGTH or FLENGTH option. The address of the area is returned in the pointer reference that is supplied in the SET option.
Because no default initialization is done, you must use the INITIMG option if you require the storage to be initialized to a specific bit configuration.
The storage that is acquired by a task is available until it is released with a FREEMAIN command. For an area that is obtained by a GETMAIN command without the SHARED option, only the task that acquired the storage can release it; at task termination, CICS automatically releases any such storage that is not already released.
A SHARED area, on the other hand, is not released at task termination and remains until explicitly freed; any task can issue the corresponding FREEMAIN. This means that you can use SHARED storage in task-to-task communication. However, because no automatic release of such storage occurs, ensure that some task releases the storage when it is no longer needed, to prevent an overall shortage.
The following example shows how to get a 1024-byte area of main storage and initialize it to spaces:
EXEC CICS GETMAIN SET(PTR) LENGTH(1024) INITIMG(BLANK)
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!