|
Two rules when using QSYSINC/QRPGLESRC source in your own applications:structure by
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
adding a length of 2000 for the data structure. Your code will work fornow.
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
Behalf Of Coyle, Stephen F.list
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
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.