The OPS/MVS OPSTHRSH function is used to implement a time interval threshold count in an AOF rule but it is failing with return code 40 when the text being checked contains single quotes.
For example the message:
DFHSR0001 APPLID An abend (code aaa/bbbb) has occurred at offset X'FFFFFFFF' in program Progname
OPS/MVS 14.0
The rule contains this code:
TEXT = subword(msg.text,2)
parse var TEXT REG . 'code ' DET
... ... ...
if opsthrsh('A',7200,DET) < 5 then return
and returns a code 40
The problem is not the single quotes in the text but the length of the Criteria.
The OPSTHRSH function is coded using the following syntax:
var = OPSTHRSH(type,interval[,criteria[,position[,mlwto_line#]] ])
The criteria is a character string that must exist somewhere within the firing event and the limit is 50 characters.
The logic of the rule makes DET have more than 50 characters and that is why Return code 40 is produced.
Update the code so the character string used for criteria has less than 50 characters.