Rory,
Sorry to be so slow. I put the program under debug again. There were no errors returned. I.e., qusei = *Blanks, and qusbavl = *Zeros. I am not loading anything into the qusec data structure; I've only written about a dozen programs using API's and the few that use the error data structure simply check it afterwards, never initialize anything in it. Should I?
The prototype for the QMHSNDPM is:
D QMHSNDPM PR EXTPGM('QMHSNDPM')
D MsgId 7a CONST
D MsgF 20a CONST
D MsgData 256a CONST
D MsgDataLen 10i 0 CONST
D MsgType 10a CONST
D CallStkEntry 10a CONST
D CallStkCount 10i 0 CONST
D MsgKey 4a CONST
D ErrorCode LikeDS(QUSEC)
D CallStkLen 10i 0 CONST
D Options(*NoPass)
D CallSDtkQual 20a CONST
D Options(*NoPass)
D DspMsgWaitTim 10i 0 CONST
D Options(*NoPass)
D CallStkDataT 10a CONST
D Options(*NoPass)
D CCSID 10i 0 CONST
D Options(*NoPass)
The subprocedure that uses same is:
P $Smsg B
D $SMsg PI
D MsgId 7a
/free
qmhsndpm(msgid:@msgf:@dta:%len(@dta):@type:@pgmq:@stk:@key:qusec);
RETURN;
The value for @pgmq is 'ARQ020' which is the same value used in the Remove Message API:
qmhrmvpm(@pgmq:@stk:@key:@rmv:qusec);
It's probably something silly or stupid that I'm doing, but I just can't see it. Heck, I spent half of the morning trying to figure out why the EXFMT of the control record was blowing off; took me that long to realize that I forgot the WRITE to the subfile record. So please be gentle.
Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rory Hewitt
Sent: Tuesday, April 28, 2009 12:45 PM
To: RPG programming on the IBM i / System i
Subject: Re: QMHRMVPM Problem in Subprocedure
To be serious now...
OK, if the messages aren't being removed *and* there aren't any errors
calling QMHRMVPM, then that means that they probably weren't sent to where
you think they were. IOW< there is a mismatch between where you think you're
sending them and where you're actually sending them.
But just to check, are there any errors returned in qusec following the call
to QMHRMVPM? You don't check for them in your code, but maybe in debug you
checked? Come to that, what values (if any) do you pass in QUSEC - did you
initialize it to return errors or throw errors to the joblog.
On the plus side, once you've got this working fine, you can copy this code
everywhere and your life will be much simpler...
Rory
On Tue, Apr 28, 2009 at 10:38 AM, Rory Hewitt <roryhewitt@xxxxxxxxx> wrote:
Well that was your first problem...
On Tue, Apr 28, 2009 at 9:52 AM, Jerry Adams <Jerry@xxxxxxxxxxxxxxx>wrote:
<snip>Searched the archives again and found a reply from Rory:</snip>
As an Amazon Associate we earn from qualifying purchases.