Did you ever get weird errors after you called an API?
barbara_morris 120000DX5W Visits (1857)
Here are the top 3 mistakes I see people make that can cause storage corruption. Storage corruption can then cause strange and sometimes intermittent errors to occur.
Mistake: Not passing the feedback parameter for CEE APIs
When the API documentation says a parameter is "omissible", it means you can pass *OMIT as the parameter. It doesn't mean you can completely leave it out. On your RPG prototype, code OPTIONS(*OMIT).
Here's the API documentation that talks about omitting parameters for CEE APIs: http
Mistake: Not initializing the error-code parameter for non CEE APIs
The first subfield, "Bytes_Available", of the error-code parameter is a 4-byte integer that gives the length of the error-code parameter. Valid values are zero, meaning "no error-code parameter", or a value 8 or greater.
Here's the API documentation about the error code parameter: http
Mistake: Not passing a big enough buffer to QRCVDTAQ (Receive Data Queue)
Many people just pass a buffer big enough for the message they are interested in. They think the "length" parameter is used to tell the API how big the buffer is. But really, the length parameter is used by the API to return how big the message is. The API assumes that the buffer is at least as big as the maximum size of a message for that data queue.
Here's the documentation for the QRCVDTAQ API: http