       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.     PCSCA190.                                        
       DATE-WRITTEN.   FEB, 1995.                                       
           DATE-COMPILED.                                               
      ***************************************************************** 00050000
      **              COPYRIGHT/CONFIDENTIAL  MATERIAL               ** 00060000
      **                     PRICE WATERHOUSE                        ** 00070000
      **                1410 NORTH WESTSHORE BLVD                    ** 00080000
      **                   TAMPA, FLORIDA  33607                     ** 00090000
      **                      (813) 287-9200                         ** 00100000
      **                                                             ** 00110000
      ********            CUSTOMER SERVICE SYSTEM             ********* 00120000
      ********                      DB2                       ********* 00130000
      ***************************************************************** 00140000
      **                                                             ** 00150000
      **              PROGRAM  MODIFICATION  LOG                     ** 00160000
      **    DATE    INITIALS     REASON                              ** 00170000
      **    ____    ________     ______                              ** 00180000
      ** 02/07/95    LRG         SCE&G INITIAL REQUEST FOR PROGRAM   ** 00190000
      ** 11/27/95    JTH         ADD THREE REPORT EXTRACTS: CA191,   ** 00200000
      **                         CA192, CA399 (LOCATED IN EQUIVALENT ** 00210000
      **                         RP PROGRAM)                         ** 00220000
      ** 12/15/95    LMB         CA191 FILE SHOULD ONLY CONTAIN ACCTS** 00230000
      **                         WHERE DRAFT AMT IS DIFFERENT THAN   ** 00240000
      **                         ACCT BALANCE.  ALSO, MISSING INFO   ** 00250000
      **                         NEEDED FOR CA399 FILE.              ** 00260000
      ** 06/26/96    LMB         ADD TBATMISC FOR CPD00074           ** 00270000
      ** 08/12/96    CSG         ADD CPD0023B TO USE WITH CPD00074.  ** 00280000
      ** 09/02/96    CDS         TPR 5327 ADD RS-RETURN-CODE-DISP.   ** 00290000
      ** 09/09/96    JHR         ADDED NULL IND FOR ESTABLISHED_DATE.** 00300000
      ** 02/25/97    MED         WHEN WRITING OUT THE LAST CA191 REC ** 00310000
      **                         DO NOT WRITE IT IF THE DRAFT AMT    ** 00320000
      **                         AND ACCOUNT BALANCE ARE EQUAL.      ** 00330000
      ** 03/17/97    MKN         TO UPDATE THE LAST-DRAFT-CYCLE COL  ** 00340000
      **                         WHEN DRAFTING IS DONE               ** 00350000
      ** 10/29/97    MKN         REMOVED PARTITIONING                ** 00360000
      ** 11/03/97    MKN         ADDED LOGIC TO TAKE CARE OF NO RES  ** 00370000
      **                         IN EFT EXTRACT (PREVENT OC7)        ** 00380000
      ** 01/11/98    KLP         CHANGED CREATE DATE TO NEXT BUS DAY ** 00390000
T14696** 02/16/98    VB          INITIALIZE FIOCA191                 **         
T15452** 03/17/98    VB          ADDED LOGIC TO GENERATE WORK QUEUE  **         
      **                         WHEN THERE IS AN INVALID ACCOUNT NO **         
      **                         OR BANK ID OR DRAFT AMT.            **         
T15615** 03/25/98    VB          FIXED THE ABEND WHEN CLOSED BILL    **         
      **                         CYCLE IS NOT FOUND FOR RUN DATE     **         
PCR619** 03/31/98    VB          CHANGED THE PROGRAM SO THAT FCSCA191**         
      **                         LISTS ALL ACCOUNTS THAT ARE TO BE   **         
      **                         DRAFTED THE NEXT DAY                **         
T16755** 06/11/98    VB          ADDED DRAFT-STATUS IN FIOAC192      **         
T20405** 07/22/99    VB          MOVED '01' TO HEADER COMPANY NO OF  **         
T20405**                         FIOCA191 FILE                       **         
AGLPWC** 09/01/99    AMG         CHANGES FOR SEB TO SELECT VALUES    **         
AGLPWC**                         FROM CSS_DELINQUENCY                **         
AGLPWC** 09/21/99    RAO         MOVE CHAR(08) VALUE FOR TYPE5,6 AND 8*         
AGLPWC**                         FOR FCSAC0C FILE.                   **         
AGLPWC** 09/24/99    RAO         INITIALIZE WS-DESTINATION-ID CORRECTLY         
T23549** 02/23/01    JS83520     INCLUDED CHANGES FOR EPAY           **         
T22767** 05/30/01    COVANSYS    ACCUMULATES DRAFT AMOUNT FROM EFT-CSR*         
T22767**             CHENNAI     AND INSERTS IN CSH_DRWR_CNTL,        *         
T22767**                         CSH_DRWR_JRNL AND BANK_TRANSFER      *         
T22767** 10/02/01    BASKAR      SEND ZERO AMOUNT IN CREDIT FOR BANK  *         
TKDF00** 10/11/01    KDF         TO FIX S0C4                          *         
TJS000** 10/17/01    JS83520     CHANGE PARA 8840- AND 3100- TO HANDLE*         
TJS000**                         MULTI COMPANY                        *         
T25584** 10/19/01    JS83520     ADD RESTART LOGIC                    *         
C25487** 01/10/02    LF19392     REVISED DATE LOGIC FOR PULLING EPAY  *         
C25487**                         PAYMENTS                             *         
C25882** 01/22/02    DP18904     REMOVE STATUS CODE RESTRICTIONS FROM *         
C25882**                         INCLUDING DOLLAR AMOUNT IN BANK      *         
C25882**                         TRANSFER                             *         
C25923** 02/13/02    BASKAR      BANK TRANSFER LOGIC IS COMMENTED HERE*         
C25923**                         AND IT IS MOVED TO PCSAC170.         *         
C25964** 08/05/02    BASKAR      CHANGES FOR E-DRAFTS                 *         
C25964** 08/22/02    DPS         ALLOW EDRAFTS IN 191 REPORT                    
T28580** 29/03/03    COVANSYS    ALLOW E-PAY AND E-DRAFT ACCOUNTS IN  *         
T28580**                         PCSRP1911 REPORT.                    *         
T29332** 17/10/03    GOKUL       CHANGED EFT CURSOR DECLARATION       *         
T29332**                         'WITH HOLD FOR' CLAUSE ADDED         *         
C29529** 04/15/04    SS19371     ADDING FIELDS TO FILE LAYOUT FOR     *         
C29529**                         E-DRAFT AND E-PAY AND ADDED BACK     *         
C29529**                         BANK TRANSFER FOR REAL-TIME E-PAY    *         
C29529** 08/17/04    SS19371     CORRECTED LOGIC IN BANK TRANSFER SO  *         
C29529**                         THAT CORRENT LOCAL OFFICE IS USED    *         
C29529**                         BASED ON COMPANY                     *         
C29529**                         ALSO ADDED MISSING COPYBOOK FOR      *         
C29529**                         CSS_ACCT_BILL_NMES                   *         
C29529**                         CORRECTED LOGIC TO PULL BANK INFO    *         
C29529**                         FROM CSS_CUSTOMER_BANK INSTEAD OF    *         
C29529**                         CSS_BANK_EFT                         *         
C29529** 09/20/04    BB18179     FILTER OUT REAL-TIME EPAYMENTS THAT  *         
      **                         WERE PROCESSED SINCE JOURNALLING RAN.*         
C31844** 11/30/04    BASKAR    1.REMOVE REAL-TIME EPAY BANK DEPOSIT   *         
C31844**                         LOGIC AS CSR03413 WILL BE POSTING    *         
C31844**                         TO THE THIRD PARTY GL                *         
C31844**                       2.SPLIT REAL TIME E-PAY FROM E-PAYMENT *         
C31844**                         FOR CA192 REPORTING                  *         
C31844**                       3.USE CODE-SOURCE-ID TO REPORT PAYMENT *         
C31844**                         TRANSACTIONS INSTEAD OF STATUS-CODE  *         
C32389**                                                                        
C32389** 05/15/05    WR19680  CML32389.  ADDED CODE TO CHECK FOR      *         
C32389**                      SPACES IN BANK ACCOUNT NAME, ZERO IN    *         
C32389**                      BANK ID AND DUPLICATE BANK PAYMENTS FROM*         
C32389**                      THE SAME ACCOUNT ON THE SAME DAY.       *         
C32389**                      ALSO CLEANED UP ERROR ROUTINE PROCESSING*         
C32389**                      IN PARAGRAPH 2100.                                
C33105** 08/19/05    BASKAR   FIX DUPLICATE PAYMENTS WQ'S ACCOUNT NO  *         
C33105**                      PROBLEM                                 *         
RS1114** 11/14/05  R SPIRES   ADD DISPLAYS FOR RESTART FILE ERRORS.   *         
T34140** 04/12/06    JC91900  DISPLAY COMMIT POINTS CORRECTLY ON REST *         
T34140**                      ART OF CSRC190.                         *         
C35308** 06/05/07    CB18344  REMOVE WORK QUEUE LOGIC AND PRINT REPORT*         
C35308**                      INSTEAD.                                *         
A00996** 04/15/09    AP40911  THE DRAFTS WHICH ARE LESS THAN THE      *         
A00996**                      TOLERANCE AMOUNT SHOULD NOT BE HELD     *         
A00996**                      AND ALSO SHOULD NOT BE ON THE REPORT.   *         
A01497** 08/06/09    AP40911  HOLD ACCOUNTS WITH MISSING BANK INFO IN *         
A01497**                      CSS_BANK_EFT.                           *         
P00641** 05/01/12    DB41297  REMOVE TBGLATNO UNUSED FIELDS.          *         
A03874** 09/21/12    AP40911  REVIEW RE-RUN LOGIC.                    *         
A04527** 06/06/13    MR7E794  REMOVED UNUSED COPYBOOK CWS00056.       *         
P00613** 02/12/14    LG41184  TO GET THE PAYMENT FACILITY FOR MOBILE  *         
P00613**                      EPAYS.                                  *         
      ***************************************************************** 00400000
                                                                        
      *================================================================*00420000
      *================================================================*00430000
      *                                                                *00440000
      *   PCSCA190 PRODUCES THE BANKDRAFT FILE SENT TO SCE&G BANK AND  *00450000
      *   INITIATES THE POSTING OF THE PAYMENT TO THE CUSTOMER'S ACCT. *00460000
      *   PRODUCES THREE REPORTS FOR THE BANKDRAFT SENT TO THE BANK.   *00470000
      *                                                                *00480000
      *================================================================*00490000
      *================================================================*00500000
                                                                        
       ENVIRONMENT DIVISION.                                            
       CONFIGURATION SECTION.                                           
       SOURCE-COMPUTER.    IBM-370.                                     
       OBJECT-COMPUTER.    IBM-370.                                     
       INPUT-OUTPUT SECTION.                                            
       FILE-CONTROL.                                                    
                                                                        
                                                                        
           COPY CSSCM16.                                                00600000
           COPY CSSAC03.                                                00610000
T25584     SELECT FCSAC03R-FILE                                         
T25584         ASSIGN TO UT-S-FCSAC03R                                  
T25584         FILE STATUS IS WS-FAC03R-STATUS.                         
           COPY CSSCA191.                                               00620000
T25584     SELECT FCSC191R-FILE                                         
T25584         ASSIGN TO UT-S-FCSC191R                                  
T25584         FILE STATUS IS WS-FCA191R-STATUS.                        
           COPY CSSCA192.                                               00630000
T25584     SELECT FCSC192R-FILE                                         
T25584         ASSIGN TO UT-S-FCSC192R                                  
T25584         FILE STATUS IS WS-FCA192R-STATUS.                        
C35308     COPY CSSPT33.                                                        
                                                                        
       DATA DIVISION.                                                   
                                                                        
       FILE SECTION.                                                    
                                                                        
       COPY CFDCM16.                                                    00700000
       COPY FIOCM16.                                                    00710000
      *                                                                 00720000
       COPY CFDAC03.                                                    00730000
C29529 COPY FIOAC03B.                                                   00740000
      *                                                                 00750000
T25584 FD  FCSAC03R-FILE                                                
T25584     BLOCK CONTAINS  0 RECORDS                                    
T25584     RECORDING MODE  IS F                                         
T25584     LABEL RECORDS   ARE STANDARD.                                
T25584                                                                  
C29529 01  FIOAC03R-REC                         PIC X(105).             
       COPY CFDCA191.                                                   00760000
       COPY FIOCA191.                                                   00770000
      *                                                                 00780000
T25584 FD  FCSC191R-FILE                                                
T25584     BLOCK CONTAINS 0 RECORDS                                     
T25584     RECORD CONTAINS 103 CHARACTERS                               
T25584     RECORDING MODE IS F                                          
T25584     LABEL RECORDS ARE STANDARD.                                  
T25584                                                                  
T25584 01  FIOC191R-REC                         PIC X(103).             
       COPY CFDCA192.                                                   00790000
       COPY FIOCA192.                                                   00800000
      *                                                                 00810000
T25584 FD  FCSC192R-FILE                                                
T25584     BLOCK CONTAINS 0 RECORDS                                     
T25584     RECORD CONTAINS 177 CHARACTERS                               
T25584     RECORDING MODE IS F                                          
T25584     LABEL RECORDS ARE STANDARD.                                  
T25584                                                                  
T25584 01  FIOC192R-REC                         PIC X(177).             
      *                                                                 00810000
C35308 COPY CFDPT33.                                                            
      *                                                                 00810000
                                                                        
       WORKING-STORAGE SECTION.                                         

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'PCSCA190'.
MSQ017     COPY MFASQLM.
                                                                        
       COPY FIOCA00.                                                    00880000
                                                                        
       COPY FIOJC01.                                                    00900000
T22767 COPY CJF00101.                                                           
C35308*                                                                 00910000
C35308****************************************************************          
C35308**           COMMON WORKING STORAGE FOR REPORT HEADERS        **          
C35308****************************************************************          
C35308*                                                                         
C35308 01  WS-HEADING-LINES.                                            
C35308     05  WS-RPT-TITLE-1.                                          
C35308         10  P-RPT-PGRMNAME-1    PIC X(10).                       
C35308         10  FILLER              PIC X(49)    VALUE SPACES.       
C35308         10  P-RPT-CO-NAME-1     PIC X(26).                       
C35308         10  FILLER              PIC X(28)    VALUE SPACES.       
C35308         10  FILLER              PIC X(11)    VALUE               
C35308                                'RUN DATE: '.                     
C35308         10  P-RPT-RUN-DATE-1    PIC X(08).                       
C35308*                                                                         
C35308     05  WS-RPT-TITLE-2.                                          
C35308         10  FILLER              PIC X(06)    VALUE 'DATE: '.     
C35308         10  P-RPT-TRAN-DATE     PIC X(08).                       
C35308         10  FILLER              PIC X(40)    VALUE SPACES.       
C35308         10  FILLER              PIC X(23)    VALUE               
C35308         'BANK DRAFT ERROR REPORT'.                               
C35308         10  FILLER              PIC X(36)    VALUE SPACES.       
C35308         10  FILLER              PIC X(11)    VALUE               
C35308                                'RUN TIME:  '.                    
C35308         10  P-RPT-RUN-TIME      PIC X(08).                       
C35308*                                                                         
C35308     05  WS-RPT-TITLE-3.                                          
C35308         10  FILLER              PIC X(113)   VALUE SPACES.       
C35308         10  FILLER              PIC X(09)    VALUE               
C35308                                'PAGE NO: '.                      
C35308         10  P-RPT-PAGE-NO       PIC ZZ9.                         
C35308         10  FILLER              PIC X(07)    VALUE SPACES.       
C35308*                                                                         
C35308 01  WS-PRINT-REP-HDR-11.                                         
C35308     05  FILLER                  PIC X(51)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(06)    VALUE               
C35308                                 'POSTED'.                        
C35308     05  FILLER                  PIC X(03)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(03)    VALUE               
C35308                                 'SEQ'.                           
C35308     05  FILLER                  PIC X(68)    VALUE SPACES.       
C35308*                                                                         
C35308 01  WS-PRINT-REP-HDR-12.                                         
C35308     05  FILLER                  PIC X(01)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(11)    VALUE               
C35308                                 'ACCT NUMBER'.                   
C35308     05  FILLER                  PIC X(03)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(10)    VALUE               
C35308                                 'DRAFT DATE'.                    
C35308     05  FILLER                  PIC X(03)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(08)    VALUE               
C35308                                 'RPT DATE'.                      
C35308     05  FILLER                  PIC X(06)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(06)    VALUE               
C35308                                 'AMOUNT'.                        
C35308     05  FILLER                  PIC X(05)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(03)    VALUE               
C35308                                 'FL'.                            
C35308     05  FILLER                  PIC X(04)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(03)    VALUE               
C35308                                 'NUM'.                           
C35308     05  FILLER                  PIC X(05)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(09)    VALUE               
C35308                                 'DATE/TIME'.                     
C35308     05  FILLER                  PIC X(18)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(07)    VALUE               
C35308                                 'MESSAGE'.                       
C35308     05  FILLER                  PIC X(39)    VALUE SPACES.       
C35308*                                                                         
C35308 01  WS-PRINT-REP-HDR-13.                                         
C35308     05  FILLER                  PIC X(132)   VALUE SPACES.       
C35308*                                                                         
C35308 01  WS-PRINT-REP-DET-11.                                         
C35308     05  FILLER                  PIC X(01)    VALUE ZEROES.       
C35308     05  P-RPT1-ACCT-NUMB        PIC 9(13)    VALUE ZEROES.       
C35308     05  FILLER                  PIC X(02)    VALUE SPACES.       
C35308     05  P-RPT1-DRAFT-DATE       PIC X(10)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(02)    VALUE SPACES.       
C35308     05  P-RPT1-CASH-REPORT-DATE PIC X(10)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(01)    VALUE SPACES.       
C35308     05  P-RPT1-DRAFT-AMT        PIC ZZZ,ZZ9.99                   
C35308                                              VALUE ZEROES.       
C35308     05  FILLER                  PIC X(05)    VALUE SPACES.       
C35308     05  P-RPT1-PYMT-POSTED-FL   PIC X(01)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(05)    VALUE SPACES.       
C35308     05  P-RPT1-CUST-BANK-SEQ-NO PIC ZZ9.                         
C35308     05  FILLER                  PIC X(03)    VALUE SPACES.       
C35308     05  P-RPT1-TSTAMP           PIC X(16)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(02)    VALUE SPACES.       
C35308     05  P-RPT1-MESSAGE          PIC X(50)    VALUE SPACES.       
C35308*                                                                         
C35308 01  WS-END-DATA-LINE.                                            
C35308     05  FILLER                  PIC X(55)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(22)    VALUE               
C35308              '*** END OF REPORT ***'.                            
C35308     05  FILLER                  PIC X(55)    VALUE SPACES.       
C35308*                                                                         
       01  WS-MISCELLANEOUS.                                            
           05 WS-START                 PIC X(40)                        
           VALUE 'WORKING STORAGE FOR PCSCA190 STARTS HERE'.            
           05  WS-ABEND-PARAGRAPH      PIC XXXX           VALUE SPACES. 
           05  RS-RETURN-CODE          PIC S9(04)   COMP.               
           05  RS-RETURN-CODE-DISP     PIC +Z(04).                      
           05  WS-SQLCODE              PIC --------9.                   
           05  WS-NULL-IND-1           PIC S9(4)  COMP.                 
           05  WS-BANK-CITY-ST         PIC X(26) VALUE SPACES.          
           05  WS-PREV-CO-NO           PIC X(02) VALUE SPACES.          
           05  WS-EPP-BALANCE          PIC S9(09)V99 COMP-3 VALUE ZERO. 
T20405     05  WS-DEFAULT-CO-NO        PIC X(02)  VALUE '01'.           
AGLPWC     05  WS-DRAFT-TAX-ID-LIT     PIC X(20)  VALUE                 
AGLPWC         'DRAFT-TAX-ID        '.                                  
AGLPWC     05  WS-VALID-TAX-ID         PIC 9(10).                       
AGLPWC     05  WS-DESTINATION-ID-LIT   PIC X(20)  VALUE                 
AGLPWC         'DESTINATION-ID      '.                                  
AGLPWC     05  WS-DESTINATION-ID.                                       
AGLPWC       07  WS-DESTINATION-ID-1CHAR  PIC X(01).                    
AGLPWC       07  WS-DESTINATION-ID-9CHAR  PIC X(09).                    
AGLPWC     05  WS-DESTINATION-ID-8-CHAR PIC 9(08).                      
AGLPWC     05  WS-DESTINATION-NAME     PIC X(20).                       
A00996     05  WS-DRAFT-TOLL-CD        PIC X(20)  VALUE                 
A00996         'DRAFT-TOLERANCE-AMT '.                                  
T22767     05  WS-CASHIER-XFER-OFFICE  PIC X(03) VALUE SPACES.          
T22767     05  WS-CASHIER-USER-ID      PIC X(07) VALUE SPACES.          
T22767     05  WS-CASHIER-LOCAL-OFFICE PIC X(03) VALUE SPACES.          
T22767     05  WS-CASHIER-BANK-ID      PIC 9(05) VALUE 2.               
T22767     05  WS-METER-NO             PIC X(09) VALUE                  
T22767                                           '000000000'.           
T22767     05  WS-ALL9-ACNO            PIC 9(13) VALUE                  
T22767                                           9999999999999.         
T22767     05  WS-CASH-GL-ACCT         PIC 9(03)V9(04)                  
T22767                                           VALUE ZEROES.          
T22767     05  WS-TRAN-ID              PIC X(04) VALUE 'A190'.          
T22767     05  WS-TRAN-TIME            PIC X(08) VALUE SPACES.          
T22767     05  WS-XFR-TS               PIC X(26) VALUE SPACES.          
C29529     05  WS-DATABASE             PIC X(08) VALUE 'DATABASE'.      
C29529     05  WS-DATABASE-SW          PIC 9(01) VALUE 0.               
C29529         88 CSR-DATABASE                   VALUE 1.               
C29529         88 SEB-DATABASE                   VALUE 2.               
C35308     05  WS-PAGE-COUNT           PIC S9(5)  COMP-3 VALUE +1.      
C35308     05  WS-LINE-COUNT           PIC S9(5)  COMP-3 VALUE +0.      
C35308     05  WS-FIRST-TIME           PIC X(01)  VALUE 'Y'.            
C35308*                                                                         
C35308 01  WS-DATE-10.                                                  
C35308     05  WS-D10-CC               PIC X(02).                       
C35308     05  WS-D10-YY               PIC X(02).                       
C35308     05  FILLER                  PIC X(01)    VALUE '-'.          
C35308     05  WS-D10-MM               PIC X(02).                       
C35308     05  FILLER                  PIC X(01)    VALUE '-'.          
C35308     05  WS-D10-DD               PIC X(02).                       
C35308*                                                                         
C35308 01  WS-DATE-8.                                                   
C35308     05  WS-D8-MM                PIC X(02).                       
C35308     05  FILLER                  PIC X(01)    VALUE '/'.          
C35308     05  WS-D8-DD                PIC X(02).                       
C35308     05  FILLER                  PIC X(01)    VALUE '/'.          
C35308     05  WS-D8-YY                PIC X(02).                       
C35308*                                                                         
C35308 01  WS-PRINT-DATE.                                               
C35308     05  WS-P1-MONTH             PIC X(02)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(01)    VALUE '/'.          
C35308     05  WS-P1-DAY               PIC X(02)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(01)    VALUE '/'.          
C35308     05  WS-P1-YEAR              PIC X(04)    VALUE SPACES.       
C35308     05  FILLER                  PIC X(01)    VALUE SPACE.        
C35308     05  WS-P1-TIME              PIC X(05)    VALUE SPACES.       
T25584 01  WS-RESTART-MISC.                                             
T25584     05  WS-IS-THIS-A-RESTART      PIC X(01)   VALUE 'N'.         
T25584         88  WS-THIS-IS-A-RESTART              VALUE 'Y'.         
T25584     05  WS-RESTART-COMMIT-COUNTER PIC 9(04)   VALUE ZERO.        
T25584     05  WS-RESTART-REQ            PIC X(01).                     
T25584     05  WS-DEFAULT-RESTART-REQ    PIC X(01)   VALUE 'N'.         
T25584     05  WS-DEFAULT-CHKP-LUW-LIMIT PIC 9(04)   VALUE 4.           
T25584     05  WS-SEQ-NO                 PIC 9(04)   VALUE ZERO.        
T25584     05  WS-CHKP-LUW-LIMIT         PIC 9(04)   VALUE ZERO.        
T25584     05  WS-CHKP-LUW-COUNTER       PIC 9(04)   VALUE ZERO COMP-3. 
T25584     05  WS-DEFAULT-CHKP-UPD-LIMIT PIC 9(04)   VALUE 20.          
T25584     05  WS-CHKP-UPD-LIMIT         PIC 9(04)   VALUE ZERO.        
T25584     05  WS-CHKP-ID.                                              
T25584         10  WS-CHKP-PGM-ID        PIC X(02)   VALUE '09'.        
T25584         10  WS-CHKP-PART-NO       PIC 9(01)   VALUE 1.           
T25584         10  WS-CHKP-SEQ-NO        PIC 9(05)   VALUE ZERO.        
      *                                                                 01050000
T25584 01 WS-RESTART-DATA.                                              
T25584     05  WS-RESTART-PROCESS-TYPE   PIC 9(01).                     
T25584     05  WS-RESTART-JOB-STATUS     PIC X(01).                     
T25584         88  WS-RUN-COMPLETED-NO-PROBLEMS      VALUE 'A'.         
T25584     05  WS-RESTART-COMMON-DATE    PIC X(10).                     
T25584     05  WS-RESTART-CHKP-SEQ-NO    PIC 9(05).                     
T25584     05  WS-RES-DRAFT-TOTALS.                                     
T25584         10  WS-RES-DRAFT-HEADER-CNT     PIC 9(06).               
T25584         10  WS-RES-DRAFT-DETAIL-CNT     PIC 9(06).               
T25584         10  WS-RES-DRAFT-HASH-TOTAL     PIC 9(10).               
T25584         10  WS-RES-DRAFT-DEBIT-TOTAL    PIC 9(10)V99.            
T25584         10  WS-RES-DRAFT-CREDIT-TOTAL   PIC 9(10)V99.            
T25584         10  WS-RES-FINAL-BANK-DFT-TOTAL PIC 9(10)V99.            
T25584         10  WS-RES-DRAFT-TYPE-5-WRITTEN PIC 9(06).               
T25584         10  WS-RES-DRAFT-TYPE-6-WRITTEN PIC 9(06).               
T25584         10  WS-RES-TYPE-6-SEQ-NBR       PIC 9(07).               
T25584     05  WS-RES-COMPANY-END-REC-DATA     PIC X(30).               
T25584     05  WS-RES-FIOCA192                 PIC X(177).              
T25584     05  WS-RES-NEW-BUSINESS-DAY         PIC X(10).               
T25584     05  WS-RESTART-FCSAC03-REC-CNTR                              
T25584                                   PIC S9(07)  COMP-3 VALUE ZERO. 
T25584     05  WS-RESTART-FCSC191-REC-CNTR                              
T25584                                   PIC S9(07)  COMP-3 VALUE ZERO. 
T25584     05  WS-RESTART-FCSC192-REC-CNTR                              
T25584                                   PIC S9(07)  COMP-3 VALUE ZERO. 
T25584     05  WS-RES-WRITE-FILES           PIC X(01).                  
COB305     05 WS-RES-FCSCA191-REC-CNTR        PIC S9(09) COMP-3 VALUE 0.        
COB305     05 WS-RES-FCSCA191-CO-CNTR        PIC S9(09) COMP-3 VALUE 0.         
COB305     05 WS-RES-FCSCA192-REC-CNTR        PIC S9(09) COMP-3 VALUE 0.        
COB305     05 WS-RES-FCSCA192-CO-CNTR        PIC S9(09) COMP-3 VALUE 0.         
T25584     05  WS-RES-DESTINATION-ID-8-CHAR PIC 9(08).                  
T25584     05  WS-RES-TYPE-8-COMPANY-ID     PIC X(10).                  
T25584     05  WS-RES-NACHA-REC-WRITTEN     PIC 9(06).                  
T25584     05  WS-RES-PREV-CO-NO            PIC X(02).                  
COB305     05 WS-TEMP-RES-ACC-NO        PIC S9(13)V USAGE COMP-3 
COB305       VALUE 0.   
A03874     05  WS-RES-ACCOUNT-NO            PIC S9(13)V USAGE COMP-3    
A03874                                                  VALUE ZERO.     
COB305     05 WS-RES-PREV-ACC-NO        PIC S9(13)V USAGE COMP-3 
COB305       VALUE 0.   
COB305     05 WS-RES-PREV-DRAFT-AMT        PIC S9(9)V9(2) USAGE COMP-3 
COB305       VALUE 0.
A03874     05  WS-RES-PREV-DRAFT-DATE       PIC X(10).                  
A03874     05  WS-RES-PREV-SEQ-NO           PIC S9(9) USAGE COMP.       
                                                                        
       01  WS-COUNTERS.                                                 
