User Exits › How You Manage User Exits › Communication Words in Exit Routines
Communication Words in Exit Routines
CA MIM exit routines use words that serve as communication pointers during processing. A communication word is a CA-defined word of memory that CA MIM sets at initialization and then passes unchanged for all subsequent calls of an exit routine. The routines use two types of communication words:
- A routine-specific communication word is unique to a particular exit routine. The routine-specific communication word may be used for any purpose, but most often it is used as a pointer to an area of storage. The exit routine is permitted to set the value of this word during an initialization call, and the value will be passed to the exit routine on each subsequent call.
- When an exit routine is reloaded, the prior value of its communication word is made available for the re-initialization call. Doing this enables the exit routine to either reuse the previous data area or release it from storage. The exit routine is responsible for maintaining any previously allocated storage.
- The value of the routine-specific communication word is retained under some conditions even if CA MIM is stopped and restarted. Therefore, it is possible for this word to be set to a nonzero value when the initialization call occurs during startup. It is the responsibility of the exit routine initialization code to determine whether any nonzero value was supplied, and if it was, to determine whether the value is still usable. The exit routine common parameter list provides a flag bit to indicate whether the exit initialization call is being made after a restart of CA MIM.
- For example, if the routine-specific communication word is set to point to storage obtained in CSA, then the pointer remains valid even if CA MIM is restarted. In this case, the initialization code could leave the word set as it is, and the exit routine would reuse the same area.
- However, if the word points to private storage that was obtained from the CA MIM address space, then the value during a second initialization pass no longer points to a valid area of storage, and a new area has to be obtained. This occurs because all storage obtained from the CA MIM address is freed when the address space is stopped.
- A global communication word is a common value that is set by the MIMINIXT exit routine and passed to all routines.
- The MIMINIXT exit routine is called once when CA MIM initializes, before any other exit routine is initialized. You can use the MIMINIXT routine to acquire and initialize a global exit communication area. The MIMINIXT exit routine is described in Coding the MIMINIXT Exit in this chapter.