×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Bob,
This works great! Thanks.
Is there data that suggests that this routine is as efficient or better than
calling the QMH message APIs to remove the message?
Thanks again.
-Bob


-----Original Message-----
From: mi400-bounces@xxxxxxxxxxxx [mailto:mi400-bounces@xxxxxxxxxxxx] On
Behalf Of Bob Donovan
Sent: Tuesday, May 18, 2004 8:45 AM
To: MI Programming on the AS400 / iSeries
Cc: mi400@xxxxxxxxxxxx; mi400-bounces@xxxxxxxxxxxx
Subject: Re: [MI400] MCH3401 removal

mi400-bounces@xxxxxxxxxxxx wrote on 05/18/2004 07:46:36 AM:

> 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

If you choose to use a signal handler, you'll need to use the message 
handler APIs (in particular, QMHCHGEM).

>From C, a simpler and more efficient option, especially if the exception 
path is take with some regularity, is to replace the signal handler with a 
branch-point exception handler that removes messages from the job log. For 
example:

    #include <stddef.h>
    #include <except.h>
    #include <pointer.h>
    #include <mih/rslvsp.h>

    _SYSPTR checkObj( ... ) 
    {
      _SYSPTR obj = NULL;

      obj = NULL;
      _VBDY();
      #pragma exception_handler (EH_LBL,   \
                 0,  _C1_ALL, _C2_ALL, _CTLA_HANDLE_NO_MSG )
      obj = rslvsp( ... );
      #pragma disable_handler

     EH_LBL:
      return obj;
    }

Any follow-up questions should probably go to the C400-L.

Bob Donovan, rjd@xxxxxxxxxx

_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.