*=================================================================================== * Write Log File Record Service Procedure (ERRLOGF) *=================================================================================== * 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 nomain aut(*use) option(*nodebugio) debug *=============================================================== fERRLOGF uf a e k disk usropn rename(ERRLOGFR:Record) *=============================================================== d ERRLOGF$ pr d PP * const Parameter Pointer d RP * const Record Pointer d MD 128 const Message Data *===================================================== d ERRLOGFP s * d ERRLOGFR e ds based(ERRLOGFP) extname(ERRLOGF) *=============================================================== * Percolate *DIAG messages and ReSend *ESCAPE messages d ERR03 pr d MT 1 const options(*nopass) *=============================================================== * Return substituted message from MsgId (MI) in MsgFile (MF). MD is substitution data d ERR20 pr 132 d MI 7 const d MF 10 const options(*omit:*nopass) d MD 128 const options(*nopass) *=============================================================== **************************************************************** *=============================================================== p ERRLOGF$ b export d ERRLOGF$ pi d PP * const Parameter Pointer d RP * const Record Pointer d MD 128 const Message Data *===================================================== d P1 ds based(PP) 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 *===================================================== /free monitor; //================================================ if not %open(ERRLOGF); open ERRLOGF; endif; //================================================ ERRLOGFP = RP; //================================================ FILENM = PFName; EVENTI = Event; LOGDTS = %timestamp(); //================================================ ERRTXT = ERR20(ERRMSG:'ERRMSGF':MD); // retrieve Substituted Message Text //================================================ select; // Set BEFORE and AFTER Images when EVENTI = '1'; // Insert BEFORE = ' '; AFTER = %subst(P1:NewOS:NewLen); when EVENTI = '2'; // Delete BEFORE = %subst(P1:OldOS:OldLen); AFTER = ' '; when EVENTI = '3'; // Update BEFORE = %subst(P1:OldOS:OldLen); AFTER = %subst(P1:NewOS:NewLen); endsl; //================================================ write Record; //================================================ on-error; ERR03(); endmon; /end-free *===================================================== p ERRLOGF$ e *===============================================================