Retrieve Message (QMHRTVM)

From MidrangeWiki
Revision as of 20:10, 6 December 2018 by DaveLClarkI (talk | contribs) (DaveLClarkI moved page QMHRTVM — Retrieve Message to Retrieve Message (QMHRTVM): Better Indexing (too many Q's))
Jump to: navigation, search

Summary

The QMHRTVM api is used to retrieve message's from message files and optionally replace substitution data.

Prototype for the QMHRTVM API

     DQMHRTVM          PR                  EXTPGM('QMHRTVM')
     D  pMsgInfo                  32767a   options(*varsize)
     D  pMsgInfoLen                  10i 0 const
     D  pReturnFmt                    8a   const
     D  pMsgId                        7a   const
     D  pMsgFile                     20a   const
     D  pMsgData                  32767a   const options(*varsize)
     D  pMsgDataLen                  10i 0 const
     D  pReplSubst                   10a   const
     D  pRtnCtrl                     10a   const
     D  pApiErrorDS               32767a   options(*nopass:*varsize)
     D  pRtvOption                   10a   options(*nopass)
     D  pCCSID                       10i 0 const options(*nopass)
     D  pReplCCSID                   10i 0 const options(*nopass)

An RPG/LE fully free-form alternative:

//******************************************************************************
// IBM API to Retrieve Message Text or Full Description (depending on chosen format)
// https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/QMHRTVM.htm
//******************************************************************************
/include qsysinc/qrpglesrc,qmhrtvm          // QMHRTVM API data structures
dcl-pr IBMAPI_RtvMsgDesc          extpgm('QMHRTVM');
  MsgDesc               likedS(QMHM010004)  options(*varsize);
  MsgDscL               int(10)   const;
  MsgDFmt               char(8)   const;
  MsgId                 char(7)   const;
  MsgMsgF               char(20)  const;
  MsgData               char(3000) const    options(*varsize);
  MsgDatL               int(10)   const;
  MsgROpt               char(10)  const;
  MsgFCtl               char(10)  const;
  MsgErrC               likeds(ApiErrC)     options(*varsize);
// optional parm group
  MsgRtvO               char(10)  const     options(*nopass);
  MsgToCss              int(10)   const     options(*nopass);
  MsgRCss               int(10)   const     options(*nopass);
end-pr;

References