This installment of Carsten Flensburg’s APIs by Example features utility SetPrfExit, which shows how to use the Set Profile Exit Programs (QWTSETPX) and Retrieve Profile Exit Programs (QWTRTVPX) APIs. Profile exit programs provide a powerful way of controlling what happens when a user suspends interactive jobs by pressing Attn or System Request. Once registered with WRKREGINF or ADDEXITPGM/RMVEXITPGM, these programs run every time a user presses Attn or System Request. The SetPrfExit lets you quickly enable or disable the calling of these registered exit programs based on the user ID.
Download the save file containing the source code.