× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Oh, I see what you're saying. I knew we were somehow misaligned. I felt pretty safe removing all messages in the situation I presented, but I can see where there could be a need to check the messages received. And you're right, I forgot that I switched from the Receive API that the article uses to the Remove API.

Thanks again,
Kurt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vern Hamberg
Sent: Monday, June 28, 2010 6:30 PM
To: RPG programming on the IBM i / System i
Subject: Re: Removing Job Log Messages

Hi Kurt

Yeah, I'm thinking of receiving first without removing, then removing
only the ones I don't want. I think the article only did receives - yes,
it does, other than the remove of the dummy messages for getting the
keys before and after.

You can use QMHRCVPM by key just as you use QMHRMVPM. Check the message
ID, perhaps something in the message text if the same message ID appears
repeatedly, such as the infamous CPF9898.

Hope that clarifies what I've been saying!!

Vern

On 6/28/2010 2:56 PM, Kurt Anderson wrote:
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.