**free //& Apache License ============================================================* // Copyright © 2008-2021 TEMBO Technology Lab (Pty) Ltd. * // Created by AO Foundation - www.adsero-optima.com * // Original TEMPLATE author: Tommy Atkins - Chief Development Officer * // * // Licensed under the Apache License, Version 2.0 (the "License"); * // you may not use this file except in compliance with the License. * // You may obtain a copy of the License at * // http://www.apache.org/licenses/LICENSE-2.0 * // * // Unless required by applicable law or agreed to in writing, software * // distributed under the License is distributed on an "AS IS" BASIS, * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * // See the License for the specific language governing permissions and * // limitations under the License. * // * // The above copyright notice and this permission notice shall be included in * // all copies or substantial portions of the Software. * // https://www.i-nterprise.org/ * // https://www.adsero-optima.com/ * //=============================================================================* //& Error Handler Services - Retrieve Messages Text/Help ctl-opt nomain aut(*use) extbinint(*yes) option(*nodebugio) debug; //==================================================================== //& Exports // Application Error Handlers - Module 04 // EXPORT SYMBOL(ERR20 ) /* Retrieve Message Text MD=128 RETURN=132 // EXPORT SYMBOL(ERR21 ) /* Retrieve Message Text MD=2048 RETURN=132 // EXPORT SYMBOL(ERR22 ) /* Retrieve Message Help MD=2048 RETURN=3000 //==================================================================== //& Prototypes /include *LIBL/SRCCPY,ERR03 Move *DIAG and Resend *ESCAPE Messages //========================================================== dcl-pr QMHRTVM extpgm('QMHRTVM'); RV char(4096) options(*varsize); RVL int(10) const; Fmt char( 8) const; MsgId char( 7) const; MsgFL char(20) const; MsgDta char(128) const options(*varsize); MsgDtaL int(10) const; RplSubVal char(10) const; RtnFmtChr char(10) const; Err like(EC); //RtvOpt char(10) const options(*nopass); //CvtCcsId int(10) const options(*nopass); //RplCcsId int(10) const options(*nopass); end-pr; //==================================================================== //& Data Definitions /include *LIBL/SRCCPY,API_EC API Error Code Data Structure //========================================================== dcl-s RVP pointer inz(%addr(RV)); dcl-s RVL int(10) inz(%size(RV)); dcl-ds RV len(4096); BytesR int(10); BytesA int(10); MsgLR int(10); MsgLA int(10); HelpLR int(10); HelpLA int(10); Msg char(132); end-ds; //========================================================== dcl-s HP pointer; dcl-s Help char(3000) based(HP); //========================================================== dcl-s MFL char(20) inz('ERRMSGF *LIBL'); dcl-s MDD char(2048) inz(' '); dcl-s MDL int(10) inz(0); //& ================================================================== //& ERR20: Retrieve Message Text RETURN=char(132) dcl-proc ERR20 export; dcl-pi *n char(132); MI char(7) const; MF char(10) const options(*omit:*nopass); MD varchar(2048) const options(*nopass); end-pi; //========================================================== monitor; //========================================================== select; when %parms = 1; QMHRTVM(RV:RVL:'RTVM0100':MI:MFL:' ':1:'*YES':'*NO':EC); when %parms = 2; QMHRTVM(RV:RVL:'RTVM0100':MI:MF+'*LIBL':' ':1:'*YES':'*NO':EC); when %parms = 3; MDD = MD; MDL = %len(MD); QMHRTVM(RV:RVL:'RTVM0100':MI:MF+'*LIBL':MDD:MDL:'*YES':'*NO':EC); endsl; //========================================================== return %subst(Msg:1:MsgLR); //========================================================== on-error; ERR03(); endmon; //========================================================== end-proc; //==================================================================== //& ERR22: Retrieve Message Help RETURN=char(3000) dcl-proc ERR22 export; dcl-pi *n char(3000); MI char(7) const; MF char(10) const options(*omit:*nopass); MD varchar(2048) const options(*nopass); end-pi; //========================================================== monitor; //======================================================= select; when %parms = 1; QMHRTVM(RV:RVL:'RTVM0100':MI:MFL:' ':1:'*YES':'*NO':EC); when %parms = 2; QMHRTVM(RV:RVL:'RTVM0100':MI:MF+'*LIBL':' ':1:'*YES':'*NO':EC); when %parms = 3; MDD = MD; MDL = %len(MD); QMHRTVM(RV:RVL:'RTVM0100':MI:MF+'*LIBL':MDD:MDL:'*YES':'*NO':EC); endsl; //======================================================= HP = %addr(Msg) + MsgLR; //======================================================= return %subst(Help:1:HelpLR); //======================================================= on-error; ERR03(); endmon; //========================================================== end-proc; //& ==================================================================