Two rules when using QSYSINC/QRPGLESRC source in your own applications:
1) The data structures suck, so write your own, more readable version.
2) If you're using QSYSINC/QRPGLESRC, see rule 1.
To make your code work, change the DS line for your RCVM02000000 structure by
adding a length of 2000 for the data structure. Your code will work for now.
-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Coyle, Stephen F.
Sent: Thursday, May 17, 2007 10:37 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: Reading QMHRCVPM data returned
Hi All, 
I'm having a situation when reading the varying length data returned
from the QMHRCVPM API. The format I'm using, RCVM0200, is copied in from
QSysInc/QRpgleSrc,QMHRCVPM. 
     DQMHM020000       DS                                       Qmh
Rcvpm RCVM0200
     D QMHBRTN02               1      4B 0              Bytes Returned
        .
     D QMHLDRTN00            153    156B 0              Length Data
Returned
        .
     D QMHLHAVL00            173    176B 0              Length Help
Available
     D*QMHMT06               177    177                 Varying length
     D*QMHSSAGE00            178    178                 Varying length
     D*QMHMH00               179    179                 Varying length
When attempting to scan the message replacement data,
        %Scan( 'Manager': %Subst( QMHM020000: 177 : QMHLDRTN00 ))
The compiler justifiably says that the start position,177, is greater
than the variable length, 176. The text in the QSysInc copy member also
states 
     D*NOTE: The following type definition only defines the fixed
     D*   portion of the format.  Any varying length field will
     D*   have to be defined by the user.     
The thing is, the production program that is coded like this is working
fine. It was compiled at V4R5M0, but it won't compile now at V5R3M0.    
It looks like a hole has been fixed since V4R5 but I really don't know. 
Anyway, does this mean the QSysInc copy members cannot be used and I'll
have to redefine them in my own copy members? Or is there a better way? 
I was thinking of copying the member and changing the QMHM020000 data
structure length to match my prototype receiver variable, like so: 
     DQMHM020000       DS            1024               Qmh Rcvpm
RCVM0200
     D RcvPgmMessage   Pr                  ExtPgm('QMHRCVPM')
     D   MsgData                   1024A    Options(*VarSize)
     D   MsgDataLen                  10I 0  Const
     D   FormatName                   8A    Const
     D   CallStEntry                 10A    Const
     D   CallStCount                 10I 0  Const
     D   MsgType                     10A    Const
     D   MsgKey                       4A    Const
     D   WaitTime                    10I 0  Const
     D   MsgAction                   10A    Const
     D   APIErrorDS                         Like( QUsEC )  
Any suggestions on how others would do this are appreciated. I'd like to
continue to use QSysInc if possible.
Thanks...
- Steve
As an Amazon Associate we earn from qualifying purchases.