Callback routines can be used in C but are not available in Cobol.
When you define a terminal, you can use the optional parameter NotifyFn to provide the address of a callback routine that the EPI is to call whenever an event occurs against that terminal.
An application should carry out the minimum of processing in its callback routine, and never block in the specified routine before returning to the EPI. The routine itself cannot make EPI calls. You decide what it should do when the notification is received. For example, in a multithreaded environment, it might post a semaphore to signal another thread that an event has occurred. In a Windows® environment, it might post a message to a window to indicate to the window procedure that an event has occurred. Other actions will be appropriate for other environments.
When the callback routine is called, it is passed a single parameter—the terminal index of the terminal against which the event occurred. This allows the same callback routine to be used for more than one terminal.