       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02313.                                         
COB303 DATE-WRITTEN.     JAN  29, 1996.                                 
       DATE-COMPILED.                                                   
                                                                        
CVT000******************************************************************00000100
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *00000200
CVT000*         S313 CONVERTED TO DB2 SP CSR02313 ON 10/25/2005        *00000300
CVT000*             -NOTE: AUTOMATED CONVERSION PROGRAM USED           *00000400
CVT000*                                                                *00000500
CVT000*                    CVT000 - CONVERTED CODE                     *00000501
CVT000*                    CVT004 - NEEDED REVIEW                      *00000502
CVT000*                    CVT999 - COMMENTED OUT CODE THAT CAN        *00000503
CVT000*                             POTENTIALLY BE DELETED             *00000510
CVT000*                                                                *00000520
CVT000******************************************************************00000600
      ******************************************************************        
      *                SOUTH CAROLINA ELECTRIC & GAS                   *        
      *                                                                *        
      *  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).   *        
      *                                                                *        
      *  TRANID:        S313                                           *        
      *  PROGRAM:       S313                                           *        
      *  CALLING SP:    PA_S313                                        *        
      *                                                                *        
      ******************************************************************        
      *                 P R O G R A M  S U M M A R Y                   *        
      *                                                                *        
      *  THIS PROGRAM IS A REMOTE PROCEDURE CALL MADE FROM             *        
      *  DESKTOP 2000 VIA THE SYBASE NETGATEWAY.                       *        
      *  THIS PROGRAM ACCEPTS DATA IN WINDOW OF PANEL 289 AND PANEL 293*        
      *  AND UPDATES CSS_PROJ_SHARE                                    *        
      ******************************************************************        
      *                                                                *        
      *                     PROGRAM MODIFICATION LOG                   *        
      *                                                                *        
      *    DATE    INITIALS   COMMENTS                                 *        
      *  --------  --------   ---------------------------------------  *        
      *  01/29/96     AG      PROGRAM INITIALLY WRITTEN                *        
      *  03/24/96    RSN      RETURN AR LOCKOUT INDICATOR              *        
      *  07/29/96    ALI      TPR#5016                                 *        
      *                       MODIFIED THE CODES TO CORRECT THE VALUE  *        
      *                       OF THE FIELD SHARE_ENROLL_DT             *        
TP3516*  08/20/96    ALI      ADDED A CONDITION FOR THE CHECKING OF    *        
TP3516*                       ACCOUNT STATUS IN THE PARA 2205-  &      *        
TP3516*                       RETURN ERROR MESSAGE IF FINAL/WRITE-OFF  *        
TP3516*                       PENDING/INACTIVE.                        *        
TP5240*  09/06/96    ELJ      CHANGED CODE IN PARGRAPH 2610-INSERT-AR- *        
TP5240*                       CNTL. INSTEAD OF CREATING CSS_AR_CNTL    *        
TP5240*                       DETAIL RECORD WITH THE PROJECT SHARE     *        
TP5240*                       AMOUNT IN THE AC-AMT-TRAN-BALANCE.       *        
TP5240*                       THE AC-AMT-TRAN-BALANCE SHOULD EQUAL 0.  *        
TP5430*  09/10/96    ELJ      CHANGED CODE SO THAT AMT-TRAM-BALANCE    *        
TP5430*                       IS UPDATED WITH THE PJ-MONTHLY-BILL-AM   *        
TP5240*                       WHEN PROJECT SHARE STATUS IS ONE TIME.   *        
TP5866*  11/05/96    SG       FIXED JOURNAL TRAN ID.                   *        
TP5746*  01/16/97    SLK      IF ACCOUNT HAS ONE TIME CONTRIBUTION     *        
TP5746*                       AND NOT PAID,RETURN MSG 'ACCOUNT ALREADY *        
TP5746*                       HAS PROJECT SHARE'.                      *        
TP8767*  02/05/97    JEP      ADDED REFERENCES TO CPD00309 & CWS00309  *        
TP8767*                       WHICH ARE USED TO CORRECTLY DETERMINE    *        
TP8767*                       THE NEXT BILL DATE.                      *        
T11379*  06/02/97    PP       CHANGED AR-CODE-TRAN-TYPE AND MADE IT AS *        
T11379*                       PER PCR404.                              *        
T11675*  06/17/97    PP       CORRECTED BILLED BALANCE FOR ONE-TIME PJS*        
T11675*                       PER TPR11675.                            *        
CBSI  *  12/19/98    CBSI     ABEND LOG MODIFIED TO INCLUDE ALL THE    *        
CBSI  *              MADRAS   ABEND PARAMETERS                         *        
T20213*  07/14/99    CBSI     CHANGED TO SET ONE TIME PJS ON PENDING   *        
T20213*              MADRAS   STATUS ACCOUNTS.                         *        
T21072*  11/03/99    CBSI     UPDATE CSS_ACCOUNT WITH LAST UPDATE TS   *        
T21072*              INDIA                                             *        
T21206*  01/25/2000  CBSI     CALL SUB ROUTINE SCSCA182 AND CHECK IF   *        
T21206*              MADRAS   THE PARM-LAST-UPDATE-TS AND THE ONE      *        
T21206*                       OBTAINED FROM THE SUB ROUTINE ARE SAME,  *        
T21206*                       IF THEY ARE SAME UPDATES AR_CNTL ELSE    *        
T21206*                       SENDS ERROR MSG TO THE PANEL             *        
      *  04/09/01    CHANELLE MCR310. CSS_GL_ACCT_NO CHANGES. RECOMPILE*        
      *                       FOR CPD00006.                            *        
REARCH*  10/27/05    CVNS     RPC TO COBOL SP CONVERSION               *        
REARCH*              CHENNAI                                           *        
T34828*  11/26/2006 JS83520   CHANGE TRANS HIST APPL PROGRAM ID FOR    *        
T34828*                       PSNC PROJECT SHARE TO HEAT CARE          *        
A00956*  03/26/09    CVNS     REPLACE CPD00006 WITH CPD0006A.          *        
A00956*              CHENNAI                                           *        
A03044*  03/10/2011 SP95538   WHEN ONE TIME CONTRIBUTION IS MADE PUT   *        
A03044*                       THE MONEY IN TOTAL_SUM_UNBILLED          *        
ACT131*  11/15/2012 VIJAY     ADD TOTAL_SUM_UNBILLED IN 8620-UPDATE-AC*         
ACT131*   A03967                                                       *        
P00758*  07/22/2013 RAJ       PROJECT SHARE MODERNIZATION.             *        
ACT253*  12/11/2015 MC95456   FIX TO ADD ONE TIME CONTRIBUTIONS FOR    *        
ACT253*  A05136-ACT253        2ND TIME.                                *        
ACT253*  12/18/2015 MC95456   UPDATE INIT_BY FIELD TO CSS_PROJ_SHARE   *        
ACT253*  A05136-ACT253                                                 *        
      ******************************************************************        
      ******************************************************************        
      *                                                                *        
      *                ---- BASIC SEQUENCE STRUCTURE ----              *        
      *                                                                *        
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION             *        
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                    *        
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                   *        
      *  3000 - 4999  NOT USED                                         *        
      *  5000 - 5999  COMMON PROGRAM MODULES                           *        
      *  6000 - 6999  COMMON SYSTEM MODULES                            *        
      *  7000 - 7999  INPUT MODULES                                    *        
      *  8000 - 8999  OUTPUT MODULES                                   *        
      *  9000 - 9999  TERMINATION,ABEND, MESSAGING MODULES             *        
      *                                                                *        
      ******************************************************************        
                                                                        
       ENVIRONMENT DIVISION.                                            
       DATA DIVISION.                                                   
       WORKING-STORAGE SECTION.                                         

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 'CSR02313'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-START                                   PIC X(40) VALUE   
REARCH     'WORKING STORAGE FOR CSR02313 STARTS HERE'.                  
                                                                        
      ******************************************************************        
      *    DB2 INCLUDES                                                *        
      ******************************************************************        
                                                                        
           EXEC SQL                                                             
              INCLUDE SQLCA                                                     
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBPRJSHR                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBMNHIST                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBMNHDT                                                   
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBARHIST                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBARHDT                                                   
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBARLOCK                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBCDCNTL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBCDJRNL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBUSRPRF                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBARCNTL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBACCT                                                    
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBGLATNO                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBBJCNTL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBBTJRNL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBMSJRNL                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE TBBILWDW                                                  
           END-EXEC.                                                            
                                                                        
T21206 COPY CWS00182.                                                           
                                                                        
      ******************************************************************        
      *    COBOL WORKING STORAGE COPY BOOKS                            *        
      ******************************************************************        
      *--------< SUPPORTS DB2 AND SQL ERROR CHECKING >                          
           EXEC SQL                                                             
              INCLUDE CWS00017                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
A00956        INCLUDE CWS0013B                                                  
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                             
              INCLUDE CWS00061                                                  
           END-EXEC.                                                            
                                                                        
TP8767     EXEC SQL                                                             
TP8767        INCLUDE CWS00309                                                  
TP8767     END-EXEC.                                                            
                                                                        
           COPY CWS00303.                                                       
                                                                        
           COPY CWS00056.                                                       
                                                                        
           COPY CJF00101.                                                       
                                                                        
      ******************************************************************        
      * WORKING STORAGE FOR JOURNALING                                 *        
      ******************************************************************        
       01  AR-TRANSACTION-STORAGE.                                      
           05  CURRENT-TIMESTAMP       PIC X(26).                       
           05  CURRENT-DATE            PIC X(10).                       
                                                                        
       01  WS-MISC.                                                     
           05 WS-YES                   PIC X(01) VALUE 'Y'.             
           05 WS-998                   PIC X(03) VALUE '998'.           
           05 CTR-ROWS                PIC S9(9) COMP VALUE 0.           
           05 WS-01                    PIC X(02) VALUE '01'.            
T21206     05 SCSCA182                 PIC X(08) VALUE 'SCSCA182'.      
REARCH     05 MCSCA182                 PIC X(08) VALUE 'MCSCA182'.      
T21206     05 WS-LAST-UPDATE-TS        PIC X(26).                       
           05 WS-CURRENT-TIMESTAMP     PIC X(26).                       
           05 WS-CURRENT-DATE          PIC X(10).                       
           05 WS-DATE-YYYY-MM-DD.                                       
              10 WS-YYYY               PIC X(04) VALUE SPACES.          
              10 FILLER                PIC X(01) VALUE SPACES.          
              10 WS-MM                 PIC X(02) VALUE SPACES.          
              10 FILLER                PIC X(01) VALUE SPACES.          
              10 WS-DD                 PIC X(02) VALUE SPACES.          
           05 WS-DATE-MM-DD-YYYY.                                       
              10 WS-DATE-MM            PIC X(02) VALUE SPACES.          
              10 FILLER                PIC X(01) VALUE '/'.             
              10 WS-DATE-DD            PIC X(02) VALUE SPACES.          
              10 FILLER                PIC X(01) VALUE '/'.             
              10 WS-DATE-YYYY          PIC X(04) VALUE SPACES.          
           05 WS-RESP-ARE-ID           PIC X(93) VALUE SPACES.          
           05 WS-DATE-EXTRACT          PIC X(10) VALUE SPACES.          
           05 WS-DONATION-AMT          PIC  X(13).                      
           05 WS-DONATION-AMT-NUM REDEFINES WS-DONATION-AMT             
                                       PIC  9(11)V99.                   
           05 WS-DONATION-AMT-COMP3    PIC S9(11)V99 COMP-3 VALUE 0.    
           05 WS-AR-CNTL-AMT           PIC S9(09)V99 COMP-3 VALUE 0.    
                                                                        
           05 WS-NULL-IND1             PIC S9(04) COMP.                 
           05 WS-NULL-IND2             PIC S9(04) COMP.                 
           05 WS-NULL-IND3             PIC S9(04) COMP.                 
           05 WS-USER-ID               PIC X(07) VALUE SPACES.          
           05 WS-RESP-AREA-ID          PIC X(03) VALUE SPACES.          
           05 WS-CUSTOMER-NO           PIC S9(10)V COMP-3 VALUE 0.      
TP8767     05  REFORMAT-DATE.                                           
TP8767         10  WS-FORMAT-YEAR      PIC X(04).                       
TP8767         10  FILLER              PIC X(01).                       
TP8767         10  WS-FORMAT-MONTH     PIC X(02).                       
TP8767         10  FILLER              PIC X(01).                       
TP8767         10  WS-FORMAT-DAY       PIC X(02).                       
TP8767     05  USA-DATE-FORMAT.                                         
TP8767         10  USA-MONTH           PIC X(02).                       
TP8767         10  FILLER              PIC X(01) VALUE '/'.             
TP8767         10  USA-DAY             PIC X(02).                       
TP8767         10  FILLER              PIC X(01) VALUE '/'.             
TP8767         10  USA-YEAR            PIC X(04).                       
                                                                        
      * WS-CASH-DRAWER CHANGED FOR FCS CHANGES                                  
           05  WS-CASH-DRAWER.                                          
               10  WS-COMPANY           PIC  X(02) VALUE SPACES.        
               10  WS-LOC-OFF           PIC  X(03) VALUE SPACES.        
               10  WS-REPORT-NO         PIC  X(02) VALUE SPACES.        
               10  WS-REPORT-DT         PIC  X(10) VALUE SPACES.        
               10  WS-CASH-DRWR         PIC  S9(04) COMP VALUE 0.       
                                                                        
           05 WS-PREV-COL-VALUES.                                       
              10 WS-PREV-ACCOUNT-NO      PIC S9(13)V COMP-3 VALUE 0.    
              10 WS-PREV-START-ENRL-DATE PIC X(10).                     
              10 WS-PREV-INACTIVE-DATE   PIC X(10).                     
              10 WS-PREV-DONATION-AMT    PIC S9(11)V9(2) COMP-3 VALUE 0.
              10 WS-PREV-CURRENT-STATUS  PIC X(01).                     
                                                                        
           05 WS-NEW-COL-VALUES.                                        
              10 WS-NEW-ACCOUNT-NO       PIC S9(13)V COMP-3 VALUE 0.    
              10 WS-NEW-START-ENRL-DATE  PIC X(10).                     
              10 WS-NEW-INACTIVE-DATE    PIC X(10).                     
              10 WS-NEW-DONATION-AMT     PIC S9(11)V9(2) COMP-3 VALUE 0.
              10 WS-NEW-CURRENT-STATUS   PIC X(01).                     
                                                                        
           05 WS-MONTHLY-BILL-AM-NUM   PIC $$$$$$$$9.99.                
           05 WS-MONTHLY-BILL-AM-CHAR  PIC X(13) JUSTIFIED.             
TP3516     05 WS-ACCT-EXIST-MSG        PIC X(34)                        
TP3516                   VALUE 'ACCOUNT ALREADY HAS PROJECT SHARE.'.    
TP3516     05 WS-FNL-INACT-WOFF-MSG    PIC X(53) VALUE                  
TP3516         'CANNOT SETUP A PROJECT SHARE ON THIS TYPE OF ACCOUNT.'. 
                                                                        
TP5746     05 WS-CNTL-EXISTS          PIC X(01) VALUE 'N'.              
                                                                        
           05 WS-ACCT-XFER-MSG.                                         
              10  WS-ACCOUNT-TEXT      PIC X(08) VALUE 'ACCOUNT '.      
              10  WS-FROM-ACCOUNT      PIC X(13) VALUE SPACES.          
              10  WS-XFER-TEXT         PIC X(15) VALUE                  
                                       ' TRANSFERED TO '.               
              10  WS-TO-ACCOUNT        PIC X(13) VALUE SPACES.          
           05 WS-ACCT-NOT-FOUND-MSG.                                    
              10  WS-ACCOUNT-TEXT      PIC X(08) VALUE 'ACCOUNT '.      
              10  WS-NOT-FOUND-ACCOUNT PIC X(13) VALUE SPACES.          
              10  WS-NOT-FOUND-TEXT    PIC X(15) VALUE                  
                                       ' NOT FOUND.'.                   
           05 WS-TRAN-APPL-NO          PIC S9(04)  COMP   VALUE 0.      
           05 WS-TRAN-COMMENT-LEN      PIC 9(04)  VALUE 0.              
           05 WS-TRAN-COMMENT-LEN-NUM  PIC S9(04) COMP VALUE 0.         
           05 WS-TRAN-COMMENT-TEXT     PIC X(210).                      
REARCH     05 PROGRAM-NAME             PIC X(8)  VALUE 'CSR02313'.      
REARCH     05 EIBTRNID                 PIC X(04) VALUE 'S313'.          
CBSI       05 WS-TOTAL-AR-BALANCE-ED   PIC -Z(10)9.9(2).                
CBSI       05 WS-GL-ACCT-CREDIT-ED     PIC -Z(02)9.9(4).                
CBSI       05 WS-GL-ACCT-DEBIT-ED      PIC -Z(02)9.9(4).                
CBSI       05 WS-AMT-AR-DAY-00-ED      PIC -Z(08)9.9(2).                
CBSI       05 WS-AMT-UNUSED-CR-ED      PIC -Z(08)9.9(2).                
CBSI       05 WS-AMT-TRAN-BALANCE-ED   PIC -Z(08)9.9(2).                
                                                                        
       01  SWITCHES.                                                    
           05  WS-MST-SUB-ACCT-IND     PIC X(01) VALUE SPACES.          
               88 MASTER-ACCOUNT                 VALUE 'M'.             
           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'.             
                                                                        
