       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.        CSR04332.                                     
COB303 DATE-WRITTEN.  FEB  18, 2010                                     
       DATE-COMPILED.                                                   
      *                                                                 00050000
      ******************************************************************00060000
      *                                                                *00070000
      *                SOUTH CAROLINA ELECTRIC & GAS                   *00080000
      *                                                                *00090000
      *                                                                *00150000
      ******************************************************************00160000
      *                 P R O G R A M  S U M M A R Y                   *00170000
      *                                                                *00180000
      *  THIS PROGRAM INSERTS/UPDATES CASE HDR& DETAILS. ALSO ADDS REV *00190000
      *  PROTECTION CHARGES& CREATES DFA'S FROM THOSE CHARGES.         *00200000
      *                                                                *00210000
      ******************************************************************00220000
      *                                                                *00230000
      *                     PROGRAM MODIFICATION LOG                   *00240000
      *                                                                *00250000
      *    DATE    INITIALS   COMMENTS                                 *00260000
      *  --------  --------   ---------------------------------------  *00270000
P00253*  02/18/10  SP95538    PROCEDURE ORIGINALLY CODED.              *00280000
P00253*  06/28/10  SP95538    RETRIEVE DESCRIPTION FOR TRANSACTION     *00280000
      *                       HISTORY.                                 *00230000
ACT018*  02/29/12  VENKAT P   FIXED THE ISSUE WHILE WRITING TRANS HIST *00280000
      *                       (APPL00003967)                           *00280000
P00793*  03/03/14  VENKAT P   - TRANSFER CASE DETAILS                  *00280000
P00793*                       - ADD/EDIT FEE & POST CHARGE WHEN CASE   *00280000
P00793*                         ACTIVATED                              *00280000
      ******************************************************************00473200
      ******************************************************************00473300
      *                                                                *00473400
      *                ---- BASIC SEQUENCE STRUCTURE ----              *00473500
      *                                                                *00473600
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION             *00473700
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                    *00473800
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                   *00473900
      *  3000 - 4999  NOT USED                                         *00474000
      *  5000 - 5999  COMMON PROGRAM MODULES                           *00474100
      *  6000 - 6999  COMMON SYSTEM MODULES                            *00475000
      *  7000 - 7999  INPUT MODULES                                    *00476000
      *  8000 - 8999  OUTPUT MODULES                                   *00477000
      *  9000 - 9999  TERMINATION,ABEND, MESSAGING MODULES             *00478000
      *                                                                *00479000
      ******************************************************************00480000
      *                                                                 00490000
       ENVIRONMENT DIVISION.                                            
      *                                                                 00490000
       DATA DIVISION.                                                   
      *                                                                 00520000
       WORKING-STORAGE SECTION.                                         

MSQ001     EXEC SQL
MSQ001      INCLUDE SQLDA
MSQ001     END-EXEC
MSQ001 01 MSQ001-SQLCABACK PIC X(136).
MSQ002  01 MFA-CSRERLOG.
MSQ002    05 ARG-5 PIC X(255).
MSQ002    05 ARG-6 PIC X(255).
MSQ002    05 ARG-7 PIC X(447).

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'CSR04332'.
MSQ017     COPY MFASQLM.
       01 WS-START                     PIC X(40) VALUE                  
          'WORKING STORAGE FOR CSR04332 STARTS HERE'.                   
      *                                                                 00820000
       01 WS-MISC.                                                      
          05 PROGRAM-NAME              PIC X(08) VALUE 'CSR04332'.      
P00253    05 CSR04333                  PIC X(08) VALUE 'CSR04333'.      
          05 WS-REVENUE-MONTH          PIC S9(6) COMP-3 VALUE +0.       
          05 WS-REV-MONTH              PIC X(6)  VALUE SPACES.          
          05 WS-DFA-EXISTS             PIC X(01) VALUE 'N'.             
          05 WS-CASE-EXISTS            PIC X(01) VALUE 'N'.             
P00793    05 WS-CASE-STATUS            PIC X(11) VALUE SPACES.          
          05 WS-CASE-NO                PIC X(09) VALUE SPACES.          
          05 WS-HEADER-CHANGE          PIC X(01) VALUE 'Y'.             
P00253    05 WS-PREV-WORK-TYPE-DESC    PIC X(25) VALUE SPACES.          
P00253    05 WS-WORK-TYPE-DESC         PIC X(25) VALUE SPACES.          
P00253    05 WS-PREV-UNCOLLEC-DESC     PIC X(16) VALUE SPACES.          
P00253    05 WS-UNCOLLEC-RESN-DESC     PIC X(16) VALUE SPACES.          
P00253    05 WS-PREV-SOURCE-CD-DESC    PIC X(16) VALUE SPACES.          
P00253    05 WS-SOURCE-CD-DESC         PIC X(16) VALUE SPACES.          
P00253    05 WS-PREV-UNCOLLEC-LEN      PIC S9(4) USAGE COMP.            
P00253    05 WS-UNCOLLEC-RESN-LEN      PIC S9(4) USAGE COMP.            
P00253    05 WS-PREV-SOURCE-CD-LEN     PIC S9(4) USAGE COMP.            
P00253    05 WS-SOURCE-CD-LEN          PIC S9(4) USAGE COMP.            
          05 WS-NULL-IND-1             PIC S9(04) COMP VALUE +0.        
          05 WS-NULL-IND-2             PIC S9(04) COMP VALUE +0.        
          05 WS-REV-CASE-NO.                                            
             10 WS-YEAR                PIC X(02).                       
             10 FILLER                 PIC X(01) VALUE '-'.             
             10 WS-CASE-NUM            PIC X(06).                       
      * ACCT# REDEFINES                                                         
          05 WS-ACCOUNT                PIC X(13).                       
          05 WS-ACCOUNT-DEC            REDEFINES WS-ACCOUNT             
                                       PIC 9(13).                       
          05 WS-ACCOUNT-NO             PIC S9(13)V USAGE COMP-3         
                                                   VALUE +0.            
P00793    05 WS-TO-ACCOUNT             PIC X(13).                       
P00793    05 WS-TO-ACCOUNT-DEC         REDEFINES WS-TO-ACCOUNT          
P00793                                 PIC 9(13).                       
P00793    05 WS-TO-ACCOUNT-NO          PIC S9(13)V USAGE COMP-3         
P00793                                             VALUE +0.            
P00793    05 WS-TRANSFER-TEXT.                                          
P00793       10 FILLER                 PIC X(15) VALUE                  
P00793                                           'TRANSFERRED TO:'.     
P00793       10 WS-TRANSFER-ACCT       PIC X(13).                       
      * MNT TRANS HIST EDIT MASK                                                
          05 WS-PREV-COLLECT-AMT       PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-PREV-UNITS             PIC ZZZ,ZZZ,ZZ9.                 
          05 WS-PREV-COLL-UNITS        PIC ZZZ,ZZZ,ZZ9.                 
          05 WS-PREV-CASE-AMT          PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-PREV-DOWN-PYMT         PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-PREV-RECURR-REV-PCT    PIC Z,Z9.99.                     
          05 WS-COLLECTIBLE-AM         PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-TOTAL-UNITS            PIC ZZZ,ZZZ,ZZ9.                 
          05 WS-COLLECTIBLE-UNITS      PIC ZZZ,ZZZ,ZZ9.                 
          05 WS-CASE-AMT               PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-AMT-DOWN-PYMT          PIC ZZ,ZZZ,ZZZ,ZZ9.99.           
          05 WS-RECURR-REV-PCT         PIC Z,Z9.99.                     
      *                                                                         
       01 PARM-FIELDS.                                                  
          05 PARM-RECV.                                                 
             10 PARM-CONSMPT-TYPE-CD-1 PIC  X(01).                      
             10 PARM-CASE-SEQ-NO-1     PIC  S9(4) USAGE COMP.           
             10 PARM-RATE-PLAN-NO-1    PIC  X(03).                      
             10 PARM-CODE-REV-CLASS-1  PIC  X(03).                      
             10 PARM-CASE-TYPE-CD-1    PIC  X(01).                      
COB305       10 PARM-NO-UNITS-1        PIC  S9(9)V USAGE COMP-3 VALUE 0.        
COB305       10 PARM-COLLECT-UNITS-1        PIC  S9(9)V USAGE COMP-3 
COB305          VALUE 0.        
COB305       10 PARM-CASE-AM-1        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-COLLECT-AM-1        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-AMT-DOWN-PYMT-1        PIC  S9(11)V9(2) 
COB305          USAGE COMP-3 VALUE 0.   
COB305       10 PARM-RECURR-REV-PCT-1        PIC  S9(3)V9(2) 
COB305          USAGE COMP-3 VALUE 0.    
             10 PARM-CONSMPT-TYPE-CD-2 PIC  X(01).                      
             10 PARM-CASE-SEQ-NO-2     PIC  S9(4) USAGE COMP.           
             10 PARM-RATE-PLAN-NO-2    PIC  X(03).                      
             10 PARM-CODE-REV-CLASS-2  PIC  X(03).                      
             10 PARM-CASE-TYPE-CD-2    PIC  X(01).                      
COB305       10 PARM-NO-UNITS-2        PIC  S9(9)V USAGE COMP-3 VALUE 0.        
COB305       10 PARM-COLLECT-UNITS-2        PIC  S9(9)V USAGE COMP-3 
COB305          VALUE 0.        
COB305       10 PARM-CASE-AM-2        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-COLLECT-AM-2        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-AMT-DOWN-PYMT-2        PIC  S9(11)V9(2) 
COB305          USAGE COMP-3 VALUE 0.   
COB305       10 PARM-RECURR-REV-PCT-2        PIC  S9(3)V9(2) 
COB305          USAGE COMP-3 VALUE 0.   
             10 PARM-CONSMPT-TYPE-CD-3 PIC  X(01).                      
             10 PARM-CASE-SEQ-NO-3     PIC  S9(4) USAGE COMP.           
             10 PARM-RATE-PLAN-NO-3    PIC  X(03).                      
             10 PARM-CODE-REV-CLASS-3  PIC  X(03).                      
             10 PARM-CASE-TYPE-CD-3    PIC  X(01).                      
COB305       10 PARM-NO-UNITS-3        PIC  S9(9)V USAGE COMP-3 VALUE 0.        
COB305       10 PARM-COLLECT-UNITS-3        PIC  S9(9)V USAGE COMP-3 
COB305          VALUE 0.        
COB305       10 PARM-CASE-AM-3        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-COLLECT-AM-3        PIC  S9(11)V9(2) USAGE COMP-3 
COB305          VALUE 0.   
COB305       10 PARM-AMT-DOWN-PYMT-3        PIC  S9(11)V9(2) 
COB305          USAGE COMP-3 VALUE 0.   
COB305       10 PARM-RECURR-REV-PCT-3        PIC  S9(3)V9(2) 
COB305          USAGE COMP-3 VALUE 0.   
          05 TB-PARM-RECV  REDEFINES PARM-RECV                          
                          OCCURS 3 TIMES.                               
             10 TB-CNS-TYP-CD          PIC  X(01) .                     
             10 TB-CASE-SEQ-NO         PIC  S9(4) USAGE COMP.           
             10 TB-RATE-PLAN-NO        PIC  X(03) .                     
             10 TB-CODE-REV-CLS        PIC  X(03) .                     
             10 TB-CASE-TYPE-CD        PIC  X(01) .                     
             10 TB-NO-UNITS            PIC  S9(9)V USAGE COMP-3.        
             10 TB-COLLECT-UNITS       PIC  S9(9)V USAGE COMP-3.        
             10 TB-CASE-AM             PIC  S9(11)V9(2) USAGE COMP-3.   
             10 TB-COLLECT-AM          PIC  S9(11)V9(2) USAGE COMP-3.   
             10 TB-AMT-DOWN-PYMT       PIC  S9(11)V9(2) USAGE COMP-3.   
             10 TB-RECURR-REV-PCT      PIC  S9(3)V9(2)  USAGE COMP-3.   
      *                                                                 01850000
       01 WS-SUBSCRIPTS.                                                
          05 SUB-RECV                  PIC  S9(3) COMP VALUE +0.        
      *                                                                 01850000
       01 WS-COUNTERS.                                                  
          05 CTR-ROWS                  PIC S9(9) COMP VALUE 0.          
      *                                                                 01850000
       01 FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.       
      *                                                                 02168000
       01 GTT-RETURN-FIELDS.                                            
          05 S-RETURN-CODE             PIC S9(09) COMP VALUE +0.        
      *                                                                 02250000
       01 WS-SWITCHES.                                                  
          05 ALL-DONE-SW               PIC X(01) VALUE 'N'.             
             88 NOT-ALL-DONE                     VALUE 'N'.             
             88 ALL-DONE                         VALUE 'Y'.             
          05 SEND-DONE-SW              PIC X(01) VALUE 'Y'.             
             88 SEND-DONE-ERROR                  VALUE 'N'.             
             88 SEND-DONE-OK                     VALUE 'Y'.             
      *                                                                 02250000
      ******************************************************************02260000
      * THIS IS  TO RECEIVE THE PARM VALUES                            *02270000
      ******************************************************************02280000
      *                                                                 02250000
       01 WS-RECV-PARM.                                                 
          05 WS-REV-PROT-CASE-NO       PIC  X(10) VALUE SPACES.         
          05 WS-CASE-SEQ-NO            PIC  S9(4) USAGE COMP.           
          05 WS-COMPANY-NO             PIC  X(2)  VALUE SPACES.         
          05 WS-CASE-STATUS-CD         PIC  X(1)  VALUE SPACES.         
          05 WS-SOURCE-CD              PIC  X(3)  VALUE SPACES.         
          05 WS-UNCOLLEC-REASON-CD     PIC  X(1)  VALUE SPACES.         
          05 WS-SETUP-USER-ID          PIC  X(7)  VALUE SPACES.         
          05 WS-CREATE-DT              PIC  X(10) VALUE SPACES.         
          05 WS-END-DT                 PIC  X(10) VALUE SPACES.         
          05 WS-LAST-UPDATE-USERID     PIC  X(07) VALUE SPACES.         
          05 WS-CASE-NOTES.                                             
             49 FILLER                 PIC  S9(4) USAGE COMP            
                                                  VALUE +0.             
             49 WS-CASE-NOTES-TEXT     PIC  X(1000) VALUE SPACES.       
          05 WS-CASE-NOTES-LEN         PIC  S9(4) COMP VALUE +0.        
          05 WS-STATUS-CHANGE-DT       PIC  X(10) VALUE SPACES.         
          05 WS-WORK-TYPE-CD           PIC  X(03) VALUE SPACES.         
          05 WS-RATE-PLAN-NO           PIC  X(03) VALUE SPACES.         
          05 WS-CODE-REV-CLS           PIC  X(03) VALUE SPACES.         
          05 WS-CONSUMPTION-TYPE-CD    PIC  X(01) VALUE SPACES.         
          05 WS-NO-SCHED-PYMTS         PIC  S9(4) USAGE COMP VALUE 0.   
          05 WS-CODE-DFA-DESC          PIC  X(01) VALUE SPACES.         
          05 WS-DFA-ITEM-ID            PIC  S9(9) USAGE COMP VALUE +0.  
          05 WS-DFA-ITEM-ID-DP         PIC  S9(9) USAGE COMP VALUE +0.  
          05 WS-ACTIVE-IND             PIC  X(01) VALUE SPACES.         
          05 WS-ADD-CHARGE-IND         PIC  X(01) VALUE SPACES.         
          05 WS-CD-ACCT-STAT           PIC  X(01) VALUE SPACES.         
          05 WS-START-DT               PIC  X(10) VALUE SPACES.         
          05 WS-CURRENT-TIMESTAMP      PIC  X(26) VALUE SPACES.         
          05 WS-CURRENT-DT             PIC  X(10) VALUE SPACES.         
          05 WS-COLLECT-AM             PIC  S9(11)V9(2) USAGE COMP-3    
                                                        VALUE +0.       
          05 WS-NO-UNITS               PIC  S9(9)V USAGE COMP-3         
                                                   VALUE +0.            
          05 WS-COLLECT-UNITS          PIC  S9(9)V USAGE COMP-3         
                                                   VALUE +0.            
          05 WS-CASE-AM                PIC S9(11)V9(2) USAGE COMP-3     
                                                        VALUE +0.       
          05 WS-DOWN-PYMT-AMT          PIC S9(11)V9(2) USAGE COMP-3     
                                                       VALUE +0.        
          05 WS-RECURR-REV             PIC S9(3)V9(2) USAGE COMP-3      
                                                         VALUE +0.      
      *                                                                         
       01 WS-COLUMN-DESC.                                               
          05 WS-COLUMN-DESC1           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC2           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC3           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC4           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC5           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC6           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC7           PIC X(15) VALUE SPACES.          
          05 WS-COLUMN-DESC8           PIC X(15) VALUE SPACES.          
      *                                                                         
       01 WS-REV-HDR-TRANS.                                             
          05 WS-PREV-SOURCE-CD         PIC X(03) VALUE SPACES.          
          05 WS-PREV-SETUP-ID          PIC X(07) VALUE SPACES.          
          05 WS-PREV-CREATE-DT         PIC X(10) VALUE SPACES.          
          05 WS-PREV-END-DT            PIC X(10) VALUE SPACES.          
          05 WS-PREV-STATUS-CHNG-DT    PIC X(10) VALUE SPACES.          
          05 WS-PREV-WORK-TYPE-CD      PIC X(03) VALUE SPACES.          
          05 WS-PREV-LAST-UPDATE-ID    PIC X(07) VALUE SPACES.          
          05 WS-PREV-UNCOLEC-RSN-CD    PIC X(01) VALUE SPACES.          
