Function codes for local check routines

IBM Health Checker for z/OS invokes a local check routine with a function code to indicate why it was called. All the function code calls will run under the same jobstep task, but you cannot assume that any of these function codes will run in the same task as a preceding function.

In general:
  • PQE_Function_Code_Init (Init function) is called once for the life of the check (which lasts until the check is deleted).
  • PQE_Function_Code_Check (Check function) is called at the specified interval for the check
  • PQE_Function_Code_Cleanup (Cleanup function) is called right after the Check function
  • PQE_Function_Code_Delete (Delete function) is called once at the end of the life of the check.
The following table summarizes the function codes provided by IBM Health Checker for z/OS, showing what the check should do for each PQE_Function_Code_ and when IBM Health Checker for z/OS invokes it:
Table 1. Summary of function codes for local checks
Function Check and system actions When is it invoked?
Init What should the check do? For PQE_Function_Code_Init, the check routine should validate that the environment is suitable for the check. If it is not, issue the HZSFMSG REQUEST=STOP macro to stop the check. If you obtain additional storage for the check, obtain it in Init processing and obtain it in jobstep-task owned storage. (You cannot assume that each function code runs under the same task.)
  • Refresh
  • When a check is added
  • When a check transitions to the active enabled state
What does the system do? The system does the following setup steps to prepare for multiple check iteration:
  • Initializes the HZSPQE data area with default and override values for the check.
  • Passes the default and installation overrides to the check in the HZSPQE data area for the check.
  • Obtains 2K of workarea storage mapped by field PQEChkWork. This storage is zeroed for Init processing and lasts for the life of the check.
  • Obtains 4K of dynamic work area pointed to by field PQE_DynamicAreaAddr. The contents of this work area are not set to any particular value and are not preserved across check iterations.
Check What should the check do? For PQE_Function_Code_Check, the check routine should:
  1. Check to see if the PQE_LookatParm bit is set on, indicating either that this is the first iteration of the check, or that the installation has changed the check parameters since the last iteration. If the bit is on, validate the parameters in the PQE_UserParmArea of the HZSPQE data area.
    If the check finds bad installation parameters, it should:
    1. Issue an error message indicating what the problem is.
    2. Issue the HZSFMSG REQUEST=STOP,REASON=BADPARM macro request to stop the check. See HZSFMSG macro — Issue a formatted check message.
  2. Check for the setting or potential problem it was designed to report on.
  3. Report check results using the HZSFMSG service to issue exception messages, reports, and other messages that tell the installation the results of and how to respond to conditions found by the check. You can issue a particular message multiple times in a check routine.

    For an exception message, issue the HZSFMSG REQUEST=CHECKMSG request. See Issuing messages in your local check routine with the HZSFMSG macro.

  • After Init function
  • At specified check interval
  • When check run is requested.
  • When a check parameter changes.
What does the system do?
  • If a check abends for three iterations in a row, the system stops calling the check, which will not run again until it is refreshed or its parameter is changed.
  • Obtains 4K of dynamic work area pointed to by field PQE_DynamicAreaAddr . The contents of this work area are not set to any particular value and are not preserved across check iterations.
Cleanup What should the check do? For PQE_Function_Code_Cleanup, the check routine should clean up anything that you want cleaned between check iterations. For example, cleanup anything that you are not cleaning up in Check processing, or that must be cleaned up if Check processing abends.

If you obtained resources owned by the current task during check function processing, check the PQE_CleanupInDifferentTaskThanCheck bit. If the bit is on, the system has already cleaned up the resources for you.

  • After Check function
What does the system do? The system obtains 4K of dynamic work area pointed to by field PQE_DynamicAreaAddr. The contents of this work area are not set to any particular value and are not preserved across check iterations.
Delete What should the check do? For PQE_Function_Code_Delete, the check routine should free any storage obtained during Init or Check processing that has not yet been freed.
  • Delete
  • Refresh
  • When the check transitions out of the active enabled state. For example, when the check issues HZSFMSG with the STOP request.
  • When the IBM Health Checker for z/OS address space stops.
What does the system do? The system:
  • Obtains 4K of dynamic work area pointed to by field PQE_DynamicAreaAddr . The contents of this work area are not set to any particular value and are not preserved across check iterations.
  • Stops calling the check.