I am trying to use MESSAGE_QUEUE_INFO view to retrieve messages waiting for a reply in QSYSOPR in order to reply to them. I have been unable to convert the MESSAGE_KEY field from that view into usable field in my code. I keep getting a 462 error. Documentation says that that field is a binary(4) field. I would normally associate that as a integer(10). I have tried using the QMHLSTM API but the documentation indicates that the Message key is Character, however that isn't working either. Can any one point me as to the proper way to extract the field value into my code.
Current SQL statement I am using
Current SQL statement I am using
Code:
[FONT=Courier New]Select MESSAGE_QUEUE_LIBRARY, MESSAGE_QUEUE_NAME, [B]MESSAGE_KEY[/B] From QSYS2.MESSAGE_QUEUE_INFO WHERE MESSAGE_QUEUE_NAME = 'QSYSOPR' and MESSAGE_QUEUE_LIBRARY = 'QSYS' and FROM_PROGRAM = 'QCLXERR' [B]Relevant RPG Code:[/B] [B] DCL-S MsgK Char( 10); Have tried setting this as VarChar and Integer(10)[/B] DCL-S MsgQ VarChar( 10); DCL-S MsgL VarChar( 10); Exec SQL Fetch next From MYCSR into :MsgL, :MsgQ, [B]:MsgK[/B];[/FONT]
Comment