P00793    05 WS-PREV-CASE-STATUS-CD    PIC X(01) VALUE SPACES.          
      *                                                                         
       01 WS-REV-DET-TRANS.                                             
          05 WS-PREV-RATE-PLAN-NO      PIC X(03) VALUE SPACES.          
          05 WS-PREV-REV-CLASS         PIC X(03) VALUE SPACES.          
          05 WS-PREV-COLLECT-UNITS     PIC S9(9)V USAGE COMP-3          
                                                  VALUE +0.             
          05 WS-PREV-COLLECT-AM        PIC S9(11)V9(2) USAGE COMP-3     
                                                       VALUE +0.        
          05 WS-PREV-CASE-AM           PIC S9(11)V9(2) USAGE COMP-3     
                                                       VALUE +0.        
          05 WS-PREV-NO-UNITS          PIC S9(9)V USAGE COMP-3          
                                                  VALUE +0.             
          05 WS-PREV-AMT-DOWN-PYMT     PIC S9(11)V9(2) USAGE COMP-3     
                                                       VALUE +0.        
          05 WS-PREV-RECURR-REV        PIC S9(3)V9(2) USAGE COMP-3      
                                                       VALUE +0.        
      *                                                                         
       01 WS-04333-CALL-DATA.                                           
          05 WS-04333-ACCT-NO        PIC X(13) VALUE SPACES.            
          05 WS-04333-CASE-TYPE-CD   PIC X(01) VALUE SPACES.            
          05 WS-04333-CASE-NO        PIC X(10) VALUE SPACES.            
          05 WS-04333-COMPANY-NO     PIC X(02) VALUE SPACES.            
          05 WS-04333-CNS-TYP-CD     PIC X(01) VALUE SPACES.            
          05 WS-04333-CASE-SEQ-NO    PIC S9(4) USAGE COMP VALUE 0.      
          05 WS-04333-GL-ACCT-NO     PIC S9(3)V9(4) USAGE COMP-3        
                                                          VALUE +0.     
          05 WS-04333-START-DT       PIC X(10) VALUE SPACES.            
          05 WS-04333-CD-DFA-DESC    PIC X(01) VALUE SPACES.            
          05 WS-04333-NO-SCHED-PYMTS PIC S9(4) USAGE COMP VALUE 0.      
COB305    05 WS-04333-COLLECT-AMT        PIC S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0.      
COB305    05 WS-04333-DOWN-PYMT-AMT        PIC S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0.      
          05 WS-04333-CD-ACCT-STAT   PIC X(01) VALUE SPACES.            
          05 WS-04333-REV-MONTH      PIC X(06) VALUE SPACES.            
          05 WS-04333-USER-ID        PIC X(07) VALUE SPACES.            
      *                                                                         
       01 WS-04333-RETURN-DATA.                                         
          05 WS-04333-RET-CD         PIC S9(9) COMP VALUE 0.            
                                                                        
      * RESULT SETLOCATOR                                               00520000
      *01 LOC-RESLTSET USAGE SQL TYPE IS RESULT-SET-LOCATOR VARYING.    
      *                                                                 00520000
      ******************************************************************00570000
      *               COBOL WORKING STORAGE COPY BOOKS                 *00580000
      ******************************************************************00590000
      *                                                                 03010800
      ******************************************************************12232440
      *    ERROR HANDLING                                               03010800
      ******************************************************************12232440
      *                                                                 03010800
           EXEC SQL                                                             
              INCLUDE CWSX0010                                                  
           END-EXEC.                                                            
      *                                                                 00520000
      ******************************************************************12232440
      *    SUPPORTS DB2 AND SQL ERROR CHECKING                         *03011500
      ******************************************************************12232460
      *                                                                         
           COPY CWS00303.                                               00710000
                                                                        
      *                                                                 04091400
      ***************************************************************** 04091500
      *   SQL COMMUNICATION AREA                                      * 04091600
      ***************************************************************** 04091700
      *                                                                 04091800
           EXEC SQL                                                     04091900
              INCLUDE SQLCA                                             04092000
           END-EXEC.                                                    04093000
      *                                                                         
P00793******************************************************************        
P00793*    CSS_ACCOUNT - AT                                            *        
P00793******************************************************************        
P00793*                                                                         
P00793     EXEC SQL                                                             
P00793          INCLUDE TBACCT                                                  
P00793     END-EXEC.                                                            
P00793*                                                                 04094000
      *****************************************************************         
      *    CSS_REV_CLS_RATE - Q8                                      *         
      *****************************************************************         
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBRVCLS                                                  
           END-EXEC.                                                            
      *                                                                 04094000
      *****************************************************************         
      *    CSS_JOB_PARM - G6                                          *         
      *****************************************************************         
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBJBPARM                                                 
           END-EXEC.                                                            
      *                                                                         
      *****************************************************************         
      *    CSS_DFA_ACCT - DA                                          *         
      *****************************************************************         
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBDFAACT                                                 
           END-EXEC.                                                            
      *                                                                         
P00253*****************************************************************         
P00253*    CSS_CODE_VALUE - UV                                        *         
P00253*****************************************************************         
P00253*                                                                         
P00253     EXEC SQL                                                             
P00253         INCLUDE TBCDVALU                                                 
P00253     END-EXEC.                                                            
P00253*                                                                         
      ******************************************************************        
      *    CSS_MNT_TRANS_HIST - MH                                              
      ******************************************************************        
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBMNHIST                                                 
           END-EXEC.                                                            
      *                                                                         
      ******************************************************************        
      *    CSS_MT_TRN_HST_DET - MI                                     *        
      ******************************************************************        
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBMNHDT                                                  
           END-EXEC.                                                            
      *                                                                         
      ******************************************************************        
      *    CSS_REV_PROTEC_HDR -R0                                      *        
      ******************************************************************        
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBREVPRT                                                 
           END-EXEC.                                                            
      *                                                                         
      ******************************************************************        
      *    CSS_REV_PROTEC_DET -RL                                      *        
      ******************************************************************        
      *                                                                         
           EXEC SQL                                                             
               INCLUDE TBREVDET                                                 
           END-EXEC.                                                            
      *                                                                         
P00253******************************************************************        
P00253*    CSS_WORK_TYPE - L4                                          *        
P00253******************************************************************        
P00253*                                                                         
P00253     EXEC SQL                                                             
P00253         INCLUDE TBWKTYP                                                  
P00253     END-EXEC.                                                            
P00793*                                                                         
P00793     EXEC SQL                                                     
P00793         DECLARE FEE-DTLS CURSOR  FOR                  
P00793         SELECT  RL.CASE_SEQ_NO                                   
P00793               , RL.CASE_TYPE_CD                                  
P00793               , RL.RATE_PLAN_NO                                  
P00793               , RL.CODE_REVENUE_CLASS                            
P00793               , RL.CONSUMPT_TYPE_CD                              
P00793               , RL.NO_UNITS                                      
P00793               , RL.COLLECTIBLE_UNITS                             
P00793               , RL.CASE_AM                                       
P00793               , RL.COLLECTIBLE_AM                                
P00793               , RL.AMT_DOWN_PYMT                                 
P00793               , RL.RECURR_REV_PCT                                
P00793               , RL.DFA_ITEM_ID                                   
P00793               , RL.DFA_ITEM_ID_DP                                
P00793               , RL.GL_ACCT_NO                                    
P00793           FROM CSS_REV_PROTEC_DET RL WITH(READUNCOMMITTED)               
P00793          WHERE RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                  
P00793            AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO        
P00793            AND RL.CASE_TYPE_CD = 'F'                             
P00793            AND RL.CONSUMPT_TYPE_CD > ''                          
P00793          FOR READ ONLY                                          
P00793                                                           
P00793     END-EXEC.

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ004
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        DECLARE FEE-DTLS CURSOR WITH RETURN FOR                          
MFA-TR*        SELECT  RL.CASE_SEQ_NO                                           
MFA-TR*              , RL.CASE_TYPE_CD                                          
MFA-TR*              , RL.RATE_PLAN_NO                                          
MFA-TR*              , RL.CODE_REVENUE_CLASS                                    
MFA-TR*              , RL.CONSUMPT_TYPE_CD                                      
MFA-TR*              , RL.NO_UNITS                                              
MFA-TR*              , RL.COLLECTIBLE_UNITS                                     
MFA-TR*              , RL.CASE_AM                                               
MFA-TR*              , RL.COLLECTIBLE_AM                                        
MFA-TR*              , RL.AMT_DOWN_PYMT                                         
MFA-TR*              , RL.RECURR_REV_PCT                                        
MFA-TR*              , RL.DFA_ITEM_ID                                           
MFA-TR*              , RL.DFA_ITEM_ID_DP                                        
MFA-TR*              , RL.GL_ACCT_NO                                            
MFA-TR*          FROM CSS_REV_PROTEC_DET RL                                     
MFA-TR*         WHERE RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                          
MFA-TR*           AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO                
MFA-TR*           AND RL.CASE_TYPE_CD = 'F'                                     
MFA-TR*           AND RL.CONSUMPT_TYPE_CD > ''                                  
MFA-TR*         FOR FETCH ONLY                                                  
MFA-TR*         WITH UR                                                         
MFA-TR*    END-EXEC.                                                            
MSQ001        EXEC SQL
MSQ001          DECLARE DFA_CUR CURSOR
MSQ001          FOR CALL CSR04333                                       
               ( :WS-04333-ACCT-NO
                  , :WS-04333-CASE-TYPE-CD
                  , :WS-04333-CASE-NO
                  , :WS-04333-COMPANY-NO
                  , :WS-04333-CNS-TYP-CD
                  , :WS-04333-CASE-SEQ-NO
                  , :WS-04333-GL-ACCT-NO
                  , :WS-04333-START-DT
                  , :WS-04333-CD-DFA-DESC
                  , :WS-04333-NO-SCHED-PYMTS
                  , :WS-04333-COLLECT-AMT
                  , :WS-04333-DOWN-PYMT-AMT
                  , :WS-04333-CD-ACCT-STAT
                  , :WS-04333-REV-MONTH
                  , :WS-04333-USER-ID
                  )
MSQ001        END-EXEC.
                                                    
      *                                                                         
      *                                                                         
       LINKAGE SECTION.                                                 
       01  PARM-ACCOUNT-NO               PIC  X(13).                    
       01  PARM-REV-PROT-CASE-NO         PIC  X(10).                    
       01  PARM-COMPANY-NO               PIC  X(2).                     
       01  PARM-CASE-STATUS-CD           PIC  X(1).                     
       01  PARM-SOURCE-CD                PIC  X(3).                     
       01  PARM-SETUP-USER-ID            PIC  X(7).                     
       01  PARM-CREATE-DT                PIC  X(10).                    
       01  PARM-END-DT                   PIC  X(10).                    
       01  PARM-LAST-UPDATE-USERID       PIC  X(07).                    
       01  PARM-CASE-NOTES-TEXT          PIC  X(1000).                  
       01  PARM-CASE-NOTES-LEN           PIC  S9(04) COMP.              
       01  PARM-STATUS-CHANGE-DT         PIC  X(10).                    
       01  PARM-UNCOLLEC-REASON-CD       PIC  X(01).                    
       01  PARM-ACTIVE-IND               PIC  X(01).                    
       01  PARM-CODE-DFA-DESC            PIC  X(01).                    
       01  PARM-NO-SCHED-PYMTS           PIC  S9(4) USAGE COMP.         
       01  PARM-START-DT                 PIC  X(10).                    
       01  PARM-DFA-ITEM-ID              PIC  S9(9) USAGE COMP.         
       01  PARM-ADD-CHARGE-IND           PIC  X(01).                    
       01  PARM-CD-ACCT-STAT             PIC  X(01).                    
       01  PARM-WORK-TYPE-CD             PIC  X(03).                    
       01  PARM-CONSMPT-TYPE-CD-EL       PIC  X(01).                    
       01  PARM-CASE-SEQ-NO-EL           PIC  S9(4) USAGE COMP.         
       01  PARM-RATE-PLAN-NO-EL          PIC  X(03).                    
       01  PARM-CODE-REV-CLASS-EL        PIC  X(03).                    
       01  PARM-CASE-TYPE-CD-EL          PIC  X(01).                    
COB305 01 PARM-NO-UNITS-ELE        PIC  S9(9)V USAGE COMP-3 VALUE 0.      
COB305 01 PARM-COLLECT-UNITS-EL        PIC  S9(9)V USAGE COMP-3 VALUE 0.      
COB305 01 PARM-CASE-AM-EL        PIC  S9(11)V9(2) USAGE COMP-3 VALUE 0. 
COB305 01 PARM-COLLECT-AM-EL        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-AMT-DOWN-PYMT-EL        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-RECURR-REV-PCT-EL        PIC  S9(3)V9(2) USAGE COMP-3 
COB305       VALUE 0.  
       01  PARM-CONSMPT-TYPE-CD-DM       PIC  X(01).                    
       01  PARM-CASE-SEQ-NO-DM           PIC  S9(4) USAGE COMP.         
       01  PARM-RATE-PLAN-NO-DM          PIC  X(03).                    
       01  PARM-CODE-REV-CLASS-DM        PIC  X(03).                    
       01  PARM-CASE-TYPE-CD-DM          PIC  X(01).                    
COB305 01 PARM-NO-UNITS-DM        PIC  S9(9)V USAGE COMP-3 VALUE 0.      
COB305 01 PARM-COLLECT-UNITS-DM        PIC  S9(9)V USAGE COMP-3 VALUE 0.      
COB305 01 PARM-CASE-AM-DM        PIC  S9(11)V9(2) USAGE COMP-3 VALUE 0. 
COB305 01 PARM-COLLECT-AM-DM        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-AMT-DOWN-PYMT-DM        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-RECURR-REV-PCT-DM        PIC  S9(3)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
       01  PARM-CONSMPT-TYPE-CD-GAS      PIC  X(01).                    
       01  PARM-CASE-SEQ-NO-GAS          PIC  S9(4) USAGE COMP.         
       01  PARM-RATE-PLAN-NO-GAS         PIC  X(03).                    
       01  PARM-CODE-REV-CLASS-GAS       PIC  X(03).                    
       01  PARM-CASE-TYPE-CD-GAS         PIC  X(01).                    
