OPS1040I error 40 using the OPSTHRSH function
search cancel

OPS1040I error 40 using the OPSTHRSH function

book

Article ID: 127543

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

Using OPSTHRSH to check the second line of a multi line message and it is abending with incorrect call.

)MSG CSQX548E MLWTO

CSQX548E :TCD1 CSQXRESP Messages sent to local dead-letter queue,
  channel QUXG.TO.TCD1
   reason=2053 (MQRC_Q_FULL)
OPS0997T *-* 18:trace 'i'
OPS0997T *-* 22: tran_val = opsthrsh('A','43200',,2)
OPS0997T >L> A
OPS0997T >L> 43200
OPS0997T >L>
OPS0997T >L> 2
OPS1040I ERROR 40 RUNNING MSGGLB.CSQX548E, LINE 22: INCORRECT CALL TO

Environment

Release:
Component: OPSMVS

Resolution

The syntax of the OPSTHRSH function is :

rtvl=OPSTHRSH('function',interval,['criteria'],[criteria_startpos],[mlwto_line_num])

Specifying a line number for a MLWTO is most times to check that some characters are present on that line, which would be the 'C' criteria function, not asid ('A') function.
If specifying a C (criteria) then it's needed to specify what to check and if it's an A (asid) a line number isnt necessary.

This works :
    tran_val = opsthrsh('C','43200',word(msg.text.2,2),,2)

Additional Information

See for the full description of the OPSTHRSH function in the manual:
 https://docops.ca.com/ca-opsmvs/13/en/reference-information/command-and-function-reference/ops-rexx-built-in-functions/opsthrsh-function