× 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.



Jose

I suggest sending a couple messages and retrieve the message keys - one message before the process you want to monitor, one after. Then do a loop doing QMHRCVPM by key between the 2 keys - this is pretty much guaranteed to give you everything between. There's a knowledge base article on this at IBM support for iseries. Can find if you search on that API, probably.

HTH
Vern
-------------- Original message --------------
From: Jose Santana <jsantana@xxxxxxxxxxxxx>

I have an Rpg program that makes a call to a command from an CMS
application to
checkout some objects under certain circumstances. My RPG program
monitors for
any errors on the call to the checkout command in the event that an
object cannot be
checked out for some reason beyond its control. However, when I try to
capture the
error I'm only getting the "program CHECKOUT ended Abnormally" message
that's
issued by the called command but it is not capturing the preceding
CPF2469 escape message.
This escape message then causes the main program MYPGM to crash. Here's
a snippet
of my code:

c monitor
c call 'QCMDEXC'
c parm CmdStr
c parm CmdLen
c endif
c dow 1=1
c callp ReceiveMsg(Msg0200
c : %size(Msg0200)
c : 'RCVM0200'
c : '*'
c : 0
c : '*LAST'
c : *blanks
c : 1
c : '*REMOVE'
c : ApiError)
*ReceiveMsg makes a call to the QMHRCVPM
c if Msg0200.BytesAvail = 0
c Leave
c endif
c callp LogMessage
c enddo
c endmon

Can anyone please shed some light as to what I might be missing. Aren't
all messages
thown by the QCMDEXC call supposed to be captured by the calling
program's Monitor /End-mon block?
Any help is greatly appreciated.

Jose



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

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.