×
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.
There are 3 mistakes in your code that jump out at me:
a) Everywhere you have a field defined as "4B 0" it's wrong. Change them
all to "10I 0". Whenever API documentation says BINARY(4) it's referring
to RPG's "10I 0" data type. (Any time you find yourself coding "4B 0"
stop yourself, because it's probably a mistake. This is the #1
most common question posted to this mailing list!)
b) Remove the word "VARYING" from your definition of msgRplDta, since the
API does not allow the varying data type. That also means that you have
to trim your field when you calculate the length. i.e. change
%len(msgRplDta) to %len(%trimr(msgRplDta))
c) the error code field "msgErr" needs to be at least 8 bytes long. Yours
is currently defined as 2 bytes long. Make it a data structure containing
two "10I 0" fields, and set the first one to zero.
Those are the only bugs that stand out, but I've got another suggestion as
well:
Please consider writing a prototype for the API, and using that instead of
CALL/PARM. That way you can re-use the prototype later and it will
protect you and other people who use this API from making the same
mistakes. It also will make it possible to use the API in free format RPG
if you ever want to do that.
That advice applies to all other program calls as well, not just this API.
Hope that helps
On Thu, 10 Feb 2005, Ala, Michael A wrote:
I am trying to Write a Program Message to CPF9898 to display in a
message subfile
It Is not Displaying
Here are my D specs
D msgId s 7A INZ('CPF9898')
D msgLoc s 20A inz('QCPFMSG *LIBL ')
D msgRplDta s 3000A Varying
D msgRplDtaLen s 4B 0 inz(0)
D msgType s 10A inz('*INFO')
D msgQueue s 276A inz('*')
D msgCallStack s 4B 0 inz(0)
D msgKey s 4A inz(' ')
D msgErr s 4B 0 inz(0)
D msgrmv s 10A inz('*ALL')
call 'QMHSNDPM'
parm msgId
parm msgLoc
parm msgRplDta
parm msgRplDtaLen
parm msgType
parm msgQueue
parm msgCallStack
parm msgKey
parm msgErr
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.