COB305 01 PARM-NO-UNITS-GAS        PIC  S9(9)V USAGE COMP-3 VALUE 0.      
COB305 01 PARM-COLLECT-UNITS-GAS        PIC  S9(9)V USAGE COMP-3 
COB305       VALUE 0.      
COB305 01 PARM-CASE-AM-GAS        PIC  S9(11)V9(2) USAGE COMP-3 VALUE 0. 
COB305 01 PARM-COLLECT-AM-GAS        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-AMT-DOWN-PYMT-GAS        PIC  S9(11)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
COB305 01 PARM-RECURR-REV-PCT-GAS        PIC  S9(3)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
      *                                                                 05730900
       PROCEDURE DIVISION USING PARM-ACCOUNT-NO                         
                                PARM-REV-PROT-CASE-NO                   
                                PARM-COMPANY-NO                         
                                PARM-CASE-STATUS-CD                     
                                PARM-SOURCE-CD                          
                                PARM-SETUP-USER-ID                      
                                PARM-CREATE-DT                          
                                PARM-END-DT                             
                                PARM-LAST-UPDATE-USERID                 
                                PARM-CASE-NOTES-TEXT                    
                                PARM-CASE-NOTES-LEN                     
                                PARM-STATUS-CHANGE-DT                   
                                PARM-UNCOLLEC-REASON-CD                 
                                PARM-ACTIVE-IND                         
                                PARM-CODE-DFA-DESC                      
                                PARM-NO-SCHED-PYMTS                     
                                PARM-START-DT                           
                                PARM-DFA-ITEM-ID                        
                                PARM-ADD-CHARGE-IND                     
                                PARM-CD-ACCT-STAT                       
                                PARM-WORK-TYPE-CD                       
                                PARM-CONSMPT-TYPE-CD-EL                 
                                PARM-CASE-SEQ-NO-EL                     
                                PARM-RATE-PLAN-NO-EL                    
                                PARM-CODE-REV-CLASS-EL                  
                                PARM-CASE-TYPE-CD-EL                    
                                PARM-NO-UNITS-ELE                       
                                PARM-COLLECT-UNITS-EL                   
                                PARM-CASE-AM-EL                         
                                PARM-COLLECT-AM-EL                      
                                PARM-AMT-DOWN-PYMT-EL                   
                                PARM-RECURR-REV-PCT-EL                  
                                PARM-CONSMPT-TYPE-CD-DM                 
                                PARM-CASE-SEQ-NO-DM                     
                                PARM-RATE-PLAN-NO-DM                    
                                PARM-CODE-REV-CLASS-DM                  
                                PARM-CASE-TYPE-CD-DM                    
                                PARM-NO-UNITS-DM                        
                                PARM-COLLECT-UNITS-DM                   
                                PARM-CASE-AM-DM                         
                                PARM-COLLECT-AM-DM                      
                                PARM-AMT-DOWN-PYMT-DM                   
                                PARM-RECURR-REV-PCT-DM                  
                                PARM-CONSMPT-TYPE-CD-GAS                
                                PARM-CASE-SEQ-NO-GAS                    
                                PARM-RATE-PLAN-NO-GAS                   
                                PARM-CODE-REV-CLASS-GAS                 
                                PARM-CASE-TYPE-CD-GAS                   
                                PARM-NO-UNITS-GAS                       
                                PARM-COLLECT-UNITS-GAS                  
                                PARM-CASE-AM-GAS                        
                                PARM-COLLECT-AM-GAS                     
                                PARM-AMT-DOWN-PYMT-GAS                  
                                PARM-RECURR-REV-PCT-GAS.                
      *                                                                         
      ******************************************************************05733000
      * 0000-MAINLINE                                                  *05734000
      ******************************************************************05736000
      *                                                                         
       0000-MAINLINE.                                                   
      *                                                                         
           PERFORM 0100-INITIALIZE     THRU 0100-EXIT.                  
           PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT.                  
           PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT.                  
           PERFORM 2000A-MOVE-RESULT   THRU 2000A-EXIT.                 
           PERFORM 9999-END-PROGRAM    THRU 9999-EXIT.                  
      *                                                                 05760000
       0000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 05800000
      ******************************************************************05810000
      * 0100-INITIALIZE                                                *05820000
      ******************************************************************05880000
      *                                                                 05800000
       0100-INITIALIZE.                                                 
      *                                                                         
           EXEC SQL                                                     
               DECLARE C1 CURSOR  FOR                        
               SELECT                                                   
                   :S-RETURN-CODE          AS  RETURN_CODE              
               FROM                                                     
                   CIS.SYSDUMMY1                                     
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ027
MFA-TR*    EXEC SQL                                                             
MFA-TR*        DECLARE C1 CURSOR WITH RETURN FOR                                
MFA-TR*        SELECT                                                           
MFA-TR*            :S-RETURN-CODE          AS  RETURN_CODE                      
MFA-TR*        FROM                                                             
MFA-TR*            SYSIBM.SYSDUMMY1                                             
MFA-TR*    END-EXEC.                                                            
      *                                                                         
       0100-EXIT.                                                       
           EXIT.                                                        
      *                                                                 06120000
      ******************************************************************06140000
      * 1000-PROCESS-INPUT.                                            *06150000
      ******************************************************************06190000
      *                                                                         
       1000-PROCESS-INPUT.                                              
      *                                                                         
           MOVE PARM-ACCOUNT-NO           TO WS-ACCOUNT                 
           MOVE WS-ACCOUNT-DEC            TO WS-ACCOUNT-NO              
           MOVE PARM-REV-PROT-CASE-NO     TO WS-REV-PROT-CASE-NO        
           MOVE PARM-COMPANY-NO           TO WS-COMPANY-NO              
           MOVE PARM-CASE-STATUS-CD       TO WS-CASE-STATUS-CD          
           MOVE PARM-SOURCE-CD            TO WS-SOURCE-CD               
           MOVE PARM-SETUP-USER-ID        TO WS-SETUP-USER-ID           
           MOVE PARM-CREATE-DT            TO WS-CREATE-DT               
           MOVE PARM-END-DT               TO WS-END-DT                  
           MOVE PARM-LAST-UPDATE-USERID   TO WS-LAST-UPDATE-USERID      
           MOVE PARM-CASE-NOTES-TEXT      TO WS-CASE-NOTES              
           MOVE PARM-CASE-NOTES-LEN       TO WS-CASE-NOTES-LEN          
           MOVE PARM-STATUS-CHANGE-DT     TO WS-STATUS-CHANGE-DT        
           MOVE PARM-WORK-TYPE-CD         TO WS-WORK-TYPE-CD            
           MOVE PARM-UNCOLLEC-REASON-CD   TO WS-UNCOLLEC-REASON-CD      
           MOVE PARM-ACTIVE-IND           TO WS-ACTIVE-IND              
           MOVE PARM-START-DT             TO WS-START-DT                
           MOVE PARM-DFA-ITEM-ID          TO WS-DFA-ITEM-ID             
           MOVE PARM-ADD-CHARGE-IND       TO WS-ADD-CHARGE-IND          
           MOVE PARM-CD-ACCT-STAT         TO WS-CD-ACCT-STAT            
           MOVE PARM-NO-SCHED-PYMTS       TO WS-NO-SCHED-PYMTS          
           MOVE PARM-CODE-DFA-DESC        TO WS-CODE-DFA-DESC           
           MOVE PARM-CONSMPT-TYPE-CD-EL   TO PARM-CONSMPT-TYPE-CD-1     
           MOVE PARM-CASE-SEQ-NO-EL       TO PARM-CASE-SEQ-NO-1         
           MOVE PARM-RATE-PLAN-NO-EL      TO PARM-RATE-PLAN-NO-1        
           MOVE PARM-CODE-REV-CLASS-EL    TO PARM-CODE-REV-CLASS-1      
           MOVE PARM-CASE-TYPE-CD-EL      TO PARM-CASE-TYPE-CD-1        
           MOVE PARM-NO-UNITS-ELE         TO PARM-NO-UNITS-1            
           MOVE PARM-COLLECT-UNITS-EL     TO PARM-COLLECT-UNITS-1       
           MOVE PARM-CASE-AM-EL           TO PARM-CASE-AM-1             
           MOVE PARM-COLLECT-AM-EL        TO PARM-COLLECT-AM-1          
           MOVE PARM-AMT-DOWN-PYMT-EL     TO PARM-AMT-DOWN-PYMT-1       
           MOVE PARM-RECURR-REV-PCT-EL    TO PARM-RECURR-REV-PCT-1      
           MOVE PARM-CONSMPT-TYPE-CD-DM   TO PARM-CONSMPT-TYPE-CD-2     
           MOVE PARM-CASE-SEQ-NO-DM       TO PARM-CASE-SEQ-NO-2         
           MOVE PARM-RATE-PLAN-NO-DM      TO PARM-RATE-PLAN-NO-2        
           MOVE PARM-CODE-REV-CLASS-DM    TO PARM-CODE-REV-CLASS-2      
           MOVE PARM-CASE-TYPE-CD-DM      TO PARM-CASE-TYPE-CD-2        
           MOVE PARM-NO-UNITS-DM          TO PARM-NO-UNITS-2            
           MOVE PARM-COLLECT-UNITS-DM     TO PARM-COLLECT-UNITS-2       
           MOVE PARM-CASE-AM-DM           TO PARM-CASE-AM-2             
           MOVE PARM-COLLECT-AM-DM        TO PARM-COLLECT-AM-2          
           MOVE PARM-AMT-DOWN-PYMT-DM     TO PARM-AMT-DOWN-PYMT-2       
           MOVE PARM-RECURR-REV-PCT-DM    TO PARM-RECURR-REV-PCT-2      
           MOVE PARM-CONSMPT-TYPE-CD-GAS  TO PARM-CONSMPT-TYPE-CD-3     
           MOVE PARM-CASE-SEQ-NO-GAS      TO PARM-CASE-SEQ-NO-3         
           MOVE PARM-RATE-PLAN-NO-GAS     TO PARM-RATE-PLAN-NO-3        
           MOVE PARM-CODE-REV-CLASS-GAS   TO PARM-CODE-REV-CLASS-3      
           MOVE PARM-CASE-TYPE-CD-GAS     TO PARM-CASE-TYPE-CD-3        
           MOVE PARM-NO-UNITS-GAS         TO PARM-NO-UNITS-3            
           MOVE PARM-COLLECT-UNITS-GAS    TO PARM-COLLECT-UNITS-3       
           MOVE PARM-CASE-AM-GAS          TO PARM-CASE-AM-3             
           MOVE PARM-COLLECT-AM-GAS       TO PARM-COLLECT-AM-3          
           MOVE PARM-AMT-DOWN-PYMT-GAS    TO PARM-AMT-DOWN-PYMT-3       
           MOVE PARM-RECURR-REV-PCT-GAS   TO PARM-RECURR-REV-PCT-3      
      *                                                                 04670100
           MOVE 'COMMON'                  TO G6-PROGRAM-NAME.           
           MOVE 20                        TO G6-SEQ-NO.                 
           MOVE '01'                      TO G6-COMPANY-NO.             
           MOVE 'A'                       TO G6-STATUS.                 
           MOVE 'DATE'                    TO G6-CMND-CODE.              
           PERFORM 7000-GET-REVMON-DTBILL     THRU 7000-EXIT.           
      *                                                                 04670100
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              MOVE G6-PARM-DATA(15:6)     TO WS-REVENUE-MONTH           
              MOVE WS-REVENUE-MONTH       TO WS-REV-MONTH               
           ELSE                                                         
              MOVE ZEROS                  TO WS-REVENUE-MONTH           
           END-IF.                                                      
      *                                                                 06220000
       1000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 06250000
      ******************************************************************10556300
      * 2000-PROCESS-OUTPUT.                                           *10556400
      ******************************************************************10558000
      *                                                                         
       2000-PROCESS-OUTPUT.                                             
      *                                                                 10559100
           EVALUATE WS-ADD-CHARGE-IND                                   
              WHEN 'N'                                                  
                   PERFORM 2200-PROCESS-CASE  THRU 2200-EXIT            
              WHEN 'Y'                                                  
                   PERFORM 2550-PROCESS-FEE-DETAIL                      
                                              THRU 2550-EXIT            
              WHEN OTHER                                                
                   CONTINUE                                             
           END-EVALUATE.                                                
      *                                                                         
       2000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 10740000
      ******************************************************************        
      *2000A-MOVE-RESULT.                                                       
      ******************************************************************        
      *                                                                         
       2000A-MOVE-RESULT.                                               
      *                                                                         
           ADD +1                         TO CTR-ROWS.                  
      *                                                                         
       2000A-EXIT.                                                      
           EXIT.                                                        
      *                                                                 11670000
      ******************************************************************11690000
      * 2200-PROCESS-CASE.                                             *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2200-PROCESS-CASE.                                               
      *                                                                 11770000
           PERFORM 7300-ACCEPT-TIMESTAMP      THRU  7300-EXIT           
           PERFORM 2250-MOVE-RECV-VALUES      THRU  2250-EXIT           
      *                                                                         
           IF WS-ACTIVE-IND = 'N'                                       
      * CASE UPDATE                                                             
              EVALUATE WS-CASE-STATUS-CD                                
                 WHEN 'N'                                               
      *               CREAT NEW CASE                                            
                      PERFORM 7050-CHECK-CASE-NO                        
                                              THRU 7050-EXIT            
                      IF WS-CASE-EXISTS = 'Y'                           
                         MOVE 5500        TO S-RETURN-CODE              
                         PERFORM 2000A-MOVE-RESULT                      
                                              THRU 2000A-EXIT           
                         PERFORM 9999-END-PROGRAM                       
                                              THRU 9999-EXIT            
                      END-IF                                            
                      MOVE 'P'            TO R0-CASE-STATUS-CD          
                      PERFORM 8000-INSERT-CASE-HDR                      
                                              THRU 8000-EXIT            
                      PERFORM 2300-INSERT-REV-TABLE                     
                                              THRU 2300-EXIT            
                         VARYING SUB-RECV    FROM 1 BY 1                
                           UNTIL SUB-RECV > 3                           
                 WHEN 'P'                                               
      *               UPDATE CASE                                               
                      PERFORM 7450-GET-REV-HDR THRU 7450-EXIT           
                      PERFORM 8100-UPDATE-CASE-HDR                      
                                              THRU  8100-EXIT           
                      PERFORM 2350-UPDATE-REV-TABLE                     
                                              THRU 2350-EXIT            
                         VARYING SUB-RECV    FROM 1 BY 1                
                           UNTIL SUB-RECV > 3                           
                 WHEN 'X'                                               
      *               DELETE CASE WHEN CASE IS CANCELLED                        
                      MOVE WS-REV-PROT-CASE-NO                          
                                          TO RL-REV-PROT-CASE-NO        
                      MOVE WS-REV-PROT-CASE-NO(1:2)                     
                                          TO WS-YEAR                    
                      MOVE WS-REV-PROT-CASE-NO(3:6)                     
                                          TO WS-CASE-NUM                
                      PERFORM 7100-GET-DFA-STATUS                       
                                              THRU 7100-EXIT            
                      IF WS-DFA-EXISTS = 'Y'                            
                         MOVE  5600       TO S-RETURN-CODE              
                         PERFORM 2000A-MOVE-RESULT                      
                                              THRU 2000A-EXIT           
                         PERFORM 9999-END-PROGRAM                       
                                              THRU 9999-EXIT            
                      ELSE                                              
                         PERFORM 7150-GET-ITEM-ID                       
                                              THRU  7150-EXIT           
                         IF RL-DFA-ITEM-ID >0                           
                            MOVE 'X'      TO R0-CASE-STATUS-CD          
                            PERFORM 8250-UPDATE-CASE-STATUS             
                                              THRU  8250-EXIT           
                            MOVE 'CANCELLED' TO WS-CASE-STATUS          
                            MOVE '*UPDATED*' TO WS-CASE-NO              
                            PERFORM 5100-WRITE-TRANS-HIST               
                                              THRU  5100-EXIT           
                         ELSE                                           
                            PERFORM 8200-DELETE-CASE-DET                
                                              THRU  8200-EXIT           
                            PERFORM 8170-DELETE-CASE-HDR                
                                              THRU  8170-EXIT           
                            MOVE 'DELETED'   TO WS-CASE-STATUS          
                            MOVE '*DELETED*' TO WS-CASE-NO              
                            PERFORM 5100-WRITE-TRANS-HIST               
                                              THRU  5100-EXIT           
                         END-IF                                         
                      END-IF                                            
P00793           WHEN 'T'                                               
P00793                PERFORM 7450-GET-REV-HDR       THRU 7450-EXIT     
P00793                MOVE WS-CASE-NOTES-TEXT(35:13) TO WS-TO-ACCOUNT   
P00793                                                  WS-TRANSFER-ACCT
P00793                MOVE WS-TO-ACCOUNT-DEC         TO WS-TO-ACCOUNT-NO
P00793                MOVE WS-TO-ACCOUNT-NO          TO AT-ACCOUNT-NO   
P00793                                                  R0-ACCOUNT-NO   
P00793                                                  RL-ACCOUNT-NO   
P00793                PERFORM 7610-SEL-ACCT-DTLS     THRU 7610-EXIT     
P00793                IF AT-MST-SUB-ACCT-IND = 'M'                      
P00793                   MOVE 5700                   TO S-RETURN-CODE   
P00793                ELSE                                              
P00793                   IF AT-MST-SUB-ACCT-IND = 'S'                   
P00793                      MOVE 5710                TO S-RETURN-CODE   
P00793                   ELSE                                           
P00793                      IF AT-ACCOUNT-TYPE-CODE = 'D'               
P00793                         MOVE 5720             TO S-RETURN-CODE   
P00793                      ELSE                                        
P00793                         IF AT-COMPANY-NO NOT = WS-COMPANY-NO     
P00793                            MOVE 5730          TO S-RETURN-CODE   
P00793                         END-IF                                   
P00793                      END-IF                                      
P00793                   END-IF                                         
P00793                END-IF                                            
P00793                IF S-RETURN-CODE > 0                              
P00793                   PERFORM 2000A-MOVE-RESULT   THRU 2000A-EXIT    
P00793                   PERFORM 9999-END-PROGRAM    THRU 9999-EXIT     
P00793                END-IF                                            
P00793                PERFORM 7050-CHECK-CASE-NO     THRU 7050-EXIT     
P00793                IF WS-CASE-EXISTS = 'Y'                           
P00793                   MOVE 5800                   TO S-RETURN-CODE   
P00793                   PERFORM 2000A-MOVE-RESULT   THRU 2000A-EXIT    
P00793                   PERFORM 9999-END-PROGRAM    THRU 9999-EXIT     
P00793                END-IF                                            
P00793*               TRANSFER CASE HDR/DET                                     
P00793                MOVE WS-PREV-CASE-STATUS-CD    TO                 
P00793                                                 R0-CASE-STATUS-CD
P00793                PERFORM 8000-INSERT-CASE-HDR   THRU 8000-EXIT     
P00793                PERFORM 2300-INSERT-REV-TABLE  THRU 2300-EXIT     
P00793                        VARYING SUB-RECV FROM 1 BY 1              
P00793                        UNTIL SUB-RECV > 3                        
P00793*               TRANSFER FEE                                              
P00793                MOVE WS-ACCOUNT-NO             TO R0-ACCOUNT-NO   
P00793                                                  RL-ACCOUNT-NO   
P00793                PERFORM 2750-TRANSFER-FEE      THRU 2750-EXIT     
P00793                MOVE WS-ACCOUNT-NO             TO R0-ACCOUNT-NO   
P00793                                                  RL-ACCOUNT-NO   
P00793*               UPDATE CASE STATUS                                        
P00793                MOVE 'T'                       TO                 
P00793                                                 R0-CASE-STATUS-CD
P00793                PERFORM 8100-UPDATE-CASE-HDR   THRU  8100-EXIT    
P00793                MOVE WS-REV-PROT-CASE-NO(1:2)  TO WS-YEAR         
P00793                MOVE WS-REV-PROT-CASE-NO(3:6)  TO WS-CASE-NUM     
P00793                MOVE 'TRANSFERRED'             TO WS-CASE-STATUS  
P00793                MOVE '*UPDATED*'               TO WS-CASE-NO      
P00793                PERFORM 5100-WRITE-TRANS-HIST  THRU  5100-EXIT    
                 WHEN 'A'                                               
      *               UPDATE CASE NOTES AFTER ACTIVATING THE CASE               
                      PERFORM 8400-UPDATE-CASE-NOTES THRU  8400-EXIT    
              END-EVALUATE                                              
           ELSE                                                         
      *       ACTIVATE A PENDING CASE                                           
              MOVE 'A'                      TO R0-CASE-STATUS-CD        
              MOVE WS-REVENUE-MONTH         TO R0-REVENUE-MONTH         
              PERFORM 7450-GET-REV-HDR      THRU 7450-EXIT              
              PERFORM 8100-UPDATE-CASE-HDR  THRU  8100-EXIT             
              PERFORM 2350-UPDATE-REV-TABLE THRU 2350-EXIT              
                 VARYING SUB-RECV    FROM 1 BY 1                        
                   UNTIL SUB-RECV > 3                                   
      *       ADD CHARGES IF ANY                                                
P00793        PERFORM 2700-ADD-CHARGES      THRU  2700-EXIT             
           END-IF.                                                      
      *                                                                 12820000
       2200-EXIT.                                                       
           EXIT.                                                        
      *                                                                 14041102
      ******************************************************************11690000
      *                                                                *11691000
      * 2250-MOVE-RECV-VALUES.                                         *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2250-MOVE-RECV-VALUES.                                           
      *                                                                 11770000
           MOVE WS-ACCOUNT-NO             TO R0-ACCOUNT-NO              
                                             RL-ACCOUNT-NO              
                                             DA-ACCOUNT-NO              
           MOVE WS-REV-PROT-CASE-NO       TO R0-REV-PROT-CASE-NO        
           MOVE WS-COMPANY-NO             TO R0-COMPANY-NO              
                                             Q8-COMPANY-NO              
           MOVE WS-CASE-STATUS-CD         TO R0-CASE-STATUS-CD          
           MOVE WS-SOURCE-CD              TO R0-SOURCE-CD               
           MOVE WS-UNCOLLEC-REASON-CD     TO R0-UNCOLLEC-REASON-CD      
           MOVE WS-SETUP-USER-ID          TO R0-SETUP-USERID            
           MOVE ZERO                      TO R0-REVENUE-MONTH           
           MOVE WS-CREATE-DT              TO R0-CREATE-DT               
           MOVE WS-CURRENT-TIMESTAMP      TO R0-LAST-UPDATE-TS          
           MOVE WS-LAST-UPDATE-USERID     TO R0-LAST-UPDATE-USERID      
           MOVE WS-CASE-NOTES-TEXT        TO R0-CASE-NOTES-TEXT         
           MOVE WS-CASE-NOTES-LEN         TO R0-CASE-NOTES-LEN          
           MOVE WS-CURRENT-DT             TO WS-STATUS-CHANGE-DT        
           MOVE WS-STATUS-CHANGE-DT       TO R0-STATUS-CHANGE-DT.       
           MOVE WS-WORK-TYPE-CD           TO R0-WORK-TYPE-CD.           
           IF WS-END-DT > SPACES                                        
              MOVE WS-END-DT              TO R0-END-DT                  
           ELSE                                                         
              MOVE SPACES                 TO R0-END-DT                  
              MOVE -1                     TO WS-NULL-IND-1              
           END-IF.                                                      
      *                                                                 12820000
       2250-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************11690000
      * 2300-INSERT-REV-TABLE.                                         *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2300-INSERT-REV-TABLE.                                           
      *                                                                 11770000
              IF (TB-CNS-TYP-CD(SUB-RECV) = 'B' OR 'J' OR 'E' OR 'C') OR