HPCCDM*    EJECT                                                        00096000
                                                                        
       01  FILLER                      PIC X(11) VALUE 'PARM FIELDS'.   
                                                                        
       01  PARM-FIELDS.                                                 
           05  PARM-L                     PIC S9(9) COMP.               
           05  PARM-ACCOUNT-NO            PIC X(13).                    
           05  PARM-START-ENRL-DATE       PIC X(10).                    
           05  PARM-INACTIVE-DATE         PIC X(10).                    
           05  PARM-CURRENT-STATUS        PIC X(01).                    
           05  PARM-DONATION-AMT          PIC X(13).                    
           05  PARM-USER-ID               PIC X(07).                    
           05  PARM-UPD-INS-IND           PIC X(01).                    
           05  PARM-PANEL-NO              PIC X(08).                    
           05  PARM-TRAN-COMMENT-LEN      PIC X(04).                    
           05  PARM-TRAN-COMMENT-TEXT     PIC X(210).                   
T21206     05  PARM-LAST-UPDATE-TS        PIC X(26).                    
                                                                        
       01  TDS-RETURN-FIELDS.                                           
           05  RS-RETURN-CODE           PIC S9(9) COMP VALUE 0.         
           05  RS-ERROR-MESSAGE         PIC X(05) VALUE 'NOERR'.        
           05  RS-ERROR-TEXT            PIC X(53) VALUE SPACES.         
           05  RS-AR-LOCKOUT-IND        PIC X(01) VALUE SPACES.         
                                                                        
REARCH 01  GTT-RETURN-FIELDS.                                           
REARCH     05  S-RETURN-CODE            PIC S9(9) COMP VALUE 0.         
REARCH     05  S-ERROR-MESSAGE          PIC X(05) VALUE 'NOERR'.        
REARCH     05  S-ERROR-TEXT             PIC X(53) VALUE SPACES.         
REARCH     05  S-AR-LOCKOUT-IND         PIC X(01) VALUE SPACES.         
                                                                        
       01  FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.      
                                                                        
                                                                        
                                                                        
CVT000     EXEC SQL                                                     00000010
CVT000         INCLUDE CWSX0010                                         00000020
CVT000     END-EXEC.                                                    00000030
CVT000                                                                  
CVT000 01  CSRERLOG-P.                                                  
CVT000     10  S-SP-NAME                 PIC X(18) VALUE SPACES.        
CVT000     10  S-SQLCODE                 PIC S9(9) COMP VALUE 0.        
CVT000     10  S-SQLSTATE                PIC X(5)  VALUE ' '.           
CVT000     10  S-TABLE-NAME              PIC X(18) VALUE SPACES.        
CVT000     10  S-HOST-VARIABLES.                                        
CVT000         49  S-HOST-VARIABLES-L    PIC S9(4) USAGE COMP.          
CVT000         49  S-HOST-VARIABLES-V    PIC X(255).                    
CVT000     10  S-SQL-STATEMENT.                                         
CVT000         49  S-SQL-STATEMENT-L     PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-STATEMENT-V     PIC X(255).                    
CVT000     10  S-SQL-DESCRIPTION.                                       
CVT000         49  S-SQL-DESCRIPTION-L   PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-DESCRIPTION-V   PIC X(255).                    
CVT000     10  WS-ABEND-SQLERRMC.                                       
CVT000         49  WS-ABEND-SQLERRMC-L   PIC S9(4) USAGE COMP.          
CVT000         49  WS-ABEND-SQLERRMC-V   PIC X(255).                    
CVT000     10  WS-SQLSTATE               PIC X(05) VALUE SPACES.        
CVT000                                                                  
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-ACCOUNT-NO          PIC X(13)                .          
CVT000 01  LINK-START-ENRL-DATE     PIC X(10)                .          
CVT000 01  LINK-INACTIVE-DATE       PIC X(10)                .          
CVT000 01  LINK-CURRENT-STATUS      PIC X(01)                .          
CVT000 01  LINK-DONATION-AMT        PIC X(13)                .          
CVT000 01  LINK-USER-ID             PIC X(07)                .          
CVT000 01  LINK-UPD-INS-IND         PIC X(01)                .          
CVT000 01  LINK-PANEL-NO            PIC X(08)                .          
CVT000 01  LINK-TRAN-COMMENT-LEN    PIC X(04)                .          
CVT000 01  LINK-TRAN-COMMENT-TEXT   PIC X(210)               .          
CVT000 01  LINK-LAST-UPDATE-TS      PIC X(26)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-ACCOUNT-NO                                         
CVT000         ,LINK-START-ENRL-DATE                                    
CVT000         ,LINK-INACTIVE-DATE                                      
CVT000         ,LINK-CURRENT-STATUS                                     
CVT000         ,LINK-DONATION-AMT                                       
CVT000         ,LINK-USER-ID                                            
CVT000         ,LINK-UPD-INS-IND                                        
CVT000         ,LINK-PANEL-NO                                           
CVT000         ,LINK-TRAN-COMMENT-LEN                                   
CVT000         ,LINK-TRAN-COMMENT-TEXT                                  
CVT000         ,LINK-LAST-UPDATE-TS                                     
CVT000         .                                                        
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLWARNING                                      
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLERROR                                        
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER NOT FOUND                                       
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT999*PROCEDURE DIVISION.                                                      
                                                                        
      ******************************************************************        
      * 0000-MAINLINE                                                  *        
      *     CALLS 0100-INITIALIZE                                      *        
      *           1000-PROCESS-INPUT                                   *        
      *           2000-PROCESS-OUTPUT                                  *        
      *           9999-END-PROGRAM                                     *        
      *                                                                *        
      *     CONTROLS THE MAIN PATH OF THE PROGRAM                      *        
      ******************************************************************        
       0000-MAINLINE.                                                   
                                                                        
           PERFORM 0100-INITIALIZE     THRU 0100-EXIT.                  
           PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT.                  
           PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT.                  
           PERFORM 9999-END-PROGRAM    THRU 9999-EXIT.                  
                                                                        
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 0100-INITIALIZE                                                *        
      *     CALLS 9000-SEND-ERROR-RESULT                               *        
      *           9900-SQL-ERROR-ROUTINE                               *        
      *                                                                *        
      *     CALLED FROM 0000-MAINLINE                                  *        
      *                                                                *        
      *     1. RESET DB2 ERROR HANDLERS                                *        
      *     2. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *        
      *     3. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *        
      *     4. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*        
      *                                                                *        
      ******************************************************************        
       0100-INITIALIZE.                                                 
                                                                        
           MOVE '0100'                  TO ACTIVE-PARAGRAPH.            
                                                                        
CVT000     EXEC SQL                                                     
CVT000       DECLARE C1 CURSOR  FOR                          
CVT000       SELECT                                                     
CVT000        :S-RETURN-CODE              AS    RETURN_CODE             
CVT000       ,:S-AR-LOCKOUT-IND           AS    AR_LOCKOUT_IND          
CVT000       ,:S-ERROR-MESSAGE            AS    ERROR_MESSAGE           
CVT000       ,LTRIM(RTRIM(:S-ERROR-TEXT))        AS    ERROR_TEXT              
CVT000          FROM CIS.SYSDUMMY1                                   
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ027
MFA-TR* MSQ029
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*      ,:S-AR-LOCKOUT-IND           AS    AR_LOCKOUT_IND                  
MFA-TR*      ,:S-ERROR-MESSAGE            AS    ERROR_MESSAGE                   
MFA-TR*      ,STRIP(:S-ERROR-TEXT)        AS    ERROR_TEXT                      
MFA-TR*         FROM SYSIBM.SYSDUMMY1                                           
MFA-TR*    END-EXEC.                                                            
CVT000     MOVE LINK-ACCOUNT-NO           TO PARM-ACCOUNT-NO          . 
CVT000     MOVE LINK-START-ENRL-DATE      TO PARM-START-ENRL-DATE     . 
CVT000     MOVE LINK-INACTIVE-DATE        TO PARM-INACTIVE-DATE       . 
CVT000     MOVE LINK-CURRENT-STATUS       TO PARM-CURRENT-STATUS      . 
CVT000     MOVE LINK-DONATION-AMT         TO PARM-DONATION-AMT        . 
CVT000     MOVE LINK-USER-ID              TO PARM-USER-ID             . 
CVT000     MOVE LINK-UPD-INS-IND          TO PARM-UPD-INS-IND         . 
CVT000     MOVE LINK-PANEL-NO             TO PARM-PANEL-NO            . 
CVT000     MOVE LINK-TRAN-COMMENT-LEN     TO PARM-TRAN-COMMENT-LEN    . 
CVT000     MOVE LINK-TRAN-COMMENT-TEXT    TO PARM-TRAN-COMMENT-TEXT   . 
CVT000     MOVE LINK-LAST-UPDATE-TS       TO PARM-LAST-UPDATE-TS      . 
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 1000-PROCESS-INPUT                                             *        
      *                                                                *        
      *     CALLED FROM 0000-MAINLINE                                  *        
      *                                                                *        
      *     1. RECEIVE PARMS.                                          *        
      ******************************************************************        
       1000-PROCESS-INPUT.                                              
                                                                        
T21206     INITIALIZE SCSCA182-LINK-RECORD                              
           MOVE PARM-ACCOUNT-NO         TO PJ-ACCOUNT-NO                
T21206                                     SCSCA182-ACCOUNT-NO          
           MOVE PARM-START-ENRL-DATE    TO PJ-SHARE-ENROLL-DT           
           MOVE PARM-INACTIVE-DATE      TO PJ-ACCT-TERM-DT              
ACT253     MOVE PARM-USER-ID            TO PJ-INIT-BY                   
                                                                        
           MOVE PARM-DONATION-AMT       TO WS-DONATION-AMT              
           MOVE WS-DONATION-AMT-NUM     TO WS-DONATION-AMT-COMP3        
           MOVE WS-DONATION-AMT-COMP3   TO PJ-MONTHLY-BILL-AM           
                                                                        
           MOVE PARM-CURRENT-STATUS     TO PJ-SHARE-STATUS-CD           
                                                                        
           MOVE PJ-ACCOUNT-NO           TO WS-NEW-ACCOUNT-NO            
           MOVE PJ-SHARE-ENROLL-DT      TO WS-NEW-START-ENRL-DATE       
           MOVE PJ-ACCT-TERM-DT         TO WS-NEW-INACTIVE-DATE         
           MOVE PJ-MONTHLY-BILL-AM      TO WS-NEW-DONATION-AMT          
           MOVE PJ-SHARE-STATUS-CD      TO WS-NEW-CURRENT-STATUS.       
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2000-PROCESS-OUTPUT.                                           *        
      *     CALLS 2200-BUILD-RESULT                                    *        
      *     CALLED FROM 0000-MAINLINE                                 *         
      *                                                                *        
      *      SETS UP PARAMETERS TO BE RETURNED, POPULATES THE PARMS    *        
      *      AND SENDS THEM BACK                                       *        
      ******************************************************************        
       2000-PROCESS-OUTPUT.                                             
                                                                        
           MOVE '2000'                           TO ACTIVE-PARAGRAPH.   
P00758     IF  PARM-PANEL-NO = 'PANEL289' OR 'CISMDPJS'                 
T21206         PERFORM 9200-LINK-SCSCA182        THRU 9200-EXIT         
T21206                                                                  
T21206         IF  SCSCA182-RETURN-CODE NOT EQUAL ZERO                  
REARCH*            MOVE ABEND-FILE-LK            TO ABEND-FILE                  
T21206             MOVE PROGRAM-NAME             TO ABEND-PROGRAM       
T21206             MOVE SCSCA182-RETURN-CODE     TO                     
T21206                                           WS-ACTIVE-RETURN-CODE  
T21206                                           SQLCODE                
REARCH             PERFORM 2000A-MOVE-RESULT    THRU 2000A-EXIT         
REARCH             PERFORM 8100-SEND-RESULT     THRU 8100-EXIT          
T21206             PERFORM 9000-SEND-ERROR-RESULT                       
T21206                                           THRU 9000-EXIT         
T21206             PERFORM 9900-SQL-ERROR-ROUTINE                       
T21206                                           THRU 9900-EXIT         
T21206         ELSE                                                     
T21206             MOVE SCSCA182-LAST-UPDATE-TS  TO WS-LAST-UPDATE-TS   
T21206             IF  PARM-LAST-UPDATE-TS = WS-LAST-UPDATE-TS          
T21206                 NEXT SENTENCE                                    
T21206             ELSE                                                 
T21206                 MOVE 5272                 TO RS-RETURN-CODE      
REARCH                 PERFORM 2000A-MOVE-RESULT THRU 2000A-EXIT        
T21206                 PERFORM 8100-SEND-RESULT  THRU 8100-EXIT         
T21206                 GO                        TO 2000-EXIT           
T21206             END-IF                                               
T21206         END-IF                                                   
T21206     END-IF.                                                      
T21206*                                                                         
           PERFORM 2200-PROCESS-BEGIN            THRU 2200-EXIT.        
                                                                        
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
REARCH*****************************************************************         
REARCH* 2000A-MOVE-RESULT.                                            *         
REARCH*****************************************************************         
REARCH 2000A-MOVE-RESULT.                                               
REARCH*                                                                         
REARCH     MOVE  RS-RETURN-CODE          TO S-RETURN-CODE.              
REARCH     MOVE  RS-ERROR-MESSAGE        TO S-ERROR-MESSAGE.            
REARCH     MOVE  RS-ERROR-TEXT           TO S-ERROR-TEXT.               
REARCH     MOVE  RS-AR-LOCKOUT-IND       TO S-AR-LOCKOUT-IND.           
REARCH*                                                                         
REARCH 2000A-EXIT.                                                      
REARCH     EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2200-PROCESS-BEGIN                                             *        
      *                                                                *        
      *     CALLED FROM 2000-PROCESS-OUTPUT                            *        
      *                                                                *        
      *     BUILD THE RESULT SET DESCRIBED ABOVE.                      *        
      ******************************************************************        
       2200-PROCESS-BEGIN.                                              
                                                                        
           PERFORM 7999-SELECT-AL           THRU 7999-SELECT-AL-EXIT.   
           MOVE AL-AR-LOCKOUT-IND           TO RS-AR-LOCKOUT-IND.       
                                                                        
           IF RS-AR-LOCKOUT-IND = 'Y'                                   
REARCH        PERFORM 2000A-MOVE-RESULT     THRU 2000A-EXIT             
              PERFORM 8100-SEND-RESULT      THRU 8100-EXIT              
              PERFORM 9999-END-PROGRAM      THRU 9999-EXIT              
           ELSE                                                         
               MOVE '2200'                  TO ACTIVE-PARAGRAPH         
                                                                        
               MOVE PARM-ACCOUNT-NO         TO PJ-ACCOUNT-NO            
               MOVE PARM-START-ENRL-DATE    TO PJ-SHARE-ENROLL-DT       
               MOVE PARM-INACTIVE-DATE      TO PJ-ACCT-TERM-DT          
               MOVE 1                       TO PJ-ITEM-ID               
               MOVE 129                     TO PJ-PYMT-PRIORITY-LVL     
                                                                        
               MOVE PARM-DONATION-AMT       TO WS-DONATION-AMT          
               MOVE WS-DONATION-AMT-NUM     TO WS-DONATION-AMT-COMP3    
               MOVE WS-DONATION-AMT-COMP3   TO PJ-MONTHLY-BILL-AM       
                                                                        
               MOVE PARM-CURRENT-STATUS     TO PJ-SHARE-STATUS-CD       
               MOVE PARM-USER-ID            TO PF-USER-ID               
               MOVE PARM-TRAN-COMMENT-LEN   TO WS-TRAN-COMMENT-LEN      
               MOVE PARM-TRAN-COMMENT-TEXT  TO WS-TRAN-COMMENT-TEXT     
                                                                        
               MOVE PJ-ACCOUNT-NO           TO WS-NEW-ACCOUNT-NO        
               MOVE PJ-SHARE-ENROLL-DT      TO WS-NEW-START-ENRL-DATE   
               MOVE PJ-ACCT-TERM-DT         TO WS-NEW-INACTIVE-DATE     
               MOVE PJ-MONTHLY-BILL-AM      TO WS-NEW-DONATION-AMT      
               MOVE PJ-SHARE-STATUS-CD      TO WS-NEW-CURRENT-STATUS    
                                                                        
C34828         MOVE PJ-ACCOUNT-NO           TO AT-ACCOUNT-NO            
C34828         PERFORM 7523-SELECT-COMPANY  THRU 7523-EXIT              
                                                                        
               PERFORM 5400-JRNL-TRAN-HEAD  THRU  5400-EXIT             
           END-IF.                                                      
                                                                        
      * UPDATE                                                                  
                                                                        
           IF PARM-UPD-INS-IND = 'U'                                    
              PERFORM 7110-SELECT-PJ-ROW   THRU 7110-EXIT               
                                                                        
              MOVE PJ-ACCOUNT-NO           TO WS-PREV-ACCOUNT-NO        
              MOVE PJ-SHARE-ENROLL-DT      TO WS-PREV-START-ENRL-DATE   
              MOVE PJ-ACCT-TERM-DT         TO WS-PREV-INACTIVE-DATE     
              MOVE PJ-MONTHLY-BILL-AM      TO WS-PREV-DONATION-AMT      
              MOVE PJ-SHARE-STATUS-CD      TO WS-PREV-CURRENT-STATUS    
                                                                        
              MOVE WS-NEW-ACCOUNT-NO       TO PJ-ACCOUNT-NO             
              MOVE WS-NEW-START-ENRL-DATE  TO PJ-SHARE-ENROLL-DT        
              MOVE WS-NEW-INACTIVE-DATE    TO PJ-ACCT-TERM-DT           
              MOVE WS-NEW-DONATION-AMT     TO PJ-MONTHLY-BILL-AM        
              MOVE WS-NEW-CURRENT-STATUS   TO PJ-SHARE-STATUS-CD        
           END-IF                                                       
                                                                        
           PERFORM 2205-PROCESS            THRU 2205-EXIT               
                                                                        
