I wonder whether or not someone could help me with the PCML of the Retrieve Data Queue Message (QMHRDQM) API.

This is what my PCML looks like so far:

<pcml version="1.0">

<struct name="message" >
<data name="offsNextEntry" type="int" length="4" usage="output" />
<data name="dateTime" type="byte" length="8" usage="output" />
<data name="messageKey" type="char" length="8" usage="output" />

<struct name="rdqs0100">
<data name="type" type="char" length="1" usage="output" />
<data name="reserved" type="char" length="3" usage="output" />
<data name="numTextBytes" type="int" length="4" usage="output" />

<struct name="rdqm0100">
<data name="bytesReturned" type="int" length="4" usage="output" />
<data name="bytesAvailable" type="int" length="4" usage="output" />
<data name="numMsgRtn" type="int" length="4" usage="output" />
<data name="numMsgAvl" type="int" length="4" usage="output" />
<data name="msgKeyLenRtn" type="int" length="4" usage="output" />
<data name="msgKeyLenAvl" type="int" length="4" usage="output" />
<data name="maxTextLenRqs" type="int" length="4" usage="output" />
<data name="maxTextLenAvl" type="int" length="4" usage="output" />
<data name="reserved" type="char" length="8" usage="output" />
<data name="offsFirstEntry" type="int" length="4" usage="output" />
<data name="libraryNameRtn" type="char" length="10" usage="output" />
<data name="message" type="struct" struct="message" usage="output" offset="offsFirstEntry" offsetfrom="0" />

<program name="QMHRDQM" path="/QSYS.LIB/QMHRDQM.PGM">
<data name=" offsFirstEntry " type="struct" struct="rdqm0100" usage="output" outputsize="receiverLength"/>
<data name="receiverLength" type="int" length="4" usage="input" />
<data name="format" type="char" length="8" usage="input" />
<data name="dataQueue" type="char" length="20" usage="input" />
<data name="selection" type="struct" struct="rdqs
0100" usage="input" />
<data name="selectionLength" type="int" length="4" usage="input" />
<data name="selectionFormat" type="char" length="8" usage="input" />
<data name="errorCode" type="int" length="4" usage="input" />


It works fine for the first message entry, which is addressed by "offsFirstEntry" of structure "rdqm0100".

The question is how to get the next message entries that are addressed by "offsNextEntry" of structure "message", which is kind of a recursion.

I tried it as shown below with no success:

System.out.println("Offset 1. entry: " + pcml.getIntValue("QMHRDQM.receiver.offsFirstEntry"));

System.out.println("1. message.dateTime: " + printBytes(pcml.getValue("QMHRDQM.receiver.message.dateTime")));
System.out.println("1. message.offsNextEntry: " + pcml.getIntValue("QMHRDQM.receiver.message.offsNextEntry"));

pcml.setIntValue("QMHRDQM.receiver.offsFirstEntry", pcml.getIntValue("QMHRDQM.receiver.message.offsNextEntry"));
System.out.println("changed to: " + pcml.getIntValue("QMHRDQM.receiver.offsFirstEntry"));

System.out.println("2. message.dateTime: " + printBytes(pcml.getValue("QMHRDQM.receiver.message.dateTime")));
System.out.println("2. message.offsNextEntry: " + pcml.getIntValue("QMHRDQM.receiver.message.offsNextEntry"));

The output looks like this:

Number of bytes returned: 184
Number of bytes available: 3416
Number of messages returned: 4
Number of messages available: 30
Offset 1. entry: 56
1. message.dateTime: "unreadable bytes"
1. message.offsNextEntry: 88
changed to: 88
2. message.dateTime: "unreadable bytes"
2. message.offsNextEntry: 88

Although the output implies that the offset has changed to 88, the data of the second message is exactly matches the first message.

Any ideas? Any help would be greatly appreciated.


This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the sender.

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