P00793        (TB-CASE-TYPE-CD(SUB-RECV) = 'F')                         
              PERFORM 2400-MOVE-CASE-DET-VALUES THRU  2400-EXIT         
              PERFORM 7400-GET-MAX-SEQ-NO       THRU  7400-EXIT         
              ADD +1                     TO RL-CASE-SEQ-NO              
              IF WS-NO-UNITS > 0 OR WS-CASE-AM > 0                      
                                 OR WS-RECURR-REV > 0                   
                 PERFORM 7200-GET-GL-ACCT-NO    THRU  7200-EXIT         
                 MOVE Q8-GL-ACCT-NO      TO RL-GL-ACCT-NO               
                 PERFORM 8050-INSERT-CASE-DET   THRU  8050-EXIT         
              END-IF                                                    
              IF WS-ACTIVE-IND = 'Y' AND (WS-COLLECT-AM > 0             
                                      OR WS-DOWN-PYMT-AMT > 0)          
                 PERFORM 2500-MOVE-CALL-VALUES  THRU  2500-EXIT         
                 PERFORM 5010-CALL-CSR04333     THRU  5010-EXIT         
              END-IF                                                    
           END-IF.                                                      
      *                                                                 12820000
       2300-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************11690000
      * 2350-UPDATE-REV-TABLE.                                         *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2350-UPDATE-REV-TABLE.                                           
      *                                                                 11770000
           IF (TB-CNS-TYP-CD(SUB-RECV) = 'B' OR 'J' OR 'E' OR 'C') OR   
P00793        (TB-CASE-TYPE-CD(SUB-RECV) = 'F')                         
              PERFORM 2400-MOVE-CASE-DET-VALUES                         
                                              THRU  2400-EXIT           
              INITIALIZE  WS-REV-DET-TRANS                              
              PERFORM 7500-GET-REV-DET   THRU  7500-EXIT                
              IF WS-CASE-SEQ-NO = ZERO                                  
                 PERFORM 7400-GET-MAX-SEQ-NO      THRU  7400-EXIT       
                 ADD +1                  TO RL-CASE-SEQ-NO              
                 IF WS-NO-UNITS > 0 OR WS-CASE-AM > 0                   
                                    OR WS-RECURR-REV > 0                
                    PERFORM 7200-GET-GL-ACCT-NO   THRU  7200-EXIT       
                    MOVE Q8-GL-ACCT-NO   TO RL-GL-ACCT-NO               
                    PERFORM 8050-INSERT-CASE-DET  THRU  8050-EXIT       
                 END-IF                                                 
              ELSE                                                      
                 PERFORM 2450-MOVE-TRANS-HIST     THRU  2450-EXIT       
                 IF WS-NO-UNITS > 0 OR WS-CASE-AM > 0                   
                                    OR WS-RECURR-REV > 0                
                    PERFORM 7200-GET-GL-ACCT-NO   THRU  7200-EXIT       
                    MOVE Q8-GL-ACCT-NO   TO RL-GL-ACCT-NO               
                    PERFORM 8150-UPDATE-CASE-DET  THRU  8150-EXIT       
                 ELSE                                                   
                    PERFORM 8230-DELETE-CASE-TYPE THRU  8230-EXIT       
                 END-IF                                                 
                 PERFORM 5000-LOAD-TRANS-HIST     THRU  5000-EXIT       
              END-IF                                                    
              IF WS-ACTIVE-IND = 'Y' AND (WS-COLLECT-AM > 0             
                                      OR WS-DOWN-PYMT-AMT > 0)          
                 PERFORM 2500-MOVE-CALL-VALUES    THRU  2500-EXIT       
                 PERFORM 5010-CALL-CSR04333       THRU  5010-EXIT       
              END-IF                                                    
           END-IF.                                                      
      *                                                                 12820000
       2350-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************11690000
      * 2400-MOVE-CASE-DET-VALUES.                                     *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2400-MOVE-CASE-DET-VALUES.                                       
      *                                                                 11770000
           MOVE WS-REV-PROT-CASE-NO       TO RL-REV-PROT-CASE-NO        
           MOVE TB-CNS-TYP-CD(SUB-RECV)   TO RL-CONSUMPT-TYPE-CD        
                                             WS-CONSUMPTION-TYPE-CD     
           MOVE TB-CASE-SEQ-NO(SUB-RECV)  TO RL-CASE-SEQ-NO             
                                             WS-CASE-SEQ-NO             
           MOVE TB-RATE-PLAN-NO(SUB-RECV) TO RL-RATE-PLAN-NO            
                                             Q8-RATE-PLAN-NO            
                                             WS-RATE-PLAN-NO            
           MOVE TB-CODE-REV-CLS(SUB-RECV) TO RL-CODE-REVENUE-CLASS      
                                             Q8-CODE-REVENUE-CLASS      
                                             WS-CODE-REV-CLS            
           MOVE TB-CASE-TYPE-CD(SUB-RECV) TO RL-CASE-TYPE-CD            
                                             Q8-CODE-UTIL-TYPE          
           MOVE TB-NO-UNITS(SUB-RECV)     TO RL-NO-UNITS                
                                             WS-NO-UNITS                
           MOVE TB-COLLECT-UNITS(SUB-RECV)                              
                                          TO RL-COLLECTIBLE-UNITS       
                                             WS-COLLECT-UNITS           
           MOVE TB-CASE-AM(SUB-RECV)      TO RL-CASE-AM                 
                                             WS-CASE-AM                 
           MOVE TB-COLLECT-AM(SUB-RECV)   TO RL-COLLECTIBLE-AM          
                                             WS-COLLECT-AM              
           MOVE TB-AMT-DOWN-PYMT(SUB-RECV)                              
                                          TO RL-AMT-DOWN-PYMT           
                                             WS-DOWN-PYMT-AMT           
           MOVE TB-RECURR-REV-PCT(SUB-RECV)                             
                                          TO RL-RECURR-REV-PCT          
                                             WS-RECURR-REV.             
      *                                                                 12820000
       2400-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************11690000
      * 2450-MOVE-TRANS-HIST.                                          *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2450-MOVE-TRANS-HIST.                                            
      *                                                                 11770000
           MOVE WS-NO-UNITS               TO WS-TOTAL-UNITS             
           MOVE WS-COLLECT-UNITS          TO WS-COLLECTIBLE-UNITS       
           MOVE WS-CASE-AM                TO WS-CASE-AMT                
           MOVE WS-COLLECT-AM             TO WS-COLLECTIBLE-AM          
           MOVE WS-DOWN-PYMT-AMT          TO WS-AMT-DOWN-PYMT           
           MOVE WS-RECURR-REV             TO WS-RECURR-REV-PCT          
           MOVE WS-PREV-NO-UNITS          TO WS-PREV-UNITS              
           MOVE WS-PREV-COLLECT-UNITS     TO WS-PREV-COLL-UNITS         
           MOVE WS-PREV-CASE-AM           TO WS-PREV-CASE-AMT           
           MOVE WS-PREV-COLLECT-AM        TO WS-PREV-COLLECT-AMT        
           MOVE WS-PREV-AMT-DOWN-PYMT     TO WS-PREV-DOWN-PYMT          
           MOVE WS-PREV-RECURR-REV        TO WS-PREV-RECURR-REV-PCT.    
      *                                                                 12820000
       2450-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************11690000
      * 2500-MOVE-CALL-VALUES.                                         *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2500-MOVE-CALL-VALUES.                                           
      *                                                                 11770000
           MOVE WS-ACCOUNT-NO             TO WS-04333-ACCT-NO           
           MOVE WS-REV-PROT-CASE-NO       TO WS-04333-CASE-NO           
           MOVE WS-COMPANY-NO             TO WS-04333-COMPANY-NO        
           MOVE TB-CASE-TYPE-CD(SUB-RECV) TO WS-04333-CASE-TYPE-CD      
           MOVE TB-CNS-TYP-CD(SUB-RECV)   TO WS-04333-CNS-TYP-CD        
           IF WS-CASE-SEQ-NO =0                                         
              MOVE  RL-CASE-SEQ-NO        TO WS-04333-CASE-SEQ-NO       
           ELSE                                                         
              MOVE WS-CASE-SEQ-NO         TO WS-04333-CASE-SEQ-NO       
           END-IF                                                       
           MOVE Q8-GL-ACCT-NO             TO WS-04333-GL-ACCT-NO        
           MOVE WS-START-DT               TO WS-04333-START-DT          
           MOVE WS-CODE-DFA-DESC          TO WS-04333-CD-DFA-DESC       
           MOVE WS-NO-SCHED-PYMTS         TO WS-04333-NO-SCHED-PYMTS    
           MOVE TB-COLLECT-AM(SUB-RECV)   TO WS-04333-COLLECT-AMT       
           MOVE TB-AMT-DOWN-PYMT(SUB-RECV) TO WS-04333-DOWN-PYMT-AMT    
           MOVE WS-CD-ACCT-STAT           TO WS-04333-CD-ACCT-STAT      
           MOVE WS-REV-MONTH              TO WS-04333-REV-MONTH.        
           MOVE WS-LAST-UPDATE-USERID     TO WS-04333-USER-ID.          
      *                                                                 12820000
       2500-EXIT.                                                       
           EXIT.                                                        
      *                                                                 18823000
      ******************************************************************11690000
      * 2550-PROCESS-FEE-DETAIL.                                       *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2550-PROCESS-FEE-DETAIL.                                         
      *                                                                 11770000
           IF WS-DFA-ITEM-ID > 0                                        
              MOVE WS-ACCOUNT-NO          TO RL-ACCOUNT-NO              
              MOVE WS-REV-PROT-CASE-NO    TO RL-REV-PROT-CASE-NO        
              PERFORM 2600-MOVE-FEE-DETAIL    THRU 2600-EXIT            
              PERFORM 7400-GET-MAX-SEQ-NO     THRU  7400-EXIT           
              ADD +1                      TO RL-CASE-SEQ-NO             
              PERFORM 8300-INSERT-FEE-DETAILS THRU 8300-EXIT            
           END-IF.                                                      
      *                                                                 12820000
       2550-EXIT.                                                       
           EXIT.                                                        
      *                                                                 18823000
      ******************************************************************11690000
      * 2600-MOVE-FEE-DETAIL.                                          *11700000
      ******************************************************************11750000
      *                                                                 11751000
       2600-MOVE-FEE-DETAIL.                                            
      *                                                                 11770000
           MOVE WS-ACCOUNT-NO             TO RL-ACCOUNT-NO              
           MOVE WS-REV-PROT-CASE-NO       TO RL-REV-PROT-CASE-NO        
           MOVE 'F'                       TO RL-CASE-TYPE-CD            
           MOVE SPACES                    TO RL-RATE-PLAN-NO            
           MOVE SPACES                    TO RL-CODE-REVENUE-CLASS      
           MOVE PARM-CONSMPT-TYPE-CD-1    TO RL-CONSUMPT-TYPE-CD        
           MOVE ZERO                      TO RL-NO-UNITS                
           MOVE ZERO                      TO RL-COLLECTIBLE-UNITS       
           MOVE PARM-CASE-AM-1            TO WS-CASE-AM                 
           MOVE WS-CASE-AM                TO RL-CASE-AM                 
           MOVE ZERO                      TO RL-COLLECTIBLE-AM          
           MOVE ZERO                      TO RL-AMT-DOWN-PYMT           
           MOVE ZERO                      TO RL-RECURR-REV-PCT          
           MOVE ZERO                      TO RL-DFA-ITEM-ID             
           MOVE ZERO                      TO RL-DFA-ITEM-ID-DP          
           MOVE ZERO                      TO RL-GL-ACCT-NO.             
      *                                                                 12820000
       2600-EXIT.                                                       
           EXIT.                                                        
      *                                                                 12820000
P00793******************************************************************11690000
P00793* 2700-ADD-CHARGES.                                              *11700000
P00793******************************************************************11750000
P00793*                                                                 11751000
P00793 2700-ADD-CHARGES.                                                
P00793*                                                                 11770000
P00793     PERFORM 7700-OPEN-FEE-DTLS          THRU 7700-EXIT.          
P00793     PERFORM 7710-FETCH-FEE-DTLS         THRU 7710-EXIT.          
P00793*                                                                 11770000
P00793     PERFORM UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND              
P00793        MOVE WS-ACCOUNT-NO          TO WS-04333-ACCT-NO           
P00793        MOVE WS-REV-PROT-CASE-NO    TO WS-04333-CASE-NO           
P00793        MOVE WS-COMPANY-NO          TO WS-04333-COMPANY-NO        
P00793        MOVE RL-CASE-TYPE-CD        TO WS-04333-CASE-TYPE-CD      
P00793        MOVE RL-CONSUMPT-TYPE-CD    TO WS-04333-CNS-TYP-CD        
P00793                                       WS-04333-CD-DFA-DESC       
P00793        MOVE RL-CASE-SEQ-NO         TO WS-04333-CASE-SEQ-NO       
P00793        MOVE RL-GL-ACCT-NO          TO WS-04333-GL-ACCT-NO        
P00793        MOVE WS-START-DT            TO WS-04333-START-DT          
P00793        MOVE WS-NO-SCHED-PYMTS      TO WS-04333-NO-SCHED-PYMTS    
P00793        MOVE RL-COLLECTIBLE-AM      TO WS-04333-COLLECT-AMT       
P00793        MOVE RL-AMT-DOWN-PYMT       TO WS-04333-DOWN-PYMT-AMT     
P00793        MOVE WS-CD-ACCT-STAT        TO WS-04333-CD-ACCT-STAT      
P00793        MOVE WS-REV-MONTH           TO WS-04333-REV-MONTH         
P00793        MOVE WS-LAST-UPDATE-USERID  TO WS-04333-USER-ID           
P00793        PERFORM 5010-CALL-CSR04333       THRU  5010-EXIT          
P00793        PERFORM 7710-FETCH-FEE-DTLS      THRU 7710-EXIT           
P00793     END-PERFORM.                                                 
P00793*                                                                 11770000
P00793     PERFORM 7720-CLOSE-FEE-DTLS         THRU 7720-EXIT.          
P00793*                                                                 12820000
P00793 2700-EXIT.                                                       
P00793     EXIT.                                                        
P00793*                                                                 12820000
P00793******************************************************************11690000
P00793* 2750-TRANSFER-FEE.                                             *11700000
P00793******************************************************************11750000
P00793*                                                                 11751000
P00793 2750-TRANSFER-FEE.                                               
P00793*                                                                 11770000
P00793     PERFORM 7700-OPEN-FEE-DTLS          THRU 7700-EXIT.          
P00793     PERFORM 7710-FETCH-FEE-DTLS         THRU 7710-EXIT.          
P00793     PERFORM UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND              
P00793        MOVE WS-TO-ACCOUNT-NO            TO RL-ACCOUNT-NO         
P00793        PERFORM 7400-GET-MAX-SEQ-NO      THRU  7400-EXIT          
P00793        ADD +1                           TO RL-CASE-SEQ-NO        
P00793        PERFORM 8050-INSERT-CASE-DET     THRU 8050-EXIT           
P00793        PERFORM 7710-FETCH-FEE-DTLS      THRU 7710-EXIT           
P00793     END-PERFORM.                                                 
P00793     PERFORM 7720-CLOSE-FEE-DTLS         THRU 7720-EXIT.          
P00793*                                                                 12820000
P00793 2750-EXIT.                                                       
P00793     EXIT.                                                        
P00793*                                                                         
      ******************************************************************14700000
      * 5000-LOAD-TRANS-HIST                                           *14710000
      ******************************************************************14720000
      *                                                                 14740000
       5000-LOAD-TRANS-HIST.                                            
      *                                                                 14740000
      * DATA FOR CSS_MNT_TRANS_HIST                                     14910000
           MOVE WS-CURRENT-TIMESTAMP      TO MH-TRANS-HIST-SEQ-NO.      
           MOVE WS-CURRENT-DT             TO MH-DATE-TRANS.             
           MOVE 'F'                       TO MH-CODE-TRAN-TYPE.         
           MOVE SPACES                    TO MH-RESP-AREA-ID.           
           MOVE RL-ACCOUNT-NO             TO MH-ACCOUNT-NO.             
           MOVE +0                        TO MH-CUSTOMER-NO.            
           MOVE +0                        TO MH-PREMISE-NO.             
           MOVE 'SYSTEM'                  TO MH-USER-ID.                
           MOVE +0                        TO MH-TRAN-COMMENT-LEN.       
           MOVE SPACES                    TO MH-TRAN-COMMENT-TEXT.      
           MOVE 'PANEL161A'               TO MH-APPL-PROGRAM-ID.        
                                                                        
      * DATA FOR CSS_MT_TRN_HST_DET                                     14910000
           IF WS-HEADER-CHANGE = 'Y'                                    
              IF WS-PREV-SOURCE-CD NOT EQUAL WS-SOURCE-CD               
