Difference between revisions of "Retrieve Message (QMHRTVM)"

From MidrangeWiki
Jump to: navigation, search
m (DaveLClarkI moved page QMHRTVM — Retrieve Message to Retrieve Message (QMHRTVM): Better Indexing (too many Q's))
Line 3: Line 3:
 
= Summary =
 
= Summary =
 
The QMHRTVM api is used to retrieve message's from [[message files]] and optionally replace substitution data.
 
The QMHRTVM api is used to retrieve message's from [[message files]] and optionally replace substitution data.
 +
 +
For more information on this API, visit [https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/QMHRTVM.htm Retrieve Message (QMHRTVM) API] (right-click to open link in a new tab).
 +
 
= Prototype for the QMHRTVM API =
 
= Prototype for the QMHRTVM API =
 
<pre>
 
<pre>
Line 44: Line 47:
 
end-pr;
 
end-pr;
 
</pre>
 
</pre>
 +
 
== References ==
 
== References ==
 
* [[QMHRTVM_PCML]]
 
* [[QMHRTVM_PCML]]
 
* [[ApiErrC — API Error Code]]
 
* [[ApiErrC — API Error Code]]

Revision as of 16:08, 7 December 2018

Summary

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

For more information on this API, visit Retrieve Message (QMHRTVM) API (right-click to open link in a new tab).

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