|
From: Bob Cozzi <cozzi@xxxxxxxxx> > I have a wrapper around rslvsp so that I can access objects in QTEMP. > I am basically doing an "IF Object Exists" test in an RPG IV program by > calling a C function that evokes rslvsp. > When the object does not exist, a signal handler is evoked and I return a > *NULL value to the caller. When it does exist, I return the system pointer. > Where I'm lost is how to filter/remove the MCH3401 message so that the user > doesn't see it in their joblog. I want to do this because they may be > calling this procedure 1000's of times and that would just clutter things > up. > Is there a way to filter out messages without doing a dynamic call to one of > the QMHxxxxx message APIs? > -Bob Cozzi > This is from chapter 20 of my book: Preventing Messages in the Joblog When you run the MIDECEXC program the program catches all three exceptions and does its repair work as desired. There is, however, an undesirable (in most cases) side effect: For every exception caught, an entry is made in the job log for your job, e.g.: 3 > call midecexc Decimal data error. Attempt made to divide by zero for fixed point operation. Receiver value too small to hold result. There could be thousands of such exceptions and although some indications of the occurrence of these exceptions would be desirable, it is better that the program itself issues a short summary at the end, rather than the system clogging up the job log with thousands of messages. So, the question is: Can we prevent an exception from generating a job log entry? Since the real compare value generated by the machine is x'00000000' and not "MCH", we must monitor with *that* compare value, i.e.: DCL EXCM DEC-ERROR EXCID(H'0C02', H'0C0A', H'0C0B') INT(ERROR) IMD CV(X'00000000'); instead of (as we did): DCL EXCM DEC-ERROR EXCID(H'0C02', H'0C0A', H'0C0B') INT(ERROR) IMD CV("MCH"); If we do that, it turns out that no job log entry is generated. If we use CV("MCH"), the exception is really caught first by a lower layer monitoring for x'00000000'. That lower layer issues its joblog message and resignals a new exception (with compare value "MCH") for us to catch. ==== In MI this is so easy. Rather than the convoluted C and RPG ways.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.