ACT018           AND WS-PREV-SOURCE-CD > SPACES                         
P00253*       PREVIOUS SOURCE CD DESCRIPTION                                    
P00253           MOVE WS-COMPANY-NO          TO UV-COMPANY-NO           
P00253           MOVE +9                     TO UV-COLUMN-NA-LEN        
P00253           MOVE 'SOURCE_CD'            TO UV-COLUMN-NA-TEXT       
P00253           MOVE +3                     TO UV-CODE-VALUE-LEN       
P00253           MOVE WS-PREV-SOURCE-CD      TO UV-CODE-VALUE-TEXT      
P00253           PERFORM 7550-GET-UNCOLLEC-RESN-DESC                    
P00253                                              THRU 7550-EXIT      
P00253           MOVE UV-CODE-SHORT-DESC-LEN TO WS-PREV-SOURCE-CD-LEN   
P00253           MOVE UV-CODE-SHORT-DESC-TEXT TO WS-PREV-SOURCE-CD-DESC 
P00253*       NEW SOURCE CD DESCRIPTION                                         
P00253           MOVE WS-SOURCE-CD           TO UV-CODE-VALUE-TEXT      
P00253           PERFORM 7550-GET-UNCOLLEC-RESN-DESC                    
P00253                                              THRU 7550-EXIT      
P00253           MOVE UV-CODE-SHORT-DESC-LEN TO WS-SOURCE-CD-LEN        
P00253           MOVE UV-CODE-SHORT-DESC-TEXT TO WS-SOURCE-CD-DESC      
      *                                                                         
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'LEAD SOURCE'          TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
P00253           MOVE WS-PREV-SOURCE-CD-LEN  TO MI-PRV-COLUMN-VALUE-LEN 
P00253           MOVE WS-PREV-SOURCE-CD-DESC TO MI-PRV-COLUMN-VALUE-TEXT
P00253           MOVE WS-SOURCE-CD-LEN       TO MI-CHG-COLUMN-VALUE-LEN 
P00253           MOVE WS-SOURCE-CD-DESC      TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-UNCOLEC-RSN-CD  NOT EQUAL WS-UNCOLLEC-REASON-CD
ACT018           AND WS-PREV-UNCOLEC-RSN-CD > SPACES                    
P00253*       PREVIOUS UNCOLLECT RSN DESCRIPTION                                
P00253           MOVE WS-COMPANY-NO          TO UV-COMPANY-NO           
P00253           MOVE +13                    TO UV-COLUMN-NA-LEN        
P00253           MOVE 'UNCOLLECT_RSN'        TO UV-COLUMN-NA-TEXT       
P00253           MOVE +1                     TO UV-CODE-VALUE-LEN       
P00253           MOVE WS-PREV-UNCOLEC-RSN-CD TO UV-CODE-VALUE-TEXT      
P00253           PERFORM 7550-GET-UNCOLLEC-RESN-DESC                    
P00253                                              THRU 7550-EXIT      
P00253           MOVE UV-CODE-SHORT-DESC-LEN TO WS-PREV-UNCOLLEC-LEN    
P00253           MOVE UV-CODE-SHORT-DESC-TEXT TO WS-PREV-UNCOLLEC-DESC  
P00253*       NEW UNCOLLECT RSN DESCRIPTION                                     
P00253           MOVE WS-UNCOLLEC-REASON-CD  TO UV-CODE-VALUE-TEXT      
P00253           PERFORM 7550-GET-UNCOLLEC-RESN-DESC                    
P00253                                              THRU 7550-EXIT      
P00253           MOVE UV-CODE-SHORT-DESC-LEN TO WS-UNCOLLEC-RESN-LEN    
P00253           MOVE UV-CODE-SHORT-DESC-TEXT TO WS-UNCOLLEC-RESN-DESC  
      *                                                                         
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'UNCOLEC RESN CD'      TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
P00253           MOVE WS-PREV-UNCOLLEC-LEN   TO MI-PRV-COLUMN-VALUE-LEN 
P00253           MOVE WS-PREV-UNCOLLEC-DESC  TO MI-PRV-COLUMN-VALUE-TEXT
P00253           MOVE WS-UNCOLLEC-RESN-LEN   TO MI-CHG-COLUMN-VALUE-LEN 
P00253           MOVE WS-UNCOLLEC-RESN-DESC  TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-SETUP-ID NOT EQUAL WS-SETUP-USER-ID            
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'SETUP USER ID'        TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
                 MOVE +7                     TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-SETUP-ID       TO MI-PRV-COLUMN-VALUE-TEXT
                 MOVE +7                     TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-SETUP-USER-ID       TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-END-DT NOT EQUAL WS-END-DT                     
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'END DT'               TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
                 MOVE +10                    TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-END-DT         TO MI-PRV-COLUMN-VALUE-TEXT
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-END-DT              TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-CREATE-DT  NOT EQUAL WS-CREATE-DT              
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'CREATE DT'            TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
                 MOVE +10                    TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-CREATE-DT      TO MI-PRV-COLUMN-VALUE-TEXT
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-CREATE-DT           TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-LAST-UPDATE-ID NOT EQUAL WS-LAST-UPDATE-USERID 
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'LAST UPD ID'          TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
                 MOVE +7                     TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-LAST-UPDATE-ID TO MI-PRV-COLUMN-VALUE-TEXT
                 MOVE +7                     TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-LAST-UPDATE-USERID  TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-STATUS-CHNG-DT NOT EQUAL WS-STATUS-CHANGE-DT   
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'STATUS CHNG DT'       TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
                 MOVE +10                    TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-STATUS-CHNG-DT TO MI-PRV-COLUMN-VALUE-TEXT
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-STATUS-CHANGE-DT    TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              IF WS-PREV-WORK-TYPE-CD NOT EQUAL WS-WORK-TYPE-CD         
P00253*       PREVIOUS WORK TYPE CD DESCRIPTION                                 
P00253           MOVE WS-COMPANY-NO          TO L4-COMPANY-NO           
P00253           MOVE WS-PREV-WORK-TYPE-CD   TO L4-WORK-TYPE-CD         
P00253           PERFORM 7600-GET-WORK-TYPE-DESC    THRU 7600-EXIT      
P00253           MOVE L4-WORK-TYPE-DESC      TO WS-PREV-WORK-TYPE-DESC  
P00253*       NEW WORK TYPE CD DESCRIPTION                                      
P00253           MOVE WS-WORK-TYPE-CD        TO L4-WORK-TYPE-CD         
P00253           PERFORM 7600-GET-WORK-TYPE-DESC    THRU 7600-EXIT      
P00253           MOVE L4-WORK-TYPE-DESC      TO WS-WORK-TYPE-DESC       
      *                                                                         
                 MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO    
                 ADD +1                      TO MI-TRAN-APPL-NO         
                 MOVE 'WORK TYPE CD'         TO MI-COLUMN-DESC          
                 MOVE SPACES                 TO MI-TABLE-ID             
P00253           MOVE +25                    TO MI-PRV-COLUMN-VALUE-LEN 
P00253           MOVE WS-PREV-WORK-TYPE-DESC TO MI-PRV-COLUMN-VALUE-TEXT
P00253           MOVE +25                    TO MI-CHG-COLUMN-VALUE-LEN 
P00253           MOVE WS-WORK-TYPE-DESC      TO MI-CHG-COLUMN-VALUE-TEXT
                                                                        
                 PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT      
              END-IF                                                    
              MOVE    'N'                 TO WS-HEADER-CHANGE           
           END-IF                                                       
           IF WS-CONSUMPTION-TYPE-CD = 'B'                              
              MOVE   'RATE EL'            TO WS-COLUMN-DESC1            
              MOVE   'REV CLASS EL'       TO WS-COLUMN-DESC2            
              MOVE   'NO UNITS EL'        TO WS-COLUMN-DESC3            
              MOVE   'COLL UNITS EL'      TO WS-COLUMN-DESC4            
              MOVE   'CASE AM EL'         TO WS-COLUMN-DESC5            
              MOVE   'COLL AM EL'         TO WS-COLUMN-DESC6            
              MOVE   'DOWN PYMT EL'       TO WS-COLUMN-DESC7            
              MOVE   'RECURR FCT EL'      TO WS-COLUMN-DESC8            
           ELSE                                                         
              IF WS-CONSUMPTION-TYPE-CD = 'J' OR 'E'                    
                 MOVE   'RATE DMD'        TO WS-COLUMN-DESC1            
                 MOVE   'REV CLASS DMD'   TO WS-COLUMN-DESC2            
                 MOVE   'NO UNITS DMD'    TO WS-COLUMN-DESC3            
                 MOVE   'COLL UNITS DMD'  TO WS-COLUMN-DESC4            
                 MOVE   'CASE AM DMD'     TO WS-COLUMN-DESC5            
                 MOVE   'COLL AM DMD'     TO WS-COLUMN-DESC6            
                 MOVE   'DOWN PYMT DMD'   TO WS-COLUMN-DESC7            
                 MOVE   'RECURR FCT DMD'  TO WS-COLUMN-DESC8            
              ELSE                                                      
                 MOVE   'RATE GAS'        TO WS-COLUMN-DESC1            
                 MOVE   'REV CLASS GAS'   TO WS-COLUMN-DESC2            
                 MOVE   'NO UNITS GAS'    TO WS-COLUMN-DESC3            
                 MOVE   'COLL UNITS GAS'  TO WS-COLUMN-DESC4            
                 MOVE   'CASE AM GAS'     TO WS-COLUMN-DESC5            
                 MOVE   'COLL AM GAS'     TO WS-COLUMN-DESC6            
                 MOVE   'DOWN PYMT GAS'   TO WS-COLUMN-DESC7            
                 MOVE   'RECURR FCT GAS'  TO WS-COLUMN-DESC8            
              END-IF                                                    
           IF WS-PREV-RATE-PLAN-NO   NOT EQUAL WS-RATE-PLAN-NO          
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC1        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +3                     TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-RATE-PLAN-NO   TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +3                     TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-RATE-PLAN-NO        TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-REV-CLASS      NOT EQUAL WS-CODE-REV-CLS          
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC2        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +3                     TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-REV-CLASS      TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +3                     TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-CODE-REV-CLS        TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF
           END-IF.                                                      
           IF WS-PREV-NO-UNITS NOT EQUAL WS-NO-UNITS                    
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC3        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +11                    TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-UNITS          TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +11                    TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-TOTAL-UNITS         TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-COLLECT-UNITS  NOT EQUAL WS-COLLECT-UNITS         
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC4        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +11                    TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-COLL-UNITS     TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +11                    TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-COLLECTIBLE-UNITS   TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-CASE-AMT NOT EQUAL WS-CASE-AMT                    
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC5        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +17                    TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-CASE-AMT       TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +17                    TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-CASE-AMT            TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-COLLECT-AM    NOT EQUAL WS-COLLECT-AM             
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC6        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +17                    TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-COLLECT-AMT    TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +17                    TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-COLLECTIBLE-AM      TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-AMT-DOWN-PYMT NOT EQUAL WS-DOWN-PYMT-AMT          
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC7        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +17                    TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-DOWN-PYMT      TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +17                    TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-AMT-DOWN-PYMT       TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF                                                       
           IF WS-PREV-RECURR-REV  NOT EQUAL WS-RECURR-REV               
              MOVE WS-CURRENT-TIMESTAMP   TO MI-TRANS-HIST-SEQ-NO       
              ADD +1                      TO MI-TRAN-APPL-NO            
              MOVE WS-COLUMN-DESC8        TO MI-COLUMN-DESC             
              MOVE SPACES                 TO MI-TABLE-ID                
              MOVE +7                     TO MI-PRV-COLUMN-VALUE-LEN    
              MOVE WS-PREV-RECURR-REV-PCT TO MI-PRV-COLUMN-VALUE-TEXT   
              MOVE +7                     TO MI-CHG-COLUMN-VALUE-LEN    
              MOVE WS-RECURR-REV-PCT      TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
              PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT         
           END-IF.                                                      
                                                                        
       5000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 15160000
      ******************************************************************14700000
      * 5100-WRITE-TRANS-HIST                                          *14710000
      ******************************************************************14720000
      *                                                                 14740000
       5100-WRITE-TRANS-HIST.                                           
      *                                                                 14740000
      * DATA FOR CSS_MNT_TRANS_HIST                                     14910000
           MOVE WS-CURRENT-TIMESTAMP      TO MH-TRANS-HIST-SEQ-NO.      
           MOVE WS-CURRENT-DT             TO MH-DATE-TRANS.             
           MOVE 'F'                       TO MH-CODE-TRAN-TYPE.         
           MOVE SPACES                    TO MH-RESP-AREA-ID.           
           MOVE RL-ACCOUNT-NO             TO MH-ACCOUNT-NO.             
           MOVE +0                        TO MH-CUSTOMER-NO.            
           MOVE +0                        TO MH-PREMISE-NO.             
           MOVE 'SYSTEM'                  TO MH-USER-ID.                
           MOVE 'PANEL161A'               TO MH-APPL-PROGRAM-ID.        
P00793     IF WS-CASE-STATUS-CD = 'T'                                   
P00793        MOVE WS-TRANSFER-TEXT       TO MH-TRAN-COMMENT-TEXT       
P00793        MOVE +28                    TO MH-TRAN-COMMENT-LEN        
P00793     ELSE                                                         
P00793        MOVE SPACES                 TO MH-TRAN-COMMENT-TEXT       
P00793        MOVE +0                     TO MH-TRAN-COMMENT-LEN        
P00793     END-IF.                                                      
                                                                        
      * DATA FOR CSS_MT_TRN_HST_DET                                     14910000
           MOVE WS-CURRENT-TIMESTAMP      TO MI-TRANS-HIST-SEQ-NO       
           ADD +1                         TO MI-TRAN-APPL-NO            
           MOVE 'CASE NO'                 TO MI-COLUMN-DESC             
           MOVE SPACES                    TO MI-TABLE-ID                
           MOVE +9                        TO MI-PRV-COLUMN-VALUE-LEN    
           MOVE WS-REV-CASE-NO            TO MI-PRV-COLUMN-VALUE-TEXT   
           MOVE +9                        TO MI-CHG-COLUMN-VALUE-LEN    
           MOVE WS-CASE-NO                TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
           PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT            
      *                                                                         
           MOVE WS-CURRENT-TIMESTAMP      TO MI-TRANS-HIST-SEQ-NO       
           ADD +1                         TO MI-TRAN-APPL-NO            
           MOVE 'CASE STATUS'             TO MI-COLUMN-DESC             
           MOVE SPACES                    TO MI-TABLE-ID                
           MOVE +7                        TO MI-PRV-COLUMN-VALUE-LEN    
           MOVE 'PENDING'                 TO MI-PRV-COLUMN-VALUE-TEXT   
           MOVE +9                        TO MI-CHG-COLUMN-VALUE-LEN    
           MOVE WS-CASE-STATUS            TO MI-CHG-COLUMN-VALUE-TEXT   
                                                                        
           PERFORM 6530-LOAD-MNT-TRANS-HIST   THRU 6530-EXIT.           
      *                                                                         
       5100-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ***************************************************************           
      * 5010-CALL-CSR04333.                                         *           
      ***************************************************************           
      *                                                                         
       5010-CALL-CSR04333.                                              
      *                                                                         
      *    EXEC SQL CALL CSR04333                                       
      *        (:WS-04333-ACCT-NO                                       
      *        ,:WS-04333-CASE-TYPE-CD                                  
      *        ,:WS-04333-CASE-NO                                       
      *        ,:WS-04333-COMPANY-NO                                    
      *        ,:WS-04333-CNS-TYP-CD                                    
      *        ,:WS-04333-CASE-SEQ-NO                                   
      *        ,:WS-04333-GL-ACCT-NO                                    
      *        ,:WS-04333-START-DT                                      
      *        ,:WS-04333-CD-DFA-DESC                                   
      *        ,:WS-04333-NO-SCHED-PYMTS                                
      *        ,:WS-04333-COLLECT-AMT                                   
      *        ,:WS-04333-DOWN-PYMT-AMT                                 
      *        ,:WS-04333-CD-ACCT-STAT                                  
      *        ,:WS-04333-REV-MONTH                                     
      *        ,:WS-04333-USER-ID                                       
      *        )                                                        
      *    END-EXEC.                                                    

MSQ001        EXEC SQL
MSQ001          CLOSE DFA_CUR
MSQ001        END-EXEC
MSQ001        EXEC SQL
MSQ001          OPEN DFA_CUR
MSQ001        END-EXEC
MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

