Re: *DTAQ existence API

Buck Calabro <[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <[email protected]>
On 11/10/2016 11:54 AM, Kelly Beard wrote:
> http://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/apis/qmhqrdqd.htm
> 
> QMHQRDQD() is an API without an error receiver variable, yet the page lists
> possible error codes.  How do you get these back from the API?  I need a
> good C/C++ example on this.

This particular API returns errors the old fashioned way - as exception
messages.  If the API runs into an issue (like not authorised to the
library) then IBM i will send a message to your program (the caller of
the API) telling you so.

You need to monitor for, and receive those messages.

The whole topic is covered in 'Handling Exceptions in a Program'
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzarh/hexcp.htm#hexcp

It's a little upside down to typical C where you get errno via a 'side
channel' and you can check it or not as you see fit.  When IBM i throws
exception messages, your code gets interrupted and a white message
occurs unless you specifically monitor and handle the message.

> Also, isn't there a reason no CRTDTAQ API is available?  Why just a
> command?  That makes it difficult to capture any potential errors on that
> as well.

This works the same as QMHQRDQD(); you handle the exception message that
arises.

-- 
  --buck

Visit wiki.midrange.com and register for an account. Edit a page that
helps you, and because it's public, you'll help someone else, too!

-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.