|
I wonder if we're looking at this differently because my response is, "Yeah it'll remove everything." It has to work that way. You have to get the "from message key" before you encounter the anticipated error, the way I understand it.
Would it help to see the actual code?
Monitor;
MsgKey = $getCurrentMessageKey();
Write PreviousFile;
// If a duplicate key was found, remove the error messages.
On-Error ERR_DUPLICATE_KEY;
$RemoveJobLogEntriesByKey( MsgKey );
EndMon;
-Kurt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vern Hamberg
Sent: Monday, June 28, 2010 1:04 PM
To: RPG programming on the IBM i / System i
Subject: Re: Removing Job Log Messages
Kurt
Glad to hear this did the job for you.
One caveat - this will remove everything between the first bracketing
message and the second one. You might want to keep some messages, so you
may need to put in conditions for that kind of thing.
Vern
On 6/28/2010 10:51 AM, Kurt Anderson wrote:
Finally, success.
The article that Vern provided was really the answer. In order to get rid of that Sender's Copy, and even the system reply, I needed to use the retrieve the Message Key and remove job log entries by Message Key.
Since the article didn't have an RPGLE example, and likewise didn't mention that unlike the CL API calls, RPGLE has to monitor for CPF2410, I thought I'd share the code I came up with. (Oh, and there was also the issue of casting that the article used that I had to convert to RPGLE.)
And again, here's the article link:
https://www-912.ibm.com/s_dir/slkbase.NSF/1ac66549a21402188625680b0002037e/87d6dce3b5ab62c486256c8b005acd11?OpenDocument
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.