MSQ001        MOVE SQLCA TO MSQ001-SQLCABACK
MSQ001        MOVE 0 TO SQLD
MSQ001        EXEC SQL
MSQ001          DESCRIBE CURSOR DFA_CUR INTO :SQLDA
MSQ001        END-EXEC
MSQ001        MOVE MSQ001-SQLCABACK TO SQLCA
MSQ001        IF SQLD > 0 AND SQLCODE = 0 THEN
MSQ001          MOVE 466 TO SQLCODE
MSQ001        END-IF
      *                                                                         
            MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
            IF  WS-ACTIVE-RETURN-CODE = +466                            
      *         EXEC SQL                                                
      *             ASSOCIATE LOCATORS                                  
      *             (:LOC-RESLTSET)                                     
      *             WITH PROCEDURE CSR04333                             
      *         END-EXEC                                                
                                                                        
      *         EXEC SQL                                                
      *           ALLOCATE DFA_CUR  CURSOR FOR RESULT SET               
      *           :LOC-RESLTSET                                         
      *         END-EXEC                                                
                                                                        
                EXEC SQL                                                
                  FETCH DFA_CUR                                         
                   INTO  :WS-04333-RET-CD                               
                END-EXEC                                                

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
                MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE  
                                                 S-RETURN-CODE          
      *                                                                         
                IF  WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL             
                  IF WS-04333-RET-CD = 0                                
                     CONTINUE                                           
                  ELSE                                                  
                     MOVE WS-04333-RET-CD TO S-RETURN-CODE              
                     PERFORM 2000A-MOVE-RESULT    THRU 2000A-EXIT       
                     PERFORM 9999-END-PROGRAM     THRU 9999-EXIT        
                  END-IF                                                
                ELSE                                                    
                    MOVE '5010'               TO ACTIVE-PARAGRAPH       
                    MOVE PROGRAM-NAME         TO ABEND-PROGRAM          
                    MOVE 'FETCH'              TO ABEND-FUNCTION         
                    MOVE 'CSR04333'           TO TABLE-1                
                    MOVE 'ACCOUNT_NO'         TO TABLE-ELEMENT-1        
                    MOVE WS-04333-ACCT-NO     TO HOSTVAR-ELEMENT-1      
                    MOVE 'SQLCODE '           TO TABLE-ELEMENT-1        
                    MOVE WS-ACTIVE-RETURN-CODE TO HOSTVAR-ELEMENT-1     
                    PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT      
                    PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT      
                END-IF                                                  
      *                                                                         
                EXEC SQL                                                
                  CLOSE DFA_CUR                                         
                END-EXEC                                                

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
                MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE  
                                                 S-RETURN-CODE          
      *                                                                         
                IF  WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL             
                    CONTINUE                                            
                ELSE                                                    
                    MOVE '5010'               TO ACTIVE-PARAGRAPH       
                    MOVE PROGRAM-NAME         TO ABEND-PROGRAM          
                    MOVE 'CLOSE'              TO ABEND-FUNCTION         
                    MOVE 'CSR02107'           TO TABLE-1                
                    MOVE 'ACCOUNT_NO'         TO TABLE-ELEMENT-1        
                    MOVE WS-04333-ACCT-NO     TO HOSTVAR-ELEMENT-1      
                    MOVE 'SQLCODE '           TO TABLE-ELEMENT-1        
                    MOVE WS-ACTIVE-RETURN-CODE TO HOSTVAR-ELEMENT-1     
                    PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT      
                    PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT      
                END-IF                                                  
            ELSE                                                        
                MOVE '5010'                   TO ACTIVE-PARAGRAPH       
                MOVE PROGRAM-NAME             TO ABEND-PROGRAM          
                MOVE 'DB2SP CALL'             TO ABEND-FUNCTION         
                MOVE 'CSR04333'               TO TABLE-1                
                MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1        
                MOVE WS-04333-ACCT-NO         TO HOSTVAR-ELEMENT-1      
                MOVE 'SQLCODE'                TO TABLE-ELEMENT-1        
                MOVE WS-ACTIVE-RETURN-CODE    TO HOSTVAR-ELEMENT-1      
                PERFORM 9000-SEND-ERROR-RESULT     THRU 9000-EXIT       
                PERFORM 9900-SQL-ERROR-ROUTINE     THRU 9900-EXIT       
            END-IF.                                                     
      *                                                                         
       5010-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************        
      *     6530-LOAD-MNT-TRANS-HIST                                   *        
      ******************************************************************        
      *                                                                         
            EXEC SQL                                                            
                INCLUDE CPD00067                                                
            END-EXEC.                                                           
      *                                                                 41709000
      ******************************************************************        
      * 7000-GET-REVMON-DTBILL                                         *        
      ******************************************************************        
      *                                                                         
       7000-GET-REVMON-DTBILL.                                          
      *                                                                         
           EXEC SQL                                                     
               SELECT G6.PARM_DATA                                      
                 INTO :G6-PARM-DATA                                     
                 FROM CSS_JOB_PARM G6 WITH(READUNCOMMITTED)                     
                WHERE G6.PROGRAM_NAME = :G6-PROGRAM-NAME                
                  AND G6.COMPANY_NO   = :G6-COMPANY-NO                  
                  AND G6.CMND_CODE    = :G6-CMND-CODE                   
                  AND G6.SEQ_NO       = :G6-SEQ-NO                      
                  AND G6.STATUS       = :G6-STATUS                      
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT G6.PARM_DATA                                              
MFA-TR*          INTO :G6-PARM-DATA                                             
MFA-TR*          FROM CSS_JOB_PARM G6                                           
MFA-TR*         WHERE G6.PROGRAM_NAME = :G6-PROGRAM-NAME                        
MFA-TR*           AND G6.COMPANY_NO   = :G6-COMPANY-NO                          
MFA-TR*           AND G6.CMND_CODE    = :G6-CMND-CODE                           
MFA-TR*           AND G6.SEQ_NO       = :G6-SEQ-NO                              
MFA-TR*           AND G6.STATUS       = :G6-STATUS                              
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7000                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7000'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_JOB_PARM'         TO TABLE-1                    
              MOVE 'CMND_CODE'            TO TABLE-ELEMENT-1            
              MOVE 'SEQ_NO'               TO TABLE-ELEMENT-2            
              MOVE G6-CMND-CODE           TO HOSTVAR-ELEMENT-1          
              MOVE G6-SEQ-NO              TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 41260000
      ******************************************************************        
      * 7050-CHECK-CASE-NO.                                            *        
      ******************************************************************        
      *                                                                         
       7050-CHECK-CASE-NO.                                              
      *                                                                         
           EXEC SQL                                                     
               SELECT 'Y'                                               
                 INTO :WS-CASE-EXISTS                                   
                 FROM CSS_REV_PROTEC_HDR R0 WITH(READUNCOMMITTED)               
                WHERE R0.ACCOUNT_NO       = :R0-ACCOUNT-NO              
                  AND R0.REV_PROT_CASE_NO = :R0-REV-PROT-CASE-NO        
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*          INTO :WS-CASE-EXISTS                                           
MFA-TR*          FROM CSS_REV_PROTEC_HDR R0                                     
MFA-TR*         WHERE R0.ACCOUNT_NO       = :R0-ACCOUNT-NO                      
MFA-TR*           AND R0.REV_PROT_CASE_NO = :R0-REV-PROT-CASE-NO                
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7050                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7050'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE R0-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7050-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      *****************************************************************         
      * 7100-GET-DFA-STATUS.                                          *         
      *****************************************************************         
      *                                                                         
       7100-GET-DFA-STATUS.                                             
      *                                                                         
           EXEC SQL                                                     
               SELECT TOP(1) 'Y'                                               
                 INTO :WS-DFA-EXISTS                                    
                 FROM CSS_DFA_ACCT DA WITH(READUNCOMMITTED)                     
                     ,CSS_REV_PROTEC_DET RL WITH(READUNCOMMITTED)               
                WHERE DA.ACCOUNT_NO   = :DA-ACCOUNT-NO                  
                  AND RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                  
                  AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO        
                  AND DA.DFA_ITEM_ID  = RL.DFA_ITEM_ID                  
                  AND DA.CODE_DFA_STATUS = 'A'                          
                                                 
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*          INTO :WS-DFA-EXISTS                                            
MFA-TR*          FROM CSS_DFA_ACCT DA                                           
MFA-TR*              ,CSS_REV_PROTEC_DET RL                                     
MFA-TR*         WHERE DA.ACCOUNT_NO   = :DA-ACCOUNT-NO                          
MFA-TR*           AND RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                          
MFA-TR*           AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO                
MFA-TR*           AND DA.DFA_ITEM_ID  = RL.DFA_ITEM_ID                          
MFA-TR*           AND DA.CODE_DFA_STATUS = 'A'                                  
MFA-TR*         FETCH FIRST 1 ROWS ONLY                                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7100                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7100'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_DFA_ACCT'         TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7100-EXIT.                                                       
           EXIT.                                                        
      *                                                                 41260000
      *****************************************************************         
      * 7150-GET-ITEM-ID.                                             *         
      *****************************************************************         
      *                                                                         
       7150-GET-ITEM-ID.                                                
      *                                                                         
           EXEC SQL                                                     
               SELECT TOP(1) RL.DFA_ITEM_ID                                    
                 INTO :RL-DFA-ITEM-ID                                   
                 FROM CSS_REV_PROTEC_DET RL WITH(READUNCOMMITTED)               
                WHERE RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                  
                  AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO        
                  AND RL.CASE_TYPE_CD = 'F'                             
                                                 
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT RL.DFA_ITEM_ID                                            
MFA-TR*          INTO :RL-DFA-ITEM-ID                                           
MFA-TR*          FROM CSS_REV_PROTEC_DET RL                                     
MFA-TR*         WHERE RL.ACCOUNT_NO   = :RL-ACCOUNT-NO                          
MFA-TR*           AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO                
MFA-TR*           AND RL.CASE_TYPE_CD = 'F'                                     
MFA-TR*         FETCH FIRST 1 ROWS ONLY                                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7150                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7150'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7150-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      *****************************************************************         
      * 7200-GET-GL-ACCT-NO                                           *         
      *****************************************************************         
      *                                                                         
       7200-GET-GL-ACCT-NO.                                             
      *                                                                         
P00793     IF Q8-CODE-UTIL-TYPE = 'E' OR 'G'                            
P00793        CONTINUE                                                  
P00793     ELSE                                                         
P00793        MOVE ZERO                   TO Q8-GL-ACCT-NO              
P00793        GO TO 7200-EXIT                                           
P00793     END-IF.                                                      
      *                                                                         
           EXEC SQL                                                     
               SELECT Q8.GL_ACCT_NO                                     
                 INTO :Q8-GL-ACCT-NO                                    
                 FROM CSS_REV_CLS_RATE Q8 WITH(READUNCOMMITTED)                 
                WHERE Q8.RATE_PLAN_NO       = :Q8-RATE-PLAN-NO          
                  AND Q8.CODE_REVENUE_CLASS = :Q8-CODE-REVENUE-CLASS    
                  AND Q8.CODE_UTIL_TYPE     = :Q8-CODE-UTIL-TYPE        
                  AND Q8.COMPANY_NO         = :Q8-COMPANY-NO            
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT Q8.GL_ACCT_NO                                             
MFA-TR*          INTO :Q8-GL-ACCT-NO                                            
MFA-TR*          FROM CSS_REV_CLS_RATE Q8                                       
MFA-TR*         WHERE Q8.RATE_PLAN_NO       = :Q8-RATE-PLAN-NO                  
MFA-TR*           AND Q8.CODE_REVENUE_CLASS = :Q8-CODE-REVENUE-CLASS            
MFA-TR*           AND Q8.CODE_UTIL_TYPE     = :Q8-CODE-UTIL-TYPE                
MFA-TR*           AND Q8.COMPANY_NO         = :Q8-COMPANY-NO                    
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7200                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7200'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_CLS_RATE'     TO TABLE-1                    
              MOVE 'RATE_PLAN_NO'         TO TABLE-ELEMENT-1            
              MOVE 'CODE_UTIL_TYPE'       TO TABLE-ELEMENT-2            
              MOVE 'CODE_REVENUE_CLASS'   TO TABLE-ELEMENT-3            
              MOVE Q8-RATE-PLAN-NO        TO HOSTVAR-ELEMENT-1          
              MOVE Q8-CODE-UTIL-TYPE      TO HOSTVAR-ELEMENT-2          
              MOVE Q8-CODE-REVENUE-CLASS  TO HOSTVAR-ELEMENT-3          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7200-EXIT.                                                       
           EXIT.                                                        
      *                                                                 41260000
      ******************************************************************17770000
      * 7300-ACCEPT-TIMESTAMP                                          *17780000
      ******************************************************************17810000
      *                                                                         
       7300-ACCEPT-TIMESTAMP.                                           
      *                                                                 17830000
           EXEC SQL                                                     
               SELECT
              REPLACE(REPLACE(CONVERT(CHAR(26), CIS.CURRENT$TIMESTAMP()
           , 121), ' ', '-'), ':', '.'),
              CAST(SYSDATETIMEOFFSET() AS DATE)
            INTO
              :WS-CURRENT-TIMESTAMP,
              :WS-CURRENT-DT                 
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                     17840000
MFA-TR*        SET :WS-CURRENT-TIMESTAMP = CURRENT TIMESTAMP            17860000
MFA-TR*           ,:WS-CURRENT-DT        = CURRENT DATE                 17860000
MFA-TR*    END-EXEC.                                                    17880000

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                 17890000
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                 17920000
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7300'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'SET '                 TO TABLE-1                    
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 18050000
        7300-EXIT.                                                      
            EXIT.                                                       
      *                                                                 18090000
      *****************************************************************         
      * 7400-GET-MAX-SEQ-NO                                           *         
      *****************************************************************         
      *                                                                         
       7400-GET-MAX-SEQ-NO.                                             
      *                                                                         
           EXEC SQL                                                     
               SELECT COALESCE(MAX(RL.CASE_SEQ_NO), 0)                  
                 INTO :RL-CASE-SEQ-NO                                   
                 FROM CSS_REV_PROTEC_DET RL WITH(READUNCOMMITTED)               
                WHERE RL.ACCOUNT_NO       = :RL-ACCOUNT-NO              
                  AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO        
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT COALESCE(MAX(RL.CASE_SEQ_NO), 0)                          
MFA-TR*          INTO :RL-CASE-SEQ-NO                                           
MFA-TR*          FROM CSS_REV_PROTEC_DET RL                                     
MFA-TR*         WHERE RL.ACCOUNT_NO       = :RL-ACCOUNT-NO                      
MFA-TR*           AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO                
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7400                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7400'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7400-EXIT.                                                       
           EXIT.                                                        
      *                                                                 41260000
      ******************************************************************        
      * 7450-GET-REV-HDR.                                              *        
      ******************************************************************        
      *                                                                         
       7450-GET-REV-HDR.                                                
      *                                                                         
           EXEC SQL                                                     
               SELECT R0.SOURCE_CD                                      
                     ,R0.UNCOLLEC_REASON_CD                             
                     ,R0.SETUP_USERID                                   
                     ,R0.END_DT                                         
                     ,R0.CREATE_DT                                      
                     ,R0.LAST_UPDATE_USERID                             
                     ,R0.STATUS_CHANGE_DT                               
                     ,R0.WORK_TYPE_CD                                   
P00793               ,R0.CASE_STATUS_CD                                 
                 INTO :WS-PREV-SOURCE-CD                                
                     ,:WS-PREV-UNCOLEC-RSN-CD                           
                     ,:WS-PREV-SETUP-ID                                 
                     ,:WS-PREV-END-DT :WS-NULL-IND-2                     
                     ,:WS-PREV-CREATE-DT                                
                     ,:WS-PREV-LAST-UPDATE-ID                           
                     ,:WS-PREV-STATUS-CHNG-DT                           
                     ,:WS-PREV-WORK-TYPE-CD                             
P00793               ,:WS-PREV-CASE-STATUS-CD                           
                 FROM CSS_REV_PROTEC_HDR R0 WITH(READUNCOMMITTED)               
                WHERE R0.ACCOUNT_NO       = :R0-ACCOUNT-NO              
                  AND R0.REV_PROT_CASE_NO = :R0-REV-PROT-CASE-NO        
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT R0.SOURCE_CD                                              
MFA-TR*              ,R0.UNCOLLEC_REASON_CD                                     
MFA-TR*              ,R0.SETUP_USERID                                           
MFA-TR*              ,R0.END_DT                                                 
MFA-TR*              ,R0.CREATE_DT                                              
MFA-TR*              ,R0.LAST_UPDATE_USERID                                     
MFA-TR*              ,R0.STATUS_CHANGE_DT                                       
MFA-TR*              ,R0.WORK_TYPE_CD                                           
MFA-TR*              ,R0.CASE_STATUS_CD                                         
MFA-TR*          INTO :WS-PREV-SOURCE-CD                                        
MFA-TR*              ,:WS-PREV-UNCOLEC-RSN-CD                                   
MFA-TR*              ,:WS-PREV-SETUP-ID                                         
MFA-TR*              ,:WS-PREV-END-DT:WS-NULL-IND-2                             
MFA-TR*              ,:WS-PREV-CREATE-DT                                        
MFA-TR*              ,:WS-PREV-LAST-UPDATE-ID                                   
MFA-TR*              ,:WS-PREV-STATUS-CHNG-DT                                   
MFA-TR*              ,:WS-PREV-WORK-TYPE-CD                                     
MFA-TR*              ,:WS-PREV-CASE-STATUS-CD                                   
MFA-TR*          FROM CSS_REV_PROTEC_HDR R0                                     
MFA-TR*         WHERE R0.ACCOUNT_NO       = :R0-ACCOUNT-NO                      
MFA-TR*           AND R0.REV_PROT_CASE_NO = :R0-REV-PROT-CASE-NO                
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7450                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
              IF WS-NULL-IND-2 EQUAL -1                                 
                 MOVE SPACES TO WS-PREV-END-DT                          
              END-IF                                                    
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7450'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7450-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      *****************************************************************         
      * 7500-GET-REV-DET.                                             *         
      *****************************************************************         
      *                                                                         
       7500-GET-REV-DET.                                                
      *                                                                         
           EXEC SQL                                                     
               SELECT RL.RATE_PLAN_NO                                   
                     ,RL.CODE_REVENUE_CLASS                             
                     ,RL.NO_UNITS                                       
                     ,RL.COLLECTIBLE_UNITS                              
                     ,RL.CASE_AM                                        
                     ,RL.COLLECTIBLE_AM                                 
                     ,RL.AMT_DOWN_PYMT                                  
                     ,RL.RECURR_REV_PCT                                 
                 INTO :WS-PREV-RATE-PLAN-NO                             
                     ,:WS-PREV-REV-CLASS                                
                     ,:WS-PREV-NO-UNITS                                 
                     ,:WS-PREV-COLLECT-UNITS                            
                     ,:WS-PREV-CASE-AM                                  
                     ,:WS-PREV-COLLECT-AM                               
                     ,:WS-PREV-AMT-DOWN-PYMT                            
                     ,:WS-PREV-RECURR-REV                               
                 FROM CSS_REV_PROTEC_DET RL WITH(READUNCOMMITTED)               
                WHERE RL.ACCOUNT_NO       = :RL-ACCOUNT-NO              
                  AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO        
                  AND RL.CASE_SEQ_NO      = :RL-CASE-SEQ-NO             
                  AND RL.CONSUMPT_TYPE_CD = :RL-CONSUMPT-TYPE-CD        
                                                                 
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT RL.RATE_PLAN_NO                                           
MFA-TR*              ,RL.CODE_REVENUE_CLASS                                     
MFA-TR*              ,RL.NO_UNITS                                               
MFA-TR*              ,RL.COLLECTIBLE_UNITS                                      
MFA-TR*              ,RL.CASE_AM                                                
MFA-TR*              ,RL.COLLECTIBLE_AM                                         
MFA-TR*              ,RL.AMT_DOWN_PYMT                                          
MFA-TR*              ,RL.RECURR_REV_PCT                                         
MFA-TR*          INTO :WS-PREV-RATE-PLAN-NO                                     
MFA-TR*              ,:WS-PREV-REV-CLASS                                        
MFA-TR*              ,:WS-PREV-NO-UNITS                                         
MFA-TR*              ,:WS-PREV-COLLECT-UNITS                                    
MFA-TR*              ,:WS-PREV-CASE-AM                                          
MFA-TR*              ,:WS-PREV-COLLECT-AM                                       
MFA-TR*              ,:WS-PREV-AMT-DOWN-PYMT                                    
MFA-TR*              ,:WS-PREV-RECURR-REV                                       
MFA-TR*          FROM CSS_REV_PROTEC_DET RL                                     
MFA-TR*         WHERE RL.ACCOUNT_NO       = :RL-ACCOUNT-NO                      
MFA-TR*           AND RL.REV_PROT_CASE_NO = :RL-REV-PROT-CASE-NO                
MFA-TR*           AND RL.CASE_SEQ_NO      = :RL-CASE-SEQ-NO                     
MFA-TR*           AND RL.CONSUMPT_TYPE_CD = :RL-CONSUMPT-TYPE-CD                
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7500                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                         
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL  OR NOT-FOUND 
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '7500'                 TO ACTIVE-PARAGRAPH           
              MOVE 'SELECT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE 'CASE_SEQ_NO'          TO TABLE-ELEMENT-3            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              MOVE RL-CASE-SEQ-NO         TO HOSTVAR-ELEMENT-3          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7500-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