REARCH     PERFORM 2000A-MOVE-RESULT       THRU 2000A-EXIT.             
           PERFORM 8100-SEND-RESULT        THRU 8100-EXIT.              
                                                                        
       2200-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2205-PROCESS                                                  *         
      *                                                                *        
      *     CALLED FROM 2200-PROCESS-BEGIN                             *        
      *                                                                *        
      ******************************************************************        
       2205-PROCESS.                                                    
                                                                        
           MOVE '2205'                         TO ACTIVE-PARAGRAPH.     
                                                                        
      * PROCESSING FOR UPDATE                                                   
           IF PARM-UPD-INS-IND = 'U'                                    
              PERFORM 2500-UPDATE              THRU 2500-EXIT           
           END-IF                                                       
                                                                        
      * PROCESSING FOR INSERT                                                   
           IF PARM-UPD-INS-IND = 'I'                                    
              MOVE PJ-ACCOUNT-NO               TO AT-ACCOUNT-NO         
              PERFORM 7521-SELECT-AT           THRU 7521-EXIT           
                                                                        
              IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL            
                 IF AT-AR-XFER-IND = 'Y'                                
                    MOVE AT-ACCOUNT-NO         TO WS-FROM-ACCOUNT       
                    MOVE AT-ACCT-XFER-TO       TO WS-TO-ACCOUNT         
                    MOVE WS-ACCT-XFER-MSG      TO RS-ERROR-TEXT         
REARCH              PERFORM 2000A-MOVE-RESULT  THRU 2000A-EXIT          
                    PERFORM 8100-SEND-RESULT   THRU 8100-EXIT           
                    PERFORM 9999-END-PROGRAM   THRU 9999-EXIT           
                 END-IF                                                 
                                                                        
TP3516           IF AT-CODE-ACCT-STAT = 'S' OR                          
TP3516              AT-CODE-ACCT-STAT = 'J' OR                          
TP3516              AT-CODE-ACCT-STAT = 'B'                             
T20213*             AT-CODE-ACCT-STAT = 'P'                                     
TP3516              MOVE WS-FNL-INACT-WOFF-MSG  TO RS-ERROR-TEXT        
REARCH              PERFORM 2000A-MOVE-RESULT   THRU 2000A-EXIT         
TP3516              PERFORM 8100-SEND-RESULT    THRU 8100-EXIT          
TP3516              PERFORM 9999-END-PROGRAM    THRU 9999-EXIT          
TP3516           END-IF                                                 
                                                                        
TP5746           PERFORM 2515-AR-CNTL-CHECK     THRU 2515-EXIT          
                                                                        
TP5746           IF WS-CNTL-EXISTS = 'Y' THEN                           
TP5746               MOVE WS-ACCT-EXIST-MSG     TO RS-ERROR-TEXT        
REARCH               PERFORM 2000A-MOVE-RESULT  THRU 2000A-EXIT         
TP5746               PERFORM 8100-SEND-RESULT   THRU 8100-EXIT          
TP5746               PERFORM 9999-END-PROGRAM   THRU 9999-EXIT          
TP5746           END-IF                                                 
                                                                        
                 MOVE AT-CODES-DATA-PRESENT     TO WS-CODES-DATA-PRESENT
                 MOVE 'A'                       TO WS-CODE-PROJECT-SHARE
                 MOVE WS-CODES-DATA-PRESENT     TO AT-CODES-DATA-PRESENT
T21072           PERFORM 7800-SELECT-TIMESTAMP  THRU 7800-EXIT          
T21072           MOVE WS-CURRENT-TIMESTAMP      TO AT-LAST-UPDATE-TS    
                 PERFORM 8521-UPDATE-ACCOUNT    THRU 8521-EXIT          
                                                                        
                 PERFORM 2600-INSERT            THRU 2600-EXIT          
              ELSE                                                      
                 MOVE PARM-ACCOUNT-NO           TO WS-NOT-FOUND-ACCOUNT 
                 MOVE WS-ACCT-NOT-FOUND-MSG     TO RS-ERROR-TEXT        
REARCH           PERFORM 2000A-MOVE-RESULT      THRU 2000A-EXIT         
                 PERFORM 8100-SEND-RESULT       THRU 8100-EXIT          
                 PERFORM 9999-END-PROGRAM       THRU 9999-EXIT          
              END-IF                                                    
           END-IF                                                       
                                                                        
           PERFORM 5500-JRNL-UPDATE             THRU 5500-EXIT.         
                                                                        
       2205-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2500-UPDATE                                                    *        
      *                                                                *        
      *     CALLED FROM 2205-PROCESS                                   *        
      *                                                                *        
      ******************************************************************        
       2500-UPDATE.                                                     
                                                                        
           MOVE '2500'                            TO ACTIVE-PARAGRAPH.  
                                                                        
                                                                        
      * PROCESSING FOR INACTIVE STATUS                                          
              IF PJ-SHARE-STATUS-CD = 'I'                               
                 MOVE WS-CURRENT-DATE             TO PJ-ACCT-TERM-DT    
                                                   WS-NEW-INACTIVE-DATE 
              END-IF                                                    
                                                                        
      * PROCESSING FOR ACTIVE STATUS                                            
              IF PJ-SHARE-STATUS-CD = 'A'                               
                 MOVE -1                        TO WS-NULL-IND3         
                 MOVE SPACES                    TO WS-NEW-INACTIVE-DATE 
                                                   PJ-ACCT-TERM-DT      
                 MOVE PJ-ACCOUNT-NO             TO AC-ACCOUNT-NO        
                 MOVE 129                       TO AC-PYMT-PRIORITY-LVL 
                 MOVE 0                         TO AC-ITEM-ID           
                                                                        
                 PERFORM 7511-SELECT-AC         THRU 7511-EXIT          
                 IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                   
                    PERFORM 2610-INSERT-AR-CNTL THRU 2610-EXIT          
                 END-IF                                                 
                                                                        
                 MOVE PJ-ACCOUNT-NO             TO AT-ACCOUNT-NO        
                 PERFORM 7521-SELECT-AT         THRU 7521-EXIT          
                                                                        
                 MOVE AT-CODES-DATA-PRESENT     TO WS-CODES-DATA-PRESENT
                 MOVE 'A'                       TO WS-CODE-PROJECT-SHARE
                 MOVE WS-CODES-DATA-PRESENT     TO AT-CODES-DATA-PRESENT
                                                                        
T21072           PERFORM 7800-SELECT-TIMESTAMP  THRU 7800-EXIT          
T21072           MOVE WS-CURRENT-TIMESTAMP      TO AT-LAST-UPDATE-TS    
                 PERFORM 8521-UPDATE-ACCOUNT    THRU 8521-EXIT          
              END-IF                                                    
                                                                        
      * PROCESSING FOR ONE TIME CONTRIBUTION STATUS                             
              IF PJ-SHARE-STATUS-CD = 'O'                               
                 MOVE WS-CURRENT-DATE           TO PJ-ACCT-TERM-DT      
                                                   WS-NEW-INACTIVE-DATE 
                                                                        
                 MOVE PJ-ACCOUNT-NO             TO AC-ACCOUNT-NO        
                 MOVE 129                       TO AC-PYMT-PRIORITY-LVL 
                 MOVE 0                         TO AC-ITEM-ID           
                                                                        
                 PERFORM 7511-SELECT-AC         THRU 7511-EXIT          
                                                                        
                 IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                   
                    PERFORM 2610-INSERT-AR-CNTL THRU 2610-EXIT          
                 ELSE                                                   
                    PERFORM 2620-UPDATE-AR-CNTL THRU 2620-EXIT          
                 END-IF                                                 
                                                                        
                 MOVE PJ-ACCOUNT-NO             TO AT-ACCOUNT-NO        
                 PERFORM 7521-SELECT-AT         THRU 7521-EXIT          
                                                                        
                 MOVE AT-CODES-DATA-PRESENT     TO WS-CODES-DATA-PRESENT
                 MOVE 'A'                       TO WS-CODE-PROJECT-SHARE
                 MOVE WS-CODES-DATA-PRESENT     TO AT-CODES-DATA-PRESENT
                                                                        
T21072           PERFORM 7800-SELECT-TIMESTAMP  THRU 7800-EXIT          
T21072           MOVE WS-CURRENT-TIMESTAMP      TO AT-LAST-UPDATE-TS    
                 PERFORM 8521-UPDATE-ACCOUNT    THRU 8521-EXIT          
                                                                        
                 PERFORM 2700-PROCESS-CASH      THRU 2700-EXIT          
                                                                        
                 IF PJ-MONTHLY-BILL-AM > 0                              
                    PERFORM 2520-PROCESS-AR-HIST  THRU 2520-EXIT        
                 END-IF                                                 
ACT253        END-IF.                                                   
                                                                        
           IF PJ-ACCT-TERM-DT EQUAL SPACES                              
              MOVE -1                   TO WS-NULL-IND3                 
              MOVE SPACES               TO WS-NEW-INACTIVE-DATE         
           END-IF                                                       
           PERFORM 8500-UPDATE-PJ       THRU 8500-EXIT.                 
                                                                        
       2500-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2515-AR-CNTL-CHECK                                             *        
      *                                                                *        
      *     CALLED FROM 2505                                           *        
      *                                                                *        
      ******************************************************************        
TP5746 2515-AR-CNTL-CHECK.                                              
                                                                        
TP5746     EXEC SQL                                                     
TP5746        SELECT 'Y'                                                
TP5746          INTO :WS-CNTL-EXISTS                                    
TP5746          FROM CSS_AR_CNTL WITH(READUNCOMMITTED)                          
TP5746         WHERE ACCOUNT_NO        = :PJ-ACCOUNT-NO                 
TP5746           AND PYMT_PRIORITY_LVL = 129                            
TP5746           AND ITEM_ID           = 1                              
P00758                                                           
P00758                                                      
TP5746     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT 'Y'                                                        
MFA-TR*         INTO :WS-CNTL-EXISTS                                            
MFA-TR*         FROM CSS_AR_CNTL                                                
MFA-TR*        WHERE ACCOUNT_NO        = :PJ-ACCOUNT-NO                         
MFA-TR*          AND PYMT_PRIORITY_LVL = 129                                    
MFA-TR*          AND ITEM_ID           = 1                                      
MFA-TR*          WITH UR                                                        
MFA-TR*          QUERYNO 2515                                                   
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

                                                                        
TP5746     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
TP5746     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
TP5746        NEXT SENTENCE                                             
TP5746     ELSE                                                         
TP5746        MOVE SQLCODE                    TO RS-RETURN-CODE         
TP5746        MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
TP5746        MOVE '2515'                     TO ACTIVE-PARAGRAPH       
TP5746        MOVE 'SELECT'                   TO ABEND-FUNCTION         
TP5746        MOVE 'CSS_AR_CNTL'              TO TABLE-1                
TP5746        MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
TP5746        MOVE PJ-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
TP5746        MOVE 'PYMT_PRIORITY_LVL'        TO TABLE-ELEMENT-2        
TP5746        MOVE '129'                      TO HOSTVAR-ELEMENT-2      
TP5746        MOVE 'ITEM_ID'                  TO TABLE-ELEMENT-3        
TP5746        MOVE '1'                        TO HOSTVAR-ELEMENT-3      
TP5746        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
TP5746        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
TP5746     END-IF.                                                      
                                                                        
TP5746 2515-EXIT.                                                       
TP5746     EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2520-PROCESS-AR-HIST                                           *        
      *                                                                *        
      *     CALLED FROM 2500-UPDATE                                    *        
      *                                                                *        
      ******************************************************************        
       2520-PROCESS-AR-HIST.                                            
                                                                        
           MOVE '2520'                           TO ACTIVE-PARAGRAPH.   
                                                                        
           IF PJ-SHARE-STATUS-CD = 'I'                                  
              PERFORM 2521-POP-AR-VARS           THRU 2521-EXIT         
           ELSE                                                         
              PERFORM 2521A-POP-ONE-TIME-AR-VARS THRU 2521A-EXIT        
           END-IF                                                       
                                                                        
           PERFORM 8520-INSERT-AR-ROW            THRU 8520-EXIT         
                                                                        
           IF PJ-SHARE-STATUS-CD = 'I'                                  
              PERFORM 2522-POP-AU-VARS           THRU 2522-EXIT         
           ELSE                                                         
              PERFORM 2522A-POP-ONE-TIME-AU-VARS THRU 2522A-EXIT        
           END-IF                                                       
                                                                        
      *    IF AC-AMT-AR-DAY-00 > 0                                              
      *       MOVE '0'                           TO AU-CODE-AR-AGE              
      *       MOVE 1                             TO AU-TRAN-APPL-NO             
      *       MOVE AC-AMT-AR-DAY-00              TO AU-AMT-POSTED               
      *       PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT                
      *    END-IF                                                               
      *                                                                         
      *    IF AC-AMT-AR-DAY-30 > 0                                              
      *       MOVE '3'                           TO AU-CODE-AR-AGE              
      *       ADD  1                             TO AU-TRAN-APPL-NO             
      *       MOVE AC-AMT-AR-DAY-30              TO AU-AMT-POSTED               
      *       PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT                
      *    END-IF                                                               
      *                                                                         
      *    IF AC-AMT-AR-DAY-60 > 0                                              
      *       MOVE '6'                           TO AU-CODE-AR-AGE              
      *       ADD  1                             TO AU-TRAN-APPL-NO             
      *       MOVE AC-AMT-AR-DAY-60              TO AU-AMT-POSTED               
      *       PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT                
      *    END-IF                                                               
      *                                                                         
      **   IF AC-AMT-AR-DAY-90 > 0                                              
      *       MOVE '9'                           TO AU-CODE-AR-AGE              
      *       ADD  1                             TO AU-TRAN-APPL-NO             
      *       MOVE AC-AMT-AR-DAY-90              TO AU-AMT-POSTED               
      *       PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT                
      *    END-IF                                                               
      *                                                                         
      *    IF AC-AMT-UNUSED-CR > 0                                              
      *       MOVE 'P'                           TO AU-CODE-AR-AGE              
      *       ADD  1                             TO AU-TRAN-APPL-NO             
      *       MOVE AC-AMT-UNUSED-CR              TO AU-AMT-POSTED               
      *       PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT                
      *    END-IF.                                                              
      *                                                                         
A03044     IF AC-TOT-SUMM-UNBILLED > 0                                  
A03044        MOVE SPACES                        TO AU-CODE-AR-AGE      
A03044        ADD  1                             TO AU-TRAN-APPL-NO     
A03044        MOVE AC-TOT-SUMM-UNBILLED          TO AU-AMT-POSTED       
A03044        PERFORM 8520A-INSERT-AU-ROW        THRU 8520A-EXIT        
A03044     END-IF.                                                      
                                                                        
       2520-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2521-POP-AR-VARS.                                              *        
      *                                                                *        
      *     CALLED FROM 2520-PROCESS-AR-HIST                           *        
      *                                                                *        
      ******************************************************************        
       2521-POP-AR-VARS.                                                
                                                                        
           MOVE '2521'                 TO ACTIVE-PARAGRAPH.             
                                                                        
           MOVE  PJ-ACCOUNT-NO         TO AR-ACCOUNT-NO                 
           MOVE  WS-CURRENT-TIMESTAMP  TO AR-TRANS-HIST-SEQ-NO          
           MOVE  WS-CURRENT-DATE       TO AR-DATE-TRANS                 
           MOVE  'A'                   TO AR-CODE-TRAN-TYPE             
                                                                        
      * GET WS-AR-CNTL-AMT FROM CSS_AR_CNTL                                     
                                                                        
           MOVE  WS-AR-CNTL-AMT        TO AR-AMT-ORIG-ENTERED           
           MOVE  WS-CURRENT-DATE       TO AR-DATE-ORIG-PYMT             
           MOVE  WS-AR-CNTL-AMT        TO AR-AMT-BILLED-UNPAID          
           MOVE PF-RESP-AREA-ID        TO AR-RESP-AREA-ID               
C34828     IF AT-COMPANY-NO = '26'                                      
P00758        IF PARM-PANEL-NO = 'PANEL289'                             
P00758           MOVE 'PANEL289F'         TO AR-APPL-PROGRAM-ID         
P00758        ELSE                                                      
P00758           MOVE 'CISMDPJSF'         TO AR-APPL-PROGRAM-ID         
P00758        END-IF                                                    
C34828     ELSE                                                         
P00758        IF PARM-PANEL-NO = 'PANEL289'                             
P00758           MOVE 'PANEL289B'         TO AR-APPL-PROGRAM-ID         
P00758        ELSE                                                      
P00758           MOVE 'CISMDPJSB'         TO AR-APPL-PROGRAM-ID         
P00758        END-IF                                                    
C34828     END-IF                                                       
           MOVE 'W'                    TO AR-PYMT-FACILITY-CD           
           MOVE PARM-USER-ID           TO AR-USER-ID                    
                                                                        
           MOVE PJ-ACCOUNT-NO          TO AT-ACCOUNT-NO                 
                                                                        
           PERFORM 7521-SELECT-AT      THRU 7521-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE SPACES              TO AT-COMPANY-NO                 
           END-IF                                                       
           MOVE AT-COMPANY-NO          TO AR-COMPANY-NO                 
                                                                        
           MOVE SPACES                 TO AR-RECORD-ONLY-FL             
                                          AR-PYMT-REFUNDED-IND          
           MOVE WS-01                  TO AR-CASH-COMPANY-NO            
           MOVE WS-998                 TO AR-CASH-LOCAL-OFFICE          
           MOVE WS-998                 TO AR-CASH-REPORT-NO             
           MOVE WS-CURRENT-DATE        TO AR-DATE-CASH-REPORT           
           MOVE 9999                   TO AR-CASH-DRAWER-ID             
           MOVE PARM-TRAN-COMMENT-LEN  TO AR-TRAN-COMMENT-LEN           
           MOVE PARM-TRAN-COMMENT-TEXT TO AR-TRAN-COMMENT-TEXT.         
                                                                        
       2521-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2521A-POP-ONE-TIME-AR-VARS.                                    *        
      *                                                                *        
      *     CALLED FROM 2520-PROCESS-AR-HIST                           *        
      *                                                                *        
      ******************************************************************        
       2521A-POP-ONE-TIME-AR-VARS.                                      
                                                                        
           MOVE '2521A'                TO ACTIVE-PARAGRAPH.             
                                                                        
           MOVE  PJ-ACCOUNT-NO         TO AR-ACCOUNT-NO                 
           MOVE  WS-CURRENT-TIMESTAMP  TO AR-TRANS-HIST-SEQ-NO          
           MOVE  WS-CURRENT-DATE       TO AR-DATE-TRANS                 