COB305     05 WS-FCSCA191-REC-CNTR        PIC S9(09) COMP-3 VALUE 0.            
COB305     05 WS-FCSCA192-REC-CNTR        PIC S9(09) COMP-3 VALUE 0.            
COB305     05 WS-FCSCA191-CO-CNTR        PIC S9(09) COMP-3 VALUE 0.             
COB305     05 WS-FCSCA192-CO-CNTR        PIC S9(09) COMP-3 VALUE 0.             
      *                                                                 01130000
       01  WS-SWITCHES.                                                 
           05  WRITE-FIOCA191-SW        PIC  X(01) VALUE 'N'.           
               88 WRITE-FIOCA191                   VALUE 'Y'.           
           05  FIOCA191-DATA-SW         PIC  X(01) VALUE 'N'.           
               88 DATA-FOUND                       VALUE 'Y'.           
       01  WS-FILE-STATUS-AREA.                                         
           05  WS-FAC03-STATUS          PIC X(02).                      
               88  FAC03-SUCCESSFUL                VALUE '00'.          
T25584     05  WS-FAC03R-STATUS         PIC X(02).                      
T25584         88  FAC03R-SUCCESSFUL               VALUE '00'.          
           05  WS-FCA191-STATUS         PIC X(02).                      
               88  FCA191-SUCCESSFUL               VALUE '00'.          
T25584     05  WS-FCA191R-STATUS        PIC X(02).                      
T25584         88  FCA191R-SUCCESSFUL              VALUE '00'.          
           05  WS-FCA192-STATUS         PIC X(02).                      
               88  FCA192-SUCCESSFUL               VALUE '00'.          
T25584     05  WS-FCA192R-STATUS        PIC X(02).                      
T25584         88  FCA192R-SUCCESSFUL              VALUE '00'.          
           05  WS-WRITE-FILES           PIC X(01).                      
               88  WRITE-FILES                     VALUE 'Y'.           
T23549     05  WS-CURR-ACCT-STAT        PIC X(01)  VALUE 'N'.           
               88  EPAY-ACCOUNT                    VALUE 'Y'.           
T28580         88  BANK-DRAFT-ACCT                 VALUE 'B'.           
C25964         88  E-DRAFT-ACCT                    VALUE 'D'.           
T23549         88  NOT-EPAY-ACCOUNT                VALUE 'N'.           
T23549     05  WS-PREV-ACCT-STAT        PIC X(01).                      
T23549         88  PREV-ACCT-EPAY                  VALUE 'Y'.           
T23549         88  PREV-ACCT-NOT-EPAY              VALUE 'N'.           
                                                                        
       COPY CWS09900.                                                   01260000
                                                                        
       COPY CWS00010.                                                   01280000
                                                                        
       COPY CWS00039.                                                   01300000
                                                                        
       COPY CWS00038.                                                   01320000
                                                                        
                                                                        
                                                                        
       01  WS-CURRENT-DATE             PIC X(10).                       
       01  WS-TRANSACTION-CODE         PIC S9(04).                      
       01  FILLER REDEFINES WS-TRANSACTION-CODE.                        
           05  FILLER                  PIC S9(02).                      
           05  WS-PB-TRANS-CD          PIC 9(02).                       
      *                                                                 01420000
       01  WS-LITERALS.                                                 
           05  WS-C-LIT                PIC X(01)     VALUE 'C'.         
           05  WS-D                    PIC X(01)     VALUE 'D'.         
           05  WS-E                    PIC X(01)     VALUE 'E'.         
           05  WS-I                    PIC X(01)     VALUE 'I'.         
           05  WS-N                    PIC X(01)     VALUE 'N'.         
           05  WS-P                    PIC X(01)     VALUE 'P'.         
           05  WS-S                    PIC X(01)     VALUE 'S'.         
           05  WS-Y                    PIC X(01)     VALUE 'Y'.         
T22767     05  WS-ONE                  PIC 9(01)     VALUE  1.          
T22767     05  WS-MIN-ONE              PIC S9(4)     VALUE -1 COMP.     
T22767     05  WS-ZERO                 PIC 9(01)     VALUE  0.          
T22767     05  WS-1                    PIC X(02)     VALUE '01'.        
C29529     05  WS-01                   PIC X(02)     VALUE '01'.        
C29529     05  WS-022                  PIC X(03)     VALUE '022'.       
T22767     05  WS-025                  PIC X(03)     VALUE '025'.       
T22767     05  WS-101                  PIC 9(03)     VALUE 101.         
           05  WS-YES                  PIC X(01)     VALUE 'Y'.         
           05  WS-NO                   PIC X(01)     VALUE 'N'.         
           05  WS-PGRMNAME             PIC X(08)     VALUE 'PCSCA190'.  
           05  PROGRAM-NAME            PIC X(08)     VALUE 'PCSCA190'.  
           05  WS-PRENOTE              PIC S9(4) USAGE COMP             
                                                     VALUE +0028.       
                                                                        
       01  MISC-WORK-AREAS.                                             
           05  WS-TEMP-HASH              PIC 9(12)  VALUE 0.            
           05  WS-TYPE-8-COMPANY-ID      PIC X(10).                     
           05  WS-WORK-CNT               PIC 9(06).                     
           05  WS-WORK-CNT-DIGIT    REDEFINES WS-WORK-CNT.              
               10  WS-WORK-CNT-DIGIT5    PIC 9(05).                     
               10  WS-WORK-CNT-DIGIT6TH  PIC 9(01).                     
           05  WS-BLOCK-CNT            PIC 9(06).                       
           05  WS-CURRENT-TIME.                                         
               10  WS-CURRENT-TIMER.                                    
                   15  WS-CURRENT-TIME-HH  PIC 9(02).                   
                   15  WS-CURRENT-TIME-MM  PIC 9(02).                   
C35308             15  WS-CURRENT-TIME-SS  PIC 9(02).                   
       01  WS-RUN-TIME.                                                 
           05  WS-RT-HH                PIC X(02).                       
           05  FILLER                  PIC X(01)     VALUE ':'.         
           05  WS-RT-MM                PIC X(02).                       
           05  FILLER                  PIC X(01)     VALUE ':'.         
           05  WS-RT-SS                PIC X(02).                       
      *                                                                         
           05  WS-TYPE-6-SEQ-NBR       PIC 9(07).                       
           05  VALID-HEADER-DRAFT      PIC X(06) VALUE 'H8021 '.        
           05  VALID-HEADER-CASH       PIC X(06) VALUE 'H9003 '.        
           05  VALID-DRAFT-TAX-ID      PIC X(10) VALUE '1570248695'.    
           05  VALID-CASH-TAX-ID       PIC X(10) VALUE '2570248695'.    
           05  WS-NACHA-REC-WRITTEN    PIC 9(06).                       
           05  WS-FILE-TOTALS.                                          
               10  WS-FILE-HEADER-CNT      PIC 9(06).                   
               10  WS-FILE-DETAIL-CNT      PIC 9(06).                   
               10  WS-FILE-HASH-TOTAL      PIC 9(10).                   
               10  WS-FILE-DEBIT-TOTAL     PIC 9(10)V99.                
               10  WS-FILE-CREDIT-TOTAL    PIC 9(10)V99.                
           05  WS-DRAFT-TOTALS.                                         
               10  WS-DRAFT-HEADER-CNT     PIC 9(06).                   
               10  WS-DRAFT-DETAIL-CNT     PIC 9(06).                   
               10  WS-DRAFT-HASH-TOTAL     PIC 9(10).                   
               10  WS-DRAFT-DEBIT-TOTAL    PIC 9(10)V99.                
               10  WS-DRAFT-CREDIT-TOTAL   PIC 9(10)V99.                
T22767         10  WS-FINAL-BANK-DFT-TOTAL PIC 9(10)V99.                
           05  WS-TYPE-WRITTEN-TOTALS.                                  
               10  WS-TYPE-1-WRITTEN       PIC 9(06).                   
               10  WS-DRAFT-TYPE-1-WRITTEN PIC 9(06).                   
               10  WS-TYPE-5-WRITTEN       PIC 9(06).                   
               10  WS-CASH-TYPE-5-WRITTEN  PIC 9(06).                   
               10  WS-DRAFT-TYPE-5-WRITTEN PIC 9(06).                   
               10  WS-TYPE-6-WRITTEN       PIC 9(06).                   
               10  WS-DRAFT-TYPE-6-WRITTEN PIC 9(06).                   
               10  WS-CASH-TYPE-6-WRITTEN  PIC 9(06).                   
               10  WS-TYPE-8-WRITTEN       PIC 9(06).                   
               10  WS-CASH-TYPE-8-WRITTEN  PIC 9(06).                   
               10  WS-DRAFT-TYPE-8-WRITTEN PIC 9(06).                   
               10  WS-TYPE-9-WRITTEN       PIC 9(06).                   
               10  WS-CASH-TYPE-9-WRITTEN  PIC 9(06).                   
               10  WS-DRAFT-TYPE-9-WRITTEN PIC 9(06).                   
           05  STORE-H-EFF-DATE.                                        
               10  STORE-YEAR                PIC XX.                    
               10  STORE-MONTH               PIC XX.                    
               10  STORE-DAY                 PIC XX.                    
           05  STORE-H-COMP-NAME             PIC X(16).                 
COB305     05 WS-PREVIOUS-ACCOUNT-NO        PIC S9(13)V USAGE COMP-3 
COB305       VALUE 0.    
COB305     05 WS-PREV-DRAFT-AMOUNT        PIC S9(9)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
C32389     05  WS-PREV-DRAFT-DATE          PIC X(10).                   
C32389     05  WS-PREV-BANK-SEQ-NO         PIC S9(9) USAGE COMP.        
COB305     05 WS-TOLERANCE-AMT        PIC S9(4)V9(2) USAGE COMP-3 
COB305       VALUE 0. 
C32389     05  WS-ERROR-MESSAGES.                                       
C32389          10  WS-DUPLICATE-MESSAGE   PIC X(35) VALUE              
C32389              'DUPLICATE TRANSACTION FOR CUSTOMER.'.              
C35308          10  WS-NOTFOUND-CUST-BANK  PIC X(31) VALUE              
C35308              'NOT FOUND IN CSS_CUSTOMER_BANK.'.                  
C32389          10  WS-BANK-NAME-SPACES    PIC X(45) VALUE              
C32389              'BANK ACCT NAME = SPACES IN CSS_CUSTOMER_BANK.'.    
C32389          10  WS-BANK-NO-SPACES      PIC X(44) VALUE              
C32389              'BANK ACCT NO. = SPACES IN CSS_CUSTOMER_BANK.'.     
C32389          10  WS-BANK-ID-ZERO        PIC X(37) VALUE              
C32389              'BANK ID = ZEROS IN CSS_CUSTOMER_BANK.'.            
C32389          10  WS-BANK-ID-INVALID.                                 
C32389              15  FILLER             PIC X(10) VALUE              
C32389                  'BANK ID = '.                                   
COB305              15 WS-MESSAGE-BANK-ID        PIC S9(6)V 
COB305                USAGE COMP-3 VALUE 0.     
C32389              15 WS-BANK-ID-INVALID-MESSAGE PIC X(46) VALUE       
C32389              ' BANK ID NOT FOUND IN CSS_BANK FOR ACCOUNT NO.'.   
C32389          10  WS-DRAFTAMT-INVALID    PIC X(28) VALUE              
C32389              'DRAFT AMOUNT = 0 IS INVALID.'.                     
A01497          10  WS-INVALID-EFT         PIC X(29) VALUE              
A01497              'INVALID DATA IN CSS_BANK_EFT.'.                    
C35308 01  WS-TODAYS-DATE                    PIC X(10).                 
      *                                                                 02470000
      ***************************************************************** 02480000
      **  COPY  CWS00104                                             ** 02490000
      **                                                             ** 02500000
      **  THIS COPY STATEMENT CONTAINS THE WORKING STORAGE TABLE     ** 02510000
      **  LAYOUT FOR USE WITH CPD00104 AND CPD00105 WHICH WILL       ** 02520000
      **  ACCUMULATE RECORD COUNTS FOR EACH COMPANY IN A TABLE.      ** 02530000
      **  AND WRITE THE COMPANY RECORDS.                             ** 02540000
      **                                                             ** 02550000
      **  COPYBOOK ASSUMES THAT THERE ARE 5 COMPANIES.               ** 02560000
      **                                                             ** 02570000
      **  IF COMPANY NUMBER EXCEEDS FIVE, CHANGE THE VALUE OF        ** 02580000
      **  COMPANY-SIZE AND OCCURS VALUE TO THE NUMBER OF EXISTING    ** 02590000
      **  COMPANIES.                                                 ** 02600000
      **                                                             ** 02610000
      **  DATE LAST MODIFIED:                                        ** 02620000
      **                                                             ** 02630000
      **                                                             ** 02640000
      ***************************************************************** 02650000
       01  COMPANY-END-REC.                                             
           05  END-CO-NO                      PIC X(02).                
           05  END-CO-KEY-EREC                PIC X(48).                
           05  END-CO-REC-COUNT               PIC S9(09) COMP.          
           05  FILLER                         PIC X(70).                
      *                                                                 02710000
       01  COMPANY-END-REC-DATA.                                        
           05  CO-END-REC-DATA         OCCURS 5 TIMES                   
                                       INDEXED BY CO-END-REC-INDX.      
               10  CO-NO                      PIC X(02).                
               10  CO-NO-COUNTER              PIC S9(09) COMP.          
      *                                                                 02770000
       01  COMPARISON-FIELD.                                            
           05  CMP-COMPANY-NO                 PIC X(02).                
      *                                                                 02800000
       01  COMPANY-INFO.                                                
           05  COMPANY-SIZE                   PIC 9(02) VALUE 5.        
      *                                                                 02830000
       01  FLAGS-FLG.                                                   
           05 FLG-COMPANY-FOUND               PIC X(01) VALUE 'N'.      
      *                                                                 02860000
                                                                        
      *                                                                 02880000
      *                                                                 02920000
           COPY CWS00303.                                               02930000
                                                                        
                                                                        
      ****** CWS00315 CONTAINS WS FOR FINDING NEXT BUSINESS DAY ****    02960000
           EXEC SQL                                                     02970000
               INCLUDE CWS00315                                         02980000
           END-EXEC.                                                    02990000
                                                                        
           EXEC SQL                                                     03050000
               INCLUDE CWS00074                                         03060000
           END-EXEC.                                                    03070000
                                                                        
           EXEC SQL                                                     03090000
               INCLUDE CWS00011                                         03100000
           END-EXEC.                                                    03110000
                                                                        
           EXEC SQL                                                     03130000
               INCLUDE SQLCA                                            03140000
           END-EXEC.                                                    03150000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_ACCOUNT - AT                                           **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03170000
               INCLUDE TBACCT                                           03180000
           END-EXEC.                                                    03190000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_HOLIDAY - J8                                           **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03210000
               INCLUDE TBHLDAY                                          03220000
           END-EXEC.                                                    03230000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_CUSTOMER - CU                                          **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03250000
               INCLUDE TBCUST                                           03260000
           END-EXEC.                                                    03270000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_ADDR_FREEFORM - DZ                                     **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03290000
               INCLUDE TBADRFRE                                         03300000
           END-EXEC.                                                    03310000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_ADDR_FORMATTED - DY                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03330000
               INCLUDE TBADRFMT                                         03340000
           END-EXEC.                                                    03350000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_ZIP_CODE - A4                                          **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03370000
               INCLUDE TBZIPCD                                          03380000
           END-EXEC.                                                    03390000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_CUST_ADDR_XREF - DM                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03410000
               INCLUDE TBCSADRX                                         03420000
           END-EXEC.                                                    03430000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_BANK_EFT - BE                                          **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03450000
               INCLUDE TBBNKEFT                                         03460000
           END-EXEC.                                                    03470000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_BTCH_PARTITION - O5                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03490000
               INCLUDE TBBTHPRT                                         03500000
           END-EXEC.                                                    03510000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_JOB_PARM - G6                                          **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03530000
               INCLUDE TBJBPARM                                         03540000
           END-EXEC.                                                    03550000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_BUDGET_PLAN - BU                                       **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03570000
               INCLUDE TBBGTPLN                                         03580000
           END-EXEC.                                                    03590000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_NAME - DQ                                              **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03650000
               INCLUDE TBNAME                                           03660000
           END-EXEC.                                                    03670000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_NAME_ACCT_XREF - HT                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03690000
               INCLUDE TBNMACTX                                         03700000
           END-EXEC.                                                    03710000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_PNDNG_BNK_DRFT - PB                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03730000
               INCLUDE TBPDBKDF                                         03740000
           END-EXEC.                                                    03750000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_BANK - D1                                              **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03770000
               INCLUDE TBBANK                                           03780000
           END-EXEC.                                                    03790000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_ACCT_MISC_INFO - TA                                    **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03810000
               INCLUDE TBATMISC                                         03820000
           END-EXEC.                                                    03830000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_BILL_WINDOW - BN                                       **        
C35308******************************************************************        
C35308*                                                                         
           EXEC SQL                                                     03850000
              INCLUDE TBBILWDW                                          03860000
           END-EXEC.                                                    03870000
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_DELINQUENCY - C8                                       **        
C35308******************************************************************        
C35308*                                                                         
AGLPWC     EXEC SQL                                                     03850000
AGLPWC        INCLUDE TBDELQ                                            03860000
AGLPWC     END-EXEC.                                                    03870000
AGLPWC                                                                  
T22767                                                                  
T22767******************************************************************        
T22767**   CSS_GL_ACCT_NO - GO                                        **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE TBGLATNO                                                    
T22767     END-EXEC.                                                            
T22767*                                                                         
T22767******************************************************************        
T22767**   CSS_BANK_TRANSFER - YB                                     **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE TBBNKXFR                                                    
T22767     END-EXEC.                                                            
T22767*                                                                         
T22767******************************************************************        
T22767**   CSS_CASHIER - Y1                                           **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE TBCSHIER                                                    
T22767     END-EXEC.                                                            
T22767*                                                                         
T22767******************************************************************        
T22767**   CSS_CASHIER_OFFICE - Y2                                    **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE TBCSHOFF                                                    
T22767     END-EXEC.                                                            
C35308*                                                                         
C35308******************************************************************        
C35308**   CSS_COMPANY - C7                                           **        
C35308******************************************************************        
C35308*                                                                         
C35308     EXEC SQL                                                             
C35308      INCLUDE TBCOMPNY                                                    
C35308     END-EXEC.                                                            
T22767*                                                                         
T22767******************************************************************        
T22767**   CSS_CSH_DRWR_CNTL - CS                                     **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE TBCDCNTL                                                    
T22767     END-EXEC.                                                            
T22767******************************************************************        
T22767**   CSS_CSH_DRWR_JRNL - CJ                                     **        
T22767******************************************************************        
T22767*                                                                         
T22767     EXEC SQL                                                             
T22767      INCLUDE  TBCDJRNL                                                   
T22767     END-EXEC.                                                            
T22767*                                                                         
AGLPWC                                                                  
      *                                                                         
T25584*************************************************************             
T25584*    CSS_RESTART - RF                                                     
T25584*************************************************************             
T25584     EXEC SQL                                                             
T25584        INCLUDE TBRESTRT                                                  
T25584     END-EXEC.                                                            
      *                                                                         
C29529*************************************************************             
C29529*    CSS_ACCT_BILL_NMES - AB                                              
C29529*************************************************************             
C29529     EXEC SQL                                                             
C29529        INCLUDE TBATBLNM                                                  
C29529     END-EXEC.                                                            
      *                                                                         
C29529*************************************************************             
C29529*    CSS_CUSTOMER_BANK - JF                                               
C29529*************************************************************             
C29529     EXEC SQL                                                             
C29529        INCLUDE TBCSTBNK                                                  
C29529     END-EXEC.                                                            
      *                                                                         
C29529*************************************************************             
C29529*    CSS_PAYMENT_TRANS - JT                                               
C29529*************************************************************             
C29529     EXEC SQL                                                             
C29529        INCLUDE TBPMTRAN                                                  
C29529     END-EXEC.                                                            
      *                                                                         
           EXEC SQL                                                     
                DECLARE EFT_CSR CURSOR WITH HOLD FOR                    
                SELECT DRAFT_AMT                                        
                      ,ACCOUNT_NO                                       
                      ,DRAFT_DATE                                       
                      ,TRANSACTION_CD                                   
T23549                ,CODE_SOURCE_ID                                   
C29529                ,PYMT_POSTED_FL                                   
C29529                ,REPLACE(REPLACE(CONVERT(CHAR(26), PYMT_TRANS_TS
           , 121), ' ', '-'), ':', '.') PYMT_TRANS_TS                          
C29529                ,CUST_BANK_SEQ_NO                                 
P00613                ,USER_ID                                          
                  FROM CSS_PNDNG_BNK_DRFT WITH(READUNCOMMITTED)                 
                 WHERE                                                  
A03874                 ACCOUNT_NO  >= :WS-RES-ACCOUNT-NO                
A03874             AND ((DRAFT_DATE <= IIF(TRY_CONVERT(DATE, 
                                                       :WS-CURRENT-DATE
              ) IS NULL OR (PATINDEX('%.%', :WS-CURRENT-DATE
              ) <> 0) OR (LEN(:WS-CURRENT-DATE) <> 10), CIS.CHAR2DATE(
                                                       :WS-CURRENT-DATE
              ), CONVERT(DATE, :WS-CURRENT-DATE) ))                
                    OR (TRANSACTION_CD  =  :WS-PRENOTE)                 
C25487              OR (DRAFT_DATE <= IIF(TRY_CONVERT(DATE, 
                                                        :WS-TODAYS-DATE
              ) IS NULL OR (PATINDEX('%.%', :WS-TODAYS-DATE
              ) <> 0) OR (LEN(:WS-TODAYS-DATE) <> 10), CIS.CHAR2DATE(
                                                        :WS-TODAYS-DATE
              ), CONVERT(DATE, :WS-TODAYS-DATE) )                   
A03874             AND CODE_SOURCE_ID = 'E'))                           
C32389        ORDER BY ACCOUNT_NO                                       
                      ,DRAFT_DATE                                       
                      ,DRAFT_AMT                                        
C35308          FOR READ ONLY                                          
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ004
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                     03890000
MFA-TR*         DECLARE EFT_CSR CURSOR WITH HOLD FOR                    03900000
MFA-TR*         SELECT DRAFT_AMT                                        03910000
MFA-TR*               ,ACCOUNT_NO                                       03920000
MFA-TR*               ,DRAFT_DATE                                       03930000
MFA-TR*               ,TRANSACTION_CD                                   03940000
MFA-TR*               ,CODE_SOURCE_ID                                           
MFA-TR*               ,PYMT_POSTED_FL                                           
MFA-TR*               ,PYMT_TRANS_TS                                            
MFA-TR*               ,CUST_BANK_SEQ_NO                                         
MFA-TR*               ,USER_ID                                                  
MFA-TR*           FROM CSS_PNDNG_BNK_DRFT                               03950000
MFA-TR*          WHERE                                                  03960000
MFA-TR*                ACCOUNT_NO  >= :WS-RES-ACCOUNT-NO                        
MFA-TR*            AND ((DRAFT_DATE <= :WS-CURRENT-DATE)                03990000
MFA-TR*             OR (TRANSACTION_CD  =  :WS-PRENOTE)                 04000000
MFA-TR*             OR (DRAFT_DATE <= :WS-TODAYS-DATE                           
MFA-TR*            AND CODE_SOURCE_ID = 'E'))                                   
MFA-TR*       ORDER BY ACCOUNT_NO                                       04010000
MFA-TR*               ,DRAFT_DATE                                       04010000
MFA-TR*               ,DRAFT_AMT                                        04010000
MFA-TR*         FOR FETCH ONLY                                                  
MFA-TR*         WITH UR                                                         
MFA-TR*    END-EXEC.                                                    04020000
                                                                        
           EXEC SQL                                                     
                DECLARE EPP_CSR CURSOR FOR                              
                SELECT AMT_MO_PYT_BAL_FWD                               
                  FROM CSS_BUDGET_PLAN WITH(READUNCOMMITTED)                    
                 WHERE ACCOUNT_NO        = :BU-ACCOUNT-NO               
                   AND PYMT_PRIORITY_LVL = :BU-PYMT-PRIORITY-LVL        
C35308          FOR READ ONLY                                          
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ004
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     04040000
MFA-TR*         DECLARE EPP_CSR CURSOR FOR                              04050000
MFA-TR*         SELECT AMT_MO_PYT_BAL_FWD                               04060000
MFA-TR*           FROM CSS_BUDGET_PLAN                                  04070000
MFA-TR*          WHERE ACCOUNT_NO        = :BU-ACCOUNT-NO               04080000
MFA-TR*            AND PYMT_PRIORITY_LVL = :BU-PYMT-PRIORITY-LVL        04090000
MFA-TR*         FOR FETCH ONLY                                                  
MFA-TR*         WITH UR                                                         
MFA-TR*    END-EXEC.                                                    04100000
                                                                        
       PROCEDURE DIVISION.                                              
                                                                        
       0000-MAINLINE.                                                   
                                                                        
           PERFORM 0100-INITIALIZE          THRU 0100-EXIT              
                                                                        
           PERFORM 7000-OPEN-EFT-CSR  THRU 7000-EXIT.                   
           PERFORM 7100-FETCH-EFT-CSR THRU 7100-EXIT.                   
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T25584        IF WS-THIS-IS-A-RESTART                                   
C35308           CONTINUE                                               
T25584        ELSE                                                      
                 MOVE WS-N               TO WS-WRITE-FILES              
T25584        END-IF                                                    
              PERFORM 1000-PROCESS-ACCOUNTS THRU 1000-EXIT              
                 UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND                
              IF WRITE-FILES                                            
                 PERFORM 8710-WRITE-FCSCA192      THRU 8710-EXIT        