P00253*****************************************************************         
P00253* 7550-GET-UNCOLLEC-RESN-DESC                                   *         
P00253*****************************************************************         
P00253*                                                                         
P00253 7550-GET-UNCOLLEC-RESN-DESC.                                     
P00253*                                                                         
P00253     EXEC SQL                                                     
P00253         SELECT UV.CODE_SHORT_DESC                                
P00253           INTO :UV-CODE-SHORT-DESC                               
P00253           FROM CSS_CODE_VALUE UV WITH(READUNCOMMITTED)                   
P00253          WHERE UV.COLUMN_NA     = :UV-COLUMN-NA                  
P00253            AND UV.TABLE_NA      = 'CSS_REV_PROTEC_HDR'           
P00253            AND UV.PROGRAM_ID    = 'ALL'                          
P00253            AND UV.CODE_VALUE    = :UV-CODE-VALUE                 
P00253            AND UV.COMPANY_NO    = :UV-COMPANY-NO                 
P00253                                                           
P00253                                                      
P00253     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT UV.CODE_SHORT_DESC                                        
MFA-TR*          INTO :UV-CODE-SHORT-DESC                                       
MFA-TR*          FROM CSS_CODE_VALUE UV                                         
MFA-TR*         WHERE UV.COLUMN_NA     = :UV-COLUMN-NA                          
MFA-TR*           AND UV.TABLE_NA      = 'CSS_REV_PROTEC_HDR'                   
MFA-TR*           AND UV.PROGRAM_ID    = 'ALL'                                  
MFA-TR*           AND UV.CODE_VALUE    = :UV-CODE-VALUE                         
MFA-TR*           AND UV.COMPANY_NO    = :UV-COMPANY-NO                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7550                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00253*                                                                         
P00253     MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
P00253                                       S-RETURN-CODE.             
P00253*                                                                         
P00253     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
P00253        CONTINUE                                                  
P00253     ELSE                                                         
P00253        MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
P00253        MOVE '7550'                 TO ACTIVE-PARAGRAPH           
P00253        MOVE 'SELECT'               TO ABEND-FUNCTION             
P00253        MOVE SPACES                 TO ABEND-SQL-PREDICATES       
P00253                                       ABEND-TABLES               
P00253        MOVE 'CSS_CODE_VALUE'       TO TABLE-1                    
P00253        MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
P00253        MOVE 'CODE_VALUE'           TO TABLE-ELEMENT-2            
P00253        MOVE 'COMPANY_NO'           TO TABLE-ELEMENT-3            
P00253        MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
P00253        MOVE UV-CODE-VALUE          TO HOSTVAR-ELEMENT-2          
P00253        MOVE UV-COMPANY-NO          TO HOSTVAR-ELEMENT-3          
P00253        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00253        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00253     END-IF.                                                      
P00253*                                                                         
P00253 7550-EXIT.                                                       
P00253     EXIT.                                                        
P00253*                                                                         
P00253*****************************************************************         
P00253* 7600-GET-WORK-TYPE-DESC                                       *         
P00253*****************************************************************         
P00253*                                                                         
P00253 7600-GET-WORK-TYPE-DESC.                                         
P00253*                                                                         
P00253     EXEC SQL                                                     
P00253         SELECT L4.WORK_TYPE_DESC                                 
P00253           INTO :L4-WORK-TYPE-DESC                                
P00253           FROM CSS_WORK_TYPE L4 WITH(READUNCOMMITTED)                    
P00253          WHERE L4.COMPANY_NO    = :L4-COMPANY-NO                 
P00253            AND L4.WORK_TYPE_CD  = :L4-WORK-TYPE-CD               
P00253                                                           
P00253                                                      
P00253     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT L4.WORK_TYPE_DESC                                         
MFA-TR*          INTO :L4-WORK-TYPE-DESC                                        
MFA-TR*          FROM CSS_WORK_TYPE L4                                          
MFA-TR*         WHERE L4.COMPANY_NO    = :L4-COMPANY-NO                         
MFA-TR*           AND L4.WORK_TYPE_CD  = :L4-WORK-TYPE-CD                       
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7600                                                    
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00253*                                                                         
P00253     MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
P00253                                       S-RETURN-CODE.             
P00253*                                                                         
P00253     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
P00253        CONTINUE                                                  
P00253     ELSE                                                         
P00253        MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
P00253        MOVE '7600'                 TO ACTIVE-PARAGRAPH           
P00253        MOVE 'SELECT'               TO ABEND-FUNCTION             
P00253        MOVE SPACES                 TO ABEND-SQL-PREDICATES       
P00253                                       ABEND-TABLES               
P00253        MOVE 'CSS_WORK_TYPE'        TO TABLE-1                    
P00253        MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
P00253        MOVE 'WORK_TYPE_CD'         TO TABLE-ELEMENT-2            
P00253        MOVE 'COMPANY_NO'           TO TABLE-ELEMENT-3            
P00253        MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
P00253        MOVE L4-WORK-TYPE-CD        TO HOSTVAR-ELEMENT-2          
P00253        MOVE L4-COMPANY-NO          TO HOSTVAR-ELEMENT-3          
P00253        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00253        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00253     END-IF.                                                      
P00253*                                                                         
P00253 7600-EXIT.                                                       
P00253     EXIT.                                                        
P00253*                                                                         
P00793******************************************************************        
P00793* 7610-SEL-ACCT-DTLS                                             *        
P00793******************************************************************        
P00793*                                                                         
P00793 7610-SEL-ACCT-DTLS.                                              
P00793*                                                                         
P00793      EXEC SQL                                                    
P00793             SELECT                                               
P00793                     AT.COMPANY_NO                                
P00793                    ,AT.MST_SUB_ACCT_IND                          
P00793                    ,AT.ACCOUNT_TYPE_CODE                         
P00793               INTO                                               
P00793                     :AT-COMPANY-NO                               
P00793                    ,:AT-MST-SUB-ACCT-IND                         
P00793                    ,:AT-ACCOUNT-TYPE-CODE                        
P00793               FROM                                               
P00793                    CSS_ACCOUNT AT WITH(READUNCOMMITTED)                  
P00793              WHERE                                               
P00793                    AT.ACCOUNT_NO     = :AT-ACCOUNT-NO            
P00793                                                           
P00793                                                      
P00793      END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*     EXEC SQL                                                            
MFA-TR*            SELECT                                                       
MFA-TR*                    AT.COMPANY_NO                                        
MFA-TR*                   ,AT.MST_SUB_ACCT_IND                                  
MFA-TR*                   ,AT.ACCOUNT_TYPE_CODE                                 
MFA-TR*              INTO                                                       
MFA-TR*                    :AT-COMPANY-NO                                       
MFA-TR*                   ,:AT-MST-SUB-ACCT-IND                                 
MFA-TR*                   ,:AT-ACCOUNT-TYPE-CODE                                
MFA-TR*              FROM                                                       
MFA-TR*                   CSS_ACCOUNT AT                                        
MFA-TR*             WHERE                                                       
MFA-TR*                   AT.ACCOUNT_NO     = :AT-ACCOUNT-NO                    
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7610                                                    
MFA-TR*     END-EXEC.                                                           

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00793*                                                                         
P00793     MOVE SQLCODE                     TO WS-ACTIVE-RETURN-CODE    
P00793                                         S-RETURN-CODE.           
P00793*                                                                         
P00793     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
P00793        CONTINUE                                                  
P00793     ELSE                                                         
P00793        MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
P00793        MOVE SQLCODE                  TO ABEND-SQLCODE            
P00793        MOVE SQLSTATE                 TO ABEND-SQLSTATE           
P00793        MOVE '7610'                   TO ACTIVE-PARAGRAPH         
P00793        MOVE 'SELECT'                 TO ABEND-FUNCTION           
P00793        MOVE 'CSS_ACCOUNT'            TO TABLE-1                  
P00793        MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
P00793        MOVE AT-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
P00793        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00793        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00793     END-IF.                                                      
P00793*                                                                         
P00793 7610-EXIT.                                                       
P00793      EXIT.                                                       
P00793*                                                                         
P00793******************************************************************        
P00793* 7700-OPEN-FEE-DTLS.                                            *        
P00793******************************************************************        
P00793*                                                                         
P00793 7700-OPEN-FEE-DTLS.                                              
P00793*                                                                         
P00793     EXEC SQL                                                     
P00793        OPEN  FEE-DTLS                                            
P00793     END-EXEC.                                                    

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00793*                                                                         
P00793     MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
P00793                                       S-RETURN-CODE.             
P00793*                                                                         
P00793     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
P00793         CONTINUE                                                 
P00793     ELSE                                                         
P00793        MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
P00793        MOVE '7700'                 TO ACTIVE-PARAGRAPH           
P00793        MOVE 'OPEN'                 TO ABEND-FUNCTION             
P00793        MOVE SPACES                 TO ABEND-SQL-PREDICATES       
P00793                                       ABEND-TABLES               
P00793        MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
P00793        MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
P00793        MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
P00793        MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
P00793        MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
P00793        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00793        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00793     END-IF.                                                      
P00793*                                                                         
P00793 7700-EXIT.                                                       
P00793     EXIT.                                                        
P00793*                                                                         
P00793******************************************************************        
P00793* 7710-FETCH-FEE-DTLS                                            *        
P00793******************************************************************        
P00793*                                                                         
P00793 7710-FETCH-FEE-DTLS.                                             
P00793*                                                                         
P00793     EXEC SQL                                                     
P00793        FETCH  FEE-DTLS                                           
P00793        INTO   :RL-CASE-SEQ-NO                                    
P00793             , :RL-CASE-TYPE-CD                                   
P00793             , :RL-RATE-PLAN-NO                                   
P00793             , :RL-CODE-REVENUE-CLASS                             
P00793             , :RL-CONSUMPT-TYPE-CD                               
P00793             , :RL-NO-UNITS                                       
P00793             , :RL-COLLECTIBLE-UNITS                              
P00793             , :RL-CASE-AM                                        
P00793             , :RL-COLLECTIBLE-AM                                 
P00793             , :RL-AMT-DOWN-PYMT                                  
P00793             , :RL-RECURR-REV-PCT                                 
P00793             , :RL-DFA-ITEM-ID                                    
P00793             , :RL-DFA-ITEM-ID-DP                                 
P00793             , :RL-GL-ACCT-NO                                     
P00793     END-EXEC.                                                    

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00793*                                                                 50420200
P00793     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE       
P00793                                      S-RETURN-CODE.              
P00793*                                                                         
P00793     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
P00793        CONTINUE                                                  
P00793     ELSE                                                         
P00793        MOVE PROGRAM-NAME          TO ABEND-PROGRAM               
P00793        MOVE '7710'                TO ACTIVE-PARAGRAPH            
P00793        MOVE 'FETCH'               TO ABEND-FUNCTION              
P00793        MOVE SPACES                TO ABEND-SQL-PREDICATES        
P00793                                      ABEND-TABLES                
P00793        MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
P00793        MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
P00793        MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
P00793        MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
P00793        MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
P00793        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00793        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00793     END-IF.                                                      
P00793*                                                                         
P00793 7710-EXIT.                                                       
P00793     EXIT.                                                        
P00793*                                                                         
P00793******************************************************************        
P00793* 7720-CLOSE-FEE-DTLS                                            *        
P00793******************************************************************        
P00793*                                                                         
P00793 7720-CLOSE-FEE-DTLS.                                             
P00793*                                                                         
P00793     EXEC SQL                                                     
P00793        CLOSE  FEE-DTLS                                           
P00793     END-EXEC.                                                    

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

