The OPSCAWTO function is getting a return code 0 even when the ENFSNMPM task is down. It was expected to get a RC=4.
OPS/MVS, all releases
Using the OPSCAWTO function to send SNMP traps out of the mainframe requires the ENF started task to be active, as well as the spawned task ENFSNMPM.
The function OPSCAWTO returns a 4 when the ENF started task itself is inactive. There is no check to confirm if the ENFSNMPM is active.
A work around is to use the OPSTATUS function to check the status the ENFSNMP task before calling the OPSCAWTO function.
For more information review: OPSCAWTO Function
Common Services Reference: Customize the ENFSNMPM Procedure