TJS000           MOVE WS-PREV-CO-NO             TO CMP-COMPANY-NO       
                 PERFORM 8800-PROCESS-END-REC-TBL THRU 8800-EXIT        
              END-IF                                                    
              PERFORM 8820-WRITE-CO-END-REC    THRU 8820-EXIT           
           ELSE                                                         
              INITIALIZE WS-FILE-DETAIL-CNT                             
                         WS-FILE-HASH-TOTAL                             
                         WS-FILE-DEBIT-TOTAL                            
                         WS-FILE-CREDIT-TOTAL                           
                         WS-TYPE-5-WRITTEN                              
                         WS-TYPE-6-WRITTEN                              
           END-IF.                                                      
                                                                        
           MOVE WS-DRAFT-HEADER-CNT     TO WS-FILE-HEADER-CNT           
           MOVE WS-DRAFT-DETAIL-CNT     TO WS-FILE-DETAIL-CNT           
           MOVE WS-DRAFT-HASH-TOTAL     TO WS-FILE-HASH-TOTAL           
           MOVE WS-DRAFT-DEBIT-TOTAL    TO WS-FILE-DEBIT-TOTAL          
           MOVE WS-DRAFT-CREDIT-TOTAL   TO WS-FILE-CREDIT-TOTAL         
           MOVE WS-DRAFT-TYPE-5-WRITTEN TO WS-TYPE-5-WRITTEN            
           MOVE WS-DRAFT-TYPE-6-WRITTEN TO WS-TYPE-6-WRITTEN            
                                                                        
           PERFORM 8600-PROCESS-TYPE-8 THRU 8600-PROCESS-TYPE-8-EXIT.   
           PERFORM 8610-PROCESS-TYPE-9 THRU 8610-PROCESS-TYPE-9-EXIT.   
                                                                        
           PERFORM 0200-CLEANUP             THRU 0200-EXIT.             
           PERFORM 0300-PROCESS-FCSCA191 THRU 0300-EXIT                 
T25584     MOVE WS-SEQ-NO         TO  G6-SEQ-NO                         
T25584     MOVE WS-I              TO  G6-STATUS                         
T25584     MOVE 'RESTART-REQ=Y'   TO  G6-PARM-DATA                      
T25584     PERFORM 8893-RESET-JOB-PARM                                  
T25584        THRU 8893-EXIT.                                           
T25584     IF WS-THIS-IS-A-RESTART                                      
T25584        MOVE WS-B              TO  WS-RESTART-JOB-STATUS          
C35308        DISPLAY 'PCSCA190 RERUN COMPLETED'                        
T25584     ELSE                                                         
T25584        MOVE WS-A              TO  WS-RESTART-JOB-STATUS          
T25584     END-IF                                                       
T25584*                                                                         
T25584     PERFORM 8890-DELETE-RESTART-RECORD                           
T25584        THRU 8890-EXIT                                            
T25584*                                                                         
C35308     WRITE PRT33-RECORD FROM WS-END-DATA-LINE                     
C35308           AFTER  ADVANCING 2 LINES.                              
C35308*                                                                         
KDF000     PERFORM 9000-TERMINATE           THRU 9000-EXIT.             
           DISPLAY '<<< PCSCA190 COMPLETED >>>'.                        
           GOBACK.                                                      
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       0100-INITIALIZE.                                                 
                                                                        
C35308     OPEN OUTPUT FCSPT33-FILE.                                    
                                                                        
C32389     INITIALIZE WS-PREVIOUS-ACCOUNT-NO                            
C32389                WS-PREV-DRAFT-AMOUNT                              
C32389                WS-PREV-DRAFT-DATE                                
C32389                WS-PREV-BANK-SEQ-NO.                              
                                                                        
           OPEN OUTPUT FCSAC03-FILE.                                    
      *                                                                 04670000
           IF  FAC03-SUCCESSFUL                                         
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSAC03 OPEN.  STATUS IS '        
                       WS-FAC03-STATUS                                  
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
      *                                                                 04780000
           OPEN OUTPUT FCSCA191-FILE.                                   
      *                                                                 04800000
           IF  FCA191-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSCA191 OPEN.  STATUS IS '       
                       WS-FCA191-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
      *                                                                 04910000
           OPEN OUTPUT FCSCA192-FILE.                                   
      *                                                                 04930000
           IF  FCA192-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSCA192 OPEN.  STATUS IS '       
                       WS-FCA192-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
T25584*                                                                         
T25584     PERFORM 6253-GET-FJC01-CHKP-LIMIT                            
T25584        THRU 6253-EXIT.                                           
T25584*                                                                         
T25584     PERFORM 0400-CHECK-RESTART                                   
T25584        THRU 0400-EXIT.                                           
      *                                                                 05170000
T25584     IF WS-THIS-IS-A-RESTART                                      
T25584        CONTINUE                                                  
T25584     ELSE                                                         
              PERFORM 6251-GET-FJC01-DATE THRU 6251-EXIT                
                                                                        
              IF COMMON-DATE-NEEDED                                     
                 PERFORM 6240-GET-FCA00-COMMON-DATE THRU 6240-EXIT      
                 DISPLAY 'FCA00-COMMON-DATE = ' WS-FCA00-COMMON-DATE    
                 MOVE WS-FCA00-COMMON-DATE TO WS-INPUT-DATE             
              END-IF                                                    
                                                                        
              MOVE WS-INPUT-DATE TO WS-CURRENT-DATE                     
C35308                              WS-DATE-10                          
C35308                                                                  
                                                                        
              PERFORM 8650-WRITE-BEGIN-CONTROLS THRU 8650-EXIT          
                                                                        
C29529        MOVE SPACES        TO FIOAC03                             
                                    FIOCA191                            
                                    FIOCA192                            
                                                                        
              MOVE WS-INPUT-DATE TO WS-NEW-BUSINESS-DAY                 
T16214        PERFORM 6500-GET-NEXT-BUSINESS-DAY                        
T16214                      THRU 6500-NEXT-BUSINESS-DAY-EXIT            
T16214                UNTIL NEXT-BUSINESS-DAY-FOUND                     
T16214                                                                  
T16214        MOVE WS-NEW-BUSINESS-DAY(3:2) TO STORE-YEAR               
T16214        MOVE WS-NEW-BUSINESS-DAY(6:2) TO STORE-MONTH              
T16214        MOVE WS-NEW-BUSINESS-DAY(9:2) TO STORE-DAY                
                                                                        
AGLPWC        MOVE WS-DRAFT-TAX-ID-LIT         TO C8-DELINQ-CD          
T23549***                                                                       
T23549***  DRAFT INFORMATION WILL ONLY APPLY TO COMPANY NUMBER 01               
T23549***  (SCEG), WHEN DIFFERENT DRAFT FILES NEED TO BE PRODUCED               
T23549***  FOR SCEG AND PSNC THIS LOGIC NEEDS TO CHANGE                         
T23549***                                                                       
T23549        MOVE '01'                        TO C8-COMPANY-NO         
AGLPWC        PERFORM 7650-SELECT-COMPANY-DRAFT-INFO THRU 7650-EXIT     
AGLPWC        MOVE C8-DESCRIPTION-TEXT (1:10)  TO WS-VALID-TAX-ID       
AGLPWC        MOVE C8-DESCRIPTION-TEXT (12:16) TO STORE-H-COMP-NAME     
                                                                        
AGLPWC        MOVE WS-DESTINATION-ID-LIT       TO C8-DELINQ-CD          
AGLPWC        PERFORM 7650-SELECT-COMPANY-DRAFT-INFO THRU 7650-EXIT     
AGLPWC        MOVE SPACES           TO WS-DESTINATION-ID                
AGLPWC        MOVE SPACES           TO WS-DESTINATION-ID-1CHAR          
AGLPWC        MOVE C8-DESCRIPTION-TEXT (1:9)                            
                                      TO WS-DESTINATION-ID-9CHAR        
AGLPWC        MOVE C8-DESCRIPTION-TEXT (1:8)   TO                       
AGLPWC                                  WS-DESTINATION-ID-8-CHAR        
AGLPWC        MOVE C8-DESCRIPTION-TEXT (11:23) TO WS-DESTINATION-NAME   
                                                                        
              ADD 1 TO WS-DRAFT-HEADER-CNT                              
              PERFORM 0500-PROCESS-TYPE-1 THRU 0500-PROCESS-TYPE-1-EXIT 
              PERFORM 0600-DRAFT-HEADER   THRU 0600-DRAFT-HEADER-EXIT   
                                                                        
              INITIALIZE COMPANY-END-REC-DATA                           
T25584     END-IF                                                       
T25584*                                                                         
T25584     INITIALIZE WS-SYSIPT                                         
T25584        PERFORM 6235-GET-FJC01-RESTART-REQ                        
T25584           THRU 6235-EXIT                                         
T25584           MOVE G6-SEQ-NO        TO WS-SEQ-NO                     
T25584     INITIALIZE WS-SYSIPT                                         
T25584*                                                                         
T25584     PERFORM 0700-PREPARE-RESTART                                 
T25584        THRU 0700-EXIT.                                           
                                                                        
C35308     MOVE WS-D10-YY TO WS-D8-YY.                                  
C35308     MOVE WS-D10-MM TO WS-D8-MM.                                  
C35308     MOVE WS-D10-DD TO WS-D8-DD.                                  
C35308     MOVE WS-DATE-8 TO P-RPT-TRAN-DATE.                           
                                                                        
C25487     PERFORM 7800-GET-TODAYS-DATE THRU 7800-EXIT.                 
                                                                        
C35308     MOVE WS-TODAYS-DATE(3:2) TO WS-D8-YY.                        
C35308     MOVE WS-TODAYS-DATE(6:2) TO WS-D8-MM.                        
C35308     MOVE WS-TODAYS-DATE(9:2) TO WS-D8-DD.                        
C35308     MOVE WS-DATE-8 TO P-RPT-RUN-DATE-1.                          
C35308     MOVE WS-PGRMNAME TO P-RPT-PGRMNAME-1.                        
C35308     MOVE '01' TO C7-COMPANY-NO.                                  
C35308     PERFORM 0800-SELECT-COMP-NAME THRU 0800-EXIT.                
C35308     MOVE C7-COMPANY-NAME TO P-RPT-CO-NAME-1.                     
C35308     PERFORM 8300-PRINT-RPT1-HEADERS THRU 8300-EXIT.              
A00996     MOVE WS-DRAFT-TOLL-CD TO C8-DELINQ-CD.                       
A00996     PERFORM 7675-SELECT-TOLERANCE-DRFT-AMT THRU 7675-EXIT.       
                                                                        
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
       0200-CLEANUP.                                                    
           PERFORM 7200-CLOSE-EFT-CSR     THRU 7200-EXIT.               
           PERFORM 8660-WRITE-END-CONTROLS THRU 8660-EXIT.              
                                                                        
       0200-EXIT.                                                       
           EXIT.                                                        
                                                                        
       0300-PROCESS-FCSCA191.                                           
TJS000     INITIALIZE COMPANY-END-REC-DATA.                             
           MOVE WS-NEW-BUSINESS-DAY TO WS-CURRENT-DATE.                 
           PERFORM 7000-OPEN-EFT-CSR  THRU 7000-EXIT.                   
           PERFORM 2000-PROCESS-NEXT-DAY THRU 2000-EXIT                 
              UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND.                  
                                                                        
           MOVE WS-Y TO WRITE-FIOCA191-SW.                              
           IF DATA-FOUND                                                
              PERFORM 8820-WRITE-CO-END-REC    THRU 8820-EXIT           
           END-IF                                                       
           MOVE SPACES              TO E-FCA191-END-REC.                
           MOVE HIGH-VALUES         TO E-FCA191-KEY-EREC.               
           MOVE WS-FCSCA191-REC-CNTR                                    
                                    TO E-FCA191-RECORD-COUNT-EREC.      
           MOVE SPACES              TO E-FCA191-CREATE-DB-PART-EREC.    
           PERFORM 8700-WRITE-FCSCA191 THRU 8700-EXIT.                  
           SUBTRACT 1 FROM WS-FCSCA191-REC-CNTR.                        
           PERFORM 7200-CLOSE-EFT-CSR     THRU 7200-EXIT.               
      *                                                                 13450000
           CLOSE FCSCA191-FILE.                                         
      *                                                                 16270000
           IF  FCA191-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSCA191 OPEN.  STATUS IS '       
                       WS-FCA191-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
       0300-EXIT.                                                       
           EXIT.                                                        
      *                                                                 08980000
T25584************************************************************              
T25584*    CHECK FOR RESTART                                     *              
T25584************************************************************              
T25584 0400-CHECK-RESTART.                                              
T25584                                                                  
T25584          MOVE WS-PGRMNAME            TO RF-NAME-PROGRAM.         
T25584          MOVE 1                      TO RF-PARTITION-NO,         
T25584                                         WS-CHKP-PART-NO.         
T25584          MOVE 1                      TO RF-DUP-CNTRL-NO.         
T25584      PERFORM 7001-SELECT-RESTART                                 
T25584         THRU 7001-EXIT                                           
T25584                                                                  
T25584      IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL              
T25584         MOVE RF-RESTART-DATA-TEXT TO WS-RESTART-DATA             
T25584         IF WS-RESTART-PROCESS-TYPE NUMERIC                       
T25584            MOVE WS-Y TO WS-IS-THIS-A-RESTART                     
T25584         ELSE                                                     
T25584            GO TO 0400-EXIT                                       
T25584         END-IF                                                   
T25584      ELSE                                                        
T25584         GO TO 0400-EXIT                                          
T25584      END-IF.                                                     
T25584                                                                  
T25584 0400-EXIT.                                                       
T25584     EXIT.                                                        
       0500-PROCESS-TYPE-1.                                             
           MOVE SPACES TO CSHCNACH-OUTPUT-RECORD.                       
           MOVE '1'                  TO CSHCNACH-RECORD-TYPE.           
           MOVE '01'                 TO CSHCNACH-1-PRIORITY-CODE.       
AGLPWC     MOVE WS-DESTINATION-ID    TO CSHCNACH-1-IMMED-DEST.          
AGLPWC     MOVE WS-VALID-TAX-ID     TO CSHCNACH-1-IMMED-ORIGIN          
                                       WS-TYPE-8-COMPANY-ID.            
                                                                        
           MOVE STORE-H-EFF-DATE     TO CSHCNACH-1-FILE-CREATE-DT.      
           ACCEPT WS-CURRENT-TIME FROM TIME.                            
C35308     MOVE WS-CURRENT-TIME(1:2) TO WS-RT-HH.                       
C35308     MOVE WS-CURRENT-TIME(3:2) TO WS-RT-MM.                       
C35308     MOVE WS-CURRENT-TIME(5:2) TO WS-RT-SS.                       
C35308     MOVE WS-RUN-TIME TO P-RPT-RUN-TIME.                          
                                                                        
           MOVE WS-CURRENT-TIMER     TO CSHCNACH-1-FILE-CREATE-TIME.    
           MOVE 'A'                  TO CSHCNACH-1-FILE-ID-MODIFIER.    
           MOVE '094'                TO CSHCNACH-1-RECORD-SIZE.         
           MOVE '10'                 TO CSHCNACH-1-BLOCK-FACTOR.        
           MOVE '1'                  TO CSHCNACH-1-FORMAT-CODE.         
AGLPWC     MOVE WS-DESTINATION-NAME  TO CSHCNACH-1-IMMED-DEST-NAME.     
           MOVE STORE-H-COMP-NAME    TO CSHCNACH-1-IMMED-ORIGIN-NAME.   
           MOVE 'DRAFTS  '           TO CSHCNACH-1-REFERENCE-CODE.      
           PERFORM 8000-WRITE-FCSAC03 THRU 8000-EXIT.                   
           MOVE SPACES TO FIOAC03.                                      
                                                                        
           ADD 1 TO WS-TYPE-1-WRITTEN.                                  
           DISPLAY                                                      
              'TYPE 1 FILE  CONTROL RECORD WRITTEN DISPLAYED BELOW'.    
                                                                        
       0500-PROCESS-TYPE-1-EXIT.                                        
           EXIT.                                                        
                                                                        
      **************************************************************    06130000
      * 0600-DRAFT-HEADER PARAGRAPH                               *     06140000
      * THERE SHOULD ONLY BE 1 DRAFT HEADER PER RUN. THIS PROGRAM  *    06150000
      * WILL ABEND IF THE DRAFT HEADER CNT > 1.                    *    06160000
      * INPUT FILE SHOULD ONLY HAVE 1 RECORD WITH 'H8021' IN       *    06170000
      * POSITION 1 THRU 5 OF THE RECORD.                           *    06180000
      *                                                            *    06190000
      **************************************************************    06200000
       0600-DRAFT-HEADER.                                               
           MOVE SPACES TO CSHCNACH-OUTPUT-RECORD.                       
           MOVE '5'                  TO CSHCNACH-RECORD-TYPE.           
           MOVE '200'                TO CSHCNACH-5-SERVICE-CLASS.       
           MOVE STORE-H-COMP-NAME    TO CSHCNACH-5-COMPANY-NAME.        
           MOVE SPACES               TO CSHCNACH-5-DISCRET-DATA.        
AGLPWC     MOVE WS-VALID-TAX-ID      TO CSHCNACH-5-COMPANY-ID.          
           MOVE 'PPD'                TO CSHCNACH-5-STD-ENTRY-CLASS.     
           MOVE 'DRAFT     '         TO CSHCNACH-5-CO-ENTRY-DESC.       
           MOVE STORE-H-EFF-DATE     TO CSHCNACH-5-CO-DESC-DATE.        
           MOVE STORE-H-EFF-DATE     TO CSHCNACH-5-CO-EFF-DATE.         
           MOVE SPACES               TO CSHCNACH-5-SETTLE-DATE-JULX.    
           MOVE '1'                  TO CSHCNACH-5-ORIGINATOR-STATUE.   
AGLPWC     MOVE WS-DESTINATION-ID-8-CHAR                                
AGLPWC                               TO CSHCNACH-5-ORIGINAT-DFI-ID.     
           MOVE '0000001'            TO CSHCNACH-5-BATCH-NBR.           
           PERFORM 8000-WRITE-FCSAC03 THRU 8000-EXIT.                   
           MOVE SPACES TO FIOAC03.                                      
                                                                        
           ADD 1 TO WS-DRAFT-TYPE-5-WRITTEN.                            
           DISPLAY                                                      
              'TYPE 5 DRAFT HEADER WRITTEN DISPLAYED BELOW'.            
       0600-DRAFT-HEADER-EXIT.                                          
           EXIT.                                                        
T25584*                                                                         
T25584 0700-PREPARE-RESTART.                                            
T25584*                                                                         
T25584     IF WS-THIS-IS-A-RESTART                                      
T25584        DISPLAY '*******************************************'     
T25584        DISPLAY '*****   THIS IS A RESTART OF PCSCA190   ***'     
T25584        DISPLAY '*******************************************'     
T25584        PERFORM 0710-PROCESS-FCSAC03                              
T25584        PERFORM 0720-PROCESS-FCSC191                              
T25584        PERFORM 0730-PROCESS-FCSC192                              
T25584        MOVE WS-RESTART-COMMON-DATE    TO WS-CURRENT-DATE         
T25584                                          WS-INPUT-DATE           
C35308                                          WS-DATE-10              
C35308        MOVE WS-D10-YY TO WS-D8-YY                                
C35308        MOVE WS-D10-MM TO WS-D8-MM                                
C35308        MOVE WS-D10-DD TO WS-D8-DD                                
C35308        MOVE WS-DATE-8 TO P-RPT-TRAN-DATE                         
C35308        PERFORM 7800-GET-TODAYS-DATE THRU 7800-EXIT               
C35308        MOVE WS-TODAYS-DATE(3:2) TO WS-D8-YY                      
C35308        MOVE WS-TODAYS-DATE(6:2) TO WS-D8-MM                      
C35308        MOVE WS-TODAYS-DATE(9:2) TO WS-D8-DD                      
C35308        MOVE WS-DATE-8 TO P-RPT-RUN-DATE-1                        
C35308        MOVE WS-PGRMNAME TO P-RPT-PGRMNAME-1                      
C35308        MOVE '01' TO C7-COMPANY-NO                                
C35308        PERFORM 0800-SELECT-COMP-NAME THRU 0800-EXIT              
C35308        MOVE C7-COMPANY-NAME TO P-RPT-CO-NAME-1                   
C35308        ACCEPT WS-CURRENT-TIME FROM TIME                          
C35308        MOVE WS-CURRENT-TIME(1:2) TO WS-RT-HH                     
C35308        MOVE WS-CURRENT-TIME(3:2) TO WS-RT-MM                     
C35308        MOVE WS-CURRENT-TIME(5:2) TO WS-RT-SS                     
C35308        MOVE WS-RUN-TIME TO P-RPT-RUN-TIME                        
C35308        PERFORM 8300-PRINT-RPT1-HEADERS THRU 8300-EXIT            
                                                                        
T34140        MOVE WS-RESTART-CHKP-SEQ-NO    TO WS-CHKP-SEQ-NO          
T25584        MOVE WS-RES-WRITE-FILES        TO WS-WRITE-FILES          
T25584        MOVE WS-RES-DRAFT-HEADER-CNT   TO WS-DRAFT-HEADER-CNT     
T25584        MOVE WS-RES-DRAFT-DETAIL-CNT   TO WS-DRAFT-DETAIL-CNT     
T25584        MOVE WS-RES-DRAFT-HASH-TOTAL   TO WS-DRAFT-HASH-TOTAL     
T25584        MOVE WS-RES-DRAFT-DEBIT-TOTAL  TO WS-DRAFT-DEBIT-TOTAL    
T25584        MOVE WS-RES-DRAFT-CREDIT-TOTAL TO WS-DRAFT-CREDIT-TOTAL   
T25584        MOVE WS-RES-FINAL-BANK-DFT-TOTAL TO                       
T25584                                    WS-FINAL-BANK-DFT-TOTAL       
T25584        MOVE WS-RES-DRAFT-TYPE-5-WRITTEN TO                       
T25584                                    WS-DRAFT-TYPE-5-WRITTEN       
T25584        MOVE WS-RES-DRAFT-TYPE-6-WRITTEN TO                       
T25584                                    WS-DRAFT-TYPE-6-WRITTEN       
T25584        MOVE WS-RES-COMPANY-END-REC-DATA TO                       
T25584                                    COMPANY-END-REC-DATA          
T25584        MOVE WS-RES-TYPE-6-SEQ-NBR       TO WS-TYPE-6-SEQ-NBR     
T25584        MOVE WS-RES-FIOCA192             TO FIOCA192              
T25584        MOVE WS-RES-NEW-BUSINESS-DAY     TO WS-NEW-BUSINESS-DAY   
T25584        MOVE WS-RES-FCSCA191-REC-CNTR    TO WS-FCSCA191-REC-CNTR  
T25584        MOVE WS-RES-FCSCA191-CO-CNTR     TO WS-FCSCA191-CO-CNTR   
T25584        MOVE WS-RES-FCSCA192-REC-CNTR    TO WS-FCSCA192-REC-CNTR  
T25584        MOVE WS-RES-FCSCA192-CO-CNTR     TO WS-FCSCA192-CO-CNTR   
T25584        MOVE WS-RES-DESTINATION-ID-8-CHAR TO                      
T25584                                       WS-DESTINATION-ID-8-CHAR   
T25584        MOVE WS-RES-TYPE-8-COMPANY-ID TO WS-TYPE-8-COMPANY-ID     
T25584        MOVE WS-RES-NACHA-REC-WRITTEN TO WS-NACHA-REC-WRITTEN     
T25584        MOVE WS-RES-PREV-CO-NO        TO WS-PREV-CO-NO            
A03874        MOVE WS-TEMP-RES-ACC-NO       TO WS-RES-ACCOUNT-NO        
A03874        MOVE WS-RES-PREV-ACC-NO       TO WS-PREVIOUS-ACCOUNT-NO   
A03874        MOVE WS-RES-PREV-DRAFT-AMT    TO WS-PREV-DRAFT-AMOUNT     
A03874        MOVE WS-RES-PREV-DRAFT-DATE   TO WS-PREV-DRAFT-DATE       
A03874        MOVE WS-RES-PREV-SEQ-NO       TO WS-PREV-BANK-SEQ-NO      
T25584        MOVE SPACES                   TO FIOCA191                 
T25584     END-IF.                                                      
T25584*                                                                         
T25584 0700-EXIT.                                                       
T25584      EXIT.                                                       
T25584*                                                                 08980000
T25584 0710-PROCESS-FCSAC03.                                            
T25584     OPEN INPUT FCSAC03R-FILE                                     
T25584     IF FAC03R-SUCCESSFUL                                         
T25584        CONTINUE                                                  
T25584     ELSE                                                         
T25584        DISPLAY '0310-ERROR ON FCSAC03R OPEN.  STATUS IS '        
T25584                    WS-FAC03R-STATUS                              
T25584        PERFORM 9900-ABEND THRU 9900-EXIT                         
T25584     END-IF                                                       
T25584                                                                  
T25584     PERFORM WS-RESTART-FCSAC03-REC-CNTR TIMES                    
T25584       READ FCSAC03R-FILE INTO FIOAC03                            
T25584       IF FAC03R-SUCCESSFUL                                       
T25584          WRITE FIOAC03                                           
T25584          IF FAC03-SUCCESSFUL                                     
T25584             CONTINUE                                             
T25584          ELSE                                                    
T25584              DISPLAY 'ERROR ON FCSAC03 REWRITE.  STATUS IS '     
T25584                      WS-FAC03-STATUS                             
T25584              PERFORM 9900-ABEND THRU 9900-EXIT                   
T25584          END-IF                                                  
T25584       ELSE                                                       
T25584          DISPLAY 'PREMATURE EOF ON FCSAC03R RESTART'             
RS1114          DISPLAY 'ERROR ON FCSAC03R REWRITE.  STATUS IS '        
RS1114                      WS-FAC03R-STATUS                            
RS1114          DISPLAY 'RESTART RECORD COUNT = '                       
RS1114                      WS-RESTART-FCSAC03-REC-CNTR                 
T25584          DISPLAY 'PROCESSING TERMINATED'                         
T25584          PERFORM 9900-ABEND THRU 9900-EXIT                       
T25584       END-IF                                                     
T25584     END-PERFORM                                                  
T25584     CLOSE FCSAC03R-FILE.                                         
T25584                                                                  
T25584 0710-EXIT.                                                       
T25584      EXIT.                                                       
T25584*                                                                         
T25584 0720-PROCESS-FCSC191.                                            
T25584     OPEN INPUT FCSC191R-FILE                                     
T25584     IF FCA191R-SUCCESSFUL                                        
T25584        CONTINUE                                                  
T25584     ELSE                                                         
C35308        DISPLAY '0320-ERROR ON FCSC191R OPEN. STATUS IS '         
T25584                    WS-FCA191R-STATUS                             
T25584        PERFORM 9900-ABEND THRU 9900-EXIT                         
T25584     END-IF                                                       
T25584     PERFORM WS-RESTART-FCSC191-REC-CNTR TIMES                    
T25584       READ FCSC191R-FILE INTO FIOCA191                           
T25584       IF FCA191R-SUCCESSFUL                                      
T25584          WRITE FIOCA191                                          
T25584          IF FCA191-SUCCESSFUL                                    
T25584             CONTINUE                                             
T25584          ELSE                                                    
T25584              DISPLAY 'ERROR ON FCSCA191 REWRITE.  STATUS IS '    
T25584                      WS-FCA191-STATUS                            
T25584              PERFORM 9900-ABEND THRU 9900-EXIT                   
T25584          END-IF                                                  
T25584       ELSE                                                       
T25584          DISPLAY 'PREMATURE EOF ON FCSCA191 RESTART'             
RS1114          DISPLAY 'ERROR ON FCSCA191 REWRITE.  STATUS IS '        
RS1114                      WS-FCA191R-STATUS                           
RS1114          DISPLAY 'RESTART RECORD COUNT = '                       
RS1114                      WS-RESTART-FCSC191-REC-CNTR                 
T25584          DISPLAY 'PROCESSING TERMINATED'                         
T25584          PERFORM 9900-ABEND THRU 9900-EXIT                       
T25584       END-IF                                                     
T25584     END-PERFORM                                                  
T25584     CLOSE FCSC191R-FILE.                                         
T25584 0720-EXIT.                                                       
T25584      EXIT.                                                       
T25584*                                                                         
T25584 0730-PROCESS-FCSC192.                                            
T25584     OPEN INPUT FCSC192R-FILE                                     
T25584     IF FCA192R-SUCCESSFUL                                        
T25584        CONTINUE                                                  
T25584     ELSE                                                         
T25584        DISPLAY '0330-ERROR ON FCSC192R OPEN. STATUS IS '         
T25584                    WS-FCA192R-STATUS                             
T25584        PERFORM 9900-ABEND THRU 9900-EXIT                         
T25584     END-IF                                                       
T25584     PERFORM WS-RESTART-FCSC192-REC-CNTR TIMES                    
T25584       READ FCSC192R-FILE INTO FIOCA192                           
T25584       IF FCA192R-SUCCESSFUL                                      
T25584          WRITE FIOCA192                                          
T25584          IF FCA192-SUCCESSFUL                                    
T25584             CONTINUE                                             
T25584          ELSE                                                    
T25584              DISPLAY 'ERROR ON FCSCA192 REWRITE.  STATUS IS '    
T25584                      WS-FCA192-STATUS                            
T25584              PERFORM 9900-ABEND THRU 9900-EXIT                   
T25584          END-IF                                                  
T25584       ELSE                                                       
T25584          DISPLAY 'PREMATURE EOF ON FCSCA192 RESTART'             
RS1114          DISPLAY 'ERROR ON FCSCA192 REWRITE.  STATUS IS '        
RS1114                      WS-FCA192R-STATUS                           
RS1114          DISPLAY 'RESTART RECORD COUNT = '                       
RS1114                      WS-RESTART-FCSC192-REC-CNTR                 
T25584          DISPLAY 'PROCESSING TERMINATED'                         
T25584          PERFORM 9900-ABEND THRU 9900-EXIT                       
T25584       END-IF                                                     
T25584     END-PERFORM                                                  
T25584     CLOSE FCSC192R-FILE.                                         
T25584 0730-EXIT.                                                       
T25584      EXIT.                                                       
C35308                                                                  
C35308**************************************************************    06130000
C35308*                                                            *    06190000
C35308* 0800-SELECT-COM-NAME                                       *    06140000
C35308* SELECTS COMPANY NAME FROM CSS_COMPANY                      *    06150000
C35308*                                                            *    06190000
C35308**************************************************************    06200000
C35308 0800-SELECT-COMP-NAME.                                           
C35308                                                                  
C35308*                                                                 06619300
C35308     EXEC SQL                                                     
C35308         SELECT COMPANY_NAME                                      
C35308         INTO   :C7-COMPANY-NAME                                  
C35308         FROM   CSS_COMPANY WITH(READUNCOMMITTED)                         
C35308         WHERE COMPANY_NO = :C7-COMPANY-NO                        
C35308                                                           
C35308     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     06619400
MFA-TR*        SELECT COMPANY_NAME                                      06619500
MFA-TR*        INTO   :C7-COMPANY-NAME                                  06619600
MFA-TR*        FROM   CSS_COMPANY                                       06619700
MFA-TR*        WHERE COMPANY_NO = :C7-COMPANY-NO                        06619800
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    06619900

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

C35308                                                                  
C35308     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
C35308                                                                  
C35308     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
C35308        CONTINUE                                                  
C35308     ELSE                                                         
C35308        MOVE '0800' TO WS-ABEND-PARAGRAPH                         
C35308        MOVE SQLCODE TO WS-SQLCODE                                
C35308        DISPLAY '*============================================*'  
C35308        DISPLAY '*==========      PCSCA190       =============*'  
C35308        DISPLAY '*============================================*'  
C35308        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
C35308        DISPLAY '*============================================*'  
C35308        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
C35308                '                           *'                    
C35308        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
C35308                '                     *'                          
C35308        DISPLAY '*  ERROR WHEN SELECTING FROM CSS_COMPANY *'      
C35308                '                     *'                          
C35308        DISPLAY '*  COMPANY-NO: ' C7-COMPANY-NO                   
C35308                '                           *'                    
C35308        DISPLAY '*============================================*'  
C35308        PERFORM 9900-ABEND THRU 9900-EXIT                         
C35308     END-IF.                                                      
C35308*                                                                 06621100
C35308 0800-EXIT.                                                       
C35308     EXIT.                                                        
                                                                        
       1000-PROCESS-ACCOUNTS.                                           
                                                                        
C32389     IF PB-ACCOUNT-NO = WS-PREVIOUS-ACCOUNT-NO AND                
C32389            PB-DRAFT-DATE = WS-PREV-DRAFT-DATE AND                
C32389                PB-DRAFT-AMT = WS-PREV-DRAFT-AMOUNT AND           
C32389                   PB-CUST-BANK-SEQ-NO = WS-PREV-BANK-SEQ-NO      
A00996         IF PB-DRAFT-AMT > WS-TOLERANCE-AMT                       
C35308           MOVE WS-DUPLICATE-MESSAGE TO P-RPT1-MESSAGE            
C35308           PERFORM 3400-PRINT-REPORT THRU 3400-EXIT               
C32389           PERFORM 7100-FETCH-EFT-CSR    THRU 7100-EXIT           
C32389           GO TO 1000-EXIT                                        
A00996         END-IF                                                   
C32389     END-IF.                                                      
C32389                                                                  
C32389         MOVE PB-ACCOUNT-NO       TO WS-PREVIOUS-ACCOUNT-NO.      
C32389         MOVE PB-DRAFT-DATE       TO WS-PREV-DRAFT-DATE.          
C32389         MOVE PB-DRAFT-AMT        TO WS-PREV-DRAFT-AMOUNT.        
C32389         MOVE PB-CUST-BANK-SEQ-NO TO WS-PREV-BANK-SEQ-NO.         
                                                                        
C29529     IF PB-CODE-SOURCE-ID EQUAL WS-E                              
C29529        AND PB-PYMT-POSTED-FL EQUAL 'Y'                           
C29529        PERFORM 7900-GET-DATE-CSH-RPT                             
C29529           THRU 7900-EXIT                                         
C29529        IF JT-DATE-CASH-REPORT NOT EQUAL SPACES                   
C29529           PERFORM 7450-SELECT-ACCOUNT                            
C29529              THRU 7450-EXIT                                      
C29529           PERFORM 2100-PROCESS-EFT                               
C29529              THRU 2100-EXIT                                      
C29529        END-IF                                                    
C29529     ELSE                                                         
              PERFORM 7450-SELECT-ACCOUNT  THRU 7450-EXIT               
              PERFORM 2100-PROCESS-EFT THRU 2100-EXIT                   
C29529     END-IF                                                       
                                                                        
           PERFORM 7100-FETCH-EFT-CSR    THRU 7100-EXIT.                
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
T22767*                                                                         
T22767 1130-FETCH-JRNLING-VARIABLES.                                    
T22767                                                                  
T22767     PERFORM 7700-SELECT-USER-ID      THRU 7700-EXIT.             
T22767     MOVE Y2-BATCH-DEP-CASH-OFF       TO  WS-CASHIER-XFER-OFFICE. 
T22767     MOVE Y2-USER-ID                  TO  WS-CASHIER-USER-ID.     
T22767     MOVE Y2-LOCAL-OFFICE             TO  WS-CASHIER-LOCAL-OFFICE.
T22767     MOVE Y2-DEP-DEFT-BANK-ID         TO  WS-CASHIER-BANK-ID.     
T22767     MOVE WS-CASHIER-USER-ID          TO  Y1-USER-ID.             
T22767     PERFORM 7710-SELECT-CASHIER-CODE THRU 7710-EXIT.             
T22767     PERFORM 7720-SELECT-BANK-ST-CD   THRU 7720-EXIT.             
T22767     MOVE 'CLR-CASH'                  TO  GO-GL-ACCT-NAME.        
T22767     PERFORM 7730-SELECT-GL-ACCT-NO   THRU 7730-EXIT.             
T22767     MOVE GO-GL-ACCT-NO               TO  WS-CASH-GL-ACCT.        
T22767     PERFORM 7740-GET-CURRENT-TIMESTAMP                           
T22767                                      THRU 7740-EXIT.             
T22767     MOVE WS-CASHIER-XFER-OFFICE      TO  CS-CASH-LOCAL-OFFICE.   
T22767     MOVE WS-MIN-ONE                  TO  WS-NULL-IND-1.          
T22767     PERFORM 7750-GET-MAX-CNTL-DRWR   THRU 7750-EXIT.             
T22767 1130-EXIT.                                                       
T22767      EXIT.                                                       
T22767                                                                  
T25584*                                                                         
T25584***************************************************************           
T25584**    PREPARE-BEFORE COMMIT**                                             
T25584***************************************************************           
T25584 1700-PREPARE-PRECOMMIT.                                          
T25584                                                                  
T25584     MOVE 1                   TO  WS-RESTART-PROCESS-TYPE         
T25584     MOVE WS-C                TO  WS-RESTART-JOB-STATUS           
T25584     MOVE WS-INPUT-DATE       TO  WS-RESTART-COMMON-DATE          
T25584     MOVE WS-WRITE-FILES      TO  WS-RES-WRITE-FILES              
T25584     ADD  1                   TO  WS-CHKP-SEQ-NO.                 
T25584     MOVE WS-CHKP-SEQ-NO      TO  WS-RESTART-CHKP-SEQ-NO.         
T25584     MOVE WS-DRAFT-HEADER-CNT   TO WS-RES-DRAFT-HEADER-CNT        
T25584     MOVE WS-DRAFT-DETAIL-CNT   TO WS-RES-DRAFT-DETAIL-CNT        
T25584     MOVE WS-DRAFT-HASH-TOTAL   TO WS-RES-DRAFT-HASH-TOTAL        
T25584     MOVE WS-DRAFT-DEBIT-TOTAL  TO WS-RES-DRAFT-DEBIT-TOTAL       
T25584     MOVE WS-DRAFT-CREDIT-TOTAL TO WS-RES-DRAFT-CREDIT-TOTAL      
T25584     MOVE WS-FINAL-BANK-DFT-TOTAL TO WS-RES-FINAL-BANK-DFT-TOTAL  
T25584     MOVE WS-DRAFT-TYPE-5-WRITTEN TO                              
T25584                                 WS-RES-DRAFT-TYPE-5-WRITTEN      
T25584     MOVE WS-DRAFT-TYPE-6-WRITTEN TO                              
T25584                                 WS-RES-DRAFT-TYPE-6-WRITTEN      
T25584     MOVE COMPANY-END-REC-DATA TO                                 
T25584                                 WS-RES-COMPANY-END-REC-DATA      
T25584     MOVE WS-TYPE-6-SEQ-NBR    TO WS-RES-TYPE-6-SEQ-NBR           
T25584     MOVE FIOCA192             TO WS-RES-FIOCA192                 
T25584     MOVE WS-NEW-BUSINESS-DAY  TO WS-RES-NEW-BUSINESS-DAY         
T25584     MOVE WS-FCSCA191-REC-CNTR TO WS-RES-FCSCA191-REC-CNTR        
T25584     MOVE WS-FCSCA191-CO-CNTR  TO WS-RES-FCSCA191-CO-CNTR         
T25584     MOVE WS-FCSCA192-REC-CNTR TO WS-RES-FCSCA192-REC-CNTR        
T25584     MOVE WS-FCSCA192-CO-CNTR  TO WS-RES-FCSCA192-CO-CNTR         
T25584     MOVE WS-DESTINATION-ID-8-CHAR TO                             
T25584                                  WS-RES-DESTINATION-ID-8-CHAR    
T25584     MOVE WS-TYPE-8-COMPANY-ID TO WS-RES-TYPE-8-COMPANY-ID        
T25584     MOVE WS-NACHA-REC-WRITTEN TO WS-RES-NACHA-REC-WRITTEN        
T25584     MOVE WS-PREV-CO-NO        TO WS-RES-PREV-CO-NO               
A03874     MOVE PB-ACCOUNT-NO        TO WS-TEMP-RES-ACC-NO,             
A03874                                  WS-RES-PREV-ACC-NO              
A03874     MOVE PB-DRAFT-DATE        TO WS-RES-PREV-DRAFT-DATE          
A03874     MOVE PB-DRAFT-AMT         TO WS-RES-PREV-DRAFT-AMT           
A03874     MOVE PB-CUST-BANK-SEQ-NO  TO WS-RES-PREV-SEQ-NO.             
T25584 1700-EXIT.                                                       
T25584     EXIT.                                                        
T25584*                                                                         
       2000-PROCESS-NEXT-DAY.                                           
           PERFORM 7100-FETCH-EFT-CSR THRU 7100-EXIT.                   
T28580*    TO ALLOW ALL ACCOUNTS OTHER THAN NOT-EPAY IN 191 FILE.               
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T28580        AND (BANK-DRAFT-ACCT OR E-DRAFT-ACCT)                     
              IF PB-TRANSACTION-CD = WS-PRENOTE                         
                 CONTINUE                                               
              ELSE                                                      
                 MOVE WS-Y                TO FIOCA191-DATA-SW           
                 MOVE PB-ACCOUNT-NO       TO E-FCA191-ACCOUNT-NO        
                 MOVE PB-DRAFT-AMT        TO E-FCA191-DRAFT-AMOUNT      
                 PERFORM 7450-SELECT-ACCOUNT  THRU 7450-EXIT            
                 MOVE AT-TOTAL-AR-BALANCE TO E-FCA191-ACCOUNT-BALANCE   
                 MOVE AT-COMPANY-NO       TO E-FCA191-COMPANY-NO        
                                             CMP-COMPANY-NO             
                 IF E-FCA191-DRAFT-AMOUNT NOT EQUAL TO                  
                    E-FCA191-ACCOUNT-BALANCE                            
                    MOVE PB-ACCOUNT-NO       TO BU-ACCOUNT-NO           
                    MOVE 50                  TO BU-PYMT-PRIORITY-LVL    
                    PERFORM 7300-OPEN-EPP-BALANCE   THRU 7300-EXIT-OPEN 
                    PERFORM 7300-FETCH-EPP-BALANCE  THRU 7300-EXIT-FETCH
                    IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL          
                       MOVE ZERO             TO WS-EPP-BALANCE          
                       PERFORM 3200-ADD-EPP        THRU 3200-EXIT       
                       UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND          
                    ELSE                                                
                       MOVE ZERO             TO WS-EPP-BALANCE          
                    END-IF                                              
                    PERFORM 7300-CLOSE-EPP-BALANCE  THRU 7300-EXIT-CLOSE
                    MOVE WS-EPP-BALANCE      TO E-FCA191-EPP-BALANCE    
                    PERFORM 8700-WRITE-FCSCA191  THRU 8700-EXIT         
                    PERFORM 8800-PROCESS-END-REC-TBL THRU 8800-EXIT     
                 END-IF                                                 
              END-IF                                                    
           END-IF.                                                      
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       2100-PROCESS-EFT.                                                
           MOVE PB-ACCOUNT-NO TO BE-ACCOUNT-NO.                         
           PERFORM 7400-SELECT-BANK-EFT  THRU 7400-EXIT                 
      *                                                                         
C35308**  CHECK TO SEE IF ROW IS FOUND ON CSS_CUSTOMER_BANK  **                 
C35308     MOVE PB-CUST-BANK-SEQ-NO TO JF-CUST-BANK-SEQ-NO.             
C29529     MOVE AT-CUSTOMER-NO      TO JF-CUSTOMER-NO.                  
C29529     PERFORM 7410-SELECT-CUST-BANK THRU 7410-EXIT.                
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               CONTINUE                                                 
           ELSE                                                         
C35308         MOVE WS-NOTFOUND-CUST-BANK TO P-RPT1-MESSAGE             
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
               GO TO 2100-EXIT                                          
C32389     END-IF.                                                      
      *                                                                 06670000
C32389**  CHECK TO SEE IF BANK ACCOUNT NAME IS VALID  **                        
C32389     IF JF-BANK-ACCOUNT-NAME > SPACES                             
C32389         NEXT SENTENCE                                            
C32389     ELSE                                                         
C35308         MOVE WS-BANK-NAME-SPACES TO P-RPT1-MESSAGE               
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
C32389         GO TO 2100-EXIT                                          
C32389     END-IF.                                                      
      *                                                                         
C32389**  CHECK TO SEE IF BANK ACCOUNT NUMBER IS VALID  **                      
C32389     IF JF-BANK-ACCT-NO > SPACES                                  
C32389         NEXT SENTENCE                                            
C32389     ELSE                                                         
C35308         MOVE WS-BANK-NO-SPACES TO P-RPT1-MESSAGE                 
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
C32389         GO TO 2100-EXIT                                          
C32389     END-IF.                                                      
      *                                                                         
C32389**  CHECK TO SEE IF BANK ID IS VALID  **                                  
C32389     IF JF-BANK-ID > ZERO                                         
C32389         NEXT SENTENCE                                            
C32389     ELSE                                                         
C35308         MOVE WS-BANK-ID-ZERO TO P-RPT1-MESSAGE                   
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
C32389         GO TO 2100-EXIT                                          
C32389     END-IF.                                                      
A01497*                                                                         
A01497     IF BE-BANK-ID > ZERO                                         
A01497         NEXT SENTENCE                                            
A01497     ELSE                                                         
A01497         MOVE WS-INVALID-EFT       TO P-RPT1-MESSAGE              
A01497         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
A01497         GO TO 2100-EXIT                                          
A01497     END-IF.                                                      
      *                                                                         
C29529     MOVE JF-BANK-ID TO D1-BANK-ID                                
           PERFORM 7500-SELECT-BANK-DETAIL THRU 7500-EXIT.              
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
C32389         MOVE JF-BANK-ID            TO WS-MESSAGE-BANK-ID         
C35308         MOVE WS-BANK-ID-INVALID-MESSAGE TO P-RPT1-MESSAGE        
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
               GO TO 2100-EXIT                                          
C32389     END-IF.                                                      
      *                                                                 06770000
T15452     IF PB-DRAFT-AMT = 0 AND                                      
T15452        (PB-TRANSACTION-CD = 27 OR 37)                            
C35308         MOVE WS-DRAFTAMT-INVALID TO P-RPT1-MESSAGE               
C35308         PERFORM 3400-PRINT-REPORT THRU 3400-EXIT                 
T15452         GO TO 2100-EXIT                                          
T15452     END-IF.                                                      
                                                                        
           MOVE PB-ACCOUNT-NO TO AT-ACCOUNT-NO.                         
C35308     MOVE 'Y' TO WS-NAME-ONLY-SW.                                 
           PERFORM 4000-MAIL-NAME-ADDRESS  THRU 4000-EXIT.              
      *                                                                 06800000
           PERFORM 3000-FORMAT-AC03  THRU 3000-EXIT.                    
           PERFORM 3100-PROCESS-REPORT-EXTRACTS THRU 3100-EXIT.         
           PERFORM 8100-DELETE-EFT THRU 8100-EXIT.                      
           PERFORM 8200-UPDATE-BANK-EFT  THRU 8200-EXIT.                
                                                                        
       2100-EXIT.                                                       
           EXIT.                                                        
                                                                        
T22767*************************************************************             
T22767* 2200-WRITE-CNTL-JRNL-AUTO                                 *             
T22767*    CASH DRAWER CONTROL AND JOURNAL ENTRIES ARE CREATED    *             
T22767*    FOR TRANSACTIONS                                       *             
T22767*************************************************************             
T22767 2200-WRITE-CNTL-JRNL-AUTO.                                       
T22767                                                                  
T22767*  POPULATE CNTL RECORD                                                   
T22767     PERFORM 2220-SET-CASH-DRWR-CNTL-VALUES THRU 2220-EXIT.       
T22767     PERFORM 8400-CREATE-CASH-DRWR-CNTL     THRU 8400-EXIT.       
T22767*  POPULATE JOURNAL RECORD                                                
T22767     PERFORM 2250-SET-CASH-DRWR-JRNL-VALUES THRU 2250-EXIT.       
T22767*  POPULATE TRAN-DATA VALUES - COPYBOOK CJF00101                          
T22767     PERFORM 2260-POPULATE-TRAN-DATA        THRU 2260-EXIT.       
T22767     MOVE CJF00101                          TO   CJ-TRAN-DATA.    
T22767     PERFORM 8500-CREATE-CASH-DRWR-JRNL     THRU 8500-EXIT.       
T22767 2200-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767 2220-SET-CASH-DRWR-CNTL-VALUES.                                  
T22767                                                                  
T22767     MOVE WS-1                    TO CS-CASH-COMPANY-NO.          
T22767     MOVE WS-CASHIER-XFER-OFFICE  TO CS-CASH-REPORT-NO.           
T22767     MOVE WS-NEW-BUSINESS-DAY     TO CS-DATE-CASH-REPORT.         
T22767     MOVE WS-XFR-TS(1:10)         TO CS-DATE-LAST-ACTIVITY.       
T22767     ADD  WS-ONE                  TO CS-CASH-DRAWER-ID.           
T22767     MOVE WS-ONE                  TO CS-NO-ITEMS-ENTERED.         
T22767     MOVE Y1-CASHIER-CODE         TO CS-CASHIER-CODE.             
T22767     MOVE WS-D                    TO CS-CODE-PYMT-FACILITY.       
T22767     MOVE WS-XFR-TS               TO CS-BALANCED-TS.              
T22767     MOVE WS-CASHIER-USER-ID      TO CS-USER-ID,                  
T22767                                     CS-BALANCED-BY.              
T22767     MOVE WS-FINAL-BANK-DFT-TOTAL TO CS-AMT-CASH-DEBIT            
T22767                                     CS-AMT-CASH-CREDIT.          
T22767 2220-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767 2250-SET-CASH-DRWR-JRNL-VALUES.                                  
T22767                                                                  
T22767     MOVE CS-CASH-COMPANY-NO      TO CJ-CASH-COMPANY-NO,          
T22767                                     CJ-COMPANY-NO.               
T22767     MOVE CS-CASH-LOCAL-OFFICE    TO CJ-CASH-LOCAL-OFFICE,        
T22767                                     CJ-CASH-REPORT-NO.           
T22767     MOVE WS-ONE                  TO CJ-TRAN-APPL-NO.             
T22767     MOVE CS-NO-ITEMS-ENTERED     TO CJ-ENTRY-NO.                 
T22767     MOVE CS-CASH-DRAWER-ID       TO CJ-CASH-DRAWER-ID.           
T22767     MOVE WS-CASHIER-LOCAL-OFFICE TO CJ-LOCAL-OFFICE,             
T22767                                     CJ-ENTRY-LOC.                
T22767     MOVE WS-A                    TO CJ-JRNL-SORT-ID.             
T22767     MOVE WS-ALL9-ACNO            TO CJ-ACCOUNT-NO.               
T22767     MOVE WS-ZERO                 TO CJ-GL-ACCT-NO,               
T22767                                     CJ-TRAN-COMMENT-LEN.         
T22767     MOVE WS-METER-NO             TO CJ-METER-NO.                 
T22767     MOVE WS-TRAN-TIME            TO CJ-TRAN-TIME,                
T22767                                     CJ-TIME-BALANCED.            
T22767     MOVE WS-TRAN-ID              TO CJ-TRAN-ID.                  
T22767     MOVE CS-DATE-CASH-REPORT     TO CJ-DATE-CASH-REPORT.         
T22767     MOVE WS-INPUT-DATE           TO CJ-DATE-TRAN.                
T22767     MOVE WS-XFR-TS(1:10)         TO CJ-DATE-LAST-ACTION,         
T22767                                     CJ-DATE-BALANCED.            
T22767     MOVE WS-A                    TO CJ-CODE-ENTRY-SOURCE.        
T22767     MOVE CS-USER-ID              TO CJ-USER-ID,                  
T22767                                     CJ-BALANCED-BY.              
T22767     MOVE WS-C-LIT                TO CJ-CURRENCY-TYPE,            
T22767                                     CJ-CODE-STATUS.              
T22767     MOVE CS-CODE-PYMT-FACILITY   TO CJ-CODE-PYMT-FACILITY.       
T22767 2250-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767 2260-POPULATE-TRAN-DATA.                                         
T22767                                                                  
T22767     MOVE SPACES                  TO CJF00101.                    
T22767     MOVE WS-101                  TO WS-101-JRNL-FORMAT-NO.       
T22767     MOVE WS-ONE                  TO WS-101-CASH-DRAWER-USED.     
T22767     MOVE WS-FINAL-BANK-DFT-TOTAL TO WS-101-AMOUNT-ENTERED,       
T22767                                     WS-101-AMT-POSTED.           
T22767     MOVE WS-CASH-GL-ACCT         TO WS-101-ACCT-GEN-LED-DR,      
T22767                                     WS-101-ACCT-GEN-LED-CR.      
T22767     MOVE ZEROES                  TO WS-101-ITEM-ID-NO,           
T22767                                     WS-101-DETAIL-END-AR-BAL,    
T22767                                     WS-101-ACCT-END-AR-BAL,      
T22767                                     WS-101-REVENUE-MONTH.        
T22767     MOVE WS-CASHIER-BANK-ID      TO WS-101-FCS-DEP-BANK-CD.      
T22767     MOVE D1-FCS-DEP-BANK-ST-CD   TO WS-101-FCS-DEP-BANK-ST-CD.   
T22767 2260-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767 2300-WRITE-BANK-XFR.                                             
T22767                                                                  
T22767     MOVE CS-CASH-COMPANY-NO      TO YB-CASH-COMPANY-NO.          
T22767     MOVE WS-CASHIER-XFER-OFFICE  TO YB-CASH-LOCAL-OFFICE.        
T22767     MOVE CS-CASH-DRAWER-ID       TO YB-CASH-DRAWER-ID.           
T22767     MOVE CS-DATE-CASH-REPORT     TO YB-DATE-CASH-REPORT.         
T22767     MOVE WS-CASHIER-USER-ID      TO YB-USER-ID.                  
T22767     MOVE WS-CASHIER-BANK-ID      TO YB-BANK-ID.                  
T22767     MOVE WS-FINAL-BANK-DFT-TOTAL TO YB-TRANSFER-AMT.             
T22767     MOVE WS-XFR-TS               TO YB-TRANSFER-TS.              
T22767     MOVE WS-C-LIT                TO YB-CURRENCY-TYPE.            
T22767     MOVE WS-D                    TO YB-CODE-DR-CR.               
T22767                                                                  
T22767     PERFORM 8550-CREATE-BANK-TRANSFER THRU 8550-EXIT.            
T22767 2300-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
       3000-FORMAT-AC03.                                                
      **************************************************************    06900000
      * THE SHOULD 1 TYPE '6' RECORD WRITTEN FOR EACH DRAFT DETAIL *    06910000
      * READ. THE TYPE '6' RECORD IS THE NACHA FORMAT FOR DETAILS. *    06920000
      **************************************************************    06930000
           MOVE SPACES TO CSHCNACH-OUTPUT-RECORD.                       
           MOVE '6'                  TO CSHCNACH-RECORD-TYPE.           
           MOVE PB-TRANSACTION-CD    TO WS-TRANSACTION-CODE.            
           MOVE WS-PB-TRANS-CD       TO CSHCNACH-6-TRANSACTION-CODE.    
           MOVE D1-ROUTING-NUMBER    TO CSHCNACH-6-TRANSIT-NBR.         
           IF D1-ROUTING-NUMBER NUMERIC                                 
               ADD CSHCNACH-6-TRANSITR-8 TO WS-DRAFT-HASH-TOTAL         
           ELSE                                                         
               DISPLAY 'RECORD HAS NON NUMERIC TRANSIT NUMBER'          
               DISPLAY 'PROCESSING WILL CONTINUE'                       
               DISPLAY 'ROUTING NBR DISPLAYED BELOW'                    
               DISPLAY D1-ROUTING-NUMBER                                
           END-IF.                                                      
           IF CSHCNACH-6-TRANSIT-NBR NUMERIC                            
               ADD CSHCNACH-6-TRANSITR-8 TO WS-TEMP-HASH                
           END-IF.                                                      
C29529     MOVE JF-BANK-ACCT-NO  TO CSHCNACH-6-BANK-ACCT-NBR.           
           MOVE PB-DRAFT-AMT     TO CSHCNACH-6-DRAFT-AMT.               
           IF PB-DRAFT-AMT NUMERIC                                      
               ADD PB-DRAFT-AMT TO WS-DRAFT-DEBIT-TOTAL                 
C31844                             WS-FINAL-BANK-DFT-TOTAL              
           ELSE                                                         
               DISPLAY 'RECORD HAS NON NUMERIC DRAFT AMT     '          
               DISPLAY 'PROCESSING WILL CONTINUE'                       
               DISPLAY 'DRAFT AMT DISPLAYED BELOW'                      
               DISPLAY PB-DRAFT-AMT                                     
           END-IF.                                                      
           MOVE PB-ACCOUNT-NO        TO CSHCNACH-6-ID-NBR.              
C29529     MOVE JF-BANK-ACCOUNT-NAME TO CSHCNACH-6-NAME.                
C25964     IF EPAY-ACCOUNT OR E-DRAFT-ACCT                              
T23549        MOVE 'S'          TO CSHCNACH-6-BANK-DISCRET-DATA(1:1)    
T23549     ELSE                                                         
              MOVE SPACES       TO CSHCNACH-6-BANK-DISCRET-DATA(1:1)    
T23549     END-IF                                                       
P00613     IF PB-USER-ID EQUAL 'WEBTRN2'                                
P00613        MOVE 'I'          TO CSHCNACH-6-BANK-DISCRET-DATA(2:1)    
P00613     ELSE                                                         
P00613        MOVE SPACE        TO CSHCNACH-6-BANK-DISCRET-DATA(2:1)    
P00613     END-IF                                                       
C29529     MOVE PB-PYMT-POSTED-FL    TO CSHCNACH-6-PYMT-POSTED-FL       
C29529     MOVE PB-CUST-BANK-SEQ-NO  TO CSHCNACH-6-CUST-BANK-SEQ-NO     
C29529     MOVE PB-CODE-SOURCE-ID    TO CSHCNACH-6-CODE-SOURCE-ID       
           MOVE '0'                  TO CSHCNACH-6-ADDENDA-IND.         
AGLPWC     MOVE WS-DESTINATION-ID-8-CHAR                                
                                     TO CSHCNACH-6-TRACE-TRANSIT-8.     
           ADD 1 TO WS-TYPE-6-SEQ-NBR.                                  
           MOVE WS-TYPE-6-SEQ-NBR    TO CSHCNACH-6-TRACE-SEQ.           
           PERFORM 8000-WRITE-FCSAC03 THRU 8000-EXIT.                   
           MOVE SPACES TO FIOAC03.                                      
                                                                        
           ADD 1 TO WS-DRAFT-TYPE-6-WRITTEN.                            
                                                                        
       3000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       3100-PROCESS-REPORT-EXTRACTS.                                    
                                                                        
           IF WRITE-FILES                                               
              PERFORM 8710-WRITE-FCSCA192  THRU 8710-EXIT               
              MOVE WS-PREV-CO-NO             TO CMP-COMPANY-NO          
              PERFORM 8800-PROCESS-END-REC-TBL THRU 8800-EXIT           
           ELSE                                                         
              MOVE WS-Y           TO WS-WRITE-FILES                     
           END-IF.                                                      
                                                                        
      * LOADING CA191                                                   07500000
           MOVE AT-COMPANY-NO     TO E-FCA192-COMPANY-NO                
TJS000                               WS-PREV-CO-NO.                     
           MOVE PB-ACCOUNT-NO     TO E-FCA192-ACCOUNT-NO                
                                     BU-ACCOUNT-NO.                     
           MOVE PB-DRAFT-AMT      TO E-FCA192-DRAFT-AMOUNT.             
      * LOADING CA192                                                   07760000
           MOVE WS-ACCOUNT-NAME   TO E-FCA192-CUSTOMER-NAME.            
           MOVE D1-BANK-NAME      TO E-FCA192-BANK-NAME.                
           STRING D1-BANK-CITY                                          
                  ', '                                                  
                  D1-BANK-STATE                                         
               DELIMITED BY SIZE                                        
               INTO WS-BANK-CITY-ST.                                    
           MOVE WS-BANK-CITY-ST   TO E-FCA192-BANK-CITY-STATE.          
           MOVE D1-ROUTING-NUMBER TO E-FCA192-BANK-TRANSIT-NO.          
C29529     MOVE JF-BANK-ACCT-NO   TO E-FCA192-BANK-ACCOUNT-NO.          
C29529     IF EPAY-ACCOUNT                                              
C31844        IF PB-PYMT-POSTED-FL = 'Y'                                
C31844           MOVE 'R'            TO E-FCA192-ACTION-CODE            
C31844        ELSE                                                      
C29529           MOVE 'M'            TO E-FCA192-ACTION-CODE            
C31844        END-IF                                                    
C29529     ELSE                                                         
C29529        MOVE BE-STATUS-CODE    TO E-FCA192-ACTION-CODE            
C25964* FOR E-DRAFTS W,X,Y,Z ARE PASSED INSTEAD OF A,B,C,D              07920000
C31844        IF E-DRAFT-ACCT                                           
C25964           EVALUATE BE-STATUS-CODE                                
C25964               WHEN 'A'                                           
C25964                    MOVE 'W'   TO E-FCA192-ACTION-CODE            
C25964               WHEN 'B'                                           
C25964                    MOVE 'X'   TO E-FCA192-ACTION-CODE            
C25964               WHEN 'C'                                           
C25964                    MOVE 'Y'   TO E-FCA192-ACTION-CODE            
C25964               WHEN 'D'                                           
C25964                    MOVE 'Z'   TO E-FCA192-ACTION-CODE            
C25964           END-EVALUATE                                           
C25964        END-IF                                                    
C29529     END-IF                                                       
T16755     EVALUATE PB-TRANSACTION-CD                                   
T16755         WHEN 27                                                  
T16755              MOVE WS-C-LIT TO E-FCA192-DRAFT-STATUS              
T16755         WHEN 28                                                  
T16755              MOVE WS-P     TO E-FCA192-DRAFT-STATUS              
T16755         WHEN 37                                                  
T16755              MOVE WS-S     TO E-FCA192-DRAFT-STATUS              
T16755         WHEN OTHER                                               
T16755              MOVE SPACES   TO E-FCA192-DRAFT-STATUS              
T16755     END-EVALUATE.                                                
                                                                        
       3100-EXIT.                                                       
           EXIT.                                                        
                                                                        
       3200-ADD-EPP.                                                    
                                                                        
           ADD BU-AMT-MO-PYT-BAL-FWD  TO WS-EPP-BALANCE.                
           PERFORM 7300-FETCH-EPP-BALANCE    THRU 7300-EXIT-FETCH.      
                                                                        
       3200-EXIT.                                                       
           EXIT.                                                        
                                                                        
C35308*                                                                         
C35308 3400-PRINT-REPORT.                                               
C35308                                                                  
C35308     MOVE PB-ACCOUNT-NO TO P-RPT1-ACCT-NUMB.                      
C35308     MOVE PB-DRAFT-DATE TO P-RPT1-DRAFT-DATE.                     
C35308     IF  EPAY-ACCOUNT                                             
C35308     AND PB-PYMT-POSTED-FL = 'Y'                                  
C35308         MOVE JT-DATE-CASH-REPORT TO P-RPT1-CASH-REPORT-DATE      
C35308     ELSE                                                         
C35308         MOVE SPACES TO P-RPT1-CASH-REPORT-DATE                   
C35308     END-IF.                                                      
C35308     MOVE PB-DRAFT-AMT TO P-RPT1-DRAFT-AMT.                       
C35308     MOVE PB-PYMT-POSTED-FL TO P-RPT1-PYMT-POSTED-FL.             
C35308     MOVE PB-CUST-BANK-SEQ-NO TO P-RPT1-CUST-BANK-SEQ-NO.         
C35308     MOVE PB-PYMT-TRANS-TS(1:04) TO WS-P1-YEAR.                   
C35308     MOVE PB-PYMT-TRANS-TS(6:02) TO WS-P1-MONTH.                  
C35308     MOVE PB-PYMT-TRANS-TS(9:02) TO WS-P1-DAY.                    
C35308     MOVE PB-PYMT-TRANS-TS(12:05) TO WS-P1-TIME.                  
C35308     MOVE WS-PRINT-DATE TO P-RPT1-TSTAMP.                         
C35308     IF WS-LINE-COUNT > 50                                        
C35308        PERFORM 8300-PRINT-RPT1-HEADERS THRU 8300-EXIT            
C35308     END-IF.                                                      
C35308     WRITE PRT33-RECORD FROM WS-PRINT-REP-DET-11                  
C35308           AFTER  ADVANCING 1 LINE.                               
C35308     ADD 1 TO WS-LINE-COUNT.                                      
C35308                                                                  
C35308 3400-EXIT.                                                       
C35308     EXIT.                                                        
      *                                                                 08400000
       3600-FIND-DRAFT-CYCLE.                                           
      *************************************************************     08420000
      *ACCOUNTS THAT ARE FINAL BILLED ARE DRAFTED IMMEDIATELY. HENCE    08430000
      *THEIR LAST_DRAFT_CYCLE IS OBTAINED FROM THE DATE ON WHICH THEY   08440000
      *ARE DRAFTED (WHICH IS THE CURRENT DATE). CREATED FOR TPR9566     08450000
      *************************************************************     08460000
                                                                        
           MOVE '3600'  TO WS-ABEND-PARAGRAPH.                          
           EXEC SQL                                                     
              SELECT MIN(BILL_CYCLE)                                    
              INTO  :BN-BILL-CYCLE                                      
              FROM   CSS_BILL_WINDOW WITH(READUNCOMMITTED)                      
              WHERE  DATE_EXTRACT   = IIF(TRY_CONVERT(DATE, 
                                                       :WS-CURRENT-DATE
              ) IS NULL OR (PATINDEX('%.%', :WS-CURRENT-DATE
              ) <> 0) OR (LEN(:WS-CURRENT-DATE) <> 10), CIS.CHAR2DATE(
                                                       :WS-CURRENT-DATE
              ), CONVERT(DATE, :WS-CURRENT-DATE) )                  
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     08490000
MFA-TR*       SELECT MIN(BILL_CYCLE)                                    08500000
MFA-TR*       INTO  :BN-BILL-CYCLE                                      08510000
MFA-TR*       FROM   CSS_BILL_WINDOW                                    08520000
MFA-TR*       WHERE  DATE_EXTRACT   = :WS-CURRENT-DATE                  08530000
MFA-TR*       WITH UR                                                           
MFA-TR*    END-EXEC.                                                    08550000

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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ACCOUNT NO : ' PB-ACCOUNT-NO                  
                      '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT                         
           END-IF.                                                      
                                                                        
       3600-EXIT.                                                       
      *                                                                 08800000
      ***************************************************************** 08880000
      *    4000-MAIL-NAME-ADDRESS.                                   ** 08890000
      *    4010-GET-ALL-NAMES.                                       ** 08890000
      *    4015-SHIFT-NAME-TABLE                                     ** 08890000
      *    4020-FORMAT-NAME                                          ** 08890000
      *    4022-SALUTATION-NAME                                      ** 08890000
      *    4025-DETERMINE-ADDRESS                                    ** 08890000
      *    4030-LOAD-NAME-ADDR                                       ** 08890000
      *    4035-LOAD-ADDL-BILL-NAME                                  ** 08890000
      *    4040-MOVE-DQ-TO-WS                                        ** 08890000
      *    4050-GET-FORMATTED-ADDRESS                                ** 08890000
      *    4060-GET-NAME                                             ** 08890000
      *    4065-SELECT-NAME                                          ** 08890000
      *    4070-OPEN-NAME-CURSOR                                     ** 08890000
      *    4070-FETCH-NAME                                           ** 08890000
      *    4070-CLOSE-NAME                                           ** 08890000
      *    4071-SELECT-BILL-NAME                                     ** 08890000
      *    4075-SELECT-ACCT-MISC-INFO                                ** 08890000
      *    4080-SELECT-CUST-ADDR-XREF                                ** 08890000
      *    4085-SELECT-ADDR-FORMATTED                                ** 08890000
      *    4090-SELECT-ADDR-FREEFORM                                 ** 08890000
      *    4095-SELECT-ZIP-CODE                                      ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00074 CONTAINS THE LOGIC FOR FINDING THE NAME ** 08910000
      *    AND MAILING ADDRESS.                                      ** 08920000
      *                                                              ** 08920000
      ***************************************************************** 08930000
      *                                                                 08760000
           EXEC SQL                                                     08810000
               INCLUDE CPD00074                                         08820000
           END-EXEC.                                                    08830000
      *                                                                 08800000
      ***************************************************************** 08880000
      *    6010-REDUCE-EMBEDDED-SPACES.                              ** 08890000
      *    6011-COMPRESSION-ROUTINE.                                 ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00004 CONTAINS THE LOGIC FOR REDUCING EMBEDDED** 08910000
      *    SPACES.                                                   ** 08920000
      ***************************************************************** 08930000
      *                                                                 08800000
           EXEC SQL                                                     08770000
               INCLUDE CPD00004                                         08780000
           END-EXEC.                                                    08790000
      *                                                                 08800000
      ***************************************************************** 08880000
      *    6235-GET-FJC01-RESTART-REQ.                               ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00035 READS THE PARM FILE FOR RESTART REQUEST.** 08910000
      ***************************************************************** 08930000
      *                                                                 08940000
T25584     EXEC SQL                                                             
T25584         INCLUDE CPD00035                                                 
T25584     END-EXEC.                                                            
T25584*                                                                         
      *                                                                 08800000
      ***************************************************************** 08880000
      *    6240-GET-FCA00-COMMON-DATE.                               ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00040 CONTAINS THE LOGIC FOR FINDING          ** 08910000
      *    THE COMMON DATE.                                          ** 08920000
      ***************************************************************** 08930000
      *                                                                 08940000
       COPY CPD00040.                                                   08850000
      ***************************************************************** 08880000
      *    6251-GET-FJC01-DATE                                       ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00037 CONTAINS THE LOGIC FOR FINDING THE      ** 08910000
      *    OVERRIDE DATE.                                            ** 08920000
      ***************************************************************** 08930000
      *                                                                 08940000
       COPY CPD00037.                                                   08860000
T25584*                                                                         
      ***************************************************************** 08880000
      *    6253-GET-FJC01-CHKP-LIMIT                                 ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00035 READS THE PARM FILE FOR CHECKPOINT      ** 08910000
      *    LIMITS.                                                   ** 08920000
      ***************************************************************** 08930000
      *                                                                 08940000
T25584      EXEC SQL                                                            
T25584          INCLUDE CPD00034                                                
T25584      END-EXEC.                                                           
      *                                                                 08980000
      ***************************************************************** 08880000
      *    6500-GET-NEXT-BUSINESS-DAY                                ** 08890000
      *                                                              ** 08900000
      *    COPYBOOK CPD00315 CONTAINS THE LOGIC FOR FINDING          ** 08910000
      *    THE NEXT BUSINESS DAY.                                    ** 08920000
      ***************************************************************** 08930000
      *                                                                 08940000
           EXEC SQL                                                     08950000
               INCLUDE CPD00315                                         08960000
           END-EXEC.                                                    08970000
T25584*                                                                         
       7000-OPEN-EFT-CSR.                                               
                                                                        
           MOVE '7000'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                OPEN EFT_CSR                                            
           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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ERROR WHEN OPENING EFT_CSR '                  
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
                                                                        
       7000-EXIT.                                                       
           EXIT.                                                        
T25584*                                                                         
T25584****************************************************************          
T25584*          7001-SELECT-RESTART                                 *          
T25584****************************************************************          
T25584 7001-SELECT-RESTART.                                             
T25584*                                                                         
T25584     MOVE '7000'                 TO WS-ACTIVE-PARAGRAPH.          
T25584*                                                                         
T25584     EXEC SQL                                                     
T25584         SELECT RESTART_DATA                                      
T25584           INTO :RF-RESTART-DATA                                  
T25584           FROM CSS_RESTART WITH(READUNCOMMITTED)                         
T25584          WHERE NAME_PROGRAM = :RF-NAME-PROGRAM AND               
T25584                PARTITION_NO = :RF-PARTITION-NO AND               
T25584                DUP_CNTRL_NO = :RF-DUP-CNTRL-NO                   
C35308                                                           
T25584     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT RESTART_DATA                                              
MFA-TR*          INTO :RF-RESTART-DATA                                          
MFA-TR*          FROM CSS_RESTART                                               
MFA-TR*         WHERE NAME_PROGRAM = :RF-NAME-PROGRAM AND                       
MFA-TR*               PARTITION_NO = :RF-PARTITION-NO AND                       
MFA-TR*               DUP_CNTRL_NO = :RF-DUP-CNTRL-NO                           
MFA-TR*         WITH UR                                                         
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

T25584                                                                  
T25584     MOVE SQLCODE                TO WS-ACTIVE-RETURN-CODE.        
T25584                                                                  
T25584     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
T25584        CONTINUE                                                  
T25584     ELSE                                                         
T25584        DISPLAY '**   ERROR ON 7001-SELECT-RESTART   **'          
T25584        DISPLAY '**   RETURN CODE = ' WS-ACTIVE-RETURN-CODE       
T25584        DISPLAY '**       PROCESSING TERMINATED      **'          
T25584        PERFORM 9900-ABEND                THRU 9900-EXIT          
T25584     END-IF.                                                      
T25584                                                                  
T25584 7001-EXIT.                                                       
T25584     EXIT.                                                        
                                                                        
                                                                        
       7100-FETCH-EFT-CSR.                                              
                                                                        
           MOVE '7100'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                FETCH EFT_CSR INTO                                      
                      :PB-DRAFT-AMT,                                    
                      :PB-ACCOUNT-NO,                                   
                      :PB-DRAFT-DATE,                                   
                      :PB-TRANSACTION-CD,                               
T23549                :PB-CODE-SOURCE-ID,                               
T29529                :PB-PYMT-POSTED-FL,                               
T29529                :PB-PYMT-TRANS-TS,                                
T29529                :PB-CUST-BANK-SEQ-NO,                             
P00613                :PB-USER-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 OR NOT-FOUND      
T23549        MOVE WS-CURR-ACCT-STAT    TO WS-PREV-ACCT-STAT            
T23549        IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                
T28580           EVALUATE PB-CODE-SOURCE-ID                             
T28580             WHEN 'E'                                             
T28580                 SET EPAY-ACCOUNT        TO TRUE                  
T28580             WHEN 'S'                                             
T28580                 SET BANK-DRAFT-ACCT     TO TRUE                  
T28580             WHEN 'I'                                             
C25964                 SET E-DRAFT-ACCT     TO TRUE                     
T28580             WHEN OTHER                                           
T23549                 SET NOT-EPAY-ACCOUNT TO TRUE                     
T28580           END-EVALUATE                                           
T23549        END-IF                                                    
           ELSE                                                         
              MOVE SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  DRAFT-DATE <= ' WS-CURRENT-DATE               
T15615                '                     *'                          
T15615        DISPLAY '*  TRANSACTION-CD = ' WS-PRENOTE                 
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       7100-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7200-CLOSE-EFT-CSR.                                              
                                                                        
           MOVE '7200'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                CLOSE EFT_CSR                                           
           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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ERROR WHEN CLOSING EFT_CSR '                  
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       7200-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7300-OPEN-EPP-BALANCE.                                           
                                                                        
           MOVE '7300'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                OPEN EPP_CSR                                            
           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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ERROR WHEN OPENING EPP_CSR '                  
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT                         
           END-IF.                                                      
                                                                        
       7300-EXIT-OPEN.                                                  
           EXIT.                                                        
                                                                        
       7300-FETCH-EPP-BALANCE.                                          
                                                                        
           MOVE '7300'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                FETCH EPP_CSR INTO                                      
                      :BU-AMT-MO-PYT-BAL-FWD                            
           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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ACCOUNT NO : ' BU-ACCOUNT-NO                  
T15615                '                           *'                    
T15615        DISPLAY '*  PYMT_PRIORITY_LVL = ' BU-PYMT-PRIORITY-LVL    
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT                         
           END-IF.                                                      
                                                                        
       7300-EXIT-FETCH.                                                 
           EXIT.                                                        
                                                                        
       7300-CLOSE-EPP-BALANCE.                                          
                                                                        
           MOVE '7300'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                CLOSE EPP_CSR                                           
           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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ERROR WHEN CLOSING THE EPP_CSR CURSOR'        
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT                         
           END-IF.                                                      
                                                                        
       7300-EXIT-CLOSE.                                                 
           EXIT.                                                        
                                                                        
       7400-SELECT-BANK-EFT.                                            
                                                                        
           MOVE '7400'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                SELECT  BANK_ACCT_NO,                                   
                        BANK_ID,                                        
                        BANK_ACCOUNT_NAME,                              
                        STATUS_CODE,                                    
                        ESTABLISHED_DATE,                               
                        REQSTED_DRAFT_DAY,                              
                        DRAFT_CYCLE,                                    
C25964                  INIT_TYPE_CD                                    
                  INTO :BE-BANK-ACCT-NO,                                
                       :BE-BANK-ID,                                     
                       :BE-BANK-ACCOUNT-NAME,                           
                       :BE-STATUS-CODE,                                 
                       :BE-ESTABLISHED-DATE :WS-NULL-IND-1,             
                       :BE-REQSTED-DRAFT-DAY,                           
                       :BE-DRAFT-CYCLE,                                 
C25964                 :BE-INIT-TYPE-CD                                 
                  FROM CSS_BANK_EFT WITH(READUNCOMMITTED)                       
                 WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                      
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     10750000
MFA-TR*         SELECT  BANK_ACCT_NO,                                   10760000
MFA-TR*                 BANK_ID,                                        10770000
MFA-TR*                 BANK_ACCOUNT_NAME,                              10780000
MFA-TR*                 STATUS_CODE,                                    10790000
MFA-TR*                 ESTABLISHED_DATE,                               10800000
MFA-TR*                 REQSTED_DRAFT_DAY,                              10810000
MFA-TR*                 DRAFT_CYCLE,                                    10820000
MFA-TR*                 INIT_TYPE_CD                                    10820000
MFA-TR*           INTO :BE-BANK-ACCT-NO,                                10830000
MFA-TR*                :BE-BANK-ID,                                     10840000
MFA-TR*                :BE-BANK-ACCOUNT-NAME,                           10850000
MFA-TR*                :BE-STATUS-CODE,                                 10860000
MFA-TR*                :BE-ESTABLISHED-DATE :WS-NULL-IND-1,             10870000
MFA-TR*                :BE-REQSTED-DRAFT-DAY,                           10880000
MFA-TR*                :BE-DRAFT-CYCLE,                                 10890000
MFA-TR*                :BE-INIT-TYPE-CD                                 10890000
MFA-TR*           FROM CSS_BANK_EFT                                     10900000
MFA-TR*          WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                      10910000
MFA-TR*           WITH UR                                               10910000
MFA-TR*    END-EXEC.                                                    10920000

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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  TABLE NAME: CSS_BANK_EFT'                     
T15615                '                     *'                          
T15615        DISPLAY '*  ACCOUNT NO : ' BE-ACCOUNT-NO                  
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
            IF SQLCODE = SUCCESSFUL-CALL                                
               IF WS-NULL-IND-1 < ZERO                                  
                  MOVE LOW-VALUES TO BE-ESTABLISHED-DATE                
               END-IF                                                   
            END-IF.                                                     
                                                                        
       7400-EXIT.                                                       
           EXIT.                                                        
                                                                        
C29529**************************************************************            
C29529*7410-SELECT-CUST-BANK                                       *    10710000
C29529*        GETS INFORMATION FROM CSS_CUSTOMER_BANK TO USE FOR  *            
C29529*        PROCESSING PAYMENT                                  *            
C29529**************************************************************            
C29529 7410-SELECT-CUST-BANK.                                           
C29529                                                                  
C29529     MOVE '7410'  TO WS-ABEND-PARAGRAPH.                          
C29529                                                                  
C29529     EXEC SQL                                                     
C29529          SELECT  BANK_ACCOUNT_NAME,                              
C29529                  BANK_ACCT_NO,                                   
C29529                  BANK_ACCT_STAT_CD,                              
C29529                  BANK_ID                                         
C29529            INTO :JF-BANK-ACCOUNT-NAME,                           
C29529                 :JF-BANK-ACCT-NO,                                
C29529                 :JF-BANK-ACCT-STAT-CD,                           
C29529                 :JF-BANK-ID                                      
C29529            FROM CSS_CUSTOMER_BANK WITH(READUNCOMMITTED)                  
C29529           WHERE CUSTOMER_NO      = :JF-CUSTOMER-NO               
C29529             AND CUST_BANK_SEQ_NO = :JF-CUST-BANK-SEQ-NO          
C35308                                                           
C29529     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     10750000
MFA-TR*         SELECT  BANK_ACCOUNT_NAME,                              10760000
MFA-TR*                 BANK_ACCT_NO,                                   10770000
MFA-TR*                 BANK_ACCT_STAT_CD,                              10780000
MFA-TR*                 BANK_ID                                         10790000
MFA-TR*           INTO :JF-BANK-ACCOUNT-NAME,                           10830000
MFA-TR*                :JF-BANK-ACCT-NO,                                10840000
MFA-TR*                :JF-BANK-ACCT-STAT-CD,                           10850000
MFA-TR*                :JF-BANK-ID                                      10860000
MFA-TR*           FROM CSS_CUSTOMER_BANK                                10900000
MFA-TR*          WHERE CUSTOMER_NO      = :JF-CUSTOMER-NO               10910000
MFA-TR*            AND CUST_BANK_SEQ_NO = :JF-CUST-BANK-SEQ-NO          10910000
MFA-TR*           WITH UR                                               10910000
MFA-TR*    END-EXEC.                                                    10920000

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

C29529                                                                  
C29529     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
C29529     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
C29529        NEXT SENTENCE                                             
C29529     ELSE                                                         
C29529        MOVE SQLCODE TO WS-SQLCODE                                
C29529        DISPLAY '*============================================*'  
C29529        DISPLAY '*==========      PCSCA190       =============*'  
C29529        DISPLAY '*============================================*'  
C29529        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
C29529        DISPLAY '*============================================*'  
C29529        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
C29529                '                           *'                    
C29529        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
C29529                '                     *'                          
C29529        DISPLAY '*  TABLE NAME: CSS_CUSTOMER_BANK'                
C29529                '                *'                               
C35308        DISPLAY '*  ACCOUNT NO: ' BE-ACCOUNT-NO                   
C35308                '                     *'                          
C29529        DISPLAY '*  CUSTOMER NO: ' JF-CUSTOMER-NO                 
C29529                '                     *'                          
C29529        DISPLAY '*  CUST BANK SEQ NO:' JF-CUST-BANK-SEQ-NO        
C29529                '                     *'                          
C29529        DISPLAY '*============================================*'  
C29529        PERFORM 9900-ABEND THRU 9900-EXIT                         
C29529     END-IF.                                                      
C29529                                                                  
C29529 7410-EXIT.                                                       
C29529     EXIT.                                                        
                                                                        
       7450-SELECT-ACCOUNT.                                             
                                                                        
           MOVE '7450'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                SELECT PREMISE_NO,                                      
                       ADDRESS_ID,                                      
                       COMPANY_NO,                                      
                       CUSTOMER_NO,                                     
                       BILL_CYCLE,                                      
                       CODE_ACCT_STAT,                                  
                       EPP_OFFER_AMOUNT,                                
                       TOTAL_AR_BALANCE                                 
                  INTO :AT-PREMISE-NO,                                  
                       :AT-ADDRESS-ID,                                  
                       :AT-COMPANY-NO,                                  
                       :AT-CUSTOMER-NO,                                 
                       :AT-BILL-CYCLE,                                  
                       :AT-CODE-ACCT-STAT,                              
                       :AT-EPP-OFFER-AMOUNT,                            
                       :AT-TOTAL-AR-BALANCE                             
                  FROM CSS_ACCOUNT WITH(READUNCOMMITTED)                        
                 WHERE ACCOUNT_NO = :PB-ACCOUNT-NO                      
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     11230000
MFA-TR*         SELECT PREMISE_NO,                                      11240000
MFA-TR*                ADDRESS_ID,                                      11250000
MFA-TR*                COMPANY_NO,                                      11260000
MFA-TR*                CUSTOMER_NO,                                             
MFA-TR*                BILL_CYCLE,                                      11270000
MFA-TR*                CODE_ACCT_STAT,                                  11280000
MFA-TR*                EPP_OFFER_AMOUNT,                                11290000
MFA-TR*                TOTAL_AR_BALANCE                                 11300000
MFA-TR*           INTO :AT-PREMISE-NO,                                  11310000
MFA-TR*                :AT-ADDRESS-ID,                                  11320000
MFA-TR*                :AT-COMPANY-NO,                                  11330000
MFA-TR*                :AT-CUSTOMER-NO,                                         
MFA-TR*                :AT-BILL-CYCLE,                                  11340000
MFA-TR*                :AT-CODE-ACCT-STAT,                              11350000
MFA-TR*                :AT-EPP-OFFER-AMOUNT,                            11360000
MFA-TR*                :AT-TOTAL-AR-BALANCE                             11370000
MFA-TR*           FROM CSS_ACCOUNT                                      11380000
MFA-TR*          WHERE ACCOUNT_NO = :PB-ACCOUNT-NO                      11390000
MFA-TR*           WITH UR                                               11390000
MFA-TR*    END-EXEC.                                                    11400000

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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
              DISPLAY '*  ACCOUNT NO : ' PB-ACCOUNT-NO                  
                      '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       7450-EXIT.                                                       
           EXIT.                                                        
       7500-SELECT-BANK-DETAIL.                                         
                                                                        
           MOVE '7560'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                SELECT  ROUTING_NUMBER,                                 
                        BANK_NAME,                                      
                        BANK_CITY,                                      
                        BANK_STATE                                      
                  INTO :D1-ROUTING-NUMBER,                              
                       :D1-BANK-NAME,                                   
                       :D1-BANK-CITY,                                   
                       :D1-BANK-STATE                                   
                  FROM CSS_BANK WITH(READUNCOMMITTED)                           
                 WHERE BANK_ID = :D1-BANK-ID                            
C35308                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     11640000
MFA-TR*         SELECT  ROUTING_NUMBER,                                 11650000
MFA-TR*                 BANK_NAME,                                      11660000
MFA-TR*                 BANK_CITY,                                      11670000
MFA-TR*                 BANK_STATE                                      11680000
MFA-TR*           INTO :D1-ROUTING-NUMBER,                              11690000
MFA-TR*                :D1-BANK-NAME,                                   11700000
MFA-TR*                :D1-BANK-CITY,                                   11710000
MFA-TR*                :D1-BANK-STATE                                   11720000
MFA-TR*           FROM CSS_BANK                                         11730000
MFA-TR*          WHERE BANK_ID = :D1-BANK-ID                            11740000
MFA-TR*           WITH UR                                               11740000
MFA-TR*    END-EXEC.                                                    11750000

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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
              DISPLAY '*  TABLE NAME : CSS_BANK '                       
                      '                           *'                    
              DISPLAY '*  BANK ID =  ' D1-BANK-ID                       
                      '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       7500-EXIT.                                                       
           EXIT.                                                        
      *                                                                 08800000
      ***************************************************************** 08880000
      *    7600-START-FCSJC01                                        ** 08890000
      *    7610-READ-FCSJC01                                         ** 08890000
      *    7611-CLOSE                                                ** 08890000
      *                                                              ** 08900000
      ***************************************************************** 08930000
      *                                                                 08760000
           EXEC SQL                                                     11960000
               INCLUDE CPD00038                                         11970000
           END-EXEC.                                                    11980000
      *                                                                 08800000
      ***************************************************************** 08880000
      *    7620-START-FCSCA00                                        ** 08890000
      *    7621-READ-FCSCA00                                         ** 08890000
      *    7622-CLOSE-CA00-CSR                                       ** 08890000
      *                                                              ** 08900000
      ***************************************************************** 08930000
      *                                                                 08760000
           EXEC SQL                                                     12000000
               INCLUDE CPD00039                                         12010000
           END-EXEC.                                                    12020000
      *                                                                 11990000
AGLPWC*************************************************************             
AGLPWC*                                                           *             
AGLPWC*7650-SELECT-COMPANY-DRAFT-INFO                             *             
AGLPWC*                                                           *             
AGLPWC*************************************************************             
AGLPWC  7650-SELECT-COMPANY-DRAFT-INFO.                                 
AGLPWC                                                                  
AGLPWC      MOVE SPACES                       TO C8-DESCRIPTION-TEXT.   
AGLPWC                                                                  
AGLPWC      EXEC SQL                                                    
AGLPWC          SELECT  DELINQ_VALUE,                                   
AGLPWC                  DESCRIPTION                                     
AGLPWC            INTO  :C8-DELINQ-VALUE,                               
AGLPWC                  :C8-DESCRIPTION                                 
AGLPWC            FROM  CSS_DELINQUENCY WITH(READUNCOMMITTED)                   
AGLPWC           WHERE  DELINQ_CD  = :C8-DELINQ-CD                      
T23549             AND  COMPANY_NO = :C8-COMPANY-NO                     
C35308                                                          
AGLPWC      END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*     EXEC SQL                                                            
MFA-TR*         SELECT  DELINQ_VALUE,                                           
MFA-TR*                 DESCRIPTION                                             
MFA-TR*           INTO  :C8-DELINQ-VALUE,                                       
MFA-TR*                 :C8-DESCRIPTION                                         
MFA-TR*           FROM  CSS_DELINQUENCY                                         
MFA-TR*          WHERE  DELINQ_CD  = :C8-DELINQ-CD                              
MFA-TR*            AND  COMPANY_NO = :C8-COMPANY-NO                             
MFA-TR*           WITH  UR                                                      
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

AGLPWC                                                                  
AGLPWC      MOVE SQLCODE                      TO WS-ACTIVE-RETURN-CODE. 
AGLPWC                                                                  
AGLPWC      IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL              
AGLPWC         NEXT SENTENCE                                            
AGLPWC      ELSE                                                        
AGLPWC       DISPLAY '7650 ' WS-ACTIVE-RETURN-CODE                      
AGLPWC       DISPLAY '*************************************'            
AGLPWC       DISPLAY '**  PROCESSING ERROR'                             
AGLPWC       DISPLAY '**  PARAGRAPH = 7650- '                           
AGLPWC       DISPLAY '**  SELECT DELINQ VALUE'                          
AGLPWC       DISPLAY '**  RC                  = ' WS-ACTIVE-RETURN-CODE 
AGLPWC       DISPLAY '**  DELINQUENCY CODE    = ' C8-DELINQ-CD          
AGLPWC       DISPLAY '**  PROCESSING TERMINATED'                        
AGLPWC       DISPLAY '*************************************'            
AGLPWC       PERFORM 9900-ABEND THRU 9900-EXIT                          
AGLPWC      END-IF.                                                     
AGLPWC                                                                  
AGLPWC                                                                  
AGLPWC  7650-EXIT.                                                      
AGLPWC      EXIT.                                                       
                                                                        
A00996*7675-SELECT-TOLERANCE-DRFT-AMT                             *             
A00996*                                                           *             
A00996*************************************************************             
A00996  7675-SELECT-TOLERANCE-DRFT-AMT.                                 
A00996                                                                  
A00996                                                                  
A00996      EXEC SQL                                                    
A00996          SELECT  DELINQ_VALUE                                    
A00996            INTO  :C8-DELINQ-VALUE                                
A00996            FROM  CSS_DELINQUENCY WITH(READUNCOMMITTED)                   
A00996           WHERE  DELINQ_CD  = :C8-DELINQ-CD                      
A00996             AND  COMPANY_NO = '01'                               
A00996                                                          
A00996      END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*     EXEC SQL                                                            
MFA-TR*         SELECT  DELINQ_VALUE                                            
MFA-TR*           INTO  :C8-DELINQ-VALUE                                        
MFA-TR*           FROM  CSS_DELINQUENCY                                         
MFA-TR*          WHERE  DELINQ_CD  = :C8-DELINQ-CD                              
MFA-TR*            AND  COMPANY_NO = '01'                                       
MFA-TR*           WITH  UR                                                      
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

A00996                                                                  
A00996      MOVE SQLCODE                      TO WS-ACTIVE-RETURN-CODE. 
A00996                                                                  
A00996      IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL              
A00996       MOVE C8-DELINQ-VALUE TO WS-TOLERANCE-AMT                   
A00996      ELSE                                                        
A00996       DISPLAY '7675 ' WS-ACTIVE-RETURN-CODE                      
A00996       DISPLAY '*************************************'            
A00996       DISPLAY '**  PROCESSING ERROR'                             
A00996       DISPLAY '**  PARAGRAPH = 7675- '                           
A00996       DISPLAY '**  SELECT DELINQ VALUE'                          
A00996       DISPLAY '**  RC                  = ' WS-ACTIVE-RETURN-CODE 
A00996       DISPLAY '**  DELINQUENCY CODE    = ' C8-DELINQ-CD          
A00996       DISPLAY '**  PROCESSING TERMINATED'                        
A00996       DISPLAY '*************************************'            
A00996       PERFORM 9900-ABEND THRU 9900-EXIT                          
A00996      END-IF.                                                     
A00996  7675-EXIT.                                                      
A00996      EXIT.                                                       
                                                                        
T22767                                                                  
T22767*                                                                         
T22767*************************************************************             
T22767*                                                           *             
T22767*7700-SELECT-USER-ID                                        *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7700-SELECT-USER-ID.                                             
T22767                                                                  
T22767     MOVE '7700'  TO WS-ABEND-PARAGRAPH.                          
T22767                                                                  
T22767     EXEC SQL                                                     
T22767          SELECT USER_ID,                                         
T22767                 BATCH_DEP_CASH_OFF,                              
T22767                 DEP_DEFT_BANK_ID,                                
T22767                 LOCAL_OFFICE                                     
T22767            INTO :Y2-USER-ID,                                     
T22767                 :Y2-BATCH-DEP-CASH-OFF,                          
T22767                 :Y2-DEP-DEFT-BANK-ID,                            
T22767                 :Y2-LOCAL-OFFICE                                 
T22767            FROM CSS_CASHIER_OFFICE WITH(READUNCOMMITTED)                 
T22767           WHERE CASH_COMPANY_NO   = :Y2-CASH-COMPANY-NO          
T22767             AND CASH_LOCAL_OFFICE = :Y2-CASH-LOCAL-OFFICE        
C35308                                                           
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT USER_ID,                                                 
MFA-TR*                BATCH_DEP_CASH_OFF,                                      
MFA-TR*                DEP_DEFT_BANK_ID,                                        
MFA-TR*                LOCAL_OFFICE                                             
MFA-TR*           INTO :Y2-USER-ID,                                             
MFA-TR*                :Y2-BATCH-DEP-CASH-OFF,                                  
MFA-TR*                :Y2-DEP-DEFT-BANK-ID,                                    
MFA-TR*                :Y2-LOCAL-OFFICE                                         
MFA-TR*           FROM CSS_CASHIER_OFFICE                                       
MFA-TR*          WHERE CASH_COMPANY_NO   = :Y2-CASH-COMPANY-NO                  
MFA-TR*            AND CASH_LOCAL_OFFICE = :Y2-CASH-LOCAL-OFFICE                
MFA-TR*           WITH UR                                                       
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

T22767                                                                  
T22767     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_CASHIER_OFFICE '             
T22767                '        *'                                       
T22767        DISPLAY '*  CASH LOCAL OFFICE =  ' Y2-CASH-LOCAL-OFFICE   
T22767                '                 *'                              
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767      END-IF.                                                     
T22767 7700-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767*************************************************************             
T22767*                                                           *             
T22767*7710-SELECT-CASHIER-CODE                                   *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7710-SELECT-CASHIER-CODE.                                        
T22767                                                                  
T22767     MOVE '7710'  TO WS-ABEND-PARAGRAPH.                          
T22767                                                                  
T22767     EXEC SQL                                                     
T22767          SELECT CASHIER_CODE                                     
T22767            INTO :Y1-CASHIER-CODE                                 
T22767            FROM CSS_CASHIER WITH(READUNCOMMITTED)                        
T22767           WHERE USER_ID         = :Y1-USER-ID                    
T22767             AND CASH_COMPANY_NO = :Y1-CASH-COMPANY-NO            
C35308                                                           
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT CASHIER_CODE                                             
MFA-TR*           INTO :Y1-CASHIER-CODE                                         
MFA-TR*           FROM CSS_CASHIER                                              
MFA-TR*          WHERE USER_ID         = :Y1-USER-ID                            
MFA-TR*            AND CASH_COMPANY_NO = :Y1-CASH-COMPANY-NO                    
MFA-TR*           WITH UR                                                       
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

T22767                                                                  
T22767     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_CASHIER '                    
T22767                '                *'                               
T22767        DISPLAY '*  USER ID      =  ' Y1-USER-ID                  
T22767                '                   *'                            
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 7710-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767*************************************************************             
T22767*                                                           *             
T22767*7720-SELECT-BANK-ST-CD                                     *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7720-SELECT-BANK-ST-CD.                                          
T22767                                                                  
T22767     MOVE '7720'                   TO WS-ABEND-PARAGRAPH.         
T22767     MOVE WS-CASHIER-BANK-ID       TO D1-BANK-ID.                 
T22767     EXEC SQL                                                     
T22767          SELECT FCS_DEP_BANK_ST_CD                               
T22767            INTO :D1-FCS-DEP-BANK-ST-CD                           
T22767            FROM CSS_BANK WITH(READUNCOMMITTED)                           
T22767           WHERE BANK_ID = :D1-BANK-ID                            
C35308                                                           
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT FCS_DEP_BANK_ST_CD                                       
MFA-TR*           INTO :D1-FCS-DEP-BANK-ST-CD                                   
MFA-TR*           FROM CSS_BANK                                                 
MFA-TR*          WHERE BANK_ID = :D1-BANK-ID                                    
MFA-TR*           WITH UR                                                       
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

T22767                                                                  
T22767     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
T22767                                                                  
T22767     IF  WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                  
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_BANK'                        
T22767                '                   *'                            
T22767        DISPLAY '*  USER ID      =  ' D1-BANK-ID                  
T22767                '                   *'                            
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 7720-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767*************************************************************             
T22767*                                                           *             
T22767*7730-SELECT-GL-ACCT-NO                                     *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7730-SELECT-GL-ACCT-NO.                                          
T22767                                                                  
T22767     MOVE '7730'  TO WS-ABEND-PARAGRAPH.                          
T22767                                                                  
T22767     EXEC SQL                                                     
T22767          SELECT GL_ACCT_NO                                       
T22767            INTO :GO-GL-ACCT-NO                                   
T22767            FROM CSS_GL_ACCT_NO WITH(READUNCOMMITTED)                     
T22767           WHERE COMPANY_NO   = :GO-COMPANY-NO                    
T22767             AND GL_ACCT_NAME = :GO-GL-ACCT-NAME                  
C35308                                                           
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
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 COMPANY_NO   = :GO-COMPANY-NO                            
MFA-TR*            AND GL_ACCT_NAME = :GO-GL-ACCT-NAME                          
MFA-TR*           WITH UR                                                       
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

T22767                                                                  
T22767     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_GL_ACCT_NO '                 
T22767                '          *'                                     
T22767        DISPLAY '*  GL ACCT NAME       =  ' GO-GL-ACCT-NAME       
T22767                '           *'                                    
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 7730-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767*************************************************************             
T22767*                                                           *             
T22767*7740-GET-CURRENT-TIMESTAMP                                 *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7740-GET-CURRENT-TIMESTAMP.                                      
T22767                                                                  
T22767     MOVE '7740'  TO WS-ABEND-PARAGRAPH.                          
C35308                                                                  
C35308     EXEC SQL                                                     
C35308          SELECT
              REPLACE(REPLACE(CONVERT(CHAR(26), CIS.CURRENT$TIMESTAMP()
           , 121), ' ', '-'), ':', '.'),
              REPLACE(CONVERT(CHAR(8), CIS.CURRENT$TIME(), 108), ':', 
           '.')
            INTO
              :WS-XFR-TS,
              :WS-TRAN-TIME                        
C35308     END-EXEC.                                                    

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

T22767                                                                  
T22767     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : SET COMMANDS '                   
T22767                '             *'                                  
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 7740-EXIT.                                                       
T22767      EXIT.                                                       
T22767                                                                  
T22767*************************************************************             
T22767*                                                           *             
T22767*7750-GET-MAX-CNTL-DRWR                                     *             
T22767*                                                           *             
T22767*************************************************************             
T22767 7750-GET-MAX-CNTL-DRWR.                                          
T22767                                                                  
T22767     MOVE '7750'  TO WS-ABEND-PARAGRAPH.                          
T22767                                                                  
T22767     EXEC SQL                                                     
T22767          SELECT MAX(CASH_DRAWER_ID)                              
T22767            INTO :CS-CASH-DRAWER-ID :WS-NULL-IND-1                
T22767            FROM CSS_CSH_DRWR_CNTL WITH(READUNCOMMITTED)                  
T22767           WHERE CASH_COMPANY_NO    = :CS-CASH-COMPANY-NO         
T22767             AND CASH_LOCAL_OFFICE  = :CS-CASH-LOCAL-OFFICE       
T22767             AND CODE_CSH_DRWR_STAT = :CS-CODE-CSH-DRWR-STAT      
T22767             AND DATE_CASH_REPORT   = IIF(TRY_CONVERT(DATE, 
                                                   :CS-DATE-CASH-REPORT
              ) IS NULL OR (PATINDEX('%.%', :CS-DATE-CASH-REPORT
              ) <> 0) OR (LEN(:CS-DATE-CASH-REPORT
              ) <> 10), CIS.CHAR2DATE(:CS-DATE-CASH-REPORT
              ), CONVERT(DATE, :CS-DATE-CASH-REPORT) )        
C35308                                                           
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT MAX(CASH_DRAWER_ID)                                      
MFA-TR*           INTO :CS-CASH-DRAWER-ID :WS-NULL-IND-1                        
MFA-TR*           FROM CSS_CSH_DRWR_CNTL                                        
MFA-TR*          WHERE CASH_COMPANY_NO    = :CS-CASH-COMPANY-NO                 
MFA-TR*            AND CASH_LOCAL_OFFICE  = :CS-CASH-LOCAL-OFFICE               
MFA-TR*            AND CODE_CSH_DRWR_STAT = :CS-CODE-CSH-DRWR-STAT              
MFA-TR*            AND DATE_CASH_REPORT   = :CS-DATE-CASH-REPORT                
MFA-TR*           WITH UR                                                       
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

T22767                                                                  
T22767     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                   
T22767              MOVE WS-ZERO          TO CS-CASH-DRAWER-ID          
T22767           ELSE                                                   
T22767              MOVE SQLCODE          TO WS-SQLCODE                 
T22767              DISPLAY '*=======================================*' 
T22767              DISPLAY '*=======      PCSCA190       ===========*' 
T22767              DISPLAY '*=======================================*' 
T22767              DISPLAY '*========== BAD SQL RETURN CODE  =======*' 
T22767              DISPLAY '*=======================================*' 
T22767              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH         
T22767                      '                           *'              
T22767              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                 
T22767                      '                    *'                     
T22767              DISPLAY '*  TABLE NAME : CSS_CSH_DRWR_CNTL '        
T22767                      '          *'                               
T22767              DISPLAY '*CASH LOCAL OFFICE = ' CS-CASH-LOCAL-OFFICE
T22767              DISPLAY '*CODE DRWR STAT   = ' CS-CODE-CSH-DRWR-STAT
T22767                      '                     *'                    
T22767              DISPLAY '*=======================================*' 
T22767              PERFORM 9900-ABEND THRU 9900-EXIT                   
T22767           END-IF                                                 
T22767     END-IF.                                                      
T22767                                                                  
T22767                                                                  
T22767 7750-EXIT.                                                       
T22767      EXIT.                                                       
C25487                                                                  
C25487******************************************************************        
C25487* 7800-GET-TODAYS-DATE                                           *        
C25487*                                                                *        
C25487*                                                                *        
C25487******************************************************************        
C25487 7800-GET-TODAYS-DATE.                                            
C25487                                                                  
C25487     MOVE '7800'           TO ACTIVE-PARAGRAPH.                   
C25487                                                                  
C25487     EXEC SQL                                                     
C25487         SELECT
              CAST(SYSDATETIMEOFFSET() AS DATE)
            INTO
              :WS-TODAYS-DATE                       
C25487     END-EXEC.                                                    

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

                                                                        
C25487     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
C25487     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
C25487        NEXT SENTENCE                                             
C25487     ELSE                                                         
C25487        MOVE SQLCODE TO WS-SQLCODE                                
C25487        DISPLAY '*============================================*'  
C25487        DISPLAY '*==========      PCSCA190       =============*'  
C25487        DISPLAY '*============================================*'  
C25487        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
C25487        DISPLAY '*============================================*'  
C25487        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
C25487        DISPLAY '                           *'                    
C25487        DISPLAY '*  SQLCODE: ' WS-SQLCODE                         
C25487        DISPLAY '                   *'                            
C25487        DISPLAY '*  ERROR GETTING TODAYS DATE '                   
C25487        DISPLAY '                   *'                            
C25487        DISPLAY '*============================================*'  
C25487        PERFORM 9900-ABEND THRU 9900-EXIT                         
C25487     END-IF.                                                      
C25487                                                                  
C25487 7800-EXIT.                                                       
C25487     EXIT.                                                        
                                                                        
C29529******************************************************************        
C29529* 7900-GET-DATE-CSH-RPT                                          *        
C29529*      RETRIEVING DATE-CASH-REPORT SO CAN DETERMINE IF           *        
C29529*      PROCESSING SHOULD CONTINUE                                *        
C29529******************************************************************        
C29529 7900-GET-DATE-CSH-RPT.                                           
                                                                        
C29529     MOVE '7900'           TO ACTIVE-PARAGRAPH.                   
                                                                        
C29529     MOVE SPACES           TO JT-DATE-CASH-REPORT.                
C29529     MOVE PB-ACCOUNT-NO    TO JT-ACCOUNT-NO.                      
C29529     MOVE PB-PYMT-TRANS-TS TO JT-PYMT-RCVD-TS.                    
                                                                        
C29529     EXEC SQL                                                     
C29529         SELECT DATE_CASH_REPORT                                  
C29529           INTO :JT-DATE-CASH-REPORT                              
C29529           FROM CSS_PAYMENT_TRANS WITH(READUNCOMMITTED)                   
C29529          WHERE DATE_CASH_REPORT  <= IIF(TRY_CONVERT(DATE, 
                                                       :WS-CURRENT-DATE
              ) IS NULL OR (PATINDEX('%.%', :WS-CURRENT-DATE
              ) <> 0) OR (LEN(:WS-CURRENT-DATE) <> 10), CIS.CHAR2DATE(
                                                       :WS-CURRENT-DATE
              ), CONVERT(DATE, :WS-CURRENT-DATE) )             
C29529            AND CASH_LOCAL_OFFICE IN ('022','025')                
C29529            AND PYMT_RCVD_TS       = CIS.CHAR2TIMESTAMP(
                                                       :JT-PYMT-RCVD-TS
              )             
C29529            AND ACCOUNT_NO         = :JT-ACCOUNT-NO               
C35308                                                           
C29529     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT DATE_CASH_REPORT                                          
MFA-TR*          INTO :JT-DATE-CASH-REPORT                                      
MFA-TR*          FROM CSS_PAYMENT_TRANS                                         
MFA-TR*         WHERE DATE_CASH_REPORT  <= :WS-CURRENT-DATE                     
MFA-TR*           AND CASH_LOCAL_OFFICE IN ('022','025')                        
MFA-TR*           AND PYMT_RCVD_TS       = :JT-PYMT-RCVD-TS                     
MFA-TR*           AND ACCOUNT_NO         = :JT-ACCOUNT-NO                       
MFA-TR*          WITH UR                                                        
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

                                                                        
C29529     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
C29529     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
C29529        OR NOT-FOUND OR -811                                      
C29529        IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                  
C29529           MOVE SPACES TO JT-DATE-CASH-REPORT                     
C29529        END-IF                                                    
C29529     ELSE                                                         
C29529        MOVE SQLCODE TO WS-SQLCODE                                
C29529        DISPLAY '*============================================*'  
C29529        DISPLAY '*                PCSCA190                    *'  
C29529        DISPLAY '*--------------------------------------------*'  
C29529        DISPLAY '*    ERROR GETTING CSS_PAYMENT_TRANS INFO    *'  
C29529        DISPLAY '*--------------------------------------------*'  
C29529        DISPLAY '*       PARAGRAPH: ' WS-ABEND-PARAGRAPH          
C29529        DISPLAY '*         SQLCODE: ' WS-SQLCODE                  
C29529        DISPLAY '*      ACCOUNT-NO: ' JT-ACCOUNT-NO               
C29529        DISPLAY '*    CURRENT-DATE: ' WS-CURRENT-DATE             
C29529        DISPLAY '*    PYMT-RCVD-TS: ' JT-PYMT-RCVD-TS             
C29529        DISPLAY '*============================================*'  
C29529        PERFORM 9900-ABEND THRU 9900-EXIT                         
C29529     END-IF.                                                      
                                                                        
C29529 7900-EXIT.                                                       
C29529     EXIT.                                                        
                                                                        
       8000-WRITE-FCSAC03.                                              
           WRITE FIOAC03.                                               
                                                                        
           ADD 1 TO WS-NACHA-REC-WRITTEN                                
T25584              WS-RESTART-FCSAC03-REC-CNTR.                        
                                                                        
       8000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       8100-DELETE-EFT.                                                 
                                                                        
           MOVE '8100'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           EXEC SQL                                                     
                DELETE FROM CSS_PNDNG_BNK_DRFT                          
                WHERE  ACCOUNT_NO     = :PB-ACCOUNT-NO                  
                AND    DRAFT_DATE     = IIF(TRY_CONVERT(DATE, 
                                                         :PB-DRAFT-DATE
              ) IS NULL OR (PATINDEX('%.%', :PB-DRAFT-DATE
              ) <> 0) OR (LEN(:PB-DRAFT-DATE) <> 10), CIS.CHAR2DATE(
                                                         :PB-DRAFT-DATE
              ), CONVERT(DATE, :PB-DRAFT-DATE) )                  
                AND    DRAFT_AMT      = :PB-DRAFT-AMT                   
                AND    TRANSACTION_CD = :PB-TRANSACTION-CD              
C29529          AND    PYMT_TRANS_TS  = CIS.CHAR2TIMESTAMP(
                                                      :PB-PYMT-TRANS-TS
              )               
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     12160000
MFA-TR*         DELETE FROM CSS_PNDNG_BNK_DRFT                          12170000
MFA-TR*         WHERE  ACCOUNT_NO     = :PB-ACCOUNT-NO                  12180000
MFA-TR*         AND    DRAFT_DATE     = :PB-DRAFT-DATE                  12190000
MFA-TR*         AND    DRAFT_AMT      = :PB-DRAFT-AMT                   12200000
MFA-TR*         AND    TRANSACTION_CD = :PB-TRANSACTION-CD              12210000
MFA-TR*         AND    PYMT_TRANS_TS  = :PB-PYMT-TRANS-TS               12210000
MFA-TR*    END-EXEC.                                                    12220000

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 SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
T15615        DISPLAY '*  ACCOUNT NO : ' PB-ACCOUNT-NO                  
T15615                '                           *'                    
T15615        DISPLAY '*  DRAFT DATE : ' PB-DRAFT-DATE                  
T15615                '                     *'                          
T15615        DISPLAY '*  AMOUNT     : ' PB-DRAFT-AMT                   
T15615                '                           *'                    
T15615        DISPLAY '*  TRANSACTION: ' PB-TRANSACTION-CD              
T15615                '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       8100-EXIT.                                                       
           EXIT.                                                        
                                                                        
       8200-UPDATE-BANK-EFT.                                            
           MOVE '8200'  TO WS-ABEND-PARAGRAPH.                          
                                                                        
           IF PB-TRANSACTION-CD = WS-PRENOTE                            
              MOVE WS-CURRENT-DATE   TO BE-PRENOTE-DATE                 
                                                                        
              EXEC SQL                                                  
                UPDATE CSS_BANK_EFT                                     
                SET PRENOTE_DATE   = IIF(TRY_CONVERT(DATE, 
                                                       :BE-PRENOTE-DATE
              ) IS NULL OR (PATINDEX('%.%', :BE-PRENOTE-DATE
              ) <> 0) OR (LEN(:BE-PRENOTE-DATE) <> 10), CIS.CHAR2DATE(
                                                       :BE-PRENOTE-DATE
              ), CONVERT(DATE, :BE-PRENOTE-DATE) )                   
                WHERE ACCOUNT_NO   = :BE-ACCOUNT-NO                     
              END-EXEC

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                  12490000
MFA-TR*         UPDATE CSS_BANK_EFT                                     12500000
MFA-TR*         SET PRENOTE_DATE   = :BE-PRENOTE-DATE                   12510000
MFA-TR*         WHERE ACCOUNT_NO   = :BE-ACCOUNT-NO                     12520000
MFA-TR*       END-EXEC                                                  12530000
MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                                  
                                                                        
           ELSE                                                         
              MOVE WS-CURRENT-DATE TO BE-LAST-DRAFT-DATE                
                                                                        
T23549        IF EPAY-ACCOUNT                                           
T23549                                                                  
T23549           EXEC SQL                                               
T23549             UPDATE CSS_BANK_EFT                                  
T23549             SET LAST_DRAFT_DATE = IIF(TRY_CONVERT(DATE, 
                                                    :BE-LAST-DRAFT-DATE
              ) IS NULL OR (PATINDEX('%.%', :BE-LAST-DRAFT-DATE
              ) <> 0) OR (LEN(:BE-LAST-DRAFT-DATE
              ) <> 10), CIS.CHAR2DATE(:BE-LAST-DRAFT-DATE
              ), CONVERT(DATE, :BE-LAST-DRAFT-DATE) )            
T23549             WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                    
T23549           END-EXEC

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*          EXEC SQL                                               12640000
MFA-TR*            UPDATE CSS_BANK_EFT                                  12650000
MFA-TR*            SET LAST_DRAFT_DATE = :BE-LAST-DRAFT-DATE            12660000
MFA-TR*            WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                    12680000
MFA-TR*          END-EXEC                                               12690000
MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                               
T23549                                                                  
T23549        ELSE                                                      
                 IF AT-CODE-ACCT-STAT = 'B' THEN                        
                    PERFORM 3600-FIND-DRAFT-CYCLE THRU 3600-EXIT        
                    MOVE BN-BILL-CYCLE TO BE-LAST-DRAFT-CYCLE           
                 ELSE                                                   
                    MOVE BE-DRAFT-CYCLE TO BE-LAST-DRAFT-CYCLE          
                 END-IF                                                 
T23549                                                                  
                 EXEC SQL                                               
                   UPDATE CSS_BANK_EFT                                  
                   SET LAST_DRAFT_DATE = IIF(TRY_CONVERT(DATE, 
                                                    :BE-LAST-DRAFT-DATE
              ) IS NULL OR (PATINDEX('%.%', :BE-LAST-DRAFT-DATE
              ) <> 0) OR (LEN(:BE-LAST-DRAFT-DATE
              ) <> 10), CIS.CHAR2DATE(:BE-LAST-DRAFT-DATE
              ), CONVERT(DATE, :BE-LAST-DRAFT-DATE) ),           
                       LAST_DRAFT_CYCLE  = :BE-LAST-DRAFT-CYCLE         
                   WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                    
                 END-EXEC

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*          EXEC SQL                                               12640000
MFA-TR*            UPDATE CSS_BANK_EFT                                  12650000
MFA-TR*            SET LAST_DRAFT_DATE = :BE-LAST-DRAFT-DATE,           12660000
MFA-TR*                LAST_DRAFT_CYCLE  = :BE-LAST-DRAFT-CYCLE         12670000
MFA-TR*            WHERE ACCOUNT_NO = :BE-ACCOUNT-NO                    12680000
MFA-TR*          END-EXEC                                               12690000
MSQ017     CALL "MFASQLCA"
MSQ017       USING SQLCA, BY VALUE MFA-PROGRAM-ID, "0", "0", "0",
MSQ017       BY REFERENCE MFSQLMESSAGETEXT
MSQ017     END-CALL

                                               
T23549                                                                  
T23549        END-IF                                                    
                                                                        
           END-IF.                                                      
                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T25584        ADD 1                  TO WS-RESTART-COMMIT-COUNTER       
T25584        IF WS-RESTART-COMMIT-COUNTER = WS-CHKP-LUW-LIMIT OR       
T25584          WS-RESTART-COMMIT-COUNTER = WS-CHKP-UPD-LIMIT           
T25584           PERFORM 8888-COMMIT                                    
T25584              THRU 8888-EXIT                                      
T25584           MOVE ZEROES        TO WS-RESTART-COMMIT-COUNTER        
T25584         END-IF                                                   
           ELSE                                                         
              MOVE SQLCODE TO WS-SQLCODE                                
              DISPLAY '*============================================*'  
              DISPLAY '*==========      PCSCA190       =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*========== BAD SQL RETURN CODE =============*'  
              DISPLAY '*============================================*'  
              DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
                      '                           *'                    
              DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
                      '                     *'                          
              DISPLAY '*  ACCOUNT..: ' BE-ACCOUNT-NO                    
                      '                     *'                          
              DISPLAY '*============================================*'  
              PERFORM 9900-ABEND THRU 9900-EXIT
           END-IF.                        
       8200-EXIT.                                                       
           EXIT.                                                        
C35308*                                                                 07440000
C35308****************************************************************  07450000
C35308**                                                            **  07460000
C35308**   8300-PRINT-RPT1-HEADERS                                  **  07470000
C35308**       PRINTS THE HEADERS FOR THE REPORT                    **  07480000
C35308**                                                            **  07490000
C35308****************************************************************  07500000
C35308*                                                                 07510000
C35308 8300-PRINT-RPT1-HEADERS.                                         
C35308*                                                                 07530000
C35308     IF WS-FIRST-TIME = 'Y'                                       
C35308     OR WS-LINE-COUNT > 50                                        
C35308        MOVE WS-RPT-TITLE-1 TO PRT33-DATA                         
C35308        WRITE PRT33-RECORD AFTER ADVANCING PAGE                   
C35308        MOVE WS-RPT-TITLE-2 TO PRT33-DATA                         
C35308        WRITE PRT33-RECORD AFTER ADVANCING 1 LINE                 
C35308        MOVE WS-PAGE-COUNT TO P-RPT-PAGE-NO                       
C35308        MOVE WS-RPT-TITLE-3 TO PRT33-DATA                         
C35308        WRITE PRT33-RECORD AFTER ADVANCING 1 LINE                 
C35308        MOVE WS-PRINT-REP-HDR-13 TO PRT33-DATA                    
C35308        WRITE PRT33-RECORD AFTER ADVANCING 1 LINE                 
C35308        MOVE WS-PRINT-REP-HDR-11 TO PRT33-DATA                    
C35308        WRITE PRT33-RECORD AFTER ADVANCING 1 LINE                 
C35308        MOVE WS-PRINT-REP-HDR-12 TO PRT33-DATA                    
C35308        WRITE PRT33-RECORD AFTER ADVANCING 1 LINE                 
C35308        MOVE WS-PRINT-REP-HDR-13 TO PRT33-DATA                    
C35308        WRITE PRT33-RECORD AFTER ADVANCING 2 LINES                
C35308        ADD 1 TO WS-PAGE-COUNT                                    
C35308        MOVE 'N' TO WS-FIRST-TIME                                 
C35308        MOVE ZEROES TO WS-LINE-COUNT                              
C35308     END-IF.                                                      
C35308*                                                                 08050000
C35308 8300-EXIT.                                                       
C35308     EXIT.                                                        
T22767                                                                  
T22767*                                                                         
T22767******************************************************************        
T22767**  8400-CREATE-CASH-DRWR-CNTL                                  **        
T22767**                                                              **        
T22767******************************************************************        
T22767 8400-CREATE-CASH-DRWR-CNTL.                                      
T22767     MOVE '8400'                   TO WS-ACTIVE-PARAGRAPH.        
T22767*                                                                         
T22767     EXEC SQL                                                     
T22767      INSERT INTO CSS_CSH_DRWR_CNTL                               
T22767               (  CASH_COMPANY_NO,                                
T22767                  CASH_LOCAL_OFFICE,                              
T22767                  CASH_REPORT_NO,                                 
T22767                  DATE_CASH_REPORT,                               
T22767                  CASH_DRAWER_ID,                                 
T22767                  AMT_CASH_DEBIT,                                 
T22767                  AMT_CASH_CREDIT,                                
T22767                  AMT_AR_DEBIT,                                   
T22767                  AMT_AR_CREDIT,                                  
T22767                  AMT_CK_ISS_DEBIT,                               
T22767                  AMT_CK_ISS_CREDIT,                              
T22767                  AMT_GL_DEBIT,                                   
T22767                  AMT_GL_CREDIT,                                  
T22767                  AMT_CASH_BEGIN_BAL,                             
T22767                  AMT_BASIC_WORK,                                 
T22767                  USER_ID,                                        
T22767                  CASHIER_CODE,                                   
T22767                  CODE_PYMT_FACILITY,                             
T22767                  CODE_FCS_EXTRACTED,                             
T22767                  CODE_CSH_DRWR_STAT,                             
T22767                  DATE_LAST_ACTIVITY,                             
T22767                  BALANCED_BY,                                    
T22767                  BALANCED_TS,                                    
T22767                  NO_ITEMS_ENTERED )                              
T22767       VALUES (                                                   
T22767                  :CS-CASH-COMPANY-NO,                            
T22767                  :CS-CASH-LOCAL-OFFICE,                          
T22767                  :CS-CASH-REPORT-NO,                             
T22767                  IIF(TRY_CONVERT(DATE, :CS-DATE-CASH-REPORT
              ) IS NULL OR (PATINDEX('%.%', :CS-DATE-CASH-REPORT
              ) <> 0) OR (LEN(:CS-DATE-CASH-REPORT
              ) <> 10), CIS.CHAR2DATE(:CS-DATE-CASH-REPORT
              ), CONVERT(DATE, :CS-DATE-CASH-REPORT) ),                        
T22767                  :CS-CASH-DRAWER-ID,                             
T22767                  :CS-AMT-CASH-DEBIT,                             
T22767                  :CS-AMT-CASH-CREDIT,                            
T22767                  :CS-AMT-AR-DEBIT,                               
T22767                  :CS-AMT-AR-CREDIT,                              
T22767                  :CS-AMT-CK-ISS-DEBIT,                           
T22767                  :CS-AMT-CK-ISS-CREDIT,                          
T22767                  :CS-AMT-GL-DEBIT,                               
T22767                  :CS-AMT-GL-CREDIT,                              
T22767                  :CS-AMT-CASH-BEGIN-BAL,                         
T22767                  :CS-AMT-BASIC-WORK,                             
T22767                  :CS-USER-ID,                                    
T22767                  :CS-CASHIER-CODE,                               
T22767                  :CS-CODE-PYMT-FACILITY,                         
T22767                  :CS-CODE-FCS-EXTRACTED,                         
T22767                  :CS-CODE-CSH-DRWR-STAT,                         
T22767                  IIF(TRY_CONVERT(DATE, :CS-DATE-LAST-ACTIVITY
              ) IS NULL OR (PATINDEX('%.%', :CS-DATE-LAST-ACTIVITY
              ) <> 0) OR (LEN(:CS-DATE-LAST-ACTIVITY
              ) <> 10), CIS.CHAR2DATE(:CS-DATE-LAST-ACTIVITY
              ), CONVERT(DATE, :CS-DATE-LAST-ACTIVITY) ),                      
T22767                  :CS-BALANCED-BY,                                
T22767                  CIS.CHAR2TIMESTAMP(:CS-BALANCED-TS),                    
T22767                  :CS-NO-ITEMS-ENTERED )                          
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*     INSERT INTO CSS_CSH_DRWR_CNTL                                       
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*                 AMT_CASH_DEBIT,                                         
MFA-TR*                 AMT_CASH_CREDIT,                                        
MFA-TR*                 AMT_AR_DEBIT,                                           
MFA-TR*                 AMT_AR_CREDIT,                                          
MFA-TR*                 AMT_CK_ISS_DEBIT,                                       
MFA-TR*                 AMT_CK_ISS_CREDIT,                                      
MFA-TR*                 AMT_GL_DEBIT,                                           
MFA-TR*                 AMT_GL_CREDIT,                                          
MFA-TR*                 AMT_CASH_BEGIN_BAL,                                     
MFA-TR*                 AMT_BASIC_WORK,                                         
MFA-TR*                 USER_ID,                                                
MFA-TR*                 CASHIER_CODE,                                           
MFA-TR*                 CODE_PYMT_FACILITY,                                     
MFA-TR*                 CODE_FCS_EXTRACTED,                                     
MFA-TR*                 CODE_CSH_DRWR_STAT,                                     
MFA-TR*                 DATE_LAST_ACTIVITY,                                     
MFA-TR*                 BALANCED_BY,                                            
MFA-TR*                 BALANCED_TS,                                            
MFA-TR*                 NO_ITEMS_ENTERED )                                      
MFA-TR*      VALUES (                                                           
MFA-TR*                 :CS-CASH-COMPANY-NO,                                    
MFA-TR*                 :CS-CASH-LOCAL-OFFICE,                                  
MFA-TR*                 :CS-CASH-REPORT-NO,                                     
MFA-TR*                 :CS-DATE-CASH-REPORT,                                   
MFA-TR*                 :CS-CASH-DRAWER-ID,                                     
MFA-TR*                 :CS-AMT-CASH-DEBIT,                                     
MFA-TR*                 :CS-AMT-CASH-CREDIT,                                    
MFA-TR*                 :CS-AMT-AR-DEBIT,                                       
MFA-TR*                 :CS-AMT-AR-CREDIT,                                      
MFA-TR*                 :CS-AMT-CK-ISS-DEBIT,                                   
MFA-TR*                 :CS-AMT-CK-ISS-CREDIT,                                  
MFA-TR*                 :CS-AMT-GL-DEBIT,                                       
MFA-TR*                 :CS-AMT-GL-CREDIT,                                      
MFA-TR*                 :CS-AMT-CASH-BEGIN-BAL,                                 
MFA-TR*                 :CS-AMT-BASIC-WORK,                                     
MFA-TR*                 :CS-USER-ID,                                            
MFA-TR*                 :CS-CASHIER-CODE,                                       
MFA-TR*                 :CS-CODE-PYMT-FACILITY,                                 
MFA-TR*                 :CS-CODE-FCS-EXTRACTED,                                 
MFA-TR*                 :CS-CODE-CSH-DRWR-STAT,                                 
MFA-TR*                 :CS-DATE-LAST-ACTIVITY,                                 
MFA-TR*                 :CS-BALANCED-BY,                                        
MFA-TR*                 :CS-BALANCED-TS,                                        
MFA-TR*                 :CS-NO-ITEMS-ENTERED )                                  
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

T22767*                                                                         
T22767     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
T22767*                                                                         
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T22767         NEXT SENTENCE                                            
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_CSH_DRWR_CNTL '              
T22767                '          *'                                     
T22767        DISPLAY '*  CASH LOCAL OFFICE  =  ' CS-CASH-LOCAL-OFFICE  
T22767        DISPLAY '*  DATE CASH REPORT   =  ' CS-DATE-CASH-REPORT   
T22767        DISPLAY '*  CASH DRAWER ID     =  ' CS-CASH-DRAWER-ID     
T22767        DISPLAY '*  AMT CASH DEBIT     =  ' CS-AMT-CASH-DEBIT     
T22767        DISPLAY '*  CODE CSH DRWR STAT =  ' CS-CODE-CSH-DRWR-STAT 
T22767                '                   *'                            
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 8400-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767*                                                                         
T22767******************************************************************        
T22767**  8500-CREATE-CASH-DRWR-JRNL                                  **        
T22767**                                                              **        
T22767******************************************************************        
T22767 8500-CREATE-CASH-DRWR-JRNL.                                      
T22767     MOVE '8500'                   TO WS-ACTIVE-PARAGRAPH.        
T22767*                                                                         
T22767     EXEC SQL                                                     
T22767      INSERT INTO CSS_CSH_DRWR_JRNL                               
T22767               (  CASH_COMPANY_NO,                                
T22767                  CASH_LOCAL_OFFICE,                              
T22767                  CASH_REPORT_NO,                                 
T22767                  DATE_CASH_REPORT,                               
T22767                  CASH_DRAWER_ID,                                 
T22767                  DATE_TRAN,                                      
T22767                  ENTRY_NO,                                       
T22767                  TRAN_APPL_NO,                                   
T22767                  LOCAL_OFFICE,                                   
T22767                  COMPANY_NO,                                     
T22767                  JRNL_SORT_ID,                                   
T22767                  ACCOUNT_NO,                                     
T22767                  CUSTOMER_NO,                                    
T22767                  GL_ACCT_NO,                                     
T22767                  METER_NO,                                       
T22767                  TRAN_TIME,                                      
T22767                  TRAN_ID,                                        
T22767                  DATE_LAST_ACTION,                               
T22767                  CODE_ENTRY_SOURCE,                              
T22767                  USER_ID,                                        
T22767                  BATCH_SEND_LOC,                                 
T22767                  ENTRY_LOC,                                      
T22767                  CODE_TRAN_ERRORS,                               
T22767                  CODE_JRNL_EXTRACT,                              
T22767                  DATE_BALANCED,                                  
T22767                  TIME_BALANCED,                                  
T22767                  BALANCED_BY,                                    
T22767                  CODE_STATUS,                                    
T22767                  CURRENCY_TYPE,                                  
T22767                  CODE_PYMT_FACILITY,                             
T22767                  TRAN_DATA,                                      
T22767                  CSR_PC_ID,                                      
T22767                  TRAN_COMMENT )                                  
T22767        VALUES (                                                  
T22767                  :CJ-CASH-COMPANY-NO,                            
T22767                  :CJ-CASH-LOCAL-OFFICE,                          
T22767                  :CJ-CASH-REPORT-NO,                             
T22767                  IIF(TRY_CONVERT(DATE, :CJ-DATE-CASH-REPORT
              ) IS NULL OR (PATINDEX('%.%', :CJ-DATE-CASH-REPORT
              ) <> 0) OR (LEN(:CJ-DATE-CASH-REPORT
              ) <> 10), CIS.CHAR2DATE(:CJ-DATE-CASH-REPORT
              ), CONVERT(DATE, :CJ-DATE-CASH-REPORT) ),                        
T22767                  :CJ-CASH-DRAWER-ID,                             
T22767                  IIF(TRY_CONVERT(DATE, :CJ-DATE-TRAN
              ) IS NULL OR (PATINDEX('%.%', :CJ-DATE-TRAN
              ) <> 0) OR (LEN(:CJ-DATE-TRAN) <> 10), CIS.CHAR2DATE(
                                                          :CJ-DATE-TRAN
              ), CONVERT(DATE, :CJ-DATE-TRAN) ),                               
T22767                  :CJ-ENTRY-NO,                                   
T22767                  :CJ-TRAN-APPL-NO,                               
T22767                  :CJ-LOCAL-OFFICE,                               
T22767                  :CJ-COMPANY-NO,                                 
T22767                  :CJ-JRNL-SORT-ID,                               
T22767                  :CJ-ACCOUNT-NO,                                 
T22767                  :CJ-CUSTOMER-NO,                                
T22767                  :CJ-GL-ACCT-NO,                                 
T22767                  :CJ-METER-NO,                                   
T22767                  CIS.CHAR2TIME(:CJ-TRAN-TIME),                           
T22767                  :CJ-TRAN-ID,                                    
T22767                  IIF(TRY_CONVERT(DATE, :CJ-DATE-LAST-ACTION
              ) IS NULL OR (PATINDEX('%.%', :CJ-DATE-LAST-ACTION
              ) <> 0) OR (LEN(:CJ-DATE-LAST-ACTION
              ) <> 10), CIS.CHAR2DATE(:CJ-DATE-LAST-ACTION
              ), CONVERT(DATE, :CJ-DATE-LAST-ACTION) ),                        
T22767                  :CJ-CODE-ENTRY-SOURCE,                          
T22767                  :CJ-USER-ID,                                    
T22767                  :CJ-BATCH-SEND-LOC,                             
T22767                  :CJ-ENTRY-LOC,                                  
T22767                  :CJ-CODE-TRAN-ERRORS ,                          
T22767                  :CJ-CODE-JRNL-EXTRACT,                          
T22767                  IIF(TRY_CONVERT(DATE, :CJ-DATE-BALANCED
              ) IS NULL OR (PATINDEX('%.%', :CJ-DATE-BALANCED
              ) <> 0) OR (LEN(:CJ-DATE-BALANCED) <> 10), CIS.CHAR2DATE(
                                                      :CJ-DATE-BALANCED
              ), CONVERT(DATE, :CJ-DATE-BALANCED) ),                           
T22767                  CIS.CHAR2TIME(:CJ-TIME-BALANCED),                       
T22767                  :CJ-BALANCED-BY,                                
T22767                  :CJ-CODE-STATUS,                                
T22767                  :CJ-CURRENCY-TYPE,                              
T22767                  :CJ-CODE-PYMT-FACILITY,                         
T22767                  :CJ-TRAN-DATA,                                  
T22767                  :CJ-CSR-PC-ID,                                  
T22767                  :CJ-TRAN-COMMENT )                              
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*     INSERT INTO CSS_CSH_DRWR_JRNL                                       
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*                 DATE_TRAN,                                              
MFA-TR*                 ENTRY_NO,                                               
MFA-TR*                 TRAN_APPL_NO,                                           
MFA-TR*                 LOCAL_OFFICE,                                           
MFA-TR*                 COMPANY_NO,                                             
MFA-TR*                 JRNL_SORT_ID,                                           
MFA-TR*                 ACCOUNT_NO,                                             
MFA-TR*                 CUSTOMER_NO,                                            
MFA-TR*                 GL_ACCT_NO,                                             
MFA-TR*                 METER_NO,                                               
MFA-TR*                 TRAN_TIME,                                              
MFA-TR*                 TRAN_ID,                                                
MFA-TR*                 DATE_LAST_ACTION,                                       
MFA-TR*                 CODE_ENTRY_SOURCE,                                      
MFA-TR*                 USER_ID,                                                
MFA-TR*                 BATCH_SEND_LOC,                                         
MFA-TR*                 ENTRY_LOC,                                              
MFA-TR*                 CODE_TRAN_ERRORS,                                       
MFA-TR*                 CODE_JRNL_EXTRACT,                                      
MFA-TR*                 DATE_BALANCED,                                          
MFA-TR*                 TIME_BALANCED,                                          
MFA-TR*                 BALANCED_BY,                                            
MFA-TR*                 CODE_STATUS,                                            
MFA-TR*                 CURRENCY_TYPE,                                          
MFA-TR*                 CODE_PYMT_FACILITY,                                     
MFA-TR*                 TRAN_DATA,                                              
MFA-TR*                 CSR_PC_ID,                                              
MFA-TR*                 TRAN_COMMENT )                                          
MFA-TR*       VALUES (                                                          
MFA-TR*                 :CJ-CASH-COMPANY-NO,                                    
MFA-TR*                 :CJ-CASH-LOCAL-OFFICE,                                  
MFA-TR*                 :CJ-CASH-REPORT-NO,                                     
MFA-TR*                 :CJ-DATE-CASH-REPORT,                                   
MFA-TR*                 :CJ-CASH-DRAWER-ID,                                     
MFA-TR*                 :CJ-DATE-TRAN,                                          
MFA-TR*                 :CJ-ENTRY-NO,                                           
MFA-TR*                 :CJ-TRAN-APPL-NO,                                       
MFA-TR*                 :CJ-LOCAL-OFFICE,                                       
MFA-TR*                 :CJ-COMPANY-NO,                                         
MFA-TR*                 :CJ-JRNL-SORT-ID,                                       
MFA-TR*                 :CJ-ACCOUNT-NO,                                         
MFA-TR*                 :CJ-CUSTOMER-NO,                                        
MFA-TR*                 :CJ-GL-ACCT-NO,                                         
MFA-TR*                 :CJ-METER-NO,                                           
MFA-TR*                 :CJ-TRAN-TIME,                                          
MFA-TR*                 :CJ-TRAN-ID,                                            
MFA-TR*                 :CJ-DATE-LAST-ACTION,                                   
MFA-TR*                 :CJ-CODE-ENTRY-SOURCE,                                  
MFA-TR*                 :CJ-USER-ID,                                            
MFA-TR*                 :CJ-BATCH-SEND-LOC,                                     
MFA-TR*                 :CJ-ENTRY-LOC,                                          
MFA-TR*                 :CJ-CODE-TRAN-ERRORS ,                                  
MFA-TR*                 :CJ-CODE-JRNL-EXTRACT,                                  
MFA-TR*                 :CJ-DATE-BALANCED,                                      
MFA-TR*                 :CJ-TIME-BALANCED,                                      
MFA-TR*                 :CJ-BALANCED-BY,                                        
MFA-TR*                 :CJ-CODE-STATUS,                                        
MFA-TR*                 :CJ-CURRENCY-TYPE,                                      
MFA-TR*                 :CJ-CODE-PYMT-FACILITY,                                 
MFA-TR*                 :CJ-TRAN-DATA,                                          
MFA-TR*                 :CJ-CSR-PC-ID,                                          
MFA-TR*                 :CJ-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

T22767*                                                                         
T22767     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
T22767*                                                                         
T22767     IF  WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                  
T22767           NEXT SENTENCE                                          
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                    *'                           
T22767        DISPLAY '*  TABLE NAME : CSS_CSH_DRWR_JRNL '              
T22767                '          *'                                     
T22767        DISPLAY '*  CASH LOCAL OFFICE  =  ' CJ-CASH-LOCAL-OFFICE  
T22767        DISPLAY '*  DATE CASH REPORT   =  ' CJ-DATE-CASH-REPORT   
T22767        DISPLAY '*  CASH DRAWER ID     =  ' CJ-CASH-DRAWER-ID     
T22767                '               *'                                
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 8500-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
T22767******************************************************************        
T22767**  8550-CREATE-BANK-TRANSFER                                   **        
T22767**                                                              **        
T22767******************************************************************        
T22767 8550-CREATE-BANK-TRANSFER.                                       
T22767     MOVE '8550'                   TO WS-ACTIVE-PARAGRAPH.        
T22767*                                                                         
T22767     EXEC SQL                                                     
T22767      INSERT INTO CSS_BANK_TRANSFER                               
T22767               (  CASH_COMPANY_NO,                                
T22767                  CASH_LOCAL_OFFICE,                              
T22767                  DATE_CASH_REPORT,                               
T22767                  CASH_DRAWER_ID,                                 
T22767                  TRANSFER_TS,                                    
T22767                  CURRENCY_TYPE,                                  
T22767                  USER_ID,                                        
T22767                  BANK_ID,                                        
T22767                  TRANSFER_AMT,                                   
T22767                  CODE_DR_CR )                                    
T22767          VALUES (                                                
T22767                  :YB-CASH-COMPANY-NO,                            
T22767                  :YB-CASH-LOCAL-OFFICE,                          
T22767                  IIF(TRY_CONVERT(DATE, :YB-DATE-CASH-REPORT
              ) IS NULL OR (PATINDEX('%.%', :YB-DATE-CASH-REPORT
              ) <> 0) OR (LEN(:YB-DATE-CASH-REPORT
              ) <> 10), CIS.CHAR2DATE(:YB-DATE-CASH-REPORT
              ), CONVERT(DATE, :YB-DATE-CASH-REPORT) ),                        
T22767                  :YB-CASH-DRAWER-ID,                             
T22767                  CIS.CHAR2TIMESTAMP(:YB-TRANSFER-TS),                    
T22767                  :YB-CURRENCY-TYPE,                              
T22767                  :YB-USER-ID,                                    
T22767                  :YB-BANK-ID,                                    
T22767                  :YB-TRANSFER-AMT,                               
T22767                  :YB-CODE-DR-CR )                                
T22767     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*     INSERT INTO CSS_BANK_TRANSFER                                       
MFA-TR*              (  CASH_COMPANY_NO,                                        
MFA-TR*                 CASH_LOCAL_OFFICE,                                      
MFA-TR*                 DATE_CASH_REPORT,                                       
MFA-TR*                 CASH_DRAWER_ID,                                         
MFA-TR*                 TRANSFER_TS,                                            
MFA-TR*                 CURRENCY_TYPE,                                          
MFA-TR*                 USER_ID,                                                
MFA-TR*                 BANK_ID,                                                
MFA-TR*                 TRANSFER_AMT,                                           
MFA-TR*                 CODE_DR_CR )                                            
MFA-TR*         VALUES (                                                        
MFA-TR*                 :YB-CASH-COMPANY-NO,                                    
MFA-TR*                 :YB-CASH-LOCAL-OFFICE,                                  
MFA-TR*                 :YB-DATE-CASH-REPORT,                                   
MFA-TR*                 :YB-CASH-DRAWER-ID,                                     
MFA-TR*                 :YB-TRANSFER-TS,                                        
MFA-TR*                 :YB-CURRENCY-TYPE,                                      
MFA-TR*                 :YB-USER-ID,                                            
MFA-TR*                 :YB-BANK-ID,                                            
MFA-TR*                 :YB-TRANSFER-AMT,                                       
MFA-TR*                 :YB-CODE-DR-CR )                                        
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

T22767*                                                                         
T22767     MOVE SQLCODE                  TO WS-ACTIVE-RETURN-CODE.      
T22767*                                                                         
T22767     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T22767        NEXT SENTENCE                                             
T22767     ELSE                                                         
T22767        MOVE SQLCODE TO WS-SQLCODE                                
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*==========      PCSCA190       =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*========== BAD SQL RETURN CODE =============*'  
T22767        DISPLAY '*============================================*'  
T22767        DISPLAY '*  PARAGRAPH: ' WS-ABEND-PARAGRAPH               
T22767                '                           *'                    
T22767        DISPLAY '*  SQLCODE..: ' WS-SQLCODE                       
T22767                '                     *'                          
T22767        DISPLAY '*  TABLE NAME : CSS_BANK_TRANSFER '              
T22767                '          *'                                     
T22767        DISPLAY '*  CASH LOCAL OFFICE  =  ' YB-CASH-LOCAL-OFFICE  
T22767        DISPLAY '*  DATE CASH REPORT   =  ' YB-DATE-CASH-REPORT   
T22767        DISPLAY '*  CASH DRAWER ID     =  ' YB-CASH-DRAWER-ID     
T22767        DISPLAY '*  TRANSFER AMOUNT    =  ' YB-TRANSFER-AMT       
T22767        DISPLAY '*============================================*'  
T22767        PERFORM 9900-ABEND THRU 9900-EXIT                         
T22767     END-IF.                                                      
T22767 8550-EXIT.                                                       
T22767      EXIT.                                                       
T22767*                                                                         
      **************************************************************    13650000
      * 8600-PROCESS-TYPE-8  PARAGRAPH                             *    13660000
      * THIS PARA BUILDS 1 TYPE '8' RECORD FOR THE FILE. TYPE '8'  *    13670000
      * IS THE BATCH TRAILER.                                      *    13680000
      * NO CREDIT (OFFSET) MONEY IS SENT. THE CREDIT AMT WILL BE   *    13690000
      * SET TO 0.                                                  *    13700000
      *                                                            *    13710000
      **************************************************************    13720000
       8600-PROCESS-TYPE-8.                                             
           MOVE SPACES TO CSHCNACH-OUTPUT-RECORD.                       
           MOVE '8'                  TO CSHCNACH-RECORD-TYPE.           
           MOVE '200'                TO CSHCNACH-8-SERVICE-CLASS-CODE.  
           MOVE WS-TYPE-6-WRITTEN    TO CSHCNACH-8-ENTRY-ADDENDA-COUNT. 
           MOVE WS-FILE-HASH-TOTAL   TO CSHCNACH-8-ENTRY-HASH.          
           MOVE WS-FILE-DEBIT-TOTAL  TO CSHCNACH-8-TOTAL-DEBIT.         
T22767     MOVE ZEROS                TO CSHCNACH-8-TOTAL-CREDIT.        
           MOVE WS-TYPE-8-COMPANY-ID TO CSHCNACH-8-COMPANY-ID           
           MOVE SPACES               TO CSHCNACH-8-FILLER1.             
           MOVE SPACES               TO CSHCNACH-8-FILLER2.             
AGLPWC     MOVE WS-DESTINATION-ID-8-CHAR                                
AGLPWC                               TO CSHCNACH-8-ORIGINAT-FIN-INST.   
           MOVE '0000001'            TO CSHCNACH-8-BATCH-NBR.           
           PERFORM 8000-WRITE-FCSAC03 THRU 8000-EXIT.                   
           MOVE SPACES TO FIOAC03.                                      
                                                                        
           ADD 1 TO WS-TYPE-8-WRITTEN.                                  
           DISPLAY                                                      
              'TYPE 8 BATCH CONTROL RECORD WRITTEN DISPLAYED BELOW'.    
           DISPLAY CSHCNACH-OUTPUT-RECORD.                              
                                                                        
       8600-PROCESS-TYPE-8-EXIT.                                        
           EXIT.                                                        
                                                                        
      **************************************************************    13970000
      * 8610-PROCESS-TYPE-9  PARAGRAPH                             *    13980000
      * THIS PARA BUILDS 1 TYPE '9' RECORD FOR THE FILE. TYPE '9'  *    13990000
      * IS THE FILE TRAILER.                                       *    14000000
      *                                                            *    14010000
      * NO CREDIT (OFFSET) MONEY IS SENT. THE CREDIT AMT WILL BE   *    14020000
      * SET TO 0.                                                  *    14030000
      *                                                            *    14040000
      *                                                            *    14050000
      *                                                            *    14060000
      **************************************************************    14070000
       8610-PROCESS-TYPE-9.                                             
           MOVE SPACES TO CSHCNACH-OUTPUT-RECORD.                       
           MOVE '9'                  TO CSHCNACH-RECORD-TYPE.           
           MOVE WS-FILE-HEADER-CNT   TO CSHCNACH-9-BATCH-COUNT.         
           PERFORM 8615-CALCULATE-BLOCK THRU                            
                   8615-CALCULATE-BLOCK-EXIT.                           
           MOVE WS-TYPE-6-WRITTEN    TO CSHCNACH-9-ENTRY-ADDENDA-COUNT. 
           MOVE WS-FILE-HASH-TOTAL   TO CSHCNACH-9-ENTRY-HASH.          
           MOVE WS-FILE-DEBIT-TOTAL  TO CSHCNACH-9-TOTAL-DEBIT.         
           MOVE ZEROS                TO CSHCNACH-9-TOTAL-CREDIT.        
           MOVE SPACES               TO CSHCNACH-9-FILLER1.             
           PERFORM 8000-WRITE-FCSAC03 THRU 8000-EXIT.                   
           MOVE SPACES TO FIOAC03.                                      
                                                                        
           ADD 1 TO WS-TYPE-9-WRITTEN.                                  
           DISPLAY                                                      
              'TYPE 9 FILE CONTROL RECORD WRITTEN DISPLAYED BELOW'.     
           DISPLAY CSHCNACH-OUTPUT-RECORD.                              
                                                                        
       8610-PROCESS-TYPE-9-EXIT.                                        
           EXIT.                                                        
      **************************************************************    14290000
      * 8615-CALCULATE-BLOCK PARAGRAPH                             *    14300000
      * THIS PARA MUST BE PEFORMED BEFORE THE LAST WRITE OF THE    *    14310000
      * NACHA RECORD. THE BLOCK COUNT IS BASED ON NUMBER OF NACHA  *    14320000
      * RECORDS WRITTEN. THE FACT THAT WS-NACH-REC-WRITTEN AND     *    14330000
      * WS-TYPE-9-WRITTEN HAVE NOT BEEN ADDED TO YET MUST BE       *    14340000
      * HANDLED.                                                   *    14350000
      *                                                            *    14360000
      *                                                            *    14370000
      * THE BLOCK COUNT SHOULD USE THIS ALGORHYTHEM:               *    14380000
      * 1 - TAKE THE VALUE IN WS-NACHA-REC-WRITTEN AND MOVE        *    14390000
      *     TO WORK-BLOCK-COUNT.                                   *    14400000
      * 2 - ADD 1 TO WS-WORK-CNT      (BECAUSE P4000-WRITE-NACHA   *    14410000
      *     HAS NOT BEEN PERFORMED YET)                            *    14420000
      * 3 - WHAT THE NACHA FORMAT WANTS IS THE NUMBER OF RECORDS   *    14430000
      *     ROUNDED UP TO THE NEXT HIGHEST MULTIPLE OF 10 AND      *    14440000
      *     THEN DIVIDED BY 10.                                    *    14450000
      *     SO GO THRU ALGO CHECKING TO SEE WHAT YOU NEED TO ADD   *    14460000
      * 4 - THEN TAKE THIS COMPUTED FIELD AND DIVIDE BY 10 FOR THE *    14470000
      *     NUMBER OF BLOCKS.                                      *    14480000
      *                                                            *    14490000
      *                                                            *    14500000
      **************************************************************    14510000
       8615-CALCULATE-BLOCK.                                            
           MOVE ZEROS                TO WS-WORK-CNT.                    
           MOVE WS-NACHA-REC-WRITTEN TO WS-WORK-CNT.                    
           ADD 1                     TO WS-WORK-CNT.                    
           PERFORM 8630-CALCULATE-NEXT-MULTI-10 THRU                    
                   8630-EXIT.                                           
           MOVE WS-BLOCK-CNT         TO CSHCNACH-9-BLOCK-COUNT.         
       8615-CALCULATE-BLOCK-EXIT.                                       
           EXIT.                                                        
                                                                        
      **************************************************************    14620000
      * 8630-CALCULATE-NEX-MULTI-10  PARAGRAPH                     *    14630000
      * THIS PARA LOOKS AT THE LAST DIGIT OF WS-WORK-CNT AND       *    14640000
      * DECIDES HOW MUCH TO ADD TO WS-WORK-CNT THAT WILL GIVE YOU  *    14650000
      * 10.                                                        *    14660000
      *                                                            *    14670000
      *                                                            *    14680000
      **************************************************************    14690000
       8630-CALCULATE-NEXT-MULTI-10.                                    
           DISPLAY 'WS-WORK-CNT BEFORE CHECKING ' WS-WORK-CNT.          
           IF WS-WORK-CNT-DIGIT6TH = 0                                  
              ADD 0 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 1                                  
              ADD 9 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 2                                  
              ADD 8 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 3                                  
              ADD 7 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 4                                  
              ADD 6 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 5                                  
              ADD 5 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 6                                  
              ADD 4 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 7                                  
              ADD 3 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 8                                  
              ADD 2 TO WS-WORK-CNT                                      
              ELSE                                                      
           IF WS-WORK-CNT-DIGIT6TH = 9                                  
              ADD 1 TO WS-WORK-CNT
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF
           END-IF.                                     
           DISPLAY 'WS-WORK-CNT AFTER  CHECKING ' WS-WORK-CNT.          
           DIVIDE WS-WORK-CNT BY 10 GIVING WS-BLOCK-CNT.                
           DISPLAY 'WS-BLOCK-CNT COMPUTED       ' WS-BLOCK-CNT.         
       8630-EXIT.                                                       
           EXIT.                                                        
      ******************************************************************12930000
      *                                                                *12940000
      *     8650-WRITE-BEGIN-CONTROLS.                                 *12950000
      *                                                                *12960000
      ******************************************************************12970000
       8650-WRITE-BEGIN-CONTROLS.                                       
      *                                                                 12990000
           MOVE ZERO            TO WS-FCSCA191-REC-CNTR                 
                                   WS-FCSCA191-CO-CNTR                  
                                   WS-FCSCA192-REC-CNTR                 
                                   WS-FCSCA192-CO-CNTR.                 
           MOVE SPACES          TO E-FCA191-BEGIN-REC.                  
           MOVE WS-DEFAULT-CO-NO TO E-FCA191-BEGIN-CO-NO.               
           MOVE LOW-VALUES      TO E-FCA191-KEY-BREC.                   
           MOVE WS-CURRENT-DATE TO E-FCA191-CREATE-DATE-BREC.           
           MOVE ZERO            TO E-FCA191-DB-PART-BREC.               
           PERFORM 8700-WRITE-FCSCA191 THRU 8700-EXIT.                  
           SUBTRACT 1 FROM WS-FCSCA191-REC-CNTR                         
                           WS-FCSCA191-CO-CNTR.                         
      *                                                                 13130000
           MOVE SPACES          TO E-FCA192-BEGIN-REC.                  
           MOVE LOW-VALUES      TO E-FCA192-KEY-BREC.                   
           MOVE WS-CURRENT-DATE TO E-FCA192-CREATE-DATE-BREC.           
           MOVE ZERO            TO E-FCA192-DB-PART-BREC.               
           PERFORM 8710-WRITE-FCSCA192 THRU 8710-EXIT.                  
           SUBTRACT 1 FROM WS-FCSCA192-REC-CNTR                         
                           WS-FCSCA192-CO-CNTR.                         
       8650-EXIT.                                                       
           EXIT.                                                        
      *                                                                 13310000
      ******************************************************************13320000
      *                                                                *13330000
      *     8660-WRITE-END-CONTROLS.                                   *13340000
      *                                                                *13350000
      ******************************************************************13360000
       8660-WRITE-END-CONTROLS.                                         
           MOVE SPACES         TO E-FCA192-END-REC.                     
           MOVE HIGH-VALUES    TO E-FCA192-KEY-EREC.                    
           MOVE WS-FCSCA192-REC-CNTR                                    
                               TO E-FCA192-RECORD-COUNT-EREC.           
           MOVE SPACES         TO E-FCA192-CREATE-DB-PART-EREC.         
           PERFORM 8710-WRITE-FCSCA192 THRU 8710-EXIT.                  
           SUBTRACT 1 FROM WS-FCSCA192-REC-CNTR.                        
       8660-EXIT.                                                       
           EXIT.                                                        
HPCCDM*EJECT                                                            13630000
                                                                        
                                                                        
       8700-WRITE-FCSCA191.                                             
                                                                        
           WRITE FIOCA191.                                              
                                                                        
           IF  FCA191-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '8700-ERROR ON FCSCA191 WRITE.  STATUS IS '      
                       WS-FCA191-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
                                                                        
           INITIALIZE FIOCA191.                                         
                                                                        
           ADD 1 TO WS-FCSCA191-REC-CNTR                                
                    WS-FCSCA191-CO-CNTR                                 
T25584              WS-RESTART-FCSC191-REC-CNTR.                        
                                                                        
       8700-EXIT.                                                       
           EXIT.                                                        
                                                                        
       8710-WRITE-FCSCA192.                                             
                                                                        
           WRITE FIOCA192.                                              
                                                                        
           IF  FCA192-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '8710-ERROR ON FCSCA192 WRITE.  STATUS IS '      
                       WS-FCA192-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
               PERFORM 9900-ABEND  THRU  9900-EXIT                      
           END-IF.                                                      
                                                                        
           MOVE SPACES                    TO FIOCA192.                  
                                                                        
           ADD 1 TO WS-FCSCA192-REC-CNTR                                
                    WS-FCSCA192-CO-CNTR                                 
T25584              WS-RESTART-FCSC192-REC-CNTR.                        
                                                                        
       8710-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
           EXEC SQL                                                     15770000
               INCLUDE CPD00104                                         15780000
           END-EXEC.                                                    15790000
                                                                        
           EXEC SQL                                                     15810000
               INCLUDE CPD00105                                         15820000
           END-EXEC.                                                    15830000
                                                                        
      ***************************************************************** 15850000
      *  8840-WRITE-END-REC..                                           15860000
      *       WRITES COMPANY END RECORD...                              15870000
      ***************************************************************** 15880000
       8840-WRITE-END-REC.                                              
           IF WRITE-FIOCA191                                            
              INITIALIZE  FIOCA191                                      
              MOVE HIGH-VALUES            TO E-FCA191-CO-KEY-EREC       
              MOVE COMPANY-END-REC        TO E-FCA191-CO-NO-EREC        
TJS000        MOVE END-CO-REC-COUNT       TO E-FCA191-CO-REC-COUNT-EREC 
              PERFORM 8700-WRITE-FCSCA191 THRU 8700-EXIT                
              SUBTRACT 1 FROM WS-FCSCA191-REC-CNTR                      
           ELSE                                                         
              INITIALIZE FIOCA192                                       
              MOVE HIGH-VALUES            TO E-FCA192-CO-KEY-EREC       
              MOVE COMPANY-END-REC        TO E-FCA192-CO-NO-EREC        
              MOVE END-CO-REC-COUNT       TO E-FCA192-CO-REC-COUNT-EREC 
              PERFORM 8710-WRITE-FCSCA192      THRU 8710-EXIT           
              SUBTRACT 1 FROM WS-FCSCA192-REC-CNTR                      
           END-IF.                                                      
160800 8840-EXIT.                                                       
160900     EXIT.                                                        
T25584*                                                                         
T25584****************************************************************          
T25584**   8850-UPDATE-RESTART                                      **          
T25584****************************************************************          
T25584 8850-UPDATE-RESTART.                                             
T25584*                                                                         
T25584     MOVE '8850'                 TO WS-ACTIVE-PARAGRAPH.          
T25584*                                                                         
T25584     EXEC SQL                                                     
T25584         UPDATE CSS_RESTART                                       
T25584         SET RESTART_DATA = :RF-RESTART-DATA                      
T25584         WHERE NAME_PROGRAM = :RF-NAME-PROGRAM AND                
T25584               PARTITION_NO = :RF-PARTITION-NO AND                
T25584               DUP_CNTRL_NO = :RF-DUP-CNTRL-NO                    
T25584     END-EXEC.                                                    

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

T25584*                                                                         
T25584     MOVE SQLCODE                TO WS-ACTIVE-RETURN-CODE.        
T25584     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
T25584         CONTINUE                                                 
T25584     ELSE                                                         
T25584         IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                 
T25584             CONTINUE                                             
T25584         ELSE                                                     
T25584             DISPLAY '**  ERROR ON 8850-UPDATE-RESTART  **'       
T25584             DISPLAY '**  RETURN CODE = ' WS-ACTIVE-RETURN-CODE   
T25584             DISPLAY '**      PROCESSING TERMINATED     **'       
T25584             PERFORM 9900-ABEND            THRU 9900-EXIT         
T25584         END-IF                                                   
T25584     END-IF.                                                      
T25584*                                                                         
T25584 8850-EXIT.                                                       
T25584     EXIT.                                                        
T25584*                                                                         
T25584****************************************************************          
T25584**                                                            **          
T25584**      8860-INSERT-RESTART                                   **          
T25584**                                                            **          
T25584****************************************************************          
T25584 8860-INSERT-RESTART.                                             
T25584*                                                                         
T25584     MOVE '8860'                 TO WS-ACTIVE-PARAGRAPH.          
T25584*                                                                         
T25584     EXEC SQL                                                     
T25584         INSERT INTO CSS_RESTART                                  
T25584             (NAME_PROGRAM, PARTITION_NO, DUP_CNTRL_NO,           
T25584                 RESTART_DATA)                                    
T25584         VALUES (:RF-NAME-PROGRAM, :RF-PARTITION-NO,              
T25584                 :RF-DUP-CNTRL-NO, :RF-RESTART-DATA)              
T25584     END-EXEC.                                                    

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

T25584*                                                                         
T25584     MOVE SQLCODE                TO WS-ACTIVE-RETURN-CODE.        
T25584*                                                                         
T25584     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
T25584         CONTINUE                                                 
T25584     ELSE                                                         
T25584         DISPLAY '**   ERROR ON 8860-INSERT-RESTART   **'         
T25584         DISPLAY '**   RETURN CODE = ' WS-ACTIVE-RETURN-CODE      
T25584         DISPLAY '**       PROCESSING TERMINATED      **'         
T25584         PERFORM 9900-ABEND                THRU 9900-EXIT         
T25584     END-IF.                                                      
T25584*                                                                         
T25584 8860-EXIT.                                                       
T25584     EXIT.                                                        
T25584*                                                                         
T25584 8888-COMMIT.                                                     
T25584*                                                                         
T25584        PERFORM 1700-PREPARE-PRECOMMIT                            
T25584           THRU 1700-EXIT                                         
T25584                                                                  
T25584        PERFORM 8900-WRITE-RESTART                                
T25584           THRU 8900-EXIT                                         
T25584                                                                  
T25584           MOVE WS-SEQ-NO         TO G6-SEQ-NO                    
T25584           MOVE WS-A              TO G6-STATUS                    
T25584           MOVE 'RESTART-REQ=Y'   TO G6-PARM-DATA                 
T25584        PERFORM 8893-RESET-JOB-PARM                               
T25584           THRU 8893-EXIT                                         
T25584                                                                  
T25584            EXEC SQL                                                      
T25584                INCLUDE CPD00047                                          
T25584            END-EXEC                                                      
T25584     DISPLAY 'COMMIT POINT # ' WS-CHKP-SEQ-NO ' TAKEN.'.          
T25584                                                                  
T25584*                                                                         
T25584 8888-EXIT.                                                       
T25584     EXIT.                                                        
      *                                                                         
T25584 8890-DELETE-RESTART-RECORD.                                      
T25584                                                                  
T25584     MOVE WS-PGRMNAME            TO RF-NAME-PROGRAM.              
T25584     MOVE 1                      TO RF-PARTITION-NO.              
T25584     MOVE 1                      TO RF-DUP-CNTRL-NO.              
T25584     EXEC SQL                                                     
T25584       DELETE FROM CSS_RESTART                                    
T25584         WHERE NAME_PROGRAM = :RF-NAME-PROGRAM                    
T25584           AND DUP_CNTRL_NO = :RF-DUP-CNTRL-NO                    
T25584           AND PARTITION_NO = :RF-PARTITION-NO                    
T25584     END-EXEC.                                                    

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

T25584     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
T25584                                                                  
T25584     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T25584        CONTINUE                                                  
T25584     ELSE                                                         
T25584         DISPLAY '**  8890-DELETE-RESTART-RECORD     **'          
T25584         DISPLAY '**   RETURN CODE = ' WS-ACTIVE-RETURN-CODE      
T25584         DISPLAY '**       PROCESSING TERMINATED      **'         
T25584         PERFORM 9900-ABEND                THRU 9900-EXIT         
T25584     END-IF.                                                      
T25584 8890-EXIT.                                                       
T25584     EXIT.                                                        
T25584*                                                                         
T25584*****************************************************************         
T25584*   8893-RESET-JOB-PARM                                        **         
T25584*                                                              **         
T25584*****************************************************************         
T25584 8893-RESET-JOB-PARM.                                             
T25584*                                                                         
T25584           EXEC SQL                                               
T25584             UPDATE CSS_JOB_PARM                                  
T25584                SET STATUS         = :G6-STATUS,                  
T25584                    PARM_DATA      = :G6-PARM-DATA                
T25584              WHERE PROGRAM_NAME   = :G6-PROGRAM-NAME             
T25584                AND CMND_CODE      = :G6-CMND-CODE                
T25584                AND COMPANY_NO     = :G6-COMPANY-NO               
T25584                AND SEQ_NO         = :G6-SEQ-NO                   
T25584           END-EXEC                                               

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

T25584*                                                                         
T25584     MOVE SQLCODE          TO WS-ACTIVE-RETURN-CODE.              
T25584*                                                                         
T25584     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
T25584         CONTINUE                                                 
T25584     ELSE                                                         
T25584         DISPLAY '**   ERROR ON 8893-RESET-RESTART   **'          
T25584         DISPLAY '**   RETURN CODE = ' WS-ACTIVE-RETURN-CODE      
T25584         DISPLAY '**       PROCESSING TERMINATED      **'         
T25584         PERFORM 9900-ABEND                THRU 9900-EXIT         
T25584     END-IF.                                                      
T25584*                                                                         
T25584 8893-EXIT.                                                       
T25584     EXIT.                                                        
161000*                                                                 16100000
T25584****************************************************************          
T25584***                   8900-WRITE-RESTART                     ***          
T25584****************************************************************          
T25584 8900-WRITE-RESTART.                                              
T25584                                                                  
T25584     MOVE WS-PGRMNAME            TO RF-NAME-PROGRAM.              
T25584     MOVE 1                      TO RF-PARTITION-NO.              
T25584     MOVE 1                      TO RF-DUP-CNTRL-NO.              
T25584     MOVE WS-RESTART-DATA        TO RF-RESTART-DATA-TEXT.         
T25584     MOVE LENGTH OF WS-RESTART-DATA TO RF-RESTART-DATA-LEN.       
T25584                                                                  
T25584     PERFORM 8850-UPDATE-RESTART           THRU 8850-EXIT.        
T25584                                                                  
T25584     IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
T25584         PERFORM 8860-INSERT-RESTART       THRU 8860-EXIT         
T25584     END-IF.                                                      
T25584                                                                  
T25584 8900-EXIT.                                                       
T25584      EXIT.                                                       
       9000-TERMINATE.                                                  
      *                                                                 16120000
      *                                                                 16380000
           CLOSE FCSAC03-FILE.                                          
      *                                                                 16140000
           IF  FAC03-SUCCESSFUL                                         
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSAC03 CLOSE.  STATUS IS '       
                       WS-FAC03-STATUS                                  
               DISPLAY '**  PROCESSING TERMINATED  **'                  
           END-IF.                                                      
      *                                                                 16380000
           CLOSE FCSCA192-FILE.                                         
      *                                                                 16400000
           IF  FCA192-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY ' '                                              
               DISPLAY '**  PCSCA190 PROCESSING ERROR  **'              
               DISPLAY '0100-ERROR ON FCSCA192 OPEN.  STATUS IS '       
                       WS-FCA192-STATUS                                 
               DISPLAY '**  PROCESSING TERMINATED  **'                  
           END-IF.                                                      
      *                                                                 16640000
C35308     CLOSE FCSPT33-FILE.                                          
      *                                                                 16400000
       9000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ****************************************************************  16690000
      *  9700-PROCESS-ABEND.                                         *  16700000
      ****************************************************************  16710000
       COPY CPD0023B.                                                   16720000
                                                                        
      ****************************************************************  16690000
      *  9900-ABEND.                                                 *  16700000
      ****************************************************************  16710000
           EXEC SQL                                                     16740000
               INCLUDE CPD09900                                         16750000
           END-EXEC.                                                    16760000
