When a job produces
$HASP310 jobname TERMINATED AT END OF MEMORY
We have a rule to trap this message and check whether its in the RDF Table and mark it in ERROR
To work out the Job we use
IF msg.bewto = 1 THEN Job = msg.ojobname ELSE Job = msg.jobname
But what we have found the value of variable job is JES2 rather than the jobname that produced this message
Are there limitations in the use of msg.bewto with JES2 messages
Release : 13.5 14.0
Component : OPS/MVS
A simpler approach would be to parse the $HASP310 message to extract the desired jobname from the second word in the message:
$HASP310 jobname TERMINATED AT END OF MEMORY
This line of code is all that's necessary to extract the jobname from the message:
Job = OPSWORD(msg.text,2)
OPSWORD function documentation: