*=============================================================== * MIT License * Copyright (c) 2016 TEMBO Technology Labs (Pty) Ltd. * Author: Tommy Atkins - Chief Development Officer * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies * or substantial portions of the Software. * ================================================================================== * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *=============================================================== h option(*nodebugio) debug dftactgrp(*no) actgrp(*caller) h usrprf(*owner) aut(*use) bnddir('AMWSRV') *=============================================================== d CUSMSTF_A0 pr extpgm('CUSMSTF_A0') d P likeds(P1) options(*varsize) d PL 10i 0 const *=============================================================== d CUSMSTF_A0 pi d P likeds(P1) options(*varsize) d PL 10i 0 const *=============================================================== d PP s * *=============================================================== d P1 ds d PFName 1 10 d LibName 11 20 d MbrName 21 30 d Event 31 31 d Time 32 32 d CmtLock 33 33 d Resvd1 34 36 d CCSID 37 40b 0 d RRN 41 44b 0 d Resvd2 45 48 d OldOS 49 52b 0 d OldLen 53 56b 0 d OldNMOS 57 60b 0 d OldNMLen 61 64b 0 d NewOS 65 68b 0 d NewLen 69 72b 0 d NewNMOS 73 76b 0 d NewNMLen 77 80b 0 d Resvd3 81 96 *=============================================================== * Original Record Pointer d OP s * * Original Record d O e ds based(OP) extname(CUSMSTF) qualified * New Record Pointer d NP s * * New Record d N e ds based(NP) extname(CUSMSTF) qualified *=============================================================== * Move *DIAG and Re-Send *ESCAPE Messages d ERR03 pr d MT 1 const options(*nopass) * Send *ESCAPE Message d ERR11 pr d MI 7 const d MF 10 const options(*omit:*nopass) d MD 128 const options(*omit:*nopass) d MT 1 const options(*nopass) *=============================================================== d InsertEvent pr d DeleteEvent pr d UpdateEvent pr *=============================================================== d CUSBALFP s * inz(%addr(CUSBALFR)) d CUSBALFK e ds extname(CUSBALF:*KEY) qualified d CUSBALFR e ds extname(CUSBALF) * I/O Server =================================================== d CUSBALF$ pr n d Action 5 const d Pointer * const d Keys const options(*nopass) like(CUSBALFK) *=============================================================== /free //=================================================== monitor; //================================================ PP = %addr(P); //================================================ select; when P.Event = '1'; // Insert NP = PP + P.NewOS; InsertEvent(); when P.Event = '2'; // Delete OP = PP + P.OldOS; DeleteEvent(); when P.Event = '3'; // Update NP = PP + P.NewOS; OP = PP + P.OldOS; UpdateEvent(); endsl; //================================================ on-error; ERR11('TRGA999':'AMWMSGF':'CUSMSTF_A0'); endmon; //================================================ return; //================================================ /end-free *===================================================================== *<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *===================================================================== p InsertEvent b *===================================================== /free //=================================================== monitor; //================================================ RECSTS = ' '; CUSTNO = N.CUSTNO; DAYSC = 0; DAYS30 = 0; DAYS60 = 0; CUSTOTOS = 0; CUSBALF$('I':CUSBALFP); // Insert New Record into CUSBALF //================================================ on-error; ERR03(); endmon; //=================================================== /end-free p InsertEvent e *===================================================================== *<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *===================================================================== p DeleteEvent b *===================================================== /free //=================================================== monitor; //================================================ //================================================ on-error; ERR03(); endmon; //=================================================== /end-free p DeleteEvent e *===================================================================== *<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *===================================================================== p UpdateEvent b *===================================================== /free //=================================================== monitor; //================================================ //================================================ on-error; ERR03(); endmon; //=================================================== /end-free p UpdateEvent e *=====================================================================