P00793*                                                                 50444400
P00793     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE       
P00793                                      S-RETURN-CODE.              
P00793*                                                                 50444600
P00793     IF WS-ACTIVE-RETURN-CODE           = SUCCESSFUL-CALL         
P00793        NEXT SENTENCE                                             
P00793     ELSE                                                         
P00793        MOVE PROGRAM-NAME          TO ABEND-PROGRAM               
P00793        MOVE '7720'                TO ACTIVE-PARAGRAPH            
P00793        MOVE 'CLOSE'               TO ABEND-FUNCTION              
P00793        MOVE SPACES                TO ABEND-SQL-PREDICATES        
P00793                                      ABEND-TABLES                
P00793        MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
P00793        MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
P00793        MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
P00793        MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
P00793        MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
P00793        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00793        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00793     END-IF.                                                      
P00793*                                                                         
P00793 7720-EXIT.                                                       
P00793     EXIT.                                                        
P00793*                                                                         
      ******************************************************************        
      * 8000-INSERT-CASE-HDR                                           *        
      ******************************************************************        
      *                                                                         
       8000-INSERT-CASE-HDR.                                            
      *                                                                         
           EXEC SQL                                                     
              INSERT INTO CSS_REV_PROTEC_HDR                            
                    ( ACCOUNT_NO                                        
                    , REV_PROT_CASE_NO                                  
                    , COMPANY_NO                                        
                    , CASE_STATUS_CD                                    
                    , SOURCE_CD                                         
                    , UNCOLLEC_REASON_CD                                
                    , SETUP_USERID                                      
                    , REVENUE_MONTH                                     
                    , END_DT                                            
                    , CREATE_DT                                         
                    , LAST_UPDATE_USERID                                
                    , LAST_UPDATE_TS                                    
                    , CASE_NOTES                                        
                    , STATUS_CHANGE_DT                                  
                    , WORK_TYPE_CD)                                     
              VALUES (:R0-ACCOUNT-NO                                    
                    , :R0-REV-PROT-CASE-NO                              
                    , :R0-COMPANY-NO                                    
                    , :R0-CASE-STATUS-CD                                
                    , :R0-SOURCE-CD                                     
                    , :R0-UNCOLLEC-REASON-CD                            
                    , :R0-SETUP-USERID                                  
                    , :R0-REVENUE-MONTH                                 
                    , IIF(TRY_CONVERT(DATE, :R0-END-DT :WS-NULL-IND-1
              ) IS NULL OR (PATINDEX('%.%', :R0-END-DT :WS-NULL-IND-1
              ) <> 0) OR (LEN(:R0-END-DT :WS-NULL-IND-1
              ) <> 10), CIS.CHAR2DATE(:R0-END-DT :WS-NULL-IND-1
              ), CONVERT(DATE, :R0-END-DT :WS-NULL-IND-1) )                    
                    , IIF(TRY_CONVERT(DATE, :R0-CREATE-DT
              ) IS NULL OR (PATINDEX('%.%', :R0-CREATE-DT
              ) <> 0) OR (LEN(:R0-CREATE-DT) <> 10), CIS.CHAR2DATE(
                                                          :R0-CREATE-DT
              ), CONVERT(DATE, :R0-CREATE-DT) )                                
                    , :R0-LAST-UPDATE-USERID                            
                    , CIS.CHAR2TIMESTAMP(:R0-LAST-UPDATE-TS)                    
                    , :R0-CASE-NOTES                                    
                    , IIF(TRY_CONVERT(DATE, :R0-STATUS-CHANGE-DT
              ) IS NULL OR (PATINDEX('%.%', :R0-STATUS-CHANGE-DT
              ) <> 0) OR (LEN(:R0-STATUS-CHANGE-DT
              ) <> 10), CIS.CHAR2DATE(:R0-STATUS-CHANGE-DT
              ), CONVERT(DATE, :R0-STATUS-CHANGE-DT) )                         
                    , :R0-WORK-TYPE-CD)                                 
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*       INSERT INTO CSS_REV_PROTEC_HDR                                    
MFA-TR*             ( ACCOUNT_NO                                                
MFA-TR*             , REV_PROT_CASE_NO                                          
MFA-TR*             , COMPANY_NO                                                
MFA-TR*             , CASE_STATUS_CD                                            
MFA-TR*             , SOURCE_CD                                                 
MFA-TR*             , UNCOLLEC_REASON_CD                                        
MFA-TR*             , SETUP_USERID                                              
MFA-TR*             , REVENUE_MONTH                                             
MFA-TR*             , END_DT                                                    
MFA-TR*             , CREATE_DT                                                 
MFA-TR*             , LAST_UPDATE_USERID                                        
MFA-TR*             , LAST_UPDATE_TS                                            
MFA-TR*             , CASE_NOTES                                                
MFA-TR*             , STATUS_CHANGE_DT                                          
MFA-TR*             , WORK_TYPE_CD)                                             
MFA-TR*       VALUES (:R0-ACCOUNT-NO                                            
MFA-TR*             , :R0-REV-PROT-CASE-NO                                      
MFA-TR*             , :R0-COMPANY-NO                                            
MFA-TR*             , :R0-CASE-STATUS-CD                                        
MFA-TR*             , :R0-SOURCE-CD                                             
MFA-TR*             , :R0-UNCOLLEC-REASON-CD                                    
MFA-TR*             , :R0-SETUP-USERID                                          
MFA-TR*             , :R0-REVENUE-MONTH                                         
MFA-TR*             , :R0-END-DT:WS-NULL-IND-1                                  
MFA-TR*             , :R0-CREATE-DT                                             
MFA-TR*             , :R0-LAST-UPDATE-USERID                                    
MFA-TR*             , :R0-LAST-UPDATE-TS                                        
MFA-TR*             , :R0-CASE-NOTES                                            
MFA-TR*             , :R0-STATUS-CHANGE-DT                                      
MFA-TR*             , :R0-WORK-TYPE-CD)                                         
MFA-TR*    END-EXEC.                                                            

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                                        
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8000'                 TO ACTIVE-PARAGRAPH           
              MOVE 'INSERT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE R0-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       8000-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************        
      * 8050-INSERT-CASE-DET                                           *        
      ******************************************************************        
      *                                                                         
       8050-INSERT-CASE-DET.                                            
      *                                                                         
           EXEC SQL                                                     
              INSERT INTO CSS_REV_PROTEC_DET                            
                    ( ACCOUNT_NO                                        
                    , REV_PROT_CASE_NO                                  
                    , CASE_SEQ_NO                                       
                    , CASE_TYPE_CD                                      
                    , RATE_PLAN_NO                                      
                    , CODE_REVENUE_CLASS                                
                    , CONSUMPT_TYPE_CD                                  
                    , NO_UNITS                                          
                    , COLLECTIBLE_UNITS                                 
                    , CASE_AM                                           
                    , COLLECTIBLE_AM                                    
                    , AMT_DOWN_PYMT                                     
                    , RECURR_REV_PCT                                    
                    , DFA_ITEM_ID                                       
                    , DFA_ITEM_ID_DP                                    
                    , GL_ACCT_NO)                                       
              VALUES (:RL-ACCOUNT-NO                                    
                    , :RL-REV-PROT-CASE-NO                              
                    , :RL-CASE-SEQ-NO                                   
                    , :RL-CASE-TYPE-CD                                  
                    , :RL-RATE-PLAN-NO                                  
                    , :RL-CODE-REVENUE-CLASS                            
                    , :RL-CONSUMPT-TYPE-CD                              
                    , :RL-NO-UNITS                                      
                    , :RL-COLLECTIBLE-UNITS                             
                    , :RL-CASE-AM                                       
                    , :RL-COLLECTIBLE-AM                                
                    , :RL-AMT-DOWN-PYMT                                 
                    , :RL-RECURR-REV-PCT                                
                    , :RL-DFA-ITEM-ID                                   
                    , :RL-DFA-ITEM-ID-DP                                
                    , :RL-GL-ACCT-NO)                                   
           END-EXEC.                                                    

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                                        
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8050'                 TO ACTIVE-PARAGRAPH           
              MOVE 'INSERT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE 'CASE_SEQ_NO'          TO TABLE-ELEMENT-3            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              MOVE RL-CASE-SEQ-NO         TO HOSTVAR-ELEMENT-3          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       8050-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************41698200
      *  8100-UPDATE-CASE-HDR                                          *41698300
      ******************************************************************41698500
      *                                                                         
       8100-UPDATE-CASE-HDR.                                            
      *                                                                         
           EXEC SQL                                                     
                UPDATE R0                             
                SET    R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  
                      ,R0.COMPANY_NO            = :R0-COMPANY-NO        
                      ,R0.CASE_STATUS_CD        = :R0-CASE-STATUS-CD    
                      ,R0.SOURCE_CD             = :R0-SOURCE-CD         
                      ,R0.UNCOLLEC_REASON_CD    = :R0-UNCOLLEC-REASON-CD
                      ,R0.SETUP_USERID          = :R0-SETUP-USERID      
                      ,R0.REVENUE_MONTH         = :R0-REVENUE-MONTH     
                      ,R0.END_DT              = IIF(TRY_CONVERT(DATE, 
                                                            :R0-END-DT 
                                                         :WS-NULL-IND-1
              ) IS NULL OR (PATINDEX('%.%', :R0-END-DT :WS-NULL-IND-1
              ) <> 0) OR (LEN(:R0-END-DT :WS-NULL-IND-1
              ) <> 10), CIS.CHAR2DATE(:R0-END-DT :WS-NULL-IND-1
              ), CONVERT(DATE, :R0-END-DT :WS-NULL-IND-1) )
                      ,R0.CREATE_DT             = IIF(TRY_CONVERT(DATE, 
                                                          :R0-CREATE-DT
              ) IS NULL OR (PATINDEX('%.%', :R0-CREATE-DT
              ) <> 0) OR (LEN(:R0-CREATE-DT) <> 10), CIS.CHAR2DATE(
                                                          :R0-CREATE-DT
              ), CONVERT(DATE, :R0-CREATE-DT) )         
                      ,R0.LAST_UPDATE_USERID    = :R0-LAST-UPDATE-USERID
                      ,R0.LAST_UPDATE_TS        = 
           CIS.CURRENT$TIMESTAMP()     
                      ,R0.CASE_NOTES            = :R0-CASE-NOTES        
                      ,R0.STATUS_CHANGE_DT      = IIF(TRY_CONVERT(DATE, 
                                                   :R0-STATUS-CHANGE-DT
              ) IS NULL OR (PATINDEX('%.%', :R0-STATUS-CHANGE-DT
              ) <> 0) OR (LEN(:R0-STATUS-CHANGE-DT
              ) <> 10), CIS.CHAR2DATE(:R0-STATUS-CHANGE-DT
              ), CONVERT(DATE, :R0-STATUS-CHANGE-DT) )  
                      ,R0.WORK_TYPE_CD          = :R0-WORK-TYPE-CD      
                FROM CSS_REV_PROTEC_HDR R0
                WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        
                  AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR* MSQ028
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     41695400
MFA-TR*         UPDATE CSS_REV_PROTEC_HDR R0                            41695500
MFA-TR*         SET    R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  41695700
MFA-TR*               ,R0.COMPANY_NO            = :R0-COMPANY-NO        41695800
MFA-TR*               ,R0.CASE_STATUS_CD        = :R0-CASE-STATUS-CD    41695900
MFA-TR*               ,R0.SOURCE_CD             = :R0-SOURCE-CD         41695900
MFA-TR*               ,R0.UNCOLLEC_REASON_CD    = :R0-UNCOLLEC-REASON-CD41695900
MFA-TR*               ,R0.SETUP_USERID          = :R0-SETUP-USERID      41695900
MFA-TR*               ,R0.REVENUE_MONTH         = :R0-REVENUE-MONTH     41695900
MFA-TR*               ,R0.END_DT              = :R0-END-DT:WS-NULL-IND-141695900
MFA-TR*               ,R0.CREATE_DT             = :R0-CREATE-DT         41695900
MFA-TR*               ,R0.LAST_UPDATE_USERID    = :R0-LAST-UPDATE-USERID41695900
MFA-TR*               ,R0.LAST_UPDATE_TS        = CURRENT TIMESTAMP     41695900
MFA-TR*               ,R0.CASE_NOTES            = :R0-CASE-NOTES        41695900
MFA-TR*               ,R0.STATUS_CHANGE_DT      = :R0-STATUS-CHANGE-DT  41695900
MFA-TR*               ,R0.WORK_TYPE_CD          = :R0-WORK-TYPE-CD      41695900
MFA-TR*         WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        41696000
MFA-TR*           AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  41696100
MFA-TR*         QUERYNO 8100                                                    
MFA-TR*    END-EXEC.                                                    41696300

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8100'                 TO ACTIVE-PARAGRAPH           
              MOVE 'UPDATE'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE R0-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 41697800
       8100-EXIT.                                                       
           EXIT.                                                        
      *                                                                 41698100
      ******************************************************************41698200
      *  8100-UPDATE-CASE-DET                                          *41698300
      ******************************************************************41698500
      *                                                                         
       8150-UPDATE-CASE-DET.                                            
      *                                                                         
           EXEC SQL                                                     
                UPDATE RL                             
                SET    RL.REV_PROT_CASE_NO      = :RL-REV-PROT-CASE-NO  
                      ,RL.RATE_PLAN_NO          = :RL-RATE-PLAN-NO      
                      ,RL.CODE_REVENUE_CLASS    = :RL-CODE-REVENUE-CLASS
                      ,RL.CONSUMPT_TYPE_CD      = :RL-CONSUMPT-TYPE-CD  
                      ,RL.NO_UNITS              = :RL-NO-UNITS          
                      ,RL.COLLECTIBLE_UNITS     = :RL-COLLECTIBLE-UNITS 
                      ,RL.CASE_AM               = :RL-CASE-AM           
                      ,RL.COLLECTIBLE_AM        = :RL-COLLECTIBLE-AM    
                      ,RL.AMT_DOWN_PYMT         = :RL-AMT-DOWN-PYMT     
                      ,RL.RECURR_REV_PCT        = :RL-RECURR-REV-PCT    
                FROM CSS_REV_PROTEC_DET RL
                WHERE  RL.ACCOUNT_NO            = :RL-ACCOUNT-NO        
                  AND  RL.REV_PROT_CASE_NO      = :RL-REV-PROT-CASE-NO  
                  AND  RL.CASE_SEQ_NO           = :RL-CASE-SEQ-NO       
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     41695400
MFA-TR*         UPDATE CSS_REV_PROTEC_DET RL                            41695500
MFA-TR*         SET    RL.REV_PROT_CASE_NO      = :RL-REV-PROT-CASE-NO  41695700
MFA-TR*               ,RL.RATE_PLAN_NO          = :RL-RATE-PLAN-NO      41695800
MFA-TR*               ,RL.CODE_REVENUE_CLASS    = :RL-CODE-REVENUE-CLASS41695800
MFA-TR*               ,RL.CONSUMPT_TYPE_CD      = :RL-CONSUMPT-TYPE-CD  41695800
MFA-TR*               ,RL.NO_UNITS              = :RL-NO-UNITS          41695800
MFA-TR*               ,RL.COLLECTIBLE_UNITS     = :RL-COLLECTIBLE-UNITS 41695900
MFA-TR*               ,RL.CASE_AM               = :RL-CASE-AM           41695900
MFA-TR*               ,RL.COLLECTIBLE_AM        = :RL-COLLECTIBLE-AM    41695900
MFA-TR*               ,RL.AMT_DOWN_PYMT         = :RL-AMT-DOWN-PYMT     41695900
MFA-TR*               ,RL.RECURR_REV_PCT        = :RL-RECURR-REV-PCT    41695900
MFA-TR*         WHERE  RL.ACCOUNT_NO            = :RL-ACCOUNT-NO        41696000
MFA-TR*           AND  RL.REV_PROT_CASE_NO      = :RL-REV-PROT-CASE-NO  41696100
MFA-TR*           AND  RL.CASE_SEQ_NO           = :RL-CASE-SEQ-NO       41696100
MFA-TR*         QUERYNO 8150                                                    
MFA-TR*    END-EXEC.                                                    41696300

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8150'                 TO ACTIVE-PARAGRAPH           
              MOVE 'UPDATE'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE 'CASE_SEQ_NO'          TO TABLE-ELEMENT-3            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              MOVE RL-CASE-SEQ-NO         TO HOSTVAR-ELEMENT-3          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 41697800
       8150-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************41698200
      * 8170-DELETE-CASE-HDR                                            41698300
      ******************************************************************41698500
      *                                                                         
       8170-DELETE-CASE-HDR.                                            
      *                                                                         
           EXEC SQL                                                     
                DELETE FROM R0                        
                FROM CSS_REV_PROTEC_HDR R0
                WHERE R0.ACCOUNT_NO        = :R0-ACCOUNT-NO             
                  AND R0.REV_PROT_CASE_NO  = :R0-REV-PROT-CASE-NO       
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     39240000
MFA-TR*         DELETE FROM CSS_REV_PROTEC_HDR R0                       39250000
MFA-TR*         WHERE R0.ACCOUNT_NO        = :R0-ACCOUNT-NO             39260000
MFA-TR*           AND R0.REV_PROT_CASE_NO  = :R0-REV-PROT-CASE-NO       39270000
MFA-TR*         QUERYNO 8170                                                    
MFA-TR*    END-EXEC.                                                    39300000

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                                        
           MOVE SQLCODE                     TO WS-ACTIVE-RETURN-CODE    
                                               S-RETURN-CODE.           
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '8170'                   TO ACTIVE-PARAGRAPH         
              MOVE 'DELETE'                 TO ABEND-FUNCTION           
              MOVE SPACES                   TO ABEND-SQL-PREDICATES     
                                               ABEND-TABLES             
              MOVE 'CSS_REV_PROTEC_HDR'     TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'REV_PROT_CASE_NO'       TO TABLE-ELEMENT-2          
              MOVE R0-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE R0-REV-PROT-CASE-NO      TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       8170-EXIT.                                                       
            EXIT.                                                       
      *                                                                         
      ******************************************************************41698200
      * 8200-DELETE-CASE-DET                                            41698300
      ******************************************************************41698500
      *                                                                         
       8200-DELETE-CASE-DET.                                            
      *                                                                         
           EXEC SQL                                                     
                DELETE FROM RL                        
                FROM CSS_REV_PROTEC_DET RL
                WHERE RL.ACCOUNT_NO        = :R0-ACCOUNT-NO             
                  AND RL.REV_PROT_CASE_NO  = :R0-REV-PROT-CASE-NO       
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     39240000
MFA-TR*         DELETE FROM CSS_REV_PROTEC_DET RL                       39250000
MFA-TR*         WHERE RL.ACCOUNT_NO        = :R0-ACCOUNT-NO             39260000
MFA-TR*           AND RL.REV_PROT_CASE_NO  = :R0-REV-PROT-CASE-NO       39270000
MFA-TR*         QUERYNO 8200                                                    
MFA-TR*    END-EXEC.                                                    39300000

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

      *                                                                 39310000
           MOVE SQLCODE                     TO WS-ACTIVE-RETURN-CODE    
                                               S-RETURN-CODE.           
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '8200'                   TO ACTIVE-PARAGRAPH         
              MOVE 'DELETE'                 TO ABEND-FUNCTION           
              MOVE SPACES                   TO ABEND-SQL-PREDICATES     
                                               ABEND-TABLES             
              MOVE 'CSS_REV_PROTEC_DET'     TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'REV_PROT_CASE_NO'       TO TABLE-ELEMENT-2          
              MOVE R0-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE R0-REV-PROT-CASE-NO      TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       8200-EXIT.                                                       
            EXIT.                                                       
      *                                                                         
      ******************************************************************41698200
      * 8230-DELETE-CASE-TYPE.                                          41698300
      ******************************************************************41698500
      *                                                                         
       8230-DELETE-CASE-TYPE.                                           
      *                                                                         
           EXEC SQL                                                     
                DELETE FROM RL                        
                FROM CSS_REV_PROTEC_DET RL
                WHERE RL.ACCOUNT_NO        = :RL-ACCOUNT-NO             
                  AND RL.REV_PROT_CASE_NO  = :RL-REV-PROT-CASE-NO       
                  AND RL.CASE_SEQ_NO       = :RL-CASE-SEQ-NO            
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     39240000
MFA-TR*         DELETE FROM CSS_REV_PROTEC_DET RL                       39250000
MFA-TR*         WHERE RL.ACCOUNT_NO        = :RL-ACCOUNT-NO             39260000
MFA-TR*           AND RL.REV_PROT_CASE_NO  = :RL-REV-PROT-CASE-NO       39270000
MFA-TR*           AND RL.CASE_SEQ_NO       = :RL-CASE-SEQ-NO            39270000
MFA-TR*         QUERYNO 8230                                                    
MFA-TR*    END-EXEC.                                                    39300000

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                                        
           MOVE SQLCODE                     TO WS-ACTIVE-RETURN-CODE    
                                               S-RETURN-CODE.           
           IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '8230'                   TO ACTIVE-PARAGRAPH         
              MOVE 'DELETE'                 TO ABEND-FUNCTION           
              MOVE SPACES                   TO ABEND-SQL-PREDICATES     
                                               ABEND-TABLES             
              MOVE 'CSS_REV_PROTEC_DET'     TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'REV_PROT_CASE_NO'       TO TABLE-ELEMENT-2          
              MOVE 'CASE_SEQ_NO'            TO TABLE-ELEMENT-3          
              MOVE RL-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE RL-REV-PROT-CASE-NO      TO HOSTVAR-ELEMENT-2        
              MOVE RL-CASE-SEQ-NO           TO HOSTVAR-ELEMENT-3        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       8230-EXIT.                                                       
            EXIT.                                                       
      *                                                                         
      ******************************************************************41698200
      *  8250-UPDATE-CASE-STATUS.                                      *41698300
      ******************************************************************41698500
      *                                                                         
       8250-UPDATE-CASE-STATUS.                                         
      *                                                                         
           EXEC SQL                                                     
                UPDATE R0                             
                SET    R0.CASE_STATUS_CD        = :R0-CASE-STATUS-CD    
                FROM CSS_REV_PROTEC_HDR R0
                WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        
                  AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     41695400
MFA-TR*         UPDATE CSS_REV_PROTEC_HDR R0                            41695500
MFA-TR*         SET    R0.CASE_STATUS_CD        = :R0-CASE-STATUS-CD    41695700
MFA-TR*         WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        41696000
MFA-TR*           AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  41696100
MFA-TR*         QUERYNO 8250                                                    
MFA-TR*    END-EXEC.                                                    41696300

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8250'                 TO ACTIVE-PARAGRAPH           
              MOVE 'UPDATE'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE R0-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 41697800
       8250-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************41698200
      *  8300-INSERT-FEE-DETAILS                                       *41698300
      ******************************************************************41698500
      *                                                                         
       8300-INSERT-FEE-DETAILS.                                         
      *                                                                         
           EXEC SQL                                                     
              INSERT INTO CSS_REV_PROTEC_DET                            
                    ( ACCOUNT_NO                                        
                    , REV_PROT_CASE_NO                                  
                    , CASE_SEQ_NO                                       
                    , CASE_TYPE_CD                                      
                    , RATE_PLAN_NO                                      
                    , CODE_REVENUE_CLASS                                
                    , CONSUMPT_TYPE_CD                                  
                    , NO_UNITS                                          
                    , COLLECTIBLE_UNITS                                 
                    , CASE_AM                                           
                    , COLLECTIBLE_AM                                    
                    , AMT_DOWN_PYMT                                     
                    , RECURR_REV_PCT                                    
                    , DFA_ITEM_ID                                       
                    , DFA_ITEM_ID_DP                                    
                    , GL_ACCT_NO)                                       
              VALUES (:RL-ACCOUNT-NO                                    
                    , :RL-REV-PROT-CASE-NO                              
                    , :RL-CASE-SEQ-NO                                   
                    , :RL-CASE-TYPE-CD                                  
                    , :RL-RATE-PLAN-NO                                  
                    , :RL-CODE-REVENUE-CLASS                            
                    , :RL-CONSUMPT-TYPE-CD                              
                    , :RL-NO-UNITS                                      
                    , :RL-COLLECTIBLE-UNITS                             
                    , :RL-CASE-AM                                       
                    , :RL-COLLECTIBLE-AM                                
                    , :RL-AMT-DOWN-PYMT                                 
                    , :RL-RECURR-REV-PCT                                
                    , :RL-DFA-ITEM-ID                                   
                    , :RL-DFA-ITEM-ID-DP                                
                    , :RL-GL-ACCT-NO)                                   
           END-EXEC.                                                    

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                                        
           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              CONTINUE                                                  
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8300'                 TO ACTIVE-PARAGRAPH           
              MOVE 'INSERT'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_DET'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE RL-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE RL-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 41697800
       8300-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************41698200
      *  8400-UPDATE-CASE-NOTES.                                       *41698300
      ******************************************************************41698500
      *                                                                         
       8400-UPDATE-CASE-NOTES.                                          
      *                                                                         
           EXEC SQL                                                     
                UPDATE R0                             
                SET    R0.CASE_NOTES            = :R0-CASE-NOTES        
                FROM CSS_REV_PROTEC_HDR R0
                WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        
                  AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ019
MFA-TR*    EXEC SQL                                                     41695400
MFA-TR*         UPDATE CSS_REV_PROTEC_HDR R0                            41695500
MFA-TR*         SET    R0.CASE_NOTES            = :R0-CASE-NOTES        41695700
MFA-TR*         WHERE  R0.ACCOUNT_NO            = :R0-ACCOUNT-NO        41696000
MFA-TR*           AND  R0.REV_PROT_CASE_NO      = :R0-REV-PROT-CASE-NO  41696100
MFA-TR*         QUERYNO 8400                                                    
MFA-TR*    END-EXEC.                                                    41696300

MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

           MOVE SQLCODE                   TO WS-ACTIVE-RETURN-CODE      
                                             S-RETURN-CODE.             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               CONTINUE                                                 
           ELSE                                                         
              MOVE PROGRAM-NAME           TO ABEND-PROGRAM              
              MOVE '8400'                 TO ACTIVE-PARAGRAPH           
              MOVE 'UPDATE'               TO ABEND-FUNCTION             
              MOVE SPACES                 TO ABEND-SQL-PREDICATES       
                                             ABEND-TABLES               
              MOVE 'CSS_REV_PROTEC_HDR'   TO TABLE-1                    
              MOVE 'ACCOUNT_NO'           TO TABLE-ELEMENT-1            
              MOVE 'REV_PROT_CASE_NO'     TO TABLE-ELEMENT-2            
              MOVE R0-ACCOUNT-NO          TO HOSTVAR-ELEMENT-1          
              MOVE R0-REV-PROT-CASE-NO    TO HOSTVAR-ELEMENT-2          
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                 41697800
       8400-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      ******************************************************************41710600
      *   9700-PROCESS-ABENDG / ABEND PROCESSING                       *41710700
      ******************************************************************41710800
      *                                                                 41705300
           EXEC SQL                                                     41708700
              INCLUDE CPD0023C                                          41708800
           END-EXEC.                                                    41708900
      *                                                                 41709000
      ******************************************************************41710600
      *       9900 - JOURNALING / ERROR HANDLING ROUTINE               *41710700
      ******************************************************************41710800
      *                                                                         
           EXEC SQL                                                             
              INCLUDE CPDSP300                                                  
           END-EXEC.                                                            
      *                                                                         
      ******************************************************************41710600
      *       END PROGRAM COPYLIB                                      *41710700
      ******************************************************************41710800
      *                                                                         
           EXEC SQL                                                             
              INCLUDE CPD00321                                                  
           END-EXEC.                                                            
      *                                                                         
      ******************************************************************41720000