T11379     MOVE  'S'                   TO AR-CODE-TRAN-TYPE             
                                                                        
           MOVE  PJ-MONTHLY-BILL-AM    TO AR-AMT-ORIG-ENTERED           
           MOVE  WS-CURRENT-DATE       TO AR-DATE-ORIG-PYMT             
           MOVE  AT-TOTAL-AR-BALANCE   TO AR-AMT-BILLED-UNPAID          
           MOVE PF-RESP-AREA-ID        TO AR-RESP-AREA-ID               
C34828     IF AT-COMPANY-NO = '26'                                      
P00758        IF PARM-PANEL-NO = 'PANEL289'                             
P00758           MOVE 'PANEL289H'         TO AR-APPL-PROGRAM-ID         
P00758        ELSE                                                      
P00758           MOVE 'CISMDPJSH'         TO AR-APPL-PROGRAM-ID         
P00758        END-IF                                                    
C34828     ELSE                                                         
P00758        IF PARM-PANEL-NO = 'PANEL289'                             
P00758           MOVE 'PANEL289D'         TO AR-APPL-PROGRAM-ID         
P00758        ELSE                                                      
P00758           MOVE 'CISMDPJSD'         TO AR-APPL-PROGRAM-ID         
P00758        END-IF                                                    
C34828     END-IF                                                       
           MOVE 'W'                    TO AR-PYMT-FACILITY-CD           
           MOVE PARM-USER-ID           TO AR-USER-ID                    
                                                                        
           MOVE PJ-ACCOUNT-NO          TO AT-ACCOUNT-NO                 
                                                                        
           PERFORM 7521-SELECT-AT      THRU 7521-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE SPACES              TO AT-COMPANY-NO                 
           END-IF                                                       
           MOVE AT-COMPANY-NO          TO AR-COMPANY-NO                 
                                                                        
           MOVE SPACES                 TO AR-RECORD-ONLY-FL             
                                          AR-PYMT-REFUNDED-IND          
           MOVE WS-01                  TO AR-CASH-COMPANY-NO            
           MOVE WS-998                 TO AR-CASH-LOCAL-OFFICE          
           MOVE WS-998                 TO AR-CASH-REPORT-NO             
           MOVE WS-CURRENT-DATE        TO AR-DATE-CASH-REPORT           
           MOVE 9999                   TO AR-CASH-DRAWER-ID             
           MOVE PARM-TRAN-COMMENT-LEN  TO AR-TRAN-COMMENT-LEN           
           MOVE PARM-TRAN-COMMENT-TEXT TO AR-TRAN-COMMENT-TEXT.         
                                                                        
       2521A-EXIT.                                                      
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2522-POP-AU-VARS.                                              *        
      *                                                                *        
      *     CALLED FROM 2520-PROCESS-AR-HIST                           *        
      *                                                                *        
      ******************************************************************        
       2522-POP-AU-VARS.                                                
                                                                        
           MOVE '2522'                 TO ACTIVE-PARAGRAPH.             
                                                                        
           MOVE  AR-ACCOUNT-NO         TO AU-ACCOUNT-NO                 
           MOVE  WS-CURRENT-TIMESTAMP  TO AU-TRANS-HIST-SEQ-NO          
                                                                        
           MOVE  WS-GL-LIA-PJS-KEY     TO GO-GL-ACCT-NAME               
           MOVE  AR-COMPANY-NO         TO GO-COMPANY-NO                 
                                                                        
           PERFORM 7522-GET-GL-NO      THRU 7522-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES             TO AU-GL-ACCT-DEBIT              
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO     TO AU-GL-ACCT-DEBIT              
           END-IF                                                       
                                                                        
           MOVE  WS-GL-AR-PJS-KEY      TO GO-GL-ACCT-NAME               
           MOVE  AR-COMPANY-NO         TO GO-COMPANY-NO                 
                                                                        
           PERFORM 7522-GET-GL-NO      THRU 7522-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES             TO AU-GL-ACCT-CREDIT             
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO     TO AU-GL-ACCT-CREDIT             
           END-IF                                                       
                                                                        
           MOVE PJ-ITEM-ID             TO AU-ITEM-ID                    
           MOVE SPACES                 TO AU-CODE-CONTRACT-TYPE         
                                          AU-CURRENCY-TYPE              
           MOVE ZEROES                 TO AU-CURRENCY-AMT.              
                                                                        
       2522-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2522A-POP-ONE-TIME-AU-VARS                                     *        
      *                                                                *        
      *     CALLED FROM 2520-PROCESS-AR-HIST                           *        
      *                                                                *        
      ******************************************************************        
       2522A-POP-ONE-TIME-AU-VARS.                                      
                                                                        
           MOVE '2522A'                TO ACTIVE-PARAGRAPH.             
                                                                        
           MOVE  AR-ACCOUNT-NO         TO AU-ACCOUNT-NO                 
           MOVE  WS-CURRENT-TIMESTAMP  TO AU-TRANS-HIST-SEQ-NO          
                                                                        
           MOVE  WS-GL-AR-PJS-KEY      TO GO-GL-ACCT-NAME               
           MOVE  AR-COMPANY-NO         TO GO-COMPANY-NO                 
                                                                        
           PERFORM 7522-GET-GL-NO      THRU 7522-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES             TO AU-GL-ACCT-DEBIT              
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO     TO AU-GL-ACCT-DEBIT              
           END-IF                                                       
                                                                        
           MOVE  WS-GL-LIA-PJS-KEY     TO GO-GL-ACCT-NAME               
           MOVE  AR-COMPANY-NO         TO GO-COMPANY-NO                 
                                                                        
           PERFORM 7522-GET-GL-NO      THRU 7522-EXIT                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES             TO AU-GL-ACCT-CREDIT             
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO     TO AU-GL-ACCT-CREDIT             
           END-IF                                                       
                                                                        
           MOVE SPACES                 TO AU-CODE-CONTRACT-TYPE         
                                          AU-CURRENCY-TYPE              
           MOVE PJ-ITEM-ID             TO AU-ITEM-ID                    
           MOVE ZEROES                 TO AU-CURRENCY-AMT.              
                                                                        
       2522A-EXIT.                                                      
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2600-INSERT                                                    *        
      *                                                                *        
      *     CALLED FROM 2205-PROCESS                                   *        
      *                                                                *        
      ******************************************************************        
       2600-INSERT.                                                     
                                                                        
           MOVE '2600'                      TO ACTIVE-PARAGRAPH.        
                                                                        
           MOVE PARM-USER-ID                TO PJ-INIT-BY               
           MOVE 1                           TO PJ-ITEM-ID               
           MOVE 129                         TO PJ-PYMT-PRIORITY-LVL     
           MOVE ZEROES                      TO PJ-TOT-PREV-AM           
                                               PJ-TOT-YTD-AM            
           IF PJ-SHARE-STATUS-CD = 'O' OR                               
              PJ-SHARE-STATUS-CD = 'I'                                  
              MOVE WS-CURRENT-DATE          TO PJ-ACCT-TERM-DT          
                                               WS-NEW-INACTIVE-DATE     
           END-IF                                                       
                                                                        
           IF PJ-SHARE-STATUS-CD = 'O'                                  
              MOVE PJ-ACCOUNT-NO            TO AT-ACCOUNT-NO            
              PERFORM 7521-SELECT-AT        THRU 7521-EXIT              
T21072        PERFORM 7800-SELECT-TIMESTAMP THRU 7800-EXIT              
T21072        MOVE WS-CURRENT-TIMESTAMP     TO AT-LAST-UPDATE-TS        
              PERFORM 8521-UPDATE-ACCOUNT   THRU 8521-EXIT              
           END-IF                                                       
                                                                        
           IF PJ-SHARE-STATUS-CD = 'A'                                  
              MOVE -1                       TO WS-NULL-IND1             
              MOVE SPACES                   TO WS-NEW-INACTIVE-DATE     
           END-IF                                                       
                                                                        
P00758     IF PARM-PANEL-NO = 'PANEL289' OR 'CISMDPJS'                  
              PERFORM 8600-INSERT-PJ             THRU 8600-EXIT         
           END-IF                                                       
                                                                        
           PERFORM 2610-INSERT-AR-CNTL           THRU 2610-EXIT.        
                                                                        
           IF PJ-SHARE-STATUS-CD = 'O'                                  
              PERFORM 2700-PROCESS-CASH          THRU 2700-EXIT         
              IF PJ-MONTHLY-BILL-AM > 0                                 
                 PERFORM 2520-PROCESS-AR-HIST    THRU 2520-EXIT         
              END-IF                                                    
           END-IF.                                                      
                                                                        
       2600-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2610-INSERT-AR-CNTL                                            *        
      *                                                                *        
      *     CALLED FROM 2600-INSERT                                    *        
      *                                                                *        
      ******************************************************************        
       2610-INSERT-AR-CNTL.                                             
                                                                        
           MOVE '2610'                  TO ACTIVE-PARAGRAPH.            
                                                                        
           MOVE PJ-ACCOUNT-NO           TO AC-ACCOUNT-NO                
                                                                        
A03044     MOVE ZEROES                  TO AC-AMT-AR-DAY-00             
                                           AC-AMT-AR-DAY-30             
                                           AC-AMT-AR-DAY-60             
                                           AC-AMT-AR-DAY-90             
                                           AC-AMT-TRAN-BALANCE          
                                           AC-AMT-UNUSED-CR             
                                           AC-ITEM-ID                   
                                           AC-TOT-SUMM-UNBILLED         
           MOVE 129                     TO AC-PYMT-PRIORITY-LVL         
           MOVE WS-CURRENT-TIMESTAMP    TO AC-LAST-UPDATE-TS            
                                                                        
           IF PJ-SHARE-STATUS-CD = 'A' OR                               
              PJ-SHARE-STATUS-CD = 'O'                                  
              PERFORM 8610-INSERT-AC    THRU 8610-EXIT                  
           END-IF                                                       
                                                                        
           MOVE PJ-ACCOUNT-NO           TO AC-ACCOUNT-NO                
           IF PJ-SHARE-STATUS-CD = 'O'                                  
TP5430        MOVE PJ-MONTHLY-BILL-AM   TO AC-AMT-TRAN-BALANCE          
A03044                                     AC-TOT-SUMM-UNBILLED         
           ELSE                                                         
TP5430        MOVE ZEROES               TO AC-AMT-TRAN-BALANCE          
A03044        MOVE ZEROES               TO AC-TOT-SUMM-UNBILLED         
           END-IF                                                       
                                                                        
           MOVE ZEROES                  TO AC-AMT-AR-DAY-30             
                                           AC-AMT-AR-DAY-60             
                                           AC-AMT-AR-DAY-90             
                                           AC-AMT-UNUSED-CR             
A03044                                     AC-AMT-AR-DAY-00             
           MOVE 129                     TO AC-PYMT-PRIORITY-LVL         
           MOVE WS-CURRENT-TIMESTAMP    TO AC-LAST-UPDATE-TS            
           MOVE 1                       TO AC-ITEM-ID                   
                                                                        
           IF PJ-SHARE-STATUS-CD = 'A' OR                               
              PJ-SHARE-STATUS-CD = 'O'                                  
              PERFORM 8610-INSERT-AC    THRU 8610-EXIT                  
           END-IF.                                                      
                                                                        
       2610-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2620-UPDATE-AR-CNTL                                            *        
      *                                                                *        
      *     CALLED FROM 2600-INSERT                                    *        
      *                                                                *        
      ******************************************************************        
       2620-UPDATE-AR-CNTL.                                             
                                                                        
           MOVE '2620'                  TO ACTIVE-PARAGRAPH.            
           MOVE PJ-ACCOUNT-NO           TO AC-ACCOUNT-NO                
                                                                        
                                                                        
           MOVE 129                     TO AC-PYMT-PRIORITY-LVL         
           MOVE 1                       TO AC-ITEM-ID                   
                                                                        
           PERFORM 7511-SELECT-AC       THRU 7511-EXIT                  
                                                                        
           IF PJ-SHARE-STATUS-CD = 'O'                                  
              ADD PJ-MONTHLY-BILL-AM    TO AC-AMT-TRAN-BALANCE          
A03044        ADD PJ-MONTHLY-BILL-AM    TO AC-TOT-SUMM-UNBILLED         
              PERFORM 8620-UPDATE-AC    THRU 8620-EXIT                  
           END-IF.                                                      
                                                                        
       2620-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      *******************************************************           04991280
      * 2700-PROCESS-CASH.                                  *           04991389
      *                                                     *           04991499
      *                                                     *           04991499
      *******************************************************           04991580
       2700-PROCESS-CASH.                                               
                                                                        
           MOVE '2700'                 TO ACTIVE-PARAGRAPH.             
                                                                        
           MOVE AT-COMPANY-NO          TO WS-100-COMPANY-NO.            
           MOVE 9                      TO WS-TRAN-OPER-LEVEL.           
           MOVE 1                      TO WS-TRAN-OCAP-FIELD.           
           MOVE 1                      TO WS-TRAN-OCAP-VALUE.           
           MOVE 'C'                    TO WS-TRAN-JRNL-TYPE.            
           MOVE 'N'                    TO WS-TRAN-HOLD-EXEMPT-FLAG.     
           MOVE PARM-USER-ID           TO WS-JRNL-OL-TEMP-ID.           
           MOVE WS-JRNL-CK-OPER-ID     TO WS-JRNL-OPERATION-RQST.       
                                                                        
           PERFORM 6400-ONLINE-JRNL-ROUTINE THRU 6400-EXIT.             
                                                                        
           MOVE WS-JRNL-OL-OPR-LOC     TO WS-TERM-LOC.                  
           MOVE WS-01                  TO WS-JRNL-OL-COMPANY.           
           MOVE WS-998                 TO WS-JRNL-OL-LOC-OFF.           
           MOVE WS-998                 TO WS-JRNL-OL-REPORT-NO.         
           MOVE WS-CURRENT-DATE        TO WS-JRNL-OL-REPORT-DT.         
           MOVE 9999                   TO WS-JRNL-OL-CASH-DRWR.         
                                                                        
           MOVE WS-TERM-LOC            TO WS-JRNL-OL-TERM-LOC           
                                          WS-JRNL-OL-CASH-LOC           
                                          WS-JRNL-OL-OPR-LOC.           
           MOVE WS-JRNL-VALIDATE-OPER TO WS-JRNL-OPERATION-RQST.        
           MOVE 'C'                   TO WS-JRNL-SOURCE-CODE.           
           IF CASH-TRANSACTION                                          
              MOVE WS-JRNL-CASH-UPDATE       TO WS-JRNL-OL-AUTH-TYPE    
           ELSE                                                         
              MOVE WS-JRNL-NON-CASH-UPDATE   TO WS-JRNL-OL-AUTH-TYPE    
           END-IF.                                                      
                                                                        
           PERFORM 6400-ONLINE-JRNL-ROUTINE  THRU 6400-EXIT.            
                                                                        
           MOVE 'A'                        TO WS-100-JRNL-SORT-ID.      
           MOVE AT-ACCOUNT-NO              TO WS-100-ACCT-NO.           
           MOVE AT-CUSTOMER-NO             TO WS-100-CUSTOMER-NO.       
           MOVE 0                          TO WS-100-PREMISE-NO.        
           MOVE EIBTRNID                   TO WS-100-CODE-TERMINAL-TRAN.
           ADD 1                           TO WS-100-JRNL-TRAN-APPL-NO. 
           MOVE WS-CURRENT-DATE            TO WS-100-DATE-LAST-ACTION   
                                              AT-DATE-LAST-ACTION.      
           MOVE 'C'                        TO WS-100-CODE-ENTRY-SOURCE. 
           MOVE AT-LOCAL-OFFICE            TO WS-100-LOCAL-OFFICE-CD.   
                                                                        
           MOVE WS-JRNL-OL-COMPANY         TO WS-PAR-COMPANY-NO         
           MOVE WS-JRNL-OL-LOC-OFF         TO WS-PAR-LOCAL-OFFICE       
           MOVE WS-JRNL-OL-REPORT-NO       TO WS-PAR-REPORT-NO          
           MOVE WS-JRNL-OL-REPORT-DT       TO WS-PAR-REPORT-DATE        
           MOVE WS-JRNL-OL-CASH-DRWR       TO WS-PAR-CASH-DRAWER        
                                                                        
           MOVE WS-TERM-LOC                TO WS-PAR-ACCESS-LOC.        
           MOVE PARM-USER-ID               TO WS-PAR-OPERATOR-ID.       
           MOVE PF-RESP-AREA-ID            TO WS-PAR-RESP-AREA.         
