Difference between revisions of "Retrieve Message (QMHRTVM)"

From MidrangeWiki
Jump to: navigation, search
Line 20: Line 20:
 
     D  pReplCCSID                  10i 0 const options(*nopass)
 
     D  pReplCCSID                  10i 0 const options(*nopass)
 
</pre>
 
</pre>
 
+
An RPG/LE fully free-form alternative:
 +
<pre>
 +
//******************************************************************************
 +
// 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;
 +
</pre>
 
== References ==
 
== References ==
 
* [[QMHRTVM_PCML]]
 
* [[QMHRTVM_PCML]]

Revision as of 17:35, 6 December 2018

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