Work areas

When you use the EXEC CICS ENABLE PROGRAM command to identify a task-related user exit program to CICS®, you can specify that the program has access to one local work area and one global work area.

The global work area

As with a global user exit program, a task-related user exit program can have its own global work area, or it can share a work area that is owned by another exit program.

When you issue the ENABLE PROGRAM command to define the exit, you can specify the GALENGTH and GALOCATION options to make CICS provide a global work area for the exit program. GALENGTH specifies the length of the global work area in bytes, and GALOCATION specifies whether it is in 24-bit storage or 31-bit storage. Alternatively, you can specify the GAENTRYNAME option to name another currently enabled user exit, and your exit program shares the global work area that CICS has already provided for the named exit.

The global work area is associated with the exit program rather than with the exit point. For ease of problem determination, the global work area should be shared only by exit programs that are invoked from the same management module or domain. The address and length of the global work area are addressed by parameters UEPGAA and UEPGAL of the DFHUEPAR parameter list, which is described in DFHUEPAR standard parameters. If a user exit program does not own a global work area, UEPGAA is set to zero.

Application programs can communicate with user exit programs that use or share the same global work area. The application program uses the EXEC CICS EXTRACT EXIT command to obtain the address and length of the global work area.

The local work area

A local work area, also known as a task work area, is a work area with the following characteristics:
  • Associated with a single task
  • Lasts only for the duration of the task
  • Is for the use of a single task-related user exit program
The local work area can be thought of as a logical extension to the transaction work area (TWA, TWACOBA) that is exclusively for the exit program's use.

When you issue the ENABLE PROGRAM command to define the exit program, you can specify the TALENGTH option to make CICS provide a local work area for each task that uses the exit. CICS allocates the work area and releases it at task end. If the task-related user exit program was enabled with the LINKEDITMODE option on the ENABLE PROGRAM command, and the exit program was link-edited in AMODE(31), the local work area is located in 31-bit storage. If you did not specify the LINKEDITMODE option, or if the task-related user exit program is link-edited in AMODE(24), the local work area is located in 24-bit storage.

The address and length of the local work area are addressed by parameters UEPTAA and UEPTAL of the DFHUEPAR parameter list.