P00758     IF PARM-PANEL-NO = 'PANEL289'                                
P00758        MOVE 'PANEL289'                 TO WS-PAR-APPL-PROG-ID    
P00758     ELSE                                                         
P00758        MOVE 'CISMDPJS'                 TO WS-PAR-APPL-PROG-ID    
P00758     END-IF.                                                      
           MOVE 'W'                        TO WS-PAR-PYMT-FACILITY-CD.  
                                                                        
           IF PJ-SHARE-STATUS-CD = 'I'                                  
              PERFORM 2712-POP-CASH-JRNL-VARS THRU 2712-EXIT            
           END-IF                                                       
                                                                        
           IF PJ-SHARE-STATUS-CD = 'O'                                  
              PERFORM 2712A-POP-ONE-TIME-VARS THRU 2712A-EXIT           
           END-IF                                                       
                                                                        
           PERFORM 6400-ONLINE-JRNL-ROUTINE   THRU 6400-EXIT            
                                                                        
           IF PJ-SHARE-STATUS-CD = 'I'                                  
              MOVE WS-PAR-P                   TO WS-PAR-CODE-TRAN-TYPE  
           ELSE                                                         
              MOVE WS-PAR-B                   TO WS-PAR-CODE-TRAN-TYPE  
           END-IF                                                       
                                                                        
           MOVE WS-JRNL-CNTRL-ONLY TO WS-JRNL-OPERATION-RQST            
           PERFORM 6400-ONLINE-JRNL-ROUTINE THRU 6400-EXIT              
           IF WS-JRNL-RTRN-CODE EQUAL SPACES                            
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME              TO ABEND-PROGRAM           
              MOVE '5000'                    TO ACTIVE-PARAGRAPH        
              MOVE 'USERABEN'                TO ABEND-FUNCTION          
              MOVE WS-YES                    TO WS-USER-FORCE-ABEND     
              MOVE SPACES                    TO DSNTIAR-MESSAGE-1       
              PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT             
              PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT             
           END-IF.                                                      
                                                                        
       2700-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2712-POP-CASH-JRNL-VARS                                        *        
      *                                                                *        
      *     CALLED FROM 2700-PROCESS-CASH-JRNL.                        *        
      *                                                                *        
      ******************************************************************        
       2712-POP-CASH-JRNL-VARS.                                         
                                                                        
           MOVE '2712'                     TO ACTIVE-PARAGRAPH.         
           MOVE ' '                     TO WS-101-CODE-REVENUE-DISTRICT.
           MOVE ' '                     TO WS-101-CODE-EMPL-ACCT.       
           MOVE AT-CODE-COMPANY-ACCT    TO WS-101-CODE-COMPANY-ACCT.    
           MOVE AT-CODE-ACCT-STAT       TO WS-101-CODE-ACCOUNT-STATUS.  
           MOVE ' '                     TO WS-101-CODE-PREMISE-STATUS.  
           MOVE 'A'                     TO WS-101-CASH-DRAWER-USED.     
           MOVE 101                     TO WS-101-JRNL-FORMAT-NO.       
           MOVE WS-AR-CNTL-AMT          TO WS-101-AMOUNT-ENTERED.       
           MOVE WS-AR-CNTL-AMT          TO WS-101-AMT-POSTED.           
                                                                        
           MOVE  WS-GL-LIA-PJS-KEY      TO GO-GL-ACCT-NAME              
           MOVE  AT-COMPANY-NO          TO GO-COMPANY-NO                
           PERFORM 7522-GET-GL-NO       THRU 7522-EXIT                  
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES              TO WS-101-ACCT-GEN-LED-DR       
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO      TO WS-101-ACCT-GEN-LED-DR       
           END-IF                                                       
                                                                        
           MOVE  WS-GL-AR-PJS-KEY       TO GO-GL-ACCT-NAME              
           MOVE  AT-COMPANY-NO          TO GO-COMPANY-NO                
           PERFORM 7522-GET-GL-NO       THRU 7522-EXIT                  
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
               MOVE ZEROES              TO WS-101-ACCT-GEN-LED-CR       
           ELSE                                                         
               MOVE  GO-GL-ACCT-NO      TO WS-101-ACCT-GEN-LED-CR       
           END-IF                                                       
                                                                        
           SUBTRACT WS-AR-CNTL-AMT FROM AC-AMT-TRAN-BALANCE             
                                   GIVING WS-101-ACCT-END-AR-BAL        
           MOVE '0'                     TO WS-101-AR-AGE.               
           MOVE SPACES                  TO WS-101-DATE-AR-BILLED.       
           MOVE 1                       TO WS-101-ITEM-ID-NO.           
           MOVE AC-AMT-TRAN-BALANCE     TO WS-101-DETAIL-END-BAL.       
           MOVE WS-AR-CNTL-AMT          TO WS-101-DETAIL-END-AR-BAL.    
           MOVE SPACES                  TO WS-101-FUNCTION-CODE.        
           MOVE 'A'                     TO WS-100-JRNL-SORT-ID.         
           MOVE AT-ACCOUNT-NO           TO WS-100-ACCT-NO.              
           MOVE AT-CUSTOMER-NO          TO WS-100-CUSTOMER-NO.          
TP5866     MOVE EIBTRNID                TO WS-100-CODE-TERMINAL-TRAN.   
           MOVE 1                       TO WS-100-JRNL-TRAN-APPL-NO.    
           MOVE WS-CURRENT-DATE         TO WS-100-DATE-LAST-ACTION.     
           MOVE 'C'                     TO WS-100-CODE-ENTRY-SOURCE.    
                                                                        
           MOVE WS-AR-CNTL-AMT          TO WS-JRNL-GEN-LEG-DEBIT-AMT.   
           MOVE WS-AR-CNTL-AMT          TO WS-JRNL-RCV-CREDIT-AMT.      
                                                                        
           MOVE CJF00101                TO WS-100-USER-DEFINED-AREA.    
           MOVE WS-JRNL-ONLY            TO WS-JRNL-OPERATION-RQST.      
                                                                        
       2712-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2712A-POP-ONE-TIME-VARS                                        *        
      *                                                                *        
      *     CALLED FROM 2700-PROCESS-CASH-JRNL.                        *        
      *                                                                *        
      ******************************************************************        
       2712A-POP-ONE-TIME-VARS.                                         
                                                                        
           MOVE '2712A'                    TO ACTIVE-PARAGRAPH.         
                                                                        
           MOVE ' '                     TO WS-101-CODE-REVENUE-DISTRICT.
           MOVE ' '                     TO WS-101-CODE-EMPL-ACCT.       
           MOVE AT-CODE-COMPANY-ACCT    TO WS-101-CODE-COMPANY-ACCT.    
           MOVE AT-CODE-ACCT-STAT       TO WS-101-CODE-ACCOUNT-STATUS.  
           MOVE ' '                     TO WS-101-CODE-PREMISE-STATUS.  
           MOVE 'A'                     TO WS-101-CASH-DRAWER-USED.     
           MOVE 101                     TO WS-101-JRNL-FORMAT-NO.       
           MOVE PJ-MONTHLY-BILL-AM      TO WS-101-AMOUNT-ENTERED.       
           MOVE PJ-MONTHLY-BILL-AM      TO WS-101-AMT-POSTED.           
           MOVE  WS-GL-AR-PJS-KEY       TO GO-GL-ACCT-NAME              
           MOVE  AT-COMPANY-NO          TO GO-COMPANY-NO                
           PERFORM 7522-GET-GL-NO       THRU 7522-EXIT                  
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE ZEROES               TO WS-101-ACCT-GEN-LED-DR       
           ELSE                                                         
              MOVE  GO-GL-ACCT-NO       TO WS-101-ACCT-GEN-LED-DR       
           END-IF                                                       
           MOVE  WS-GL-LIA-PJS-KEY      TO GO-GL-ACCT-NAME              
           MOVE  AT-COMPANY-NO          TO GO-COMPANY-NO                
           PERFORM 7522-GET-GL-NO       THRU 7522-EXIT                  
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE ZEROES               TO WS-101-ACCT-GEN-LED-CR       
           ELSE                                                         
              MOVE  GO-GL-ACCT-NO       TO WS-101-ACCT-GEN-LED-CR       
           END-IF                                                       
                                                                        
           SUBTRACT PJ-MONTHLY-BILL-AM FROM AC-AMT-TRAN-BALANCE         
                                   GIVING WS-101-ACCT-END-AR-BAL        
           MOVE '0'                     TO WS-101-AR-AGE.               
           MOVE SPACES                  TO WS-101-DATE-AR-BILLED.       
           MOVE 1                       TO WS-101-ITEM-ID-NO.           
           MOVE AC-AMT-TRAN-BALANCE     TO WS-101-DETAIL-END-BAL.       
           MOVE PJ-MONTHLY-BILL-AM      TO WS-101-DETAIL-END-AR-BAL.    
           MOVE SPACES                  TO WS-101-FUNCTION-CODE.        
           MOVE 'A'                     TO WS-100-JRNL-SORT-ID.         
           MOVE AT-ACCOUNT-NO           TO WS-100-ACCT-NO.              
           MOVE AT-CUSTOMER-NO          TO WS-100-CUSTOMER-NO.          
TP5866     MOVE EIBTRNID                TO WS-100-CODE-TERMINAL-TRAN.   
           MOVE 1                       TO WS-100-JRNL-TRAN-APPL-NO.    
           MOVE WS-CURRENT-DATE         TO WS-100-DATE-LAST-ACTION.     
           MOVE 'C'                     TO WS-100-CODE-ENTRY-SOURCE.    
                                                                        
           MOVE PJ-MONTHLY-BILL-AM  TO WS-JRNL-GEN-LEG-DEBIT-AMT.       
           MOVE PJ-MONTHLY-BILL-AM  TO WS-JRNL-RCV-CREDIT-AMT.          
                                                                        
           MOVE CJF00101            TO WS-100-USER-DEFINED-AREA.        
           MOVE WS-JRNL-ONLY        TO WS-JRNL-OPERATION-RQST.          
                                                                        
       2712A-EXIT.                                                      
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5400-JRNL-TRAN-HEAD.                                        *         
      *     CALLS  7800-SELECT-TIMESTAMP                              *         
      *            7801-SELECT-DATE                                   *         
      *            7800-SELECT-RESP-AREA                              *         
      *                                                               *         
      *     CALLED FROM 5000-UPDATE                                   *         
      *                                                               *         
      *   1.   MOVE FIELDS TO THE MAINTENANCE TRANSACTION HEADER.     *         
      *        THE FIRST TIME THE TRANSACTION DETAILS ROW IS WRITTEN, *         
      *        THIS ROW WILL ALSO BE WRITTEN (SEE CPD00067).          *         
      *****************************************************************         
       5400-JRNL-TRAN-HEAD.                                             
                                                                        
           MOVE '5400'                   TO ACTIVE-PARAGRAPH.           
                                                                        
           PERFORM 7800-SELECT-TIMESTAMP THRU 7800-EXIT.                
           MOVE WS-CURRENT-TIMESTAMP     TO MH-TRANS-HIST-SEQ-NO.       
                                                                        
           PERFORM 7801-SELECT-DATE      THRU 7801-EXIT.                
           MOVE WS-CURRENT-DATE          TO MH-DATE-TRANS.              
                                                                        
           PERFORM 7802-SELECT-RESP-AREA THRU 7802-EXIT.                
           MOVE PF-RESP-AREA-ID          TO MH-RESP-AREA-ID             
                                                                        
           MOVE 1                        TO WS-TRAN-APPL-NO             
                                            MI-TRAN-APPL-NO.            
                                                                        
           MOVE 'F'                      TO MH-CODE-TRAN-TYPE.          
           MOVE PJ-ACCOUNT-NO            TO MH-ACCOUNT-NO.              
           MOVE 0                        TO MH-PREMISE-NO.              
           MOVE 0                        TO MH-CUSTOMER-NO.             
           MOVE PF-USER-ID               TO MH-USER-ID.                 
PCR404     IF PARM-UPD-INS-IND = 'I'                                    
C34828        IF AT-COMPANY-NO = '26'                                   
P00758           IF PARM-PANEL-NO = 'PANEL289'                          
P00758              MOVE 'PANEL289E'        TO MH-APPL-PROGRAM-ID       
P00758           ELSE                                                   
P00758              MOVE 'CISMDPJSE'        TO MH-APPL-PROGRAM-ID       
P00758           END-IF                                                 
C34828        ELSE                                                      
P00758           IF PARM-PANEL-NO = 'PANEL289'                          
P00758              MOVE 'PANEL289A'        TO MH-APPL-PROGRAM-ID       
P00758           ELSE                                                   
P00758              MOVE 'CISMDPJSA'        TO MH-APPL-PROGRAM-ID       
P00758           END-IF                                                 
C34828        END-IF                                                    
PCR404     ELSE                                                         
PCR404        IF PJ-SHARE-STATUS-CD = 'I'                               
C34828           IF AT-COMPANY-NO = '26'                                
P00758              IF PARM-PANEL-NO = 'PANEL289'                       
P00758                 MOVE 'PANEL289G'        TO MH-APPL-PROGRAM-ID    
P00758              ELSE                                                
P00758                 MOVE 'CISMDPJSG'        TO MH-APPL-PROGRAM-ID    
P00758              END-IF                                              
C34828           ELSE                                                   
P00758              IF PARM-PANEL-NO = 'PANEL289'                       
P00758                 MOVE 'PANEL289C'        TO MH-APPL-PROGRAM-ID    
P00758              ELSE                                                
P00758                 MOVE 'CISMDPJSC'        TO MH-APPL-PROGRAM-ID    
P00758              END-IF                                              
C34828           END-IF                                                 
PCR404        ELSE                                                      
C34828           IF AT-COMPANY-NO = '26'                                
P00758              IF PARM-PANEL-NO = 'PANEL289'                       
P00758                 MOVE 'PANEL289F'        TO MH-APPL-PROGRAM-ID    
P00758              ELSE                                                
P00758                 MOVE 'CISMDPJSF'        TO MH-APPL-PROGRAM-ID    
P00758              END-IF                                              
C34828           ELSE                                                   
P00758              IF PARM-PANEL-NO = 'PANEL289'                       
P00758                 MOVE 'PANEL289B'        TO MH-APPL-PROGRAM-ID    
P00758              ELSE                                                
P00758                 MOVE 'CISMDPJSB'        TO MH-APPL-PROGRAM-ID    
P00758              END-IF                                              
C34828           END-IF                                                 
PCR404        END-IF                                                    
PCR404     END-IF.                                                      
           MOVE WS-TRAN-COMMENT-LEN      TO WS-TRAN-COMMENT-LEN-NUM.    
           MOVE WS-TRAN-COMMENT-LEN-NUM  TO MH-TRAN-COMMENT-LEN.        
           MOVE WS-TRAN-COMMENT-TEXT     TO MH-TRAN-COMMENT-TEXT.       
                                                                        
       5400-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5500-JRNL-UPDATE.                                                     
      *                                                                         
      *     CALLED FROM 5200-UPDATE                                             
      *                                                                         
      *   1.   UPDATES THE JOURNAL                                              
      *                                                                         
      ******************************************************************        
       5500-JRNL-UPDATE.                                                
                                                                        
           MOVE '5500'                          TO ACTIVE-PARAGRAPH.    
                                                                        
           PERFORM 5501-JRNL-SHARE-ENRL-DT      THRU 5501-EXIT.         
           PERFORM 5502-JRNL-ACCT-TERM-DT       THRU 5502-EXIT.         
           PERFORM 5503-JRNL-MONTHLY-BILL-AM    THRU 5503-EXIT.         
           PERFORM 5504-JRNL-SHARE-STATUS-CD    THRU 5504-EXIT.         
                                                                        
       5500-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5501-JRNL-SHARE-ENRL-DT.                                     *        
      *                                                                *        
      *     CALLS       6530-LOAD-MNT-TRANS-HIST                       *        
      *                                                                *        
      *     CALLED FROM 5500-JRNL-UPDATE                               *        
      *                                                                *        
      ******************************************************************        
       5501-JRNL-SHARE-ENRL-DT.                                         
                                                                        
           MOVE '5501'                       TO ACTIVE-PARAGRAPH.       
                                                                        
           MOVE MH-TRANS-HIST-SEQ-NO         TO MI-TRANS-HIST-SEQ-NO    
           MOVE SPACES                       TO MI-TABLE-ID             
                                                                        
           IF WS-PREV-START-ENRL-DATE NOT EQUAL WS-NEW-START-ENRL-DATE  
              MOVE WS-TRAN-APPL-NO           TO MI-TRAN-APPL-NO         
                                                                        
              IF PARM-UPD-INS-IND = 'U'                                 
                MOVE +10                     TO MI-CHG-COLUMN-VALUE-LEN 
                MOVE WS-NEW-START-ENRL-DATE  TO MI-CHG-COLUMN-VALUE-TEXT
                MOVE +10                     TO MI-PRV-COLUMN-VALUE-LEN 
                MOVE WS-PREV-START-ENRL-DATE TO MI-PRV-COLUMN-VALUE-TEXT
              END-IF                                                    
                                                                        
              IF PARM-UPD-INS-IND = 'I'                                 
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-NEW-START-ENRL-DATE TO MI-CHG-COLUMN-VALUE-TEXT
                 MOVE +5                     TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE '*NEW*'                TO MI-PRV-COLUMN-VALUE-TEXT
              END-IF                                                    
                                                                        
              MOVE 'SHARE_ENROLL_DT'            TO MI-COLUMN-DESC       
              PERFORM 6530-LOAD-MNT-TRANS-HIST  THRU 6530-EXIT          
              ADD 1                             TO WS-TRAN-APPL-NO      
           END-IF.                                                      
                                                                        
       5501-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5502-JRNL-ACCT-TERM-DT.                                      *        
      *                                                                *        
      *     CALLS       6530-LOAD-MNT-TRANS-HIST                       *        
      *                                                                *        
      *     CALLED FROM 5500-JRNL-UPDATE                               *        
      *                                                                *        
      ******************************************************************        
       5502-JRNL-ACCT-TERM-DT.                                          
                                                                        
           MOVE '5502'                      TO ACTIVE-PARAGRAPH.        
                                                                        
           MOVE MH-TRANS-HIST-SEQ-NO        TO MI-TRANS-HIST-SEQ-NO     
           MOVE SPACES                      TO MI-TABLE-ID              
                                                                        
           IF WS-PREV-INACTIVE-DATE NOT EQUAL WS-NEW-INACTIVE-DATE      
              MOVE WS-TRAN-APPL-NO           TO MI-TRAN-APPL-NO         
                                                                        
              IF PARM-UPD-INS-IND = 'U'                                 
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                                                                        
                 IF WS-NEW-INACTIVE-DATE EQUAL SPACES                   
                   MOVE SPACES               TO MI-CHG-COLUMN-VALUE-TEXT
                 ELSE                                                   
                   MOVE WS-NEW-INACTIVE-DATE TO MI-CHG-COLUMN-VALUE-TEXT
                 END-IF                                                 
                                                                        
                 MOVE +10                    TO MI-PRV-COLUMN-VALUE-LEN 
                                                                        
                 IF WS-PREV-INACTIVE-DATE EQUAL SPACES                  
                  MOVE SPACES                TO MI-PRV-COLUMN-VALUE-TEXT
                 ELSE                                                   
                  MOVE WS-PREV-INACTIVE-DATE TO MI-PRV-COLUMN-VALUE-TEXT
                 END-IF                                                 
              END-IF                                                    
                                                                        
              IF PARM-UPD-INS-IND = 'I'                                 
                 IF WS-NEW-INACTIVE-DATE = SPACES                       
                    GO TO 5502-EXIT                                     
                 END-IF                                                 
                                                                        
                 MOVE +10                    TO MI-CHG-COLUMN-VALUE-LEN 
                                                                        
                 IF WS-NEW-INACTIVE-DATE EQUAL SPACES                   
                   MOVE SPACES               TO MI-CHG-COLUMN-VALUE-TEXT
                 ELSE                                                   
                   MOVE WS-NEW-INACTIVE-DATE TO MI-CHG-COLUMN-VALUE-TEXT
                 END-IF                                                 
                                                                        
                 MOVE +5                     TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE '*NEW*'                TO MI-PRV-COLUMN-VALUE-TEXT
              END-IF                                                    
                                                                        
              MOVE 'ACCT_TERM_DT'               TO MI-COLUMN-DESC       
              PERFORM 6530-LOAD-MNT-TRANS-HIST  THRU 6530-EXIT          
              ADD 1                             TO WS-TRAN-APPL-NO      
           END-IF.                                                      
                                                                        
       5502-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5503-JRNL-MONTHLY-BILL-AM.                                   *        
      *                                                                *        
      *     CALLS       6530-LOAD-MNT-TRANS-HIST                       *        
      *                                                                *        
      *     CALLED FROM 5500-JRNL-UPDATE                               *        
      *                                                                *        
      ******************************************************************        
       5503-JRNL-MONTHLY-BILL-AM.                                       
                                                                        
           MOVE '5503'                        TO ACTIVE-PARAGRAPH.      
                                                                        
           MOVE MH-TRANS-HIST-SEQ-NO          TO MI-TRANS-HIST-SEQ-NO   
           MOVE SPACES                        TO MI-TABLE-ID            
                                                                        
           IF WS-PREV-DONATION-AMT NOT = WS-NEW-DONATION-AMT            
              MOVE WS-TRAN-APPL-NO            TO MI-TRAN-APPL-NO        
                                                                        
              IF PARM-UPD-INS-IND = 'U'                                 
                 MOVE +13                     TO MI-CHG-COLUMN-VALUE-LEN
                 MOVE WS-NEW-DONATION-AMT     TO WS-MONTHLY-BILL-AM-NUM 
                 MOVE WS-MONTHLY-BILL-AM-NUM  TO WS-MONTHLY-BILL-AM-CHAR
                 MOVE WS-MONTHLY-BILL-AM-CHAR TO                        
                                                MI-CHG-COLUMN-VALUE-TEXT
                 MOVE +13                     TO MI-PRV-COLUMN-VALUE-LEN
                 MOVE WS-PREV-DONATION-AMT    TO WS-MONTHLY-BILL-AM-NUM 
                 MOVE WS-MONTHLY-BILL-AM-NUM  TO WS-MONTHLY-BILL-AM-CHAR
                 MOVE WS-MONTHLY-BILL-AM-CHAR TO                        
                                              MI-PRV-COLUMN-VALUE-TEXT  
              END-IF                                                    
                                                                        
              IF PARM-UPD-INS-IND = 'I'                                 
                 MOVE +13                     TO MI-CHG-COLUMN-VALUE-LEN
                 MOVE WS-NEW-DONATION-AMT     TO WS-MONTHLY-BILL-AM-NUM 
                 MOVE WS-MONTHLY-BILL-AM-NUM  TO WS-MONTHLY-BILL-AM-CHAR
                 MOVE WS-MONTHLY-BILL-AM-CHAR TO                        
                                              MI-CHG-COLUMN-VALUE-TEXT  
                 MOVE +5                      TO MI-PRV-COLUMN-VALUE-LEN
                 MOVE '*NEW*'              TO MI-PRV-COLUMN-VALUE-TEXT  
              END-IF                                                    
                                                                        
              MOVE 'MONTHLY_BILL_AM'            TO MI-COLUMN-DESC       
              PERFORM 6530-LOAD-MNT-TRANS-HIST  THRU 6530-EXIT          
              ADD 1                             TO WS-TRAN-APPL-NO      
           END-IF.                                                      
                                                                        
       5503-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *   5504-JRNL-SHARE-STATUS-CD.                                   *        
      *                                                                *        
      *     CALLS       6530-LOAD-MNT-TRANS-HIST                       *        
      *                                                                *        
      *     CALLED FROM 5500-JRNL-UPDATE                               *        
      *                                                                *        
      ******************************************************************        
       5504-JRNL-SHARE-STATUS-CD.                                       
                                                                        
           MOVE '5504'                       TO ACTIVE-PARAGRAPH.       
                                                                        
           MOVE MH-TRANS-HIST-SEQ-NO         TO MI-TRANS-HIST-SEQ-NO    
           MOVE '66'                         TO MI-TABLE-ID             
                                                                        
           IF WS-PREV-CURRENT-STATUS NOT = WS-NEW-CURRENT-STATUS        
              MOVE WS-TRAN-APPL-NO           TO MI-TRAN-APPL-NO         
                                                                        
              IF PARM-UPD-INS-IND = 'U'                                 
                 MOVE +1                     TO MI-CHG-COLUMN-VALUE-LEN 
                 MOVE WS-NEW-CURRENT-STATUS  TO MI-CHG-COLUMN-VALUE-TEXT
                 MOVE +1                     TO MI-PRV-COLUMN-VALUE-LEN 
                 MOVE WS-PREV-CURRENT-STATUS TO MI-PRV-COLUMN-VALUE-TEXT
              END-IF                                                    
                                                                        
              IF PARM-UPD-INS-IND = 'I'                                 
                 MOVE +1                    TO MI-CHG-COLUMN-VALUE-LEN  
                 MOVE WS-NEW-CURRENT-STATUS TO MI-CHG-COLUMN-VALUE-TEXT 
                 MOVE +5                    TO MI-PRV-COLUMN-VALUE-LEN  
                 MOVE '*NEW*'               TO MI-PRV-COLUMN-VALUE-TEXT 
              END-IF                                                    
                                                                        
              MOVE 'SHARE_STATUS_CD'            TO MI-COLUMN-DESC       
              PERFORM 6530-LOAD-MNT-TRANS-HIST  THRU 6530-EXIT          
              ADD 1                             TO WS-TRAN-APPL-NO      
           END-IF.                                                      
                                                                        
       5504-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      *  JOURNALING COPYBOOK.                                                   
      *                                                                         
      ******************************************************************        
                                                                        
               EXEC SQL                                                         
                  INCLUDE CPD00067                                              
               END-EXEC.                                                        
                                                                        
               EXEC SQL                                                         
A00956            INCLUDE CPD0006A                                              
               END-EXEC.                                                        
                                                                        
TP8767         EXEC SQL                                                         
TP8767            INCLUDE CPD00309                                              
TP8767         END-EXEC.                                                        
                                                                        
                                                                        
      *****************************************************************         
      * 7521-SELECT-AT                                                *         
      *     CALLS 9000-SEND-ERROR-RESULT                              *         
      *           9900-SQL-ERROR-ROUTINE                              *         
      *     CALLED FROM 2521-POP-AR-VARS                              *         
      *     SELECTS CSS_ACCOUNT                                       *         
      *****************************************************************         
        7521-SELECT-AT.                                                 
                                                                        
           MOVE '7521'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT COMPANY_NO,                                        
                     CODES_DATA_PRESENT,                                
                     CODE_COMPANY_ACCT,                                 
                     CODE_ACCT_STAT,                                    
                     CUSTOMER_NO,                                       
                     LOCAL_OFFICE,                                      
                     TOTAL_AR_BALANCE,                                  
                     BILL_CYCLE,                                        
                     AR_XFER_IND,                                       
                     ACCT_XFER_TO,                                      
TP8767               CODE_BILL_FREQ,                                    
TP8767               REV_MTH_LST_NRML                                   
                INTO :AT-COMPANY-NO,                                    
                     :AT-CODES-DATA-PRESENT,                            
                     :AT-CODE-COMPANY-ACCT,                             
                     :AT-CODE-ACCT-STAT,                                
                     :AT-CUSTOMER-NO,                                   
                     :AT-LOCAL-OFFICE,                                  
                     :AT-TOTAL-AR-BALANCE,                              
                     :AT-BILL-CYCLE,                                    
                     :AT-AR-XFER-IND,                                   
                     :AT-ACCT-XFER-TO,                                  
TP8767               :AT-CODE-BILL-FREQ,                                
TP8767               :AT-REV-MTH-LST-NRML                               
                FROM CSS_ACCOUNT WITH(READUNCOMMITTED)                          
              WHERE                                                     
                ACCOUNT_NO    = :AT-ACCOUNT-NO                          
P00758                                                           
P00758                                                      
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT COMPANY_NO,                                                
MFA-TR*              CODES_DATA_PRESENT,                                        
MFA-TR*              CODE_COMPANY_ACCT,                                         
MFA-TR*              CODE_ACCT_STAT,                                            
MFA-TR*              CUSTOMER_NO,                                               
MFA-TR*              LOCAL_OFFICE,                                              
MFA-TR*              TOTAL_AR_BALANCE,                                          
MFA-TR*              BILL_CYCLE,                                                
MFA-TR*              AR_XFER_IND,                                               
MFA-TR*              ACCT_XFER_TO,                                              
MFA-TR*              CODE_BILL_FREQ,                                            
MFA-TR*              REV_MTH_LST_NRML                                           
MFA-TR*         INTO :AT-COMPANY-NO,                                            
MFA-TR*              :AT-CODES-DATA-PRESENT,                                    
MFA-TR*              :AT-CODE-COMPANY-ACCT,                                     
MFA-TR*              :AT-CODE-ACCT-STAT,                                        
MFA-TR*              :AT-CUSTOMER-NO,                                           
MFA-TR*              :AT-LOCAL-OFFICE,                                          
MFA-TR*              :AT-TOTAL-AR-BALANCE,                                      
MFA-TR*              :AT-BILL-CYCLE,                                            
MFA-TR*              :AT-AR-XFER-IND,                                           
MFA-TR*              :AT-ACCT-XFER-TO,                                          
MFA-TR*              :AT-CODE-BILL-FREQ,                                        
MFA-TR*              :AT-REV-MTH-LST-NRML                                       
MFA-TR*         FROM CSS_ACCOUNT                                                
MFA-TR*       WHERE                                                             
MFA-TR*         ACCOUNT_NO    = :AT-ACCOUNT-NO                                  
MFA-TR*         WITH UR                                                         
MFA-TR*        QUERYNO 7521                                                     
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.      
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
              MOVE '7521'                       TO ACTIVE-PARAGRAPH     
              MOVE 'SELECT'                     TO ABEND-FUNCTION       
              MOVE 'CSS_ACCOUNT'                TO TABLE-1              
CBSI          MOVE 'ACCOUNT_NO'                 TO TABLE-ELEMENT-1      
CBSI          MOVE AT-ACCOUNT-NO                TO HOSTVAR-ELEMENT-1    
              PERFORM 9000-SEND-ERROR-RESULT    THRU 9000-EXIT          
              PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          
           END-IF.                                                      
                                                                        
       7521-EXIT.                                                       
           EXIT.                                                        
                                                                        
C34828*****************************************************************         
C34828* 7522-SELECT-COMPANY                                           *         
C34828*     CALLS 9000-SEND-ERROR-RESULT                              *         
C34828*           9900-SQL-ERROR-ROUTINE                              *         
C34828*     CALLED FROM 2521-POP-AR-VARS                              *         
C34828*     SELECTS CSS_ACCOUNT                                       *         
C34828*****************************************************************         
C34828  7523-SELECT-COMPANY.                                            
C34828                                                                  
C34828     MOVE '7523'               TO ACTIVE-PARAGRAPH.               
C34828                                                                  
C34828     EXEC SQL                                                     
C34828        SELECT COMPANY_NO                                         
C34828          INTO :AT-COMPANY-NO                                     
C34828          FROM CSS_ACCOUNT WITH(READUNCOMMITTED)                          
C34828        WHERE                                                     
C34828          ACCOUNT_NO    = :AT-ACCOUNT-NO                          
P00758                                                           
P00758                                                      
C34828     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT COMPANY_NO                                                 
MFA-TR*         INTO :AT-COMPANY-NO                                             
MFA-TR*         FROM CSS_ACCOUNT                                                
MFA-TR*       WHERE                                                             
MFA-TR*         ACCOUNT_NO    = :AT-ACCOUNT-NO                                  
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7523                                                    
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

C34828                                                                  
C34828     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
C34828     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
C34828        NEXT SENTENCE                                             
C34828     ELSE                                                         
C34828        MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
C34828        MOVE '7523'                       TO ACTIVE-PARAGRAPH     
C34828        MOVE 'SELECT'                     TO ABEND-FUNCTION       
C34828        MOVE 'CSS_ACCOUNT'                TO TABLE-1              
C34828        MOVE 'ACCOUNT_NO'                 TO TABLE-ELEMENT-1      
C34828        MOVE AT-ACCOUNT-NO                TO HOSTVAR-ELEMENT-1    
C34828        PERFORM 9000-SEND-ERROR-RESULT    THRU 9000-EXIT          
C34828        PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          
C34828     END-IF.                                                      
C34828                                                                  
C34828 7523-EXIT.                                                       
C34828     EXIT.                                                        
      *****************************************************************         
      * 7800-SELECT-TIMESTAMP                                         *         
      *     CALLS 9000-SEND-ERROR-RESULT                              *         
      *           9900-SQL-ERROR-ROUTINE                              *         
      *     CALLED FROM 5400-JRN-TRAN-HEAD                            *         
      *     SELECTS CSS_MODEL_SQL                                     *         
      *****************************************************************         
        7800-SELECT-TIMESTAMP.                                          
                                                                        
           MOVE '7800'                  TO ACTIVE-PARAGRAPH.            
                                                                        
           EXEC SQL                                                     
              SELECT
              REPLACE(REPLACE(CONVERT(CHAR(26), CIS.CURRENT$TIMESTAMP()
           , 121), ' ', '-'), ':', '.')
            INTO
              :WS-CURRENT-TIMESTAMP             
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SET :WS-CURRENT-TIMESTAMP = CURRENT TIMESTAMP                     
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

                                                                        
CBSI       MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
CBSI       IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
CBSI          NEXT SENTENCE                                             
CBSI       ELSE                                                         
CBSI          MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
CBSI          MOVE 'SET'                        TO ABEND-FUNCTION       
CBSI          MOVE 'ACCOUNT_NO'                 TO TABLE-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1    
CBSI          PERFORM 9000-SEND-ERROR-RESULT    THRU 9000-EXIT          
CBSI          PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          
CBSI       END-IF.                                                      
                                                                        
       7800-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      *****************************************************************         
      * 7801-SELECT-DATE                                              *         
      *     CALLS 9000-SEND-ERROR-RESULT                              *         
      *           9900-SQL-ERROR-ROUTINE                              *         
      *     CALLED FROM 5400-JRN-TRAN-HEAD                            *         
      *     SELECTS CSS_MODEL_SQL                                     *         
      *****************************************************************         
       7801-SELECT-DATE.                                                
                                                                        
           MOVE '7801'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT
              CAST(SYSDATETIMEOFFSET() AS DATE)
            INTO
              :WS-CURRENT-DATE                       
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SET :WS-CURRENT-DATE = CURRENT DATE                               
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

                                                                        
CBSI       MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
CBSI       IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
CBSI          NEXT SENTENCE                                             
CBSI       ELSE                                                         
CBSI          MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
CBSI          MOVE 'SET'                        TO ABEND-FUNCTION       
CBSI          MOVE 'ACCOUNT_NO'                 TO TABLE-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1    
CBSI          PERFORM 9000-SEND-ERROR-RESULT    THRU 9000-EXIT          
CBSI          PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          
CBSI       END-IF.                                                      
                                                                        
       7801-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      *****************************************************************         
      * 7802-SELECT-RESP-AREA                                         *         
      *     CALLS 9000-SEND-ERROR-RESULT                              *         
      *           9900-SQL-ERROR-ROUTINE                              *         
      *     CALLED FROM 5400-JRNL-TRAN-HEAD                           *         
      *     SELECTS CSS_USER_PROFILE                                  *         
      *****************************************************************         
       7802-SELECT-RESP-AREA.                                           
                                                                        
           MOVE '7802'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT RESP_AREA_ID                                       
                INTO :PF-RESP-AREA-ID                                   
                FROM CSS_USER_PROFILE WITH(READUNCOMMITTED)                     
               WHERE USER_ID = :PF-USER-ID                              
P00758                                                           
P00758                                                      
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT RESP_AREA_ID                                               
MFA-TR*         INTO :PF-RESP-AREA-ID                                           
MFA-TR*         FROM CSS_USER_PROFILE                                           
MFA-TR*        WHERE USER_ID = :PF-USER-ID                                      
MFA-TR*        WITH UR                                                          
MFA-TR*        QUERYNO 7802                                                     
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.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE '7802'                     TO ACTIVE-PARAGRAPH       
              MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_USER_PROFILE'         TO TABLE-1                
              MOVE 'USER_ID'                  TO TABLE-ELEMENT-1        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-2        
              MOVE PARM-USER-ID               TO HOSTVAR-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-2      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
       7802-EXIT.                                                       
            EXIT.                                                       
                                                                        
                                                                        
      ******************************************************************        
      * 7110-SELECT-PJ-ROW.                                            *        
      *                                                                *        
      *   THIS PARAGRAPH IS USED TO OBTAIN THE NEXT ROW FROM THE       *        
      *   CSS_PROJ_SHARE  TABLE                                        *        
      ******************************************************************        
       7110-SELECT-PJ-ROW.                                              
                                                                        
           MOVE '7110'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT ACCT_TERM_DT,                                      
                     SHARE_ENROLL_DT,                                   
                     SHARE_STATUS_CD,                                   
                     MONTHLY_BILL_AM                                    
                INTO :PJ-ACCT-TERM-DT :WS-NULL-IND1,                     
                     :PJ-SHARE-ENROLL-DT :WS-NULL-IND2,                  
                     :PJ-SHARE-STATUS-CD,                               
                     :PJ-MONTHLY-BILL-AM                                
                FROM CSS_PROJ_SHARE WITH(READUNCOMMITTED)                       
               WHERE ACCOUNT_NO        = :PJ-ACCOUNT-NO                 
                 AND PYMT_PRIORITY_LVL = 129                            
                 AND ITEM_ID           = 1                              
P00758                                                           
P00758                                                      
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT ACCT_TERM_DT,                                              
MFA-TR*              SHARE_ENROLL_DT,                                           
MFA-TR*              SHARE_STATUS_CD,                                           
MFA-TR*              MONTHLY_BILL_AM                                            
MFA-TR*         INTO :PJ-ACCT-TERM-DT:WS-NULL-IND1,                             
MFA-TR*              :PJ-SHARE-ENROLL-DT:WS-NULL-IND2,                          
MFA-TR*              :PJ-SHARE-STATUS-CD,                                       
MFA-TR*              :PJ-MONTHLY-BILL-AM                                        
MFA-TR*         FROM CSS_PROJ_SHARE                                             
MFA-TR*        WHERE ACCOUNT_NO        = :PJ-ACCOUNT-NO                         
MFA-TR*          AND PYMT_PRIORITY_LVL = 129                                    
MFA-TR*          AND ITEM_ID           = 1                                      
MFA-TR*          WITH UR                                                        
MFA-TR*          QUERYNO 7110                                                   
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

                                                                        
           IF WS-NULL-IND1 < 0                                          
              MOVE SPACES  TO PJ-ACCT-TERM-DT                           
           END-IF                                                       
                                                                        
           IF WS-NULL-IND2 < 0                                          
              MOVE SPACES  TO PJ-SHARE-ENROLL-DT                        
           END-IF                                                       
                                                                        
           MOVE SQLCODE                TO WS-ACTIVE-RETURN-CODE.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_PROJ_SHARE'           TO TABLE-1                
CBSI          MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
              MOVE PJ-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT
           END-IF.           
                                                                        
       7110-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7511-SELECT-AC.                                                *        
      *   THIS PARAGRAPH IS USED TO OBTAIN THE NEXT ROW FROM THE       *        
      *   CSS_AR_CNTL TABLE                                            *        
      ******************************************************************        
       7511-SELECT-AC.                                                  
                                                                        
           MOVE '7511'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT AMT_AR_DAY_00,                                     
                     AMT_AR_DAY_30,                                     
                     AMT_AR_DAY_60,                                     
                     AMT_AR_DAY_90,                                     
                     AMT_UNUSED_CR,                                     
                     AMT_TRAN_BALANCE,                                  
                     TOT_SUMM_UNBILLED                                  
                INTO :AC-AMT-AR-DAY-00,                                 
                     :AC-AMT-AR-DAY-30,                                 
                     :AC-AMT-AR-DAY-60,                                 
                     :AC-AMT-AR-DAY-90,                                 
                     :AC-AMT-UNUSED-CR,                                 
                     :AC-AMT-TRAN-BALANCE,                              
                     :AC-TOT-SUMM-UNBILLED                              
                FROM CSS_AR_CNTL                                        
               WHERE ACCOUNT_NO        = :AC-ACCOUNT-NO                 
                 AND PYMT_PRIORITY_LVL = 129                            
                 AND ITEM_ID           = 1                              
           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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_CNTL'              TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE AC-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7511-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7522-GET-GL-NO.                                                *        
      *   THIS PARAGRAPH IS USED TO OBTAIN THE GL-NO FROM THE GL-NAME  *        
      *   CSS_GL_ACCT_NO TABLE.                                        *        
      ******************************************************************        
       7522-GET-GL-NO.                                                  
                                                                        
           MOVE '7522'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              SELECT GL_ACCT_NO                                         
                INTO :GO-GL-ACCT-NO                                     
                FROM CSS_GL_ACCT_NO WITH(READUNCOMMITTED)                       
               WHERE GL_ACCT_NAME = :GO-GL-ACCT-NAME                    
MCR310           AND COMPANY_NO   = '01'                                
P00758                                                           
P00758                                                      
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT GL_ACCT_NO                                                 
MFA-TR*         INTO :GO-GL-ACCT-NO                                             
MFA-TR*         FROM CSS_GL_ACCT_NO                                             
MFA-TR*        WHERE GL_ACCT_NAME = :GO-GL-ACCT-NAME                            
MFA-TR*          AND COMPANY_NO   = '01'                                        
MFA-TR*          WITH UR                                                        
MFA-TR*          QUERYNO 7522                                                   
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_GL_ACCT_NO'           TO TABLE-1                
              MOVE 'GL_ACCT_NAME'             TO TABLE-ELEMENT-1        
              MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
              MOVE GO-GL-ACCT-NAME            TO HOSTVAR-ELEMENT-1      
              MOVE '01'                       TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-3      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7522-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8500-UPDATE-PJ.                                                *        
      *   THIS PARAGRAPH IS USED TO UPDATE THE SELECTED ROW FROM THE   *        
      *   CSS_PROJ_SHARE TABLE.                                        *        
      ******************************************************************        
       8500-UPDATE-PJ.                                                  
                                                                        
           MOVE '8500'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             UPDATE CSS_PROJ_SHARE                                      
                SET SHARE_ENROLL_DT = IIF(TRY_CONVERT(DATE, 
                                                    :PJ-SHARE-ENROLL-DT
              ) IS NULL OR (PATINDEX('%.%', :PJ-SHARE-ENROLL-DT
              ) <> 0) OR (LEN(:PJ-SHARE-ENROLL-DT
              ) <> 10), CIS.CHAR2DATE(:PJ-SHARE-ENROLL-DT
              ), CONVERT(DATE, :PJ-SHARE-ENROLL-DT) ),              
                    ACCT_TERM_DT    = IIF(TRY_CONVERT(DATE, 
                                                      :PJ-ACCT-TERM-DT 
                                                          :WS-NULL-IND3
              ) IS NULL OR (PATINDEX('%.%', :PJ-ACCT-TERM-DT 
                                                          :WS-NULL-IND3
              ) <> 0) OR (LEN(:PJ-ACCT-TERM-DT :WS-NULL-IND3
              ) <> 10), CIS.CHAR2DATE(:PJ-ACCT-TERM-DT :WS-NULL-IND3
              ), CONVERT(DATE, :PJ-ACCT-TERM-DT :WS-NULL-IND3) ),    
                    MONTHLY_BILL_AM = :PJ-MONTHLY-BILL-AM,              
ACT253              SHARE_STATUS_CD = :PJ-SHARE-STATUS-CD,              
ACT253              INIT_BY         = :PJ-INIT-BY                       
              WHERE  ACCOUNT_NO        = :PJ-ACCOUNT-NO                 
                AND  PYMT_PRIORITY_LVL = 129                            
                AND  ITEM_ID           = :PJ-ITEM-ID                    
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      UPDATE CSS_PROJ_SHARE                                              
MFA-TR*         SET SHARE_ENROLL_DT = :PJ-SHARE-ENROLL-DT,                      
MFA-TR*             ACCT_TERM_DT    = :PJ-ACCT-TERM-DT:WS-NULL-IND3,            
MFA-TR*             MONTHLY_BILL_AM = :PJ-MONTHLY-BILL-AM,                      
MFA-TR*             SHARE_STATUS_CD = :PJ-SHARE-STATUS-CD,                      
MFA-TR*             INIT_BY         = :PJ-INIT-BY                               
MFA-TR*       WHERE  ACCOUNT_NO        = :PJ-ACCOUNT-NO                         
MFA-TR*         AND  PYMT_PRIORITY_LVL = 129                                    
MFA-TR*         AND  ITEM_ID           = :PJ-ITEM-ID                            
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'UPDATE'                   TO ABEND-FUNCTION         
              MOVE 'CSS_PROJ_SHARE'           TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
              MOVE 'ITEM_ID'                  TO TABLE-ELEMENT-2        
CBSI          MOVE 'SHARE_ENROLL_DT'          TO TABLE-ELEMENT-3        
CBSI          MOVE 'ACCT_TERM_DT'             TO TABLE-ELEMENT-4        
              MOVE PJ-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE PJ-ITEM-ID                 TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PJ-SHARE-ENROLL-DT         TO HOSTVAR-ELEMENT-3      
CBSI          MOVE PJ-ACCT-TERM-DT            TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8500-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8511-DELETE-AR-CNTL-SUMM.                                      *        
      *   THIS PARAGRAPH IS USED TO DELETE A  ROW FROM THE             *        
      *   CSS_AR_CNTL TABLE                                            *        
      ******************************************************************        
       8511-DELETE-AR-CNTL-SUMM.                                        
                                                                        
           MOVE '8511'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              DELETE                                                    
                FROM CSS_AR_CNTL                                        
               WHERE ACCOUNT_NO        = :AC-ACCOUNT-NO                 
                 AND PYMT_PRIORITY_LVL = 129                            
                 AND ITEM_ID           = 0                              
           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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'DELETE'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_CNTL'              TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE AC-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8511-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8512-DELETE-AR-CNTL-DET.                                       *        
      *   THIS PARAGRAPH IS USED TO DELETE A  ROW FROM THE             *        
      *   CSS_AR_CNTL TABLE                                            *        
      ******************************************************************        
       8512-DELETE-AR-CNTL-DET.                                         
                                                                        
           MOVE '8512'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
              DELETE                                                    
                FROM CSS_AR_CNTL                                        
               WHERE ACCOUNT_NO        = :AC-ACCOUNT-NO                 
                 AND PYMT_PRIORITY_LVL = 129                            
                 AND ITEM_ID           = 1                              
           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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'DELETE'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_CNTL'              TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE AC-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8512-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8520-INSERT-AR-ROW.                                            *        
      *   THIS PARAGRAPH IS USED TO INSERT A ROW IN THE                *        
      *   CSS_AR_TRANS_HIST TABLE.                                     *        
      ******************************************************************        
       8520-INSERT-AR-ROW.                                              
                                                                        
           MOVE '8520'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             INSERT INTO CSS_AR_TRANS_HIST                              
             (ACCOUNT_NO,                                               
              TRANS_HIST_SEQ_NO,                                        
              DATE_TRANS,                                               
              CODE_TRAN_TYPE,                                           
              AMT_ORIG_ENTERED,                                         
              AMT_BILLED_UNPAID,                                        
              RESP_AREA_ID,                                             
              APPL_PROGRAM_ID,                                          
              PYMT_FACILITY_CD,                                         
              USER_ID,                                                  
              COMPANY_NO,                                               
              RECORD_ONLY_FL,                                           
              DATE_ORIG_PYMT,                                           
              PYMT_REFUNDED_IND,                                        
              CASH_COMPANY_NO,                                          
              CASH_LOCAL_OFFICE,                                        
              CASH_REPORT_NO,                                           
              DATE_CASH_REPORT,                                         
              CASH_DRAWER_ID,                                           
              TRAN_COMMENT)                                             
             VALUES                                                     
                  (:AR-ACCOUNT-NO,                                      
                   CIS.CHAR2TIMESTAMP(:AR-TRANS-HIST-SEQ-NO),                   
                   IIF(TRY_CONVERT(DATE, :AR-DATE-TRANS
              ) IS NULL OR (PATINDEX('%.%', :AR-DATE-TRANS
              ) <> 0) OR (LEN(:AR-DATE-TRANS) <> 10), CIS.CHAR2DATE(
                                                         :AR-DATE-TRANS
              ), CONVERT(DATE, :AR-DATE-TRANS) ),                              
                   :AR-CODE-TRAN-TYPE,                                  
                   :AR-AMT-ORIG-ENTERED,                                
                   :AR-AMT-BILLED-UNPAID,                               
                   :AR-RESP-AREA-ID,                                    
                   :AR-APPL-PROGRAM-ID,                                 
                   :AR-PYMT-FACILITY-CD,                                
                   :AR-USER-ID,                                         
                   :AR-COMPANY-NO,                                      
                   :AR-RECORD-ONLY-FL,                                  
                   IIF(TRY_CONVERT(DATE, :AR-DATE-ORIG-PYMT
              ) IS NULL OR (PATINDEX('%.%', :AR-DATE-ORIG-PYMT
              ) <> 0) OR (LEN(:AR-DATE-ORIG-PYMT
              ) <> 10), CIS.CHAR2DATE(:AR-DATE-ORIG-PYMT
              ), CONVERT(DATE, :AR-DATE-ORIG-PYMT) ),                          
                   :AR-PYMT-REFUNDED-IND,                               
                   :AR-CASH-COMPANY-NO,                                 
                   :AR-CASH-LOCAL-OFFICE,                               
                   :AR-CASH-REPORT-NO,                                  
                   IIF(TRY_CONVERT(DATE, :AR-DATE-CASH-REPORT
              ) IS NULL OR (PATINDEX('%.%', :AR-DATE-CASH-REPORT
              ) <> 0) OR (LEN(:AR-DATE-CASH-REPORT
              ) <> 10), CIS.CHAR2DATE(:AR-DATE-CASH-REPORT
              ), CONVERT(DATE, :AR-DATE-CASH-REPORT) ),                        
                   :AR-CASH-DRAWER-ID,                                  
                   :AR-TRAN-COMMENT)                                    
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO CSS_AR_TRANS_HIST                                      
MFA-TR*      (ACCOUNT_NO,                                                       
MFA-TR*       TRANS_HIST_SEQ_NO,                                                
MFA-TR*       DATE_TRANS,                                                       
MFA-TR*       CODE_TRAN_TYPE,                                                   
MFA-TR*       AMT_ORIG_ENTERED,                                                 
MFA-TR*       AMT_BILLED_UNPAID,                                                
MFA-TR*       RESP_AREA_ID,                                                     
MFA-TR*       APPL_PROGRAM_ID,                                                  
MFA-TR*       PYMT_FACILITY_CD,                                                 
MFA-TR*       USER_ID,                                                          
MFA-TR*       COMPANY_NO,                                                       
MFA-TR*       RECORD_ONLY_FL,                                                   
MFA-TR*       DATE_ORIG_PYMT,                                                   
MFA-TR*       PYMT_REFUNDED_IND,                                                
MFA-TR*       CASH_COMPANY_NO,                                                  
MFA-TR*       CASH_LOCAL_OFFICE,                                                
MFA-TR*       CASH_REPORT_NO,                                                   
MFA-TR*       DATE_CASH_REPORT,                                                 
MFA-TR*       CASH_DRAWER_ID,                                                   
MFA-TR*       TRAN_COMMENT)                                                     
MFA-TR*      VALUES                                                             
MFA-TR*           (:AR-ACCOUNT-NO,                                              
MFA-TR*            :AR-TRANS-HIST-SEQ-NO,                                       
MFA-TR*            :AR-DATE-TRANS,                                              
MFA-TR*            :AR-CODE-TRAN-TYPE,                                          
MFA-TR*            :AR-AMT-ORIG-ENTERED,                                        
MFA-TR*            :AR-AMT-BILLED-UNPAID,                                       
MFA-TR*            :AR-RESP-AREA-ID,                                            
MFA-TR*            :AR-APPL-PROGRAM-ID,                                         
MFA-TR*            :AR-PYMT-FACILITY-CD,                                        
MFA-TR*            :AR-USER-ID,                                                 
MFA-TR*            :AR-COMPANY-NO,                                              
MFA-TR*            :AR-RECORD-ONLY-FL,                                          
MFA-TR*            :AR-DATE-ORIG-PYMT,                                          
MFA-TR*            :AR-PYMT-REFUNDED-IND,                                       
MFA-TR*            :AR-CASH-COMPANY-NO,                                         
MFA-TR*            :AR-CASH-LOCAL-OFFICE,                                       
MFA-TR*            :AR-CASH-REPORT-NO,                                          
MFA-TR*            :AR-DATE-CASH-REPORT,                                        
MFA-TR*            :AR-CASH-DRAWER-ID,                                          
MFA-TR*            :AR-TRAN-COMMENT)                                            
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'INSERT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_TRANS_HIST'        TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'DATE_TRANS    '           TO TABLE-ELEMENT-2        
CBSI          MOVE 'DATE_ORIG_PYMT'           TO TABLE-ELEMENT-3        
CBSI          MOVE 'DATE_CASH_REPORT'         TO TABLE-ELEMENT-4        
              MOVE AR-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE AR-DATE-TRANS              TO HOSTVAR-ELEMENT-2      
CBSI          MOVE AR-DATE-ORIG-PYMT          TO HOSTVAR-ELEMENT-3      
CBSI          MOVE AR-DATE-CASH-REPORT        TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8520-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8521-UPDATE-ACCOUNT.                                           *        
      *   THIS PARAGRAPH IS USED TO UPDATE THE SELECTED ROW FROM THE   *        
      *   CSS_ACCOUNT TABLE.                                           *        
      ******************************************************************        
       8521-UPDATE-ACCOUNT.                                             
                                                                        
           MOVE '8521'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             UPDATE CSS_ACCOUNT                                         
                SET CODES_DATA_PRESENT = :AT-CODES-DATA-PRESENT,        
                    TOTAL_AR_BALANCE   = :AT-TOTAL-AR-BALANCE,          
T21072              LAST_UPDATE_TS     = CIS.CHAR2TIMESTAMP(
                                                     :AT-LAST-UPDATE-TS
              )             
              WHERE ACCOUNT_NO = :AT-ACCOUNT-NO                         
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      UPDATE CSS_ACCOUNT                                                 
MFA-TR*         SET CODES_DATA_PRESENT = :AT-CODES-DATA-PRESENT,                
MFA-TR*             TOTAL_AR_BALANCE   = :AT-TOTAL-AR-BALANCE,                  
MFA-TR*             LAST_UPDATE_TS     = :AT-LAST-UPDATE-TS                     
MFA-TR*       WHERE ACCOUNT_NO = :AT-ACCOUNT-NO                                 
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'UPDATE'                   TO ABEND-FUNCTION         
              MOVE 'CSS_ACCOUNT'              TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'CODES_DATA_PRESENT'       TO TABLE-ELEMENT-2        
CBSI          MOVE 'TOTAL_AR_BALANCE'         TO TABLE-ELEMENT-3        
T21072        MOVE 'LAST_UPDATE_TS'           TO TABLE-ELEMENT-4        
              MOVE AT-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE AT-CODES-DATA-PRESENT      TO HOSTVAR-ELEMENT-2      
CBSI          MOVE AT-TOTAL-AR-BALANCE        TO WS-TOTAL-AR-BALANCE-ED 
CBSI          MOVE WS-TOTAL-AR-BALANCE-ED     TO HOSTVAR-ELEMENT-3      
T21072        MOVE AT-LAST-UPDATE-TS          TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8521-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8520A-INSERT-AU-ROW.                                           *        
      *   THIS PARAGRAPH IS USED TO INSERT A ROW IN THE                *        
      *   CSS_AR_TRN_HST_DET TABLE.                                    *        
      ******************************************************************        
       8520A-INSERT-AU-ROW.                                             
                                                                        
           MOVE '8520A'              TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             INSERT INTO CSS_AR_TRN_HST_DET                             
             (ACCOUNT_NO,                                               
              TRANS_HIST_SEQ_NO,                                        
              TRAN_APPL_NO,                                             
              CODE_AR_AGE,                                              
              GL_ACCT_CREDIT,                                           
              GL_ACCT_DEBIT,                                            
              AMT_POSTED,                                               
              ITEM_ID,                                                  
              CODE_CONTRACT_TYPE,                                       
              CURRENCY_TYPE,                                            
              CURRENCY_AMT)                                             
             VALUES                                                     
                  (:AU-ACCOUNT-NO,                                      
                   CIS.CHAR2TIMESTAMP(:AU-TRANS-HIST-SEQ-NO),                   
                   :AU-TRAN-APPL-NO,                                    
                   :AU-CODE-AR-AGE,                                     
                   :AU-GL-ACCT-CREDIT,                                  
                   :AU-GL-ACCT-DEBIT,                                   
                   :AU-AMT-POSTED,                                      
                   :AU-ITEM-ID,                                         
                   :AU-CODE-CONTRACT-TYPE,                              
                   :AU-CURRENCY-TYPE,                                   
                   :AU-CURRENCY-AMT)                                    
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO CSS_AR_TRN_HST_DET                                     
MFA-TR*      (ACCOUNT_NO,                                                       
MFA-TR*       TRANS_HIST_SEQ_NO,                                                
MFA-TR*       TRAN_APPL_NO,                                                     
MFA-TR*       CODE_AR_AGE,                                                      
MFA-TR*       GL_ACCT_CREDIT,                                                   
MFA-TR*       GL_ACCT_DEBIT,                                                    
MFA-TR*       AMT_POSTED,                                                       
MFA-TR*       ITEM_ID,                                                          
MFA-TR*       CODE_CONTRACT_TYPE,                                               
MFA-TR*       CURRENCY_TYPE,                                                    
MFA-TR*       CURRENCY_AMT)                                                     
MFA-TR*      VALUES                                                             
MFA-TR*           (:AU-ACCOUNT-NO,                                              
MFA-TR*            :AU-TRANS-HIST-SEQ-NO,                                       
MFA-TR*            :AU-TRAN-APPL-NO,                                            
MFA-TR*            :AU-CODE-AR-AGE,                                             
MFA-TR*            :AU-GL-ACCT-CREDIT,                                          
MFA-TR*            :AU-GL-ACCT-DEBIT,                                           
MFA-TR*            :AU-AMT-POSTED,                                              
MFA-TR*            :AU-ITEM-ID,                                                 
MFA-TR*            :AU-CODE-CONTRACT-TYPE,                                      
MFA-TR*            :AU-CURRENCY-TYPE,                                           
MFA-TR*            :AU-CURRENCY-AMT)                                            
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'INSERT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_TRN_HST_DET'       TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'TRAN_APPL_NO  '           TO TABLE-ELEMENT-2        
CBSI          MOVE 'GL_ACCT_CREDIT'           TO TABLE-ELEMENT-3        
CBSI          MOVE 'GL_ACCT_DEBIT'            TO TABLE-ELEMENT-4        
              MOVE AU-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE AU-TRAN-APPL-NO            TO HOSTVAR-ELEMENT-2      
CBSI          MOVE AU-GL-ACCT-CREDIT          TO WS-GL-ACCT-CREDIT-ED   
CBSI          MOVE WS-GL-ACCT-CREDIT-ED       TO HOSTVAR-ELEMENT-3      
CBSI          MOVE AU-GL-ACCT-DEBIT           TO WS-GL-ACCT-DEBIT-ED    
CBSI          MOVE WS-GL-ACCT-DEBIT-ED        TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8520A-EXIT.                                                      
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8600-INSERT-PJ.                                                *        
      *   THIS PARAGRAPH IS USED TO INSERT A ROW IN THE                *        
      *   CSS_PROJ_SHARE  TABLE                                        *        
      ******************************************************************        
       8600-INSERT-PJ.                                                  
                                                                        
           MOVE '8600'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             INSERT INTO CSS_PROJ_SHARE                                 
             (ACCOUNT_NO,                                               
              ACCT_TERM_DT,                                             
              INIT_BY,                                                  
              ITEM_ID,                                                  
              MONTHLY_BILL_AM,                                          
              PYMT_PRIORITY_LVL,                                        
              SHARE_ENROLL_DT,                                          
              SHARE_STATUS_CD,                                          
              TOT_PREV_AM,                                              
              TOT_YTD_AM)                                               
             VALUES                                                     
                  (:PJ-ACCOUNT-NO,                                      
                   IIF(TRY_CONVERT(DATE, :PJ-ACCT-TERM-DT :WS-NULL-IND1
              ) IS NULL OR (PATINDEX('%.%', :PJ-ACCT-TERM-DT 
                                                          :WS-NULL-IND1
              ) <> 0) OR (LEN(:PJ-ACCT-TERM-DT :WS-NULL-IND1
              ) <> 10), CIS.CHAR2DATE(:PJ-ACCT-TERM-DT :WS-NULL-IND1
              ), CONVERT(DATE, :PJ-ACCT-TERM-DT :WS-NULL-IND1) ),              
                   :PJ-INIT-BY,                                         
                   :PJ-ITEM-ID,                                         
                   :PJ-MONTHLY-BILL-AM,                                 
                   :PJ-PYMT-PRIORITY-LVL,                               
                   IIF(TRY_CONVERT(DATE, :PJ-SHARE-ENROLL-DT 
                                         :WS-NULL-IND2
              ) IS NULL OR (PATINDEX('%.%', :PJ-SHARE-ENROLL-DT 
                                                          :WS-NULL-IND2
              ) <> 0) OR (LEN(:PJ-SHARE-ENROLL-DT :WS-NULL-IND2
              ) <> 10), CIS.CHAR2DATE(:PJ-SHARE-ENROLL-DT :WS-NULL-IND2
              ), CONVERT(DATE, :PJ-SHARE-ENROLL-DT :WS-NULL-IND2) ),           
                   :PJ-SHARE-STATUS-CD,                                 
                   :PJ-TOT-PREV-AM,                                     
                   :PJ-TOT-YTD-AM )                                     
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO CSS_PROJ_SHARE                                         
MFA-TR*      (ACCOUNT_NO,                                                       
MFA-TR*       ACCT_TERM_DT,                                                     
MFA-TR*       INIT_BY,                                                          
MFA-TR*       ITEM_ID,                                                          
MFA-TR*       MONTHLY_BILL_AM,                                                  
MFA-TR*       PYMT_PRIORITY_LVL,                                                
MFA-TR*       SHARE_ENROLL_DT,                                                  
MFA-TR*       SHARE_STATUS_CD,                                                  
MFA-TR*       TOT_PREV_AM,                                                      
MFA-TR*       TOT_YTD_AM)                                                       
MFA-TR*      VALUES                                                             
MFA-TR*           (:PJ-ACCOUNT-NO,                                              
MFA-TR*            :PJ-ACCT-TERM-DT:WS-NULL-IND1,                               
MFA-TR*            :PJ-INIT-BY,                                                 
MFA-TR*            :PJ-ITEM-ID,                                                 
MFA-TR*            :PJ-MONTHLY-BILL-AM,                                         
MFA-TR*            :PJ-PYMT-PRIORITY-LVL,                                       
MFA-TR*            :PJ-SHARE-ENROLL-DT:WS-NULL-IND2,                            
MFA-TR*            :PJ-SHARE-STATUS-CD,                                         
MFA-TR*            :PJ-TOT-PREV-AM,                                             
MFA-TR*            :PJ-TOT-YTD-AM )                                             
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'INSERT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_PROJ_SHARE'           TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'PYMT_PRIORITY_LVL'        TO TABLE-ELEMENT-2        
CBSI          MOVE 'ITEM_ID'                  TO TABLE-ELEMENT-3        
CBSI          MOVE 'SHARE_ENROLL_DT'          TO TABLE-ELEMENT-4        
              MOVE PJ-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE PJ-PYMT-PRIORITY-LVL       TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PJ-ITEM-ID                 TO HOSTVAR-ELEMENT-3      
CBSI          MOVE PJ-SHARE-ENROLL-DT         TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8600-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8610-INSERT-AC.                                                *        
      *   THIS PARAGRAPH IS USED TO INSERT A ROW IN THE                *        
      *   CSS_AR_CNTL TABLE.                                           *        
      ******************************************************************        
       8610-INSERT-AC.                                                  
                                                                        
           MOVE '8610'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             INSERT INTO CSS_AR_CNTL                                    
             (ACCOUNT_NO,                                               
              AMT_AR_DAY_00,                                            
              AMT_AR_DAY_30,                                            
              AMT_AR_DAY_60,                                            
              AMT_AR_DAY_90,                                            
              AMT_TRAN_BALANCE,                                         
              AMT_UNUSED_CR,                                            
              ITEM_ID,                                                  
              LAST_UPDATE_TS,                                           
              PYMT_PRIORITY_LVL,                                        
              TOT_SUMM_UNBILLED)                                        
             VALUES                                                     
                  (:AC-ACCOUNT-NO,                                      
                   :AC-AMT-AR-DAY-00,                                   
                   :AC-AMT-AR-DAY-30,                                   
                   :AC-AMT-AR-DAY-60,                                   
                   :AC-AMT-AR-DAY-90,                                   
                   :AC-AMT-TRAN-BALANCE,                                
                   :AC-AMT-UNUSED-CR,                                   
                   :AC-ITEM-ID,                                         
                   CIS.CHAR2TIMESTAMP(:AC-LAST-UPDATE-TS),                      
                   :AC-PYMT-PRIORITY-LVL,                               
                   :AC-TOT-SUMM-UNBILLED)                               
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO CSS_AR_CNTL                                            
MFA-TR*      (ACCOUNT_NO,                                                       
MFA-TR*       AMT_AR_DAY_00,                                                    
MFA-TR*       AMT_AR_DAY_30,                                                    
MFA-TR*       AMT_AR_DAY_60,                                                    
MFA-TR*       AMT_AR_DAY_90,                                                    
MFA-TR*       AMT_TRAN_BALANCE,                                                 
MFA-TR*       AMT_UNUSED_CR,                                                    
MFA-TR*       ITEM_ID,                                                          
MFA-TR*       LAST_UPDATE_TS,                                                   
MFA-TR*       PYMT_PRIORITY_LVL,                                                
MFA-TR*       TOT_SUMM_UNBILLED)                                                
MFA-TR*      VALUES                                                             
MFA-TR*           (:AC-ACCOUNT-NO,                                              
MFA-TR*            :AC-AMT-AR-DAY-00,                                           
MFA-TR*            :AC-AMT-AR-DAY-30,                                           
MFA-TR*            :AC-AMT-AR-DAY-60,                                           
MFA-TR*            :AC-AMT-AR-DAY-90,                                           
MFA-TR*            :AC-AMT-TRAN-BALANCE,                                        
MFA-TR*            :AC-AMT-UNUSED-CR,                                           
MFA-TR*            :AC-ITEM-ID,                                                 
MFA-TR*            :AC-LAST-UPDATE-TS,                                          
MFA-TR*            :AC-PYMT-PRIORITY-LVL,                                       
MFA-TR*            :AC-TOT-SUMM-UNBILLED)                                       
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.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'INSERT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_CNTL'              TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'PYMT_PRIORITY_LVL'        TO TABLE-ELEMENT-2        
CBSI          MOVE 'ITEM_ID'                  TO TABLE-ELEMENT-3        
CBSI          MOVE 'AMT_UNUSED_CR'            TO TABLE-ELEMENT-4        
              MOVE AC-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE AC-PYMT-PRIORITY-LVL       TO HOSTVAR-ELEMENT-2      
CBSI          MOVE AC-ITEM-ID                 TO HOSTVAR-ELEMENT-3      
CBSI          MOVE AC-AMT-UNUSED-CR           TO WS-AMT-UNUSED-CR-ED    
CBSI          MOVE WS-AMT-UNUSED-CR-ED        TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8610-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 8620-UDATE-AC.                                                 *        
      *   THIS PARAGRAPH IS USED TO UPDATE THE SELECTED ROW FROM THE   *        
      *   CSS_AR_CNTL TABLE.                                           *        
      ******************************************************************        
       8620-UPDATE-AC.                                                  
                                                                        
           MOVE '8620'               TO ACTIVE-PARAGRAPH.               
                                                                        
           EXEC SQL                                                     
             UPDATE CSS_AR_CNTL                                         
                SET AMT_AR_DAY_00    = :AC-AMT-AR-DAY-00                
                  , AMT_TRAN_BALANCE = :AC-AMT-TRAN-BALANCE             
ACT131            , TOT_SUMM_UNBILLED = :AC-TOT-SUMM-UNBILLED           
              WHERE ACCOUNT_NO        = :AC-ACCOUNT-NO AND              
                    PYMT_PRIORITY_LVL = 129 AND                         
                    ITEM_ID           = :AC-ITEM-ID                     
           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.        
      *                                                                         
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
CBSI          MOVE 'UPDATE'                   TO ABEND-FUNCTION         
              MOVE 'CSS_AR_CNTL'              TO TABLE-1                
              MOVE 'ACCOUNT_NO    '           TO TABLE-ELEMENT-1        
CBSI          MOVE 'ITEM_ID'                  TO TABLE-ELEMENT-2        
CBSI          MOVE 'AMT_AR_DAY_00'            TO TABLE-ELEMENT-3        
CBSI          MOVE 'AMT_TRAN_BALANCE'         TO TABLE-ELEMENT-4        
              MOVE AC-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE AC-ITEM-ID                 TO HOSTVAR-ELEMENT-2      
CBSI          MOVE AC-AMT-AR-DAY-00           TO WS-AMT-AR-DAY-00-ED    
CBSI          MOVE WS-AMT-AR-DAY-00-ED        TO HOSTVAR-ELEMENT-3      
CBSI          MOVE AC-AMT-TRAN-BALANCE        TO WS-AMT-TRAN-BALANCE-ED 
CBSI          MOVE WS-AMT-TRAN-BALANCE-ED     TO HOSTVAR-ELEMENT-4      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       8620-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 9900- JOURNALING / ERROR HANDLING INCLUDE *                             
      ******************************************************************        
           EXEC SQL                                                             
              INCLUDE CPDSP300                                                  
           END-EXEC.                                                            
                                                                        
                                                                        
      ******************************************************************        
      * 9700 - SPECIAL / ERROR HANDLING ROUTINE                        *        
      ******************************************************************        
TP8767     EXEC SQL                                                             
TP8767        INCLUDE CPD0023C                                                  
TP8767     END-EXEC.                                                            
                                                                        
                                                                        
      ******************************************************************        
      * 7999- SELECT AL                                                *        
      ******************************************************************        
           EXEC SQL                                                             
              INCLUDE CPD00075                                                  
           END-EXEC.                                                            
                                                                        
T21206*                                                                         
T21206*****************************************************************         
T21206*  CALLS THE SUBPROGRAM SCSCA182                                          
T21206*****************************************************************         
T21206*                                                                         
T21206 9200-LINK-SCSCA182.                                              
T21206*                                                                         
T21206     MOVE '9200'                        TO ACTIVE-PARAGRAPH.      
                                                                        
REARCH     CALL MCSCA182  USING  SCSCA182-ACCOUNT-NO                    
REARCH                          ,SCSCA182-RETURN-CODE                   
REARCH                          ,SCSCA182-LAST-UPDATE-TS                
REARCH                          ,ABEND-FILE.                            
T21206                                                                  
T21206 9200-EXIT.                                                       
T21206     EXIT.                                                        
                                                                        
CVT000 8100-SEND-RESULT.                                                
CVT000       ADD 1 TO CTR-ROWS.                                         
CVT000 8100-EXIT.                                                       
CVT000        EXIT.                                                     
CVT000     EXEC SQL                                                     00000100
CVT000         INCLUDE CPD00321                                         00000200
CVT000     END-EXEC.                                                    00000300
