000100 IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02068.                                         
COB303 DATE-WRITTEN. JUNE   7, 1995                                     
000400 DATE-COMPILED.                                                   
000500                                                                  
CVT000******************************************************************00000100
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *00000200
CVT000*         S068 CONVERTED TO DB2 SP CSR02068 ON 06/01/2005        *00000300
CVT000*             -NOTE: AUTOMATED CONVERSION PROGRAM USED           *00000400
CVT000*                                                                *00000500
CVT000*                    CVT000 - CONVERTED CODE                     *00000501
CVT000*                    CVT004 - NEEDED REVIEW                      *00000502
CVT000*                    CVT999 - COMMENTED OUT CODE THAT CAN        *00000503
CVT000*                             POTENTIALLY BE DELETED             *00000510
CVT000*                                                                *00000520
CVT000******************************************************************00000600
000600******************************************************************00060000
000700*                                                                *00070000
000800*                SOUTH CAROLINA ELECTRIC & GAS                   *00080000
000900*                                                                *00090000
001000*  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).   *00100000
001100*                                                                *00110000
001200*  TRANID:        S068                                           *00120000
001300*  PROGRAM:       S068                                           *00130000
001400*  CALLING SP:    PA_S068                                        *00140000
001500*                                                                *00150000
001600******************************************************************00160000
001700*                 P R O G R A M  S U M M A R Y                   *00170000
001800*                                                                *00180000
001900*  THIS PROGRAM DOES THE FOLLOWING:                              *00190000
002000*  1. RETRIEVES INFO       FROM CSS_DFA_ACCT FOR AN ACCOUNT NO   *00200000
002100*                                                                *00210000
002200******************************************************************00220000
002300*                                                                *00230000
002400*                     PROGRAM MODIFICATION LOG                   *00240000
002500*                                                                *00250000
002600*    DATE    INITIALS   COMMENTS                                 *00260000
002700*  --------  --------   ---------------------------------------  *00270000
002800*  06/07/95    RTO      PROCEDURE ORIGINALLY CODED.              *00280000
002900*  10/26/95    MAR      ADD DPP.                                 *00290000
PCR136*  09/27/96    MRB      RETRIEVE CODE_DISC_OK FOR CALLING        *00291000
PCR136*                       PANEL #164.                              *00292000
PCR328*  10/08/96    MRB      RETRIEVE CODE_ACCT_BILLED FOR CALLING    *00293000
PCR328*                       PANEL #163.                              *00294000
TP5120*  10/14/96    RPM      SELECT OPTIMUM-READ-DATE FOR PANEL #164  *00295000
TP5120*                       FROM CSS_READ_WINDOW.                    *00296000
TP7987*  12/05/96    MJG      RETRIEVE THE USERS NAME INSTEAD OF JUST  *00297000
TP7987*                       THE USER_ID.                             *00298000
T10382*  04/12/97    MJG      THE THE DNP DATE SHOULD BE EITHER THE    *00298100
T10382*                       NEXT READ DATE (USING CPD00310) OR THE   *00298200
T10382*                       DATE STORED IN THE CRED_COLL TABLE.      *00298300
T10810*  05/05/97    MJG      THE THE DNP DATE SHOULD BE BASED ON THE  *00298400
T10810*                       BILL DATE NOT THE NEXT READ DATE.        *00298500
T10810*                       (CPD00309 WAS USED INSTEAD OF CPD00310)  *00298600
T10976*  05/08/97    MJG      RS-USERS SHOULD JUST BE THE LAST-NAME    *00298700
T10976*                       IF THE USER DOESN'T HAVE A FIRST NAME.   *00298800
T10976*                       (SYSTEM, JOURNAL, ETC.)                  *00298900
T12316*  07/24/97    MJG      WE NEED TO ADD A NULL INDACTOR TO THE    *00299000
T12316*                       SELECT FROM THE ACCOUNT TABLE FOR        *00299100
T12316*                       DATE-BILL-00.                            *00299200
T12316*  08/05/97    MJG      TO DETERMINE THE DUE DATES FOR THE       *00299300
T12316*                       DFA/DPP YOU NEED THE CREDIT GROUP.       *00299400
T13759*  10/13/97    EMS      REMOVED THE JOIN BETWEEN CSS_DFA_ACCT    *00299501
      *                       AND CSS_USER_PROFILE THAT EXISTED ON     *00299601
      *                       THE DFA-ACCT CURSOR. ADD PARA 7400-      *00299701
T16088*  04/28/98    SV       TO DISPLAY NECESSARY INFO IN MC05 ERROR  *00299802
      *                       LOG.                                     *00299902
T18482*  11/17/98    SV       GET MIN(OPTIMUM READ DATE) FROM          *        
      *                       CSS_READ_WINDOW TO CALCULATE DPP/DFA     *        
      *                       DUE DATE                                 *        
T20242*  07/20/99    CBSI     IF BILL_CYCLE IS '00', ERR CODE 3000 IS  *        
      *              MADRAS   MOVED TO RETURN-CODE TO AVOID -180 ABEND *        
T21323*  02/25/00    CBSI     HANDLED -305 CONDITION FOR               *        
T21323*              MADRAS   CSS_READ_WINDOW TABLE                    *        
T21107*  02/25/00    CBSI     MODIFIED RESULT SET TO SEND              *        
T21107*              MADRAS   LAST_UPDATE_TS TO PANEL 163              *        
T21995*  05/25/00    CB18344  MODIFIED CURRENT DATE TO BE START DATE   *        
T21995*                       FROM PANEL163 WHEN CURRENT DATE <        *        
T21995*                       START DATE.  CURRENT DATE IS NOT CHANGED *        
T21995*                       WHEN CURRENT DATE > START DATE.  THIS    *        
T21995*                       SOLVED PROBLEM WITH WRONG DATE PRINTING  *        
T21995*                       ON DFA CONTRACTS.                        *        
T21995*  09/05/05    CVNS     RPC TO COBOL DB2 SP CONVERSION.          *        
T21995*              CHENNAI                                           *        
T21995*  07/29/08    VP94820  FIXED PB11 CONVERSION ISSUES.            *        
F21995*  08/27/08    VV94890  FIXED INCORRECT DNP DATE INSTEAD OF      *        
F21995*                       DISPLAYING 01/01/1900 TO SPACES.         *        
P00253*  04/07/08    AA97148  INITIALIZE PYMNT-ARNGMNT-CMTS TO AVOID   *        
P00253*                       OVERRIDEN COMMENTS ON PANEL 163.         *        
A04527*  06/07/13    AS7C117  REMOVE UNUSED COPYBOOK CWS00056.         *        
003200******************************************************************00299800
003200******************************************************************00299900
003300*                                                                *00300000
003400*                ---- BASIC SEQUENCE STRUCTURE ----              *00300100
003500*                                                                *00300200
003600*  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION             *00300300
003700*  1000 - 1999  INPUT PROCESSING CONTROL PATH                    *00300400
003800*  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                   *00301000
003900*  3000 - 4999  NOT USED                                         *00310000
004000*  5000 - 5999  COMMON PROGRAM MODULES                           *00320000
004100*  6000 - 6999  COMMON SYSTEM MODULES                            *00330000
004200*  7000 - 7999  INPUT MODULES                                    *00340000
004300*  8000 - 8999  OUTPUT MODULES                                   *00350000
004400*  9000 - 9999  TERMINATION, ABEND, MESSAGING MODULES            *00360000
004500*                                                                *00370000
004600******************************************************************00380000
004700                                                                  
004800 ENVIRONMENT DIVISION.                                            
004900 DATA DIVISION.                                                   
005000                                                                  
005100 WORKING-STORAGE SECTION.                                         

MSQ002  01 MFA-CSRERLOG.
MSQ002    05 ARG-5 PIC X(255).
MSQ002    05 ARG-6 PIC X(255).
MSQ002    05 ARG-7 PIC X(447).

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'CSR02068'.
MSQ017     COPY MFASQLM.
005200 01  WS-START                                   PIC X(40) VALUE   
REARCH     'WORKING STORAGE FOR CSR02068 STARTS HERE'.                  
005400                                                                  
005500******************************************************************00470000
005600*    COBOL WORKING STORAGE COPY BOOKS                            *00480000
005700******************************************************************00490000
005800                                                                  
CVT999*    COPY SYGWCOB.                                                00510000
CVT999*    COPY SYDBCOB.                                                00520000
006100     COPY CCA00001.                                               00530000
CVT999*    COPY CWS00010.                                               00540000
006300     COPY CWS00027.                                               00550000
006500     COPY CWS00303.                                               00570000
006600                                                                  
006700******************************************************************00590000
006800*    WORK AREAS                                                  *00600000
006900******************************************************************00610000
007000                                                                  
007100 01  WS-MISC.                                                     
REARCH     05  PROGRAM-NAME             PIC X(08) VALUE 'CSR02068'.     
007300     05  ALL-DONE-SW              PIC X(01) VALUE 'N'.            
007400         88 NOT-ALL-DONE                    VALUE 'N'.            
007500         88 ALL-DONE                        VALUE 'Y'.            
007600     05  SEND-DONE-SW             PIC X(01) VALUE 'Y'.            
007700         88 SEND-DONE-ERROR                 VALUE 'N'.            
007800         88 SEND-DONE-OK                    VALUE 'Y'.            
007900     05  WS-ACCOUNT-NO            PIC 9(13).                      
COB305     05 WS-ACCOUNT-NO-NUM        PIC S9(13) COMP-3 VALUE 0.              
008100     05  WS-ROW-COUNT             PIC 9(5) VALUE 0.               
TP5120     05  WS-OPTIMUM-READ-DATE     PIC X(10) VALUE SPACES.         
TP5120     05  WS-SPACE                 PIC X(02) VALUE SPACES.         
TP5120     05  WS-NULL-1                PIC S9(4)  COMP.                
T12316     05  WS-NULL-DATE             PIC S9(4)  COMP.                
TP7987     05  WS-SUB                   PIC S9(8) COMP VALUE ZERO.      
TP7987     05  CN-DELIMITER             PIC X VALUE ';'.                
TP7987     05  WS-FROM.                                                 
TP7987         10  WS-FROM-X                OCCURS 51 TIMES PIC X.      
008200                                                                  
TP5120 01  WS-MISC-FIELDS.                                              
           05  WS-CURRENT-DATE              PIC X(10) VALUE SPACES.     
TP5120     05  WS-DATE-CCYY-MM-DD.                                      
TP5120         10  WS-DATE-CCYY             PIC X(04) VALUE SPACES.     
TP5120         10  FILLER                   PIC X(01) VALUE SPACES.     
TP5120         10  WS-DATE-MM               PIC X(02) VALUE SPACES.     
TP5120         10  FILLER                   PIC X(01) VALUE SPACES.     
TP5120         10  WS-DATE-DD               PIC X(02) VALUE SPACES.     
TP5120     05  WS-DATE-MM-DD-YYYY.                                      
TP5120         10  WS-DATE2-MM              PIC X(02) VALUE SPACES.     
TP5120         10  FILLER                   PIC X(01) VALUE '/'.        
TP5120         10  WS-DATE2-DD              PIC X(02) VALUE SPACES.     
TP5120         10  FILLER                   PIC X(01) VALUE '/'.        
TP5120         10  WS-DATE2-CCYY            PIC X(04) VALUE SPACES.     
C37440     05  WS-FILLER-1                  PIC X(10) VALUE SPACES.     
C37440     05  WS-FILLER-2                  PIC X(10) VALUE SPACES.     
TP5120*                                                                 00815000
008300 01  WS-LITERAL.                                                  
008400     05  WS-A                     PIC X(01) VALUE 'A'.            
008500     05  WS-B                     PIC X(01) VALUE 'B'.            
008600     05  WS-C                     PIC X(01) VALUE 'C'.            
008700     05  WS-G                     PIC X(01) VALUE 'G'.            
008800     05  WS-I                     PIC X(01) VALUE 'I'.            
008900     05  WS-M                     PIC X(01) VALUE 'M'.            
009000     05  WS-R                     PIC X(01) VALUE 'R'.            
           05  WS-NULL-IND-CPD          PIC S9(04) COMP.                
T21323     05  WS-NULL-IND              PIC S9(04) COMP.                
T21323     05  WS-NULL                  PIC S9(01) VALUE -1.            
009100                                                                  
009200 01  GW-LIB-MISC-FIELDS.                                          
CVT999*    05  GWL-PROC                 POINTER.                        00826000
CVT999*    05  GWL-INIT-HANDLE          POINTER.                        00827000
CVT999*    05  GWL-RC                   PIC S9(9) COMP.                 00828000
CVT999*    05  GWL-STATUS-NR            PIC S9(9) COMP.                 00829000
CVT999*    05  GWL-STATUS-DONE          PIC S9(9) COMP.                 00830000
CVT999*    05  GWL-STATUS-COUNT         PIC S9(9) COMP.                 00840000
CVT999*    05  GWL-STATUS-COMM          PIC S9(9) COMP.                 00850000
CVT999*    05  GWL-STATUS-RETURN-CODE   PIC S9(9) COMP.                 00860000
010100     05  GWL-STATUS-SUBCODE       PIC S9(9) COMP.                 
010200 01  FILLER                       PIC X(11) VALUE 'PARM FIELDS'.  
010300                                                                  
010400 01  PARM-FIELDS.                                                 
010500     05  PARM-L                   PIC S9(09) COMP.                
CVT999*    05  PARM-ID1                 PIC S9(09) COMP VALUE 1.        00920000
010700     05  PARM-ACCOUNT-NO          PIC  X(13).                     
010800     05  PARM-DFA-TYPE            PIC  X(1).                      
010900                                                                  
011000 01  SNA-FIELDS.                                                  
011100     05  SNA-SUBC                PIC S9(9) COMP.                  
CVT999*    05  SNA-CONNECTION-NAME     PIC X(8)  VALUE SPACES.          00980000
011300                                                                  
011400 01  COUNTER-FIELDS.                                              
CVT999*    05  CTR-COLUMN              PIC S9(9) COMP VALUE 1.          01010000
011600     05  CTR-ROWS                PIC S9(9) COMP VALUE 0.          
011700                                                                  
011800 01  WORK-FIELDS.                                                 
CVT999*    05  MAX-LENGTH-PARM         PIC S9(9) COMP.                  01050000
CVT999*    05  WRKLEN1                 PIC S9(9) COMP.                  01060000
CVT999*    05  WRKLEN2                 PIC S9(9) COMP.                  01070000
012200     05  WRK-DONE-STATUS         PIC S9(9) COMP.                  
012300     05  WS-DATE-OF-AGREE-NI     PIC S9(04) COMP.                 
012400     05  WS-DATE-OF-AGREE        PIC  X(10).                      
012500     05  WS-DATE-PYMT-START-NI   PIC S9(04) COMP.                 
012600     05  WS-FRST-ERNST-PAY-DT-NI PIC S9(04) COMP.                 
012700     05  WS-SCND-ERNST-PAY-DT-NI PIC S9(04) COMP.                 
012800     05  WS-DATE-CREDIT-ACTION-NI PIC S9(04) COMP.                
014500     05  WS-PYMNT-ARNGMNT-CMTS    PIC X(255) VALUE SPACES.        
012900                                                                  
013000 01  FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.      
REARCH 01  TDS-RETURN-FIELDS.                                           
013200     05  RS-RETURN-CODE           PIC S9(09) COMP VALUE +0.       
013300     05  RS-DFA-ITEM-ID           PIC S9(09) COMP VALUE +0.       
013400     05  RS-DATE-OF-AGREE         PIC  X(10).                     
013500     05  RS-AMT-MO-PYMT           PIC S9(07)V99 COMP-3 VALUE +0.  
013600     05  RS-DATE-PYMT-START       PIC  X(10).                     
013700     05  RS-NO-SCHED-PYMTS        PIC S9(09) COMP VALUE +0.       
013800     05  RS-AMT-ORIG-ENTERED      PIC S9(09)V99 COMP-3 VALUE +0.  
013900     05  RS-CSR-USERID            PIC  X(07).                     
014000     05  RS-CODE-DFA-STATUS       PIC  X(01).                     
014100     05  RS-RCNTLY-BLLD-MTH       PIC  X(02).                     
014200     05  RS-AMT-UNDEFERD-RECV     PIC  S9(07)V99 COMP-3 VALUE +0. 
014300     05  RS-CODE-DFA-DESC         PIC  X(01).                     
014400     05  RS-REVERSE-REASON        PIC  X(50).                     
014500     05  RS-PYMNT-ARNGMNT-CMTS.                                   
014600         49  RS-PYMNT-ARNGMNT-CMTS-LEN                            
014700                                  PIC S9(4) COMP SYNC VALUE +0.   
014800         49  RS-PYMNT-ARNGMNT-CMTS-TEXT PIC X(255) VALUE SPACES.  
014900     05  RS-LAST-BILLED-DATE      PIC  X(10).                     
015000     05  RS-LAST-INSTALLMENT      PIC S9(07)V99 COMP-3 VALUE +0.  
015100     05  RS-END-DATE              PIC  X(10).                     
015200     05  RS-AMT-EXTRA-DEPOSIT     PIC S9(07)V99 COMP-3 VALUE +0.  
015300     05  RS-CODE-COMPLY-HIST      PIC  X(24).                     
015400     05  RS-FRST-ERNST-PAY-DT     PIC X(10).                      
015500     05  RS-FRST-ERNST-PAY-AMT    PIC S9(09)V99 COMP-3 VALUE +0.  
015600     05  RS-SCND-ERNST-PAY-DT     PIC X(10).                      
015700     05  RS-SCND-ERNST-PAY-AMT    PIC S9(09)V99 COMP-3 VALUE +0.  
015800     05  RS-DATE-CREDIT-ACTION    PIC X(10).                      
015900     05  RS-LAST-UPDATE-TS        PIC X(26).                      
PCR136     05  RS-CODE-DISC-OK          PIC X(01).                      
PCR328     05  RS-CODE-ACCT-BILLED      PIC X(01).                      
TP5120     05  RS-OPT-READ-DATE         PIC X(10) VALUE SPACES.         
TP5120     05  RS-BILL-CYCLE            PIC X(02) VALUE SPACES.         
TP7987     05  RS-USERS-NAME            PIC X(29) VALUE SPACES.         
T12513     05  RS-CREDIT-GROUP          PIC X(01) VALUE SPACES.         
T18482     05  RS-SECOND-NEXT-READ      PIC X(10) VALUE SPACES.         
T21107     05  RS-AT-LAST-UPD-TS        PIC X(26) VALUE SPACES.         
                                                                        
REARCH 01  GTT-RETURN-FIELDS.                                           
REARCH     05  S-RETURN-CODE           PIC S9(09) COMP VALUE +0.        
REARCH     05  S-DFA-ITEM-ID           PIC S9(09) COMP VALUE +0.        
REARCH     05  S-DATE-OF-AGREE         PIC  X(10).                      
REARCH     05  S-AMT-MO-PYMT           PIC S9(07)V99 COMP-3 VALUE +0.   
REARCH     05  S-DATE-PYMT-START       PIC  X(10).                      
REARCH     05  S-NO-SCHED-PYMTS        PIC S9(09) COMP VALUE +0.        
REARCH     05  S-AMT-ORIG-ENTERED      PIC S9(09)V99 COMP-3 VALUE +0.   
REARCH     05  S-CSR-USERID            PIC  X(07).                      
REARCH     05  S-CODE-DFA-STATUS       PIC  X(01).                      
REARCH     05  S-RCNTLY-BLLD-MTH       PIC  X(02).                      
REARCH     05  S-AMT-UNDEFERD-RECV     PIC  S9(07)V99 COMP-3 VALUE +0.  
REARCH     05  S-CODE-DFA-DESC         PIC  X(01).                      
REARCH     05  S-REVERSE-REASON        PIC  X(50).                      
REARCH     05  S-PYMNT-ARNGMNT-CMTS-LEN                                 
REARCH                                 PIC S9(4) COMP SYNC VALUE +0.    
REARCH     05  S-PYMNT-ARNGMNT-CMTS-TEXT PIC X(255) VALUE SPACES.       
REARCH     05  S-LAST-BILLED-DATE      PIC  X(10).                      
REARCH     05  S-LAST-INSTALLMENT      PIC S9(07)V99 COMP-3 VALUE +0.   
REARCH     05  S-END-DATE              PIC  X(10).                      
REARCH     05  S-AMT-EXTRA-DEPOSIT     PIC S9(07)V99 COMP-3 VALUE +0.   
REARCH     05  S-CODE-COMPLY-HIST      PIC  X(24).                      
REARCH     05  S-FRST-ERNST-PAY-DT     PIC X(10).                       
REARCH     05  S-FRST-ERNST-PAY-AMT    PIC S9(09)V99 COMP-3 VALUE +0.   
REARCH     05  S-SCND-ERNST-PAY-DT     PIC X(10).                       
REARCH     05  S-SCND-ERNST-PAY-AMT    PIC S9(09)V99 COMP-3 VALUE +0.   
REARCH     05  S-DATE-CREDIT-ACTION    PIC X(10).                       
REARCH     05  S-LAST-UPDATE-TS        PIC X(26).                       
REARCH     05  S-CODE-DISC-OK          PIC X(01).                       
REARCH     05  S-CODE-ACCT-BILLED      PIC X(01).                       
REARCH     05  S-OPT-READ-DATE         PIC X(10) VALUE SPACES.          
REARCH     05  S-BILL-CYCLE            PIC X(02) VALUE SPACES.          
REARCH     05  S-USERS-NAME            PIC X(29) VALUE SPACES.          
REARCH     05  S-CREDIT-GROUP          PIC X(01) VALUE SPACES.          
REARCH     05  S-SECOND-NEXT-READ      PIC X(10) VALUE SPACES.          
REARCH     05  S-AT-LAST-UPD-TS        PIC X(26) VALUE SPACES.          
CVT999*01  CNS-COLUMN-NAMES.                                            01520000
CVT999*    05  CNS-RETURN-CODE          PIC X(11) VALUE                 01530000
CVT999*                                       'RETURN_CODE'.            01540000
CVT999*    05  CNS-DFA-ITEM-ID          PIC X(15) VALUE                 01550000
CVT999*                                       'DFA_ITEM_ID'.            01560000
CVT999*                                                                 01570000
CVT999*    05  CNS-DATE-OF-AGREE        PIC X(15) VALUE                 01580000
CVT999*                                       'DATE-OF-AGREE'.          01590000
CVT999*    05  CNS-AMT-MO-PYMT          PIC X(15) VALUE                 01591000
CVT999*                                       'AMT-MO-PYMT'.            01592000
CVT999*                                                                 01593000
CVT999*    05  CNS-DATE-PYMT-START      PIC X(15) VALUE                 01594000
CVT999*                                       'DATE-PYMT-START'.        01595000
CVT999*                                                                 01596000
CVT999*    05  CNS-NO-SCHED-PYMTS       PIC X(15) VALUE                 01597000
CVT999*                                       'NO-SCHED-PYMTS'.         01598000
CVT999*                                                                 01599000
CVT999*    05  CNS-AMT-ORIG-ENTERED     PIC X(17) VALUE                 01600000
CVT999*                                       'AMT-ORIG-ENTERED'.       01610000
CVT999*                                                                 01620000
CVT999*    05  CNS-CSR-USERID           PIC X(15) VALUE                 01630000
CVT999*                                       'CSR-USER-ID'.            01640000
CVT999*                                                                 01650000
CVT999*    05  CNS-CODE-DFA-STATUS      PIC X(17) VALUE                 01660000
CVT999*                                       'CODE-DFA-STATUS'.        01670000
CVT999*                                                                 01680000
CVT999*    05  CNS-CODE-DFA-DESC        PIC X(17) VALUE                 01690000
CVT999*                                       'CODE-DFA-DESC'.          01700000
CVT999*                                                                 01710000
CVT999*    05  CNS-RCNTLY-BLLD-MTH      PIC X(17) VALUE                 01720000
CVT999*                                       'RCNTLY-BLLD-MTHD'.       01730000
CVT999*                                                                 01740000
CVT999*    05  CNS-AMT-UNDEFERD-RECV    PIC X(17) VALUE                 01750000
CVT999*                                       'AMT-UNDEFERD-RECV'.      01760000
CVT999*                                                                 01770000
CVT999*    05  CNS-REVERSE-REASON       PIC X(17) VALUE                 01780000
CVT999*                                       'REVERSE-REASON'.         01790000
CVT999*                                                                 01800000
CVT999*    05  CNS-PYMNT-ARNGMNT-CMTS   PIC X(20) VALUE                 01810000
CVT999*                                       'PYMNT-ARNGMNT-CMTS'.     01820000
CVT999*                                                                 01830000
CVT999*    05  CNS-LAST-BILLED-DATE     PIC X(16) VALUE                 01840000
CVT999*                                       'LAST-BILLED-DATE'.       01850000
CVT999*                                                                 01860000
CVT999*    05  CNS-LAST-INSTALLMENT     PIC X(16) VALUE                 01870000
CVT999*                                       'LAST-INSTALLMENT'.       01880000
CVT999*                                                                 01890000
CVT999*    05  CNS-END-DATE             PIC X(08) VALUE                 01900000
CVT999*                                       'END-DATE'.               01910000
CVT999*                                                                 01920000
CVT999*    05  CNS-AMT-EXTRA-DEPOSIT    PIC X(17) VALUE                 01930000
CVT999*                                       'AMT_EXTRA_DEPOSIT'.      01940000
CVT999*                                                                 01950000
CVT999*    05  CNS-CODE-COMPLY-HIST     PIC X(17) VALUE                 01960000
CVT999*                                       'CODE_COMPLY_HIST'.       01970000
CVT999*                                                                 01980000
CVT999*    05  CNS-FRST-ERNST-PAY-DT    PIC X(18) VALUE                 01990000
CVT999*                                       'FRST-ERNST-PAY-DT'.      02000000
CVT999*                                                                 02010000
CVT999*    05  CNS-FRST-ERNST-PAY-AMT   PIC X(18) VALUE                 02020000
CVT999*                                       'FRST-ERNST-PAY-AMT'.     02030000
CVT999*                                                                 02040000
CVT999*    05  CNS-SCND-ERNST-PAY-DT    PIC X(18) VALUE                 02050000
CVT999*                                       'SCND-ERNST-PAY-DT'.      02060000
CVT999*                                                                 02070000
CVT999*    05  CNS-SCND-ERNST-PAY-AMT   PIC X(18) VALUE                 02080000
CVT999*                                       'SCND-ERNST-PAY-AMT'.     02090000
CVT999*                                                                 02100000
CVT999*    05  CNS-DATE-CREDIT-ACTION   PIC X(18) VALUE                 02110000
CVT999*                                       'DATE-CREDIT-ACTION'.     02120000
CVT999*                                                                 02130000
CVT999*    05  CNS-LAST-UPDATE-TS       PIC X(18) VALUE                 02140000
CVT999*                                       'LAST-UPDATE-TS'.         02150000
CVT999*                                                                 02160000
CVT999*    05  CNS-CODE-DISC-OK         PIC X(12) VALUE                 02170000
CVT999*                                       'CODE-DISC-OK'.           02180000
CVT999*    05  CNS-CODE-ACCT-BILLED     PIC X(16) VALUE                 02190000
CVT999*                                       'CODE-ACCT-BILLED'.       02200000
CVT999*    05  CNS-OPT-READ-DATE        PIC X(13) VALUE                 02210000
CVT999*                                       'OPT-READ-DATE'.          02220000
CVT999*    05  CNS-BILL-CYCLE           PIC X(10) VALUE                 02230000
CVT999*                                       'BILL-CYCLE'.             02240000
CVT999*    05  CNS-USERS-NAME           PIC X(10) VALUE                 02250000
CVT999*                                       'USERS-NAME'.             02260000
CVT999*    05  CNS-CREDIT-GROUP         PIC X(12) VALUE                 02261000
CVT999*                                       'CREDIT-GROUP'.           02262000
CVT999*    05  CNS-SECOND-NEXT-READ     PIC X(16) VALUE                 02261000
CVT999*                                       'SECOND-NEXT-READ'.       02262000
CVT999*    05  CNS-AT-LAST-UPD-TS       PIC X(14) VALUE                 02261000
CVT999*                                       'AT_LAST_UPD_TS'.         02262000
TP7987     EXEC SQL                                                     02270000
TP7987        INCLUDE TBUSRPRF                                          02280000
TP7987     END-EXEC.                                                    02290000
                                                                        
T10382     EXEC SQL                                                     02301000
T10382        INCLUDE TBRDWNDW                                          02302000
T10382     END-EXEC.                                                    02303000
                                                                        
T10810     EXEC SQL                                                     02303200
T10810        INCLUDE TBBILWDW                                          02303300
T10810     END-EXEC.                                                    02303400
                                                                        
023300     EXEC SQL                                                     02310000
023400        INCLUDE SQLCA                                             02320000
023500     END-EXEC.                                                    02321000
023600                                                                  
023700     EXEC SQL                                                     02323000
023800        INCLUDE TBMODEL                                           02324000
023900     END-EXEC.                                                    02325000
024000                                                                  
024100     EXEC SQL                                                     02327000
024200        INCLUDE TBDFAACT                                          02328000
024300     END-EXEC.                                                    02329000
024400                                                                  
024500     EXEC SQL                                                     02340000
024600        INCLUDE TBACCT                                            02350000
024700     END-EXEC.                                                    02360000
024800                                                                  
024900     EXEC SQL                                                     02380000
025000        INCLUDE TBCRCOLL                                          02390000
025100     END-EXEC.                                                    02400000
025200                                                                  
024900     EXEC SQL                                                     02420000
025000        INCLUDE TBUTLENV                                          02430000
025100     END-EXEC.                                                    02440000
025200                                                                  
024900     EXEC SQL                                                     02450100
006500        INCLUDE CWS00309                                          02450200
025100     END-EXEC.                                                    02450400
025200                                                                  
025300***********************************************************       02460000
025400*** DFA-CURSOR: FETCH ALL ROWS IN THE CSS_DFA_ACCT         ***    02470000
025500*** TABLE WITH THE PASSED ACCOUNT NUMBER AND DFA TYPE.     ***    02480000
025600***********************************************************       02490000
025700     EXEC SQL                                                     
025800       DECLARE DFA-CURSOR  CURSOR FOR                             
025900       SELECT DA.DFA_ITEM_ID,                                     
C37440              COALESCE(CIS.CHAR2$DATE(
           DA.DATE_OF_AGREE,'USA'),'01/01/1900'),  
026100              DA.DATE_OF_AGREE,                                   
026200              DA.AMT_MO_PYMT,                                     
C37440              COALESCE(CIS.CHAR2$DATE(
           DA.DATE_PYMT_START,'USA'),'01/01/1900'),
026400              DA.NO_SCHED_PYMTS,                                  
026400              DA.AMT_ORIG_ENTERED,                                
026500              DA.CSR_USERID,                                      
026500              DA.CODE_DFA_STATUS,                                 
026600              DA.RCNTLY_BLLD_MTH,                                 
026600              DA.AMT_UNDEFERD_RECV,                               
026700              DA.CODE_DFA_DESC,                                   
026700              DA.REVERSE_REASON,                                  
026800              DA.PYMNT_ARNGMNT_CMTS,                              
026900              DA.AMT_EXTRA_DEPOSIT,                               
027000              DA.CODE_COMPLY_HIST,                                
C37440              COALESCE(CIS.CHAR2$DATE(DA.FRST_ERNST_PAY_DT,'USA'),        
C37440                       '01/01/1900'),                             
027200              DA.FRST_ERNST_PAY_AMT,                              
C37440              COALESCE(CIS.CHAR2$DATE(DA.SCND_ERNST_PAY_DT,'USA'),        
C37440                       '01/01/1900'),                             
027400              DA.SCND_ERNST_PAY_AMT,                              
027500              REPLACE(REPLACE(CONVERT(CHAR(26), DA.LAST_UPDATE_TS
           , 121), ' ', '-'), ':', '.') LAST_UPDATE_TS                         
027600       FROM   CSS_DFA_ACCT DA                                     
027700       WHERE  DA.ACCOUNT_NO        = :DA-ACCOUNT-NO               
027800         AND  DA.PYMT_PRIORITY_LVL = 90                           
027900         AND  DA.CODE_DFA_TYPE     = :DA-CODE-DFA-TYPE            
028000       ORDER  BY DA.CODE_DFA_STATUS,                              
028000                 DA.DATE_OF_AGREE DESC                            
028100     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ029
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                     02500000
MFA-TR*      DECLARE DFA-CURSOR  CURSOR FOR                             02510000
MFA-TR*      SELECT DA.DFA_ITEM_ID,                                     02510100
MFA-TR*             COALESCE(CHAR(DA.DATE_OF_AGREE,USA),'01/01/1900'),  02510200
MFA-TR*             DA.DATE_OF_AGREE,                                   02510300
MFA-TR*             DA.AMT_MO_PYMT,                                     02510400
MFA-TR*             COALESCE(CHAR(DA.DATE_PYMT_START,USA),'01/01/1900'),02510200
MFA-TR*             DA.NO_SCHED_PYMTS,                                  02510600
MFA-TR*             DA.AMT_ORIG_ENTERED,                                02510700
MFA-TR*             DA.CSR_USERID,                                      02510800
MFA-TR*             DA.CODE_DFA_STATUS,                                 02510900
MFA-TR*             DA.RCNTLY_BLLD_MTH,                                 02511000
MFA-TR*             DA.AMT_UNDEFERD_RECV,                               02512000
MFA-TR*             DA.CODE_DFA_DESC,                                   02513000
MFA-TR*             DA.REVERSE_REASON,                                  02514000
MFA-TR*             DA.PYMNT_ARNGMNT_CMTS,                              02515000
MFA-TR*             DA.AMT_EXTRA_DEPOSIT,                               02516000
MFA-TR*             DA.CODE_COMPLY_HIST,                                02517000
MFA-TR*             COALESCE(CHAR(DA.FRST_ERNST_PAY_DT,USA),            02510200
MFA-TR*                      '01/01/1900'),                             02510200
MFA-TR*             DA.FRST_ERNST_PAY_AMT,                              02519000
MFA-TR*             COALESCE(CHAR(DA.SCND_ERNST_PAY_DT,USA),            02510200
MFA-TR*                      '01/01/1900'),                             02510200
MFA-TR*             DA.SCND_ERNST_PAY_AMT,                              02530000
MFA-TR*             DA.LAST_UPDATE_TS                                   02540000
MFA-TR*      FROM   CSS_DFA_ACCT DA                                     02580000
MFA-TR*      WHERE  DA.ACCOUNT_NO        = :DA-ACCOUNT-NO               02600000
MFA-TR*        AND  DA.PYMT_PRIORITY_LVL = 90                           02610000
MFA-TR*        AND  DA.CODE_DFA_TYPE     = :DA-CODE-DFA-TYPE            02620000
MFA-TR*      ORDER  BY DA.CODE_DFA_STATUS,                              02640000
MFA-TR*                DA.DATE_OF_AGREE DESC                            02650000
MFA-TR*    END-EXEC.                                                    02660000
028200                                                                  
HPCCDM*EJECT                                                            02680000
TP5120******************************************************************02690000
TP5120*                     CURSOR DECLARATION                         *02700000
TP5120******************************************************************02710000
TP5120     EXEC SQL                                                     
TP5120       DECLARE UTIL_ENVRNMT CURSOR FOR                            
TP5120       SELECT READ_CYCLE,                                         
TP5120              CODE_UTIL_TYPE,                                     
TP5120              IC_NO                                               
TP5120       FROM CSS_UTIL_ENVRNMT                                      
TP5120       WHERE ACCOUNT_NO = :DA-ACCOUNT-NO                          
TP5120       AND READ_CYCLE IS NOT NULL                                 
TP5120       AND READ_CYCLE <> :WS-SPACE                                
TP5120       ORDER BY CODE_UTIL_TYPE, IC_NO DESC
            OPTION(FAST 1)
            FOR READ ONLY                          
TP5120     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ004
MFA-TR* MSQ021
MFA-TR*    EXEC SQL                                                     02720000
MFA-TR*      DECLARE UTIL_ENVRNMT CURSOR FOR                            02730000
MFA-TR*      SELECT READ_CYCLE,                                         02740000
MFA-TR*             CODE_UTIL_TYPE,                                     02750000
MFA-TR*             IC_NO                                               02760000
MFA-TR*      FROM CSS_UTIL_ENVRNMT                                      02770000
MFA-TR*      WHERE ACCOUNT_NO = :DA-ACCOUNT-NO                          02780000
MFA-TR*      AND READ_CYCLE IS NOT NULL                                 02790000
MFA-TR*      AND READ_CYCLE <> :WS-SPACE                                02800000
MFA-TR*      ORDER BY CODE_UTIL_TYPE, IC_NO DESC                        02810000
MFA-TR*      OPTIMIZE FOR 1 ROW FOR FETCH ONLY                          02820000
MFA-TR*    END-EXEC.                                                    02830000
TP5120*                                                                 02831000
HPCCDM*EJECT                                                            02832000
TP5120*                                                                 02833000
CVT000     EXEC SQL                                                     00000010
CVT000         INCLUDE CWSX0010                                         00000020
CVT000     END-EXEC.                                                    00000030
CVT000                                                                  
CVT000 01  CSRERLOG-P.                                                  
CVT000     10  S-SP-NAME                 PIC X(18) VALUE SPACES.        
CVT000     10  S-SQLCODE                 PIC S9(9) COMP VALUE 0.        
CVT000     10  S-SQLSTATE                PIC X(5)  VALUE ' '.           
CVT000     10  S-TABLE-NAME              PIC X(18) VALUE SPACES.        
CVT000     10  S-HOST-VARIABLES.                                        
CVT000         49  S-HOST-VARIABLES-L    PIC S9(4) USAGE COMP.          
CVT000         49  S-HOST-VARIABLES-V    PIC X(255).                    
CVT000     10  S-SQL-STATEMENT.                                         
CVT000         49  S-SQL-STATEMENT-L     PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-STATEMENT-V     PIC X(255).                    
CVT000     10  S-SQL-DESCRIPTION.                                       
CVT000         49  S-SQL-DESCRIPTION-L   PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-DESCRIPTION-V   PIC X(255).                    
CVT000     10  WS-ABEND-SQLERRMC.                                       
CVT000         49  WS-ABEND-SQLERRMC-L   PIC S9(4) USAGE COMP.          
CVT000         49  WS-ABEND-SQLERRMC-V   PIC X(255).                    
REARCH*    10  S-RETURN-CODE             PIC S9(9) COMP VALUE 0.        00001701
CVT000     10  WS-SQLSTATE               PIC X(05) VALUE SPACES.        
CVT000                                                                  
CVT000                                                                  
CVT000                                                                  
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         DECLARE C1 CURSOR  FOR                        
CVT000         SELECT                                                   
REARCH                RETURN_CODE                                       
REARCH               ,DFA_ITEM_ID                                       
REARCH               ,LTRIM(RTRIM(DATE_OF_AGREE))      AS DATE_OF_AGREE        
REARCH               ,AMT_MO_PYMT                                       
REARCH               ,LTRIM(RTRIM(DATE_PYMT_START))    AS 
           DATE_PYMT_START      
REARCH               ,NO_SCHED_PYMTS                                    
REARCH               ,AMT_ORIG_ENTERED                                  
REARCH               ,LTRIM(RTRIM(CSR_USERID))         AS CSR_USERID           
REARCH               ,LTRIM(RTRIM(CODE_DFA_STATUS))    AS 
           CODE_DFA_STATUS      
REARCH               ,LTRIM(RTRIM(RCNTLY_BLLD_MTH))    AS 
           RCNTLY_BLLD_MTH      
REARCH               ,AMT_UNDEFERD_RECV                                 
REARCH               ,LTRIM(RTRIM(CODE_DFA_DESC))      AS CODE_DFA_DESC        
REARCH               ,LTRIM(RTRIM(REVERSE_REASON))     AS REVERSE_REASON       
REARCH               ,LTRIM(RTRIM(PYMNT_ARNGMNT_CMTS)) AS 
           PYMNT_ARNGMNT_CMTS   
REARCH               ,LTRIM(RTRIM(LAST_BILLED_DATE))   AS 
           LAST_BILLED_DATE     
REARCH               ,LAST_INSTALLMENT                                  
REARCH               ,LTRIM(RTRIM(END_DATE))           AS END_DATE             
REARCH               ,AMT_EXTRA_DEPOSIT                                 
REARCH               ,LTRIM(RTRIM(CODE_COMPLY_HIST))   AS 
           CODE_COMPLY_HIST     
REARCH               ,LTRIM(RTRIM(FRST_ERNST_PAY_DT))  AS 
           FRST_ERNST_PAY_DT    
REARCH               ,FRST_ERNST_PAY_AMT                                
REARCH               ,LTRIM(RTRIM(SCND_ERNST_PAY_DT))  AS 
           SCND_ERNST_PAY_DT    
REARCH               ,SCND_ERNST_PAY_AMT                                
REARCH               ,LTRIM(RTRIM(DATE_CREDIT_ACTION)) AS 
           DATE_CREDIT_ACTION   
REARCH               ,LTRIM(RTRIM(LAST_UPDATE_TS))     AS LAST_UPDATE_TS       
REARCH               ,LTRIM(RTRIM(CODE_DISC_OK))       AS CODE_DISC_OK         
REARCH               ,LTRIM(RTRIM(CODE_ACCT_BILLED))   AS 
           CODE_ACCT_BILLED     
REARCH               ,LTRIM(RTRIM(OPT_READ_DATE))      AS OPT_READ_DATE        
REARCH               ,LTRIM(RTRIM(BILL_CYCLE))         AS BILL_CYCLE           
REARCH               ,LTRIM(RTRIM(USERS_NAME))         AS USERS_NAME           
REARCH               ,LTRIM(RTRIM(CREDIT_GROUP))       AS CREDIT_GROUP         
REARCH               ,LTRIM(RTRIM(SECOND_NEXT_READ))   AS 
           SECOND_NEXT_READ     
REARCH               ,LTRIM(RTRIM(AT_LAST_UPD_TS))     AS AT_LAST_UPD_TS       
REARCH               ,:WS-FILLER-1              AS PROTECT_FLAG         
C37440               ,:WS-FILLER-2              AS NO_REMAINING_PYMTS   
C37440               ,0                         AS BAL_TOTAL_PAYOFF     
REARCH               ,0                         AS BAL_UNBILLED         
REARCH               ,0                         AS BAL_ARREARS          
REARCH               ,0                         AS BAL_CUR_CHARGES      
REARCH               ,''                        AS CODE_CONN_DF         
REARCH               ,0                         AS CURRENT_CHARGES      
REARCH               ,0                         AS ARREARS              
REARCH               ,0                         AS UNBILLED             
REARCH               ,0                         AS TOTAL_PAYOFF         
REARCH               ,0                         AS AMT_00_DAY           
REARCH               ,0                         AS AMT_30_DAY           
REARCH               ,0                         AS AMT_60_DAY           
REARCH               ,0                         AS AMT_90_DAY           
REARCH               ,0                         AS ORIG_AMT_MO_PYMT     
CVT000         FROM #CSR02068_R1                                 
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ029
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                     00000100
MFA-TR*        DECLARE C1 CURSOR WITH RETURN FOR                        00000300
MFA-TR*        SELECT                                                   00000400
MFA-TR*               RETURN_CODE                                               
MFA-TR*              ,DFA_ITEM_ID                                               
MFA-TR*              ,STRIP(DATE_OF_AGREE)      AS DATE_OF_AGREE                
MFA-TR*              ,AMT_MO_PYMT                                               
MFA-TR*              ,STRIP(DATE_PYMT_START)    AS DATE_PYMT_START              
MFA-TR*              ,NO_SCHED_PYMTS                                            
MFA-TR*              ,AMT_ORIG_ENTERED                                          
MFA-TR*              ,STRIP(CSR_USERID)         AS CSR_USERID                   
MFA-TR*              ,STRIP(CODE_DFA_STATUS)    AS CODE_DFA_STATUS              
MFA-TR*              ,STRIP(RCNTLY_BLLD_MTH)    AS RCNTLY_BLLD_MTH              
MFA-TR*              ,AMT_UNDEFERD_RECV                                         
MFA-TR*              ,STRIP(CODE_DFA_DESC)      AS CODE_DFA_DESC                
MFA-TR*              ,STRIP(REVERSE_REASON)     AS REVERSE_REASON               
MFA-TR*              ,STRIP(PYMNT_ARNGMNT_CMTS) AS PYMNT_ARNGMNT_CMTS           
MFA-TR*              ,STRIP(LAST_BILLED_DATE)   AS LAST_BILLED_DATE             
MFA-TR*              ,LAST_INSTALLMENT                                          
MFA-TR*              ,STRIP(END_DATE)           AS END_DATE                     
MFA-TR*              ,AMT_EXTRA_DEPOSIT                                         
MFA-TR*              ,STRIP(CODE_COMPLY_HIST)   AS CODE_COMPLY_HIST             
MFA-TR*              ,STRIP(FRST_ERNST_PAY_DT)  AS FRST_ERNST_PAY_DT            
MFA-TR*              ,FRST_ERNST_PAY_AMT                                        
MFA-TR*              ,STRIP(SCND_ERNST_PAY_DT)  AS SCND_ERNST_PAY_DT            
MFA-TR*              ,SCND_ERNST_PAY_AMT                                        
MFA-TR*              ,STRIP(DATE_CREDIT_ACTION) AS DATE_CREDIT_ACTION           
MFA-TR*              ,STRIP(LAST_UPDATE_TS)     AS LAST_UPDATE_TS               
MFA-TR*              ,STRIP(CODE_DISC_OK)       AS CODE_DISC_OK                 
MFA-TR*              ,STRIP(CODE_ACCT_BILLED)   AS CODE_ACCT_BILLED             
MFA-TR*              ,STRIP(OPT_READ_DATE)      AS OPT_READ_DATE                
MFA-TR*              ,STRIP(BILL_CYCLE)         AS BILL_CYCLE                   
MFA-TR*              ,STRIP(USERS_NAME)         AS USERS_NAME                   
MFA-TR*              ,STRIP(CREDIT_GROUP)       AS CREDIT_GROUP                 
MFA-TR*              ,STRIP(SECOND_NEXT_READ)   AS SECOND_NEXT_READ             
MFA-TR*              ,STRIP(AT_LAST_UPD_TS)     AS AT_LAST_UPD_TS               
MFA-TR*              ,:WS-FILLER-1              AS PROTECT_FLAG                 
MFA-TR*              ,:WS-FILLER-2              AS NO_REMAINING_PYMTS           
MFA-TR*              ,0                         AS BAL_TOTAL_PAYOFF             
MFA-TR*              ,0                         AS BAL_UNBILLED                 
MFA-TR*              ,0                         AS BAL_ARREARS                  
MFA-TR*              ,0                         AS BAL_CUR_CHARGES              
MFA-TR*              ,''                        AS CODE_CONN_DF                 
MFA-TR*              ,0                         AS CURRENT_CHARGES              
MFA-TR*              ,0                         AS ARREARS                      
MFA-TR*              ,0                         AS UNBILLED                     
MFA-TR*              ,0                         AS TOTAL_PAYOFF                 
MFA-TR*              ,0                         AS AMT_00_DAY                   
MFA-TR*              ,0                         AS AMT_30_DAY                   
MFA-TR*              ,0                         AS AMT_60_DAY                   
MFA-TR*              ,0                         AS AMT_90_DAY                   
MFA-TR*              ,0                         AS ORIG_AMT_MO_PYMT             
MFA-TR*        FROM SESSION.CSR02068_R1                                 00000500
MFA-TR*    END-EXEC.                                                    00000700
CVT000                                                                  
                                                                        
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-ACCOUNT-NO          PIC  X(13)               .          
CVT000 01  LINK-DFA-TYPE            PIC  X(1)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-ACCOUNT-NO                                         
CVT000         ,LINK-DFA-TYPE                                           
CVT000         .                                                        
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLWARNING                                      
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLERROR                                        
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER NOT FOUND                                       
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT999*PROCEDURE DIVISION.                                              02834000
028500                                                                  
028600******************************************************************02836000
028700* 0000-MAINLINE                                                  *02837000
028800*     CONTROLS THE MAIN PATH OF THE PROGRAM                      *02838000
028900******************************************************************02839000
029000                                                                  
029100 0000-MAINLINE.                                                   
029200                                                                  
029300     PERFORM 0100-INITIALIZE     THRU 0100-EXIT.                  
REARCH*    PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT.                  02839500
029500     PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT.                  
029600     PERFORM 9999-END-PROGRAM    THRU 9999-EXIT.                  
029700 0000-EXIT.                                                       
029800     EXIT.                                                        
029900                                                                  
030000******************************************************************02850000
030100* 0100-INITIALIZE                                                *02860000
030200*                                                                *02870000
030300*                                                                *02880000
030400*     1. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *02890000
030500*     2. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *02900000
030600*     3. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*02910000
030700*                                                                *02920000
030800******************************************************************02930000
030900                                                                  
031000 0100-INITIALIZE.                                                 
031100     MOVE '0100' TO ACTIVE-PARAGRAPH.                             
CVT999*    EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.              02970000
CVT999*    EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.                02980000
CVT999*    EXEC SQL WHENEVER NOT FOUND CONTINUE END-EXEC.               02990000
CVT999*    CALL 'TDINIT'   USING DFHEIBLK, GWL-RC, GWL-INIT-HANDLE.     03000000
031600                                                                  
CVT999*    CALL 'TDACCEPT' USING GWL-PROC, GWL-RC, GWL-INIT-HANDLE,     03020000
CVT999*                          SNA-CONNECTION-NAME, SNA-SUBC.         03030000
031900                                                                  
CVT999*    CALL 'TDRESULT' USING GWL-PROC, GWL-RC.                      03050000
032100                                                                  
CVT999*    IF GWL-RC NOT = TDS-PARM-PRESENT                             03070000
CVT999*       MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     03080000
CVT999*       MOVE '0100'          TO ACTIVE-PARAGRAPH                  03090000
CVT999*       MOVE 'TDRESULT - NO RPC PARM SENT' TO ABEND-FUNCTION      03100000
CVT999*       MOVE 'CICS TRANSACTION'   TO TABLE-1                      03110000
CVT999*       MOVE GWL-RC               TO WS-ACTIVE-RETURN-CODE        03120000
CVT999*       PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            03130000
CVT999*       PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            03140000
CVT999*    END-IF.                                                      03150000
CVT000     MOVE LINK-ACCOUNT-NO           TO PARM-ACCOUNT-NO          . 
CVT000     MOVE LINK-DFA-TYPE             TO PARM-DFA-TYPE            . 
C37440*                                                                         
C37440     IF PARM-DFA-TYPE = 'A'                                       
C37440        MOVE  ' '                   TO WS-FILLER-1                
C37440        MOVE  0                     TO WS-FILLER-2                
C37440     ELSE                                                         
C37440        MOVE '1900-01-01'           TO WS-FILLER-1                
C37440                                       WS-FILLER-2                
C37440     END-IF.                                                      
C37440*                                                                         
CVT000     PERFORM 0100A-DECLARE-GTT                                    
CVT000       THRU 0100A-EXIT.                                           
033100 0100-EXIT.                                                       
033200     EXIT.                                                        
                                                                        
CVT000 0100A-DECLARE-GTT.                                               
CVT000     EXEC SQL
             CALL CIS.DROP_TEMP_TABLE('#CSR02068_R1')
           END-EXEC
           EXEC SQL
             CREATE TABLE #CSR02068_R1
              (                                                          
CVT000         RETURN_CODE              INT                         
CVT000        ,DFA_ITEM_ID              INT                         
CVT000        ,DATE_OF_AGREE CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,AMT_MO_PYMT              DECIMAL(09,2)                   
CVT000        ,DATE_PYMT_START CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,NO_SCHED_PYMTS           INT                         
CVT000        ,AMT_ORIG_ENTERED         DECIMAL(11,2)                   
CVT000        ,CSR_USERID CHAR(07)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,CODE_DFA_STATUS CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,RCNTLY_BLLD_MTH CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,AMT_UNDEFERD_RECV        DECIMAL(09,2)                   
CVT000        ,CODE_DFA_DESC CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,REVERSE_REASON CHAR(50)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,PYMNT_ARNGMNT_CMTS CHAR(255)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                       
CVT000        ,LAST_BILLED_DATE CHAR(10)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,LAST_INSTALLMENT         DECIMAL(09,2)                   
CVT000        ,END_DATE CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2               
CVT000        ,AMT_EXTRA_DEPOSIT        DECIMAL(09,2)                   
CVT000        ,CODE_COMPLY_HIST CHAR(24)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,FRST_ERNST_PAY_DT CHAR(10)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,FRST_ERNST_PAY_AMT       DECIMAL(11,2)                   
CVT000        ,SCND_ERNST_PAY_DT CHAR(10)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,SCND_ERNST_PAY_AMT       DECIMAL(11,2)                   
CVT000        ,DATE_CREDIT_ACTION CHAR(10)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,LAST_UPDATE_TS CHAR(26)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,CODE_DISC_OK CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,CODE_ACCT_BILLED CHAR(01)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,OPT_READ_DATE CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,BILL_CYCLE CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,USERS_NAME CHAR(29)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,CREDIT_GROUP CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,SECOND_NEXT_READ CHAR(10)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                        
CVT000        ,AT_LAST_UPD_TS CHAR(26)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000       )
           END-EXEC.                                                    

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

           MOVE SQLSTATE TO WS-SQLSTATE.                                
           MOVE SQLCODE  TO WS-ACTIVE-RETURN-CODE.                      
                                                                        
           IF WS-SQLSTATE = '42710'                                     
              PERFORM 8000A-DELETE-GTT-ROWS THRU 8000A-EXIT             
           ELSE                                                         
               IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL               
                   NEXT SENTENCE                                        
               ELSE                                                     
                  MOVE PROGRAM-NAME         TO ABEND-PROGRAM            
                  MOVE SQLCODE              TO ABEND-SQLCODE            
                  MOVE SQLSTATE             TO ABEND-SQLSTATE           
                  MOVE '0100A'               TO ACTIVE-PARAGRAPH        
                  MOVE 'DECLARE GTT'        TO ABEND-FUNCTION           
                  MOVE SPACES               TO ABEND-SQL-PREDICATES     
                                               ABEND-TABLES             
                  MOVE 'CSR02068_R1'        TO TABLE-1                  
                  MOVE SPACES               TO TABLE-ELEMENT-1          
                  MOVE SPACES               TO HOSTVAR-ELEMENT-1        
                  PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT       
               END-IF                                                   
           END-IF.                                                      
CVT000 0100A-EXIT.                                                      
CVT000         EXIT.                                                    
                                                                        
033300******************************************************************03180000
033400* 1000-PROCESS-INPUT.                                            *03190000
033500*                                                                *03200000
033600*     1. RECEIVE PARMS.                                          *03210000
033700*                                                                *03220000
033800******************************************************************03230000
033900                                                                  
REARCH*1000-PROCESS-INPUT.                                              03250000
REARCH*    PERFORM 1100-RECEIVE-PARMS THRU 1100-EXIT.                   03260000
REARCH*1000-EXIT.                                                       03270000
REARCH*    EXIT.                                                        03280000
034400                                                                  
034500***************************************************************** 03300000
034600* 1100-RECEIVE-PARMS                                            * 03310000
034700*                                                               * 03320000
034800*     RECEIVE EACH PARAMETER FROM THE REMOTE PROCEDURE          * 03330000
034900*                                                               * 03340000
035000***************************************************************** 03350000
035100                                                                  
REARCH*1100-RECEIVE-PARMS.                                              03370000
CVT999*      MOVE 1                           TO PARM-ID1.              03380000
CVT999*      MOVE LENGTH OF PARM-ACCOUNT-NO TO MAX-LENGTH-PARM,         03390000
CVT999*      CALL 'TDRCVPRM' USING GWL-PROC,                            03400000
CVT999*                            GWL-RC,                              03410000
CVT999*                            PARM-ID1,                            03420000
CVT999*                            PARM-ACCOUNT-NO,                     03430000
CVT999*                            TDSCHAR,                             03440000
CVT999*                            MAX-LENGTH-PARM,                     03450000
CVT999*                            PARM-L.                              03460000
CVT999*      ADD  1                           TO PARM-ID1.              03470000
CVT999*      MOVE LENGTH OF PARM-DFA-TYPE   TO MAX-LENGTH-PARM,         03480000
CVT999*      CALL 'TDRCVPRM' USING GWL-PROC,                            03490000
CVT999*                            GWL-RC,                              03500000
CVT999*                            PARM-ID1,                            03510000
CVT999*                            PARM-DFA-TYPE,                       03520000
CVT999*                            TDSCHAR,                             03530000
CVT999*                            MAX-LENGTH-PARM,                     03540000
CVT999*                            PARM-L.                              03550000
037100                                                                  
REARCH*1100-EXIT.                                                       03570000
REARCH*    EXIT.                                                        03580000
037400                                                                  
037500******************************************************************03600000
037600* 2000-PROCESS-OUTPUT.                                           *03610000
037700*                                                                *03620000
037800*     1. DESCRIBE RESULT SET                                     *03630000
037900*     2. UPDATE DB2 DATA                                         *03640000
038000*     3. BUILD RESULT SET                                        *03650000
038100*     4. SEND RESULT SET                                         *03660000
038200*                                                                *03670000
038300******************************************************************03680000
038400                                                                  
038500 2000-PROCESS-OUTPUT.                                             
038600     MOVE '2000' TO ACTIVE-PARAGRAPH.                             
REARCH*    PERFORM 2100-DESCRIBE-RESULT THRU 2100-EXIT.                 03720000
038800     PERFORM 2200-PROCESS-FETCH   THRU 2200-EXIT.                 
038900     IF CTR-ROWS < 1                                              
039000        MOVE +100                   TO RS-RETURN-CODE             
REARCH        PERFORM 2000A-MOVE-RESULT   THRU 2000A-EXIT               
039100        PERFORM 8100-SEND-RESULT  THRU 8100-EXIT
           END-IF.                 
039200                                                                  
039300 2000-EXIT. EXIT.                                                 
039400                                                                  
REARCH******************************************************************13000001
REARCH*2000A-MOVE-RESULT.                                                       
REARCH******************************************************************13000001
REARCH 2000A-MOVE-RESULT.                                               
REARCH*                                                                         
REARCH     MOVE RS-RETURN-CODE             TO S-RETURN-CODE.            
REARCH     MOVE RS-DFA-ITEM-ID             TO S-DFA-ITEM-ID.            
REARCH     MOVE RS-DATE-OF-AGREE           TO S-DATE-OF-AGREE.          
REARCH     MOVE RS-AMT-MO-PYMT             TO S-AMT-MO-PYMT.            
REARCH     MOVE RS-DATE-PYMT-START         TO S-DATE-PYMT-START.        
REARCH     MOVE RS-NO-SCHED-PYMTS          TO S-NO-SCHED-PYMTS.         
REARCH     MOVE RS-AMT-ORIG-ENTERED        TO S-AMT-ORIG-ENTERED.       
REARCH     MOVE RS-CSR-USERID              TO S-CSR-USERID.             
REARCH     MOVE RS-CODE-DFA-STATUS         TO S-CODE-DFA-STATUS.        
REARCH     MOVE RS-RCNTLY-BLLD-MTH         TO S-RCNTLY-BLLD-MTH.        
REARCH     MOVE RS-AMT-UNDEFERD-RECV       TO S-AMT-UNDEFERD-RECV.      
REARCH     MOVE RS-CODE-DFA-DESC           TO S-CODE-DFA-DESC.          
REARCH     MOVE RS-REVERSE-REASON          TO S-REVERSE-REASON.         
REARCH     MOVE RS-PYMNT-ARNGMNT-CMTS-TEXT TO S-PYMNT-ARNGMNT-CMTS-TEXT.
REARCH     MOVE RS-LAST-BILLED-DATE        TO S-LAST-BILLED-DATE.       
REARCH     MOVE RS-LAST-INSTALLMENT        TO S-LAST-INSTALLMENT.       
REARCH     MOVE RS-END-DATE                TO S-END-DATE.               
REARCH     MOVE RS-AMT-EXTRA-DEPOSIT       TO S-AMT-EXTRA-DEPOSIT.      
REARCH     MOVE RS-CODE-COMPLY-HIST        TO S-CODE-COMPLY-HIST.       
REARCH     MOVE RS-FRST-ERNST-PAY-DT       TO S-FRST-ERNST-PAY-DT.      
REARCH     MOVE RS-FRST-ERNST-PAY-AMT      TO S-FRST-ERNST-PAY-AMT.     
REARCH     MOVE RS-SCND-ERNST-PAY-DT       TO S-SCND-ERNST-PAY-DT.      
REARCH     MOVE RS-SCND-ERNST-PAY-AMT      TO S-SCND-ERNST-PAY-AMT.     
REARCH     MOVE RS-DATE-CREDIT-ACTION      TO S-DATE-CREDIT-ACTION.     
REARCH     MOVE RS-LAST-UPDATE-TS          TO S-LAST-UPDATE-TS.         
REARCH     MOVE RS-CODE-DISC-OK            TO S-CODE-DISC-OK.           
REARCH     MOVE RS-CODE-ACCT-BILLED        TO S-CODE-ACCT-BILLED.       
REARCH     MOVE RS-OPT-READ-DATE           TO S-OPT-READ-DATE.          
REARCH     MOVE RS-BILL-CYCLE              TO S-BILL-CYCLE.             
REARCH     MOVE RS-USERS-NAME              TO S-USERS-NAME.             
REARCH     MOVE RS-CREDIT-GROUP            TO S-CREDIT-GROUP.           
REARCH     MOVE RS-SECOND-NEXT-READ        TO S-SECOND-NEXT-READ.       
REARCH     MOVE RS-AT-LAST-UPD-TS          TO S-AT-LAST-UPD-TS.         
REARCH*                                                                         
REARCH 2000A-EXIT.                                                      
REARCH     EXIT.                                                        
039500******************************************************************03800000
039600* 2100-DESCRIBE-RESULT                                           *03810000
039700*                                                                *03820000
039800*     DESCRIBE EACH COLUMN IN THE RESULT SET.                    *03830000
039900*                                                                *03840000
040000******************************************************************03850000
040100                                                                  
REARCH*2100-DESCRIBE-RESULT.                                            03870000
REARCH*    MOVE '2100' TO ACTIVE-PARAGRAPH.                             03880000
040400                                                                  
CVT999*    MOVE 1       TO CTR-COLUMN.                                  03900000
CVT999*    MOVE TDSINT4 TO DB-HOST-TYPE.                                03910000
CVT999*    MOVE TDSINT4 TO DB-CLIENT-TYPE.                              03920000
CVT999*    MOVE LENGTH OF RS-RETURN-CODE TO WRKLEN1.                    03930000
CVT999*    MOVE LENGTH OF CNS-RETURN-CODE TO WRKLEN2.                   03940000
041000                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03960000
CVT999*                          GWL-RC,                                03970000
CVT999*                          CTR-COLUMN,                            03980000
CVT999*                          DB-HOST-TYPE,                          03990000
CVT999*                          WRKLEN1,                               04000000
CVT999*                          RS-RETURN-CODE,                        04010000
CVT999*                          DB-NULL-INDICATOR,                     04020000
CVT999*                          TDS-FALSE,                             04030000
CVT999*                          DB-CLIENT-TYPE,                        04040000
CVT999*                          WRKLEN1,                               04050000
CVT999*                          CNS-RETURN-CODE,                       04060000
CVT999*                          WRKLEN2.                               04070000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04080000
CVT999*    ADD  1       TO CTR-COLUMN.                                  04090000
CVT999*    MOVE TDSINT4 TO DB-HOST-TYPE.                                04100000
CVT999*    MOVE TDSINT4 TO DB-CLIENT-TYPE.                              04110000
CVT999*    MOVE LENGTH OF RS-DFA-ITEM-ID TO WRKLEN1.                    04120000
CVT999*    MOVE LENGTH OF CNS-DFA-ITEM-ID TO WRKLEN2.                   04130000
042900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04150000
CVT999*                         GWL-RC,                                 04160000
CVT999*                          CTR-COLUMN,                            04170000
CVT999*                          DB-HOST-TYPE,                          04180000
CVT999*                          WRKLEN1,                               04190000
CVT999*                          RS-DFA-ITEM-ID,                        04200000
CVT999*                          DB-NULL-INDICATOR,                     04210000
CVT999*                          TDS-FALSE,                             04220000
CVT999*                          DB-CLIENT-TYPE,                        04230000
CVT999*                          WRKLEN1,                               04240000
CVT999*                          CNS-DFA-ITEM-ID,                       04250000
CVT999*                          WRKLEN2.                               04260000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04270000
CVT999*    ADD  1                                TO CTR-COLUMN.         04280000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       04290000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     04300000
CVT999*    MOVE LENGTH OF RS-DATE-OF-AGREE   TO WRKLEN1.                04310000
CVT999*    MOVE LENGTH OF CNS-DATE-OF-AGREE  TO WRKLEN2.                04320000
044800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04340000
CVT999*                         GWL-RC,                                 04350000
CVT999*                         CTR-COLUMN,                             04360000
CVT999*                         DB-HOST-TYPE,                           04370000
CVT999*                         WRKLEN1,                                04380000
CVT999*                         RS-DATE-OF-AGREE,                       04390000
CVT999*                         DB-NULL-INDICATOR,                      04400000
CVT999*                         TDS-FALSE,                              04410000
CVT999*                         DB-CLIENT-TYPE,                         04420000
CVT999*                         WRKLEN1,                                04430000
CVT999*                         CNS-DATE-OF-AGREE,                      04440000
CVT999*                         WRKLEN2.                                04450000
046100                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04470000
046300                                                                  
CVT999*    ADD 1        TO CTR-COLUMN.                                  04490000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             04500000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           04510000
CVT999*    MOVE LENGTH OF RS-AMT-MO-PYMT          TO WRKLEN1.           04520000
CVT999*    MOVE LENGTH OF CNS-AMT-MO-PYMT      TO WRKLEN2.              04530000
046900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04550000
CVT999*                           GWL-RC,                               04560000
CVT999*                           CTR-COLUMN,                           04570000
CVT999*                           DB-HOST-TYPE,                         04580000
CVT999*                           WRKLEN1,                              04590000
CVT999*                           RS-AMT-MO-PYMT,                       04600000
CVT999*                           DB-NULL-INDICATOR,                    04610000
CVT999*                           TDS-FALSE,                            04620000
CVT999*                           DB-CLIENT-TYPE,                       04630000
CVT999*                           WRKLEN1,                              04640000
CVT999*                           CNS-AMT-MO-PYMT,                      04650000
CVT999*                           WRKLEN2.                              04660000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04670000
CVT999*    MOVE +2 TO WRKLEN2.                                          04680000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              04690000
CVT999*                          GWL-RC,                                04700000
CVT999*                          TDS-OBJECT-COL,                        04710000
CVT999*                          CTR-COLUMN,                            04720000
CVT999*                          WRKLEN1,                               04730000
CVT999*                          WRKLEN2.                               04740000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04750000
049100                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         04770000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       04780000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     04790000
CVT999*    MOVE LENGTH OF RS-DATE-PYMT-START TO WRKLEN1.                04800000
CVT999*    MOVE LENGTH OF CNS-DATE-PYMT-START TO WRKLEN2.               04810000
049700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04830000
CVT999*                         GWL-RC,                                 04840000
CVT999*                         CTR-COLUMN,                             04850000
CVT999*                         DB-HOST-TYPE,                           04860000
CVT999*                         WRKLEN1,                                04870000
CVT999*                         RS-DATE-PYMT-START,                     04880000
CVT999*                         DB-NULL-INDICATOR,                      04890000
CVT999*                         TDS-FALSE,                              04900000
CVT999*                         DB-CLIENT-TYPE,                         04910000
CVT999*                         WRKLEN1,                                04920000
CVT999*                         CNS-DATE-PYMT-START,                    04930000
CVT999*                         WRKLEN2.                                04940000
051000                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04960000
051200                                                                  
CVT999*    ADD 1        TO CTR-COLUMN.                                  04980000
CVT999*    MOVE TDSINT4 TO DB-HOST-TYPE.                                04990000
CVT999*    MOVE TDSINT4 TO DB-CLIENT-TYPE.                              05000000
CVT999*    MOVE LENGTH OF RS-NO-SCHED-PYMTS TO WRKLEN1.                 05010000
CVT999*    MOVE LENGTH OF CNS-NO-SCHED-PYMTS TO WRKLEN2.                05020000
051800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              05040000
CVT999*                          GWL-RC,                                05050000
CVT999*                          CTR-COLUMN,                            05060000
CVT999*                          DB-HOST-TYPE,                          05070000
CVT999*                          WRKLEN1,                               05080000
CVT999*                          RS-NO-SCHED-PYMTS,                     05090000
CVT999*                          DB-NULL-INDICATOR,                     05100000
CVT999*                          TDS-FALSE,                             05110000
CVT999*                          DB-CLIENT-TYPE,                        05120000
CVT999*                          WRKLEN1,                               05130000
CVT999*                          CNS-NO-SCHED-PYMTS,                    05140000
CVT999*                          WRKLEN2.                               05150000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     05160000
053200                                                                  
CVT999*    ADD 1        TO CTR-COLUMN.                                  05180000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             05190000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           05200000
CVT999*    MOVE LENGTH OF RS-AMT-ORIG-ENTERED     TO WRKLEN1.           05210000
CVT999*    MOVE LENGTH OF CNS-AMT-ORIG-ENTERED TO WRKLEN2.              05220000
053800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              05240000
CVT999*                           GWL-RC,                               05250000
CVT999*                           CTR-COLUMN,                           05260000
CVT999*                           DB-HOST-TYPE,                         05270000
CVT999*                           WRKLEN1,                              05280000
CVT999*                           RS-AMT-ORIG-ENTERED,                  05290000
CVT999*                           DB-NULL-INDICATOR,                    05300000
CVT999*                           TDS-FALSE,                            05310000
CVT999*                           DB-CLIENT-TYPE,                       05320000
CVT999*                           WRKLEN1,                              05330000
CVT999*                           CNS-AMT-ORIG-ENTERED,                 05340000
CVT999*                           WRKLEN2.                              05350000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     05360000
CVT999*    MOVE +2 TO WRKLEN2.                                          05370000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              05380000
CVT999*                          GWL-RC,                                05390000
CVT999*                          TDS-OBJECT-COL,                        05400000
CVT999*                          CTR-COLUMN,                            05410000
CVT999*                          WRKLEN1,                               05420000
CVT999*                          WRKLEN2.                               05430000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     05440000
056000                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         05460000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       05470000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     05480000
CVT999*    MOVE LENGTH OF RS-CSR-USERID      TO WRKLEN1.                05490000
CVT999*    MOVE LENGTH OF CNS-CSR-USERID      TO WRKLEN2.               05500000
056600                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              05520000
CVT999*                         GWL-RC,                                 05530000
CVT999*                         CTR-COLUMN,                             05540000
CVT999*                         DB-HOST-TYPE,                           05550000
CVT999*                         WRKLEN1,                                05560000
CVT999*                         RS-CSR-USERID,                          05570000
CVT999*                         DB-NULL-INDICATOR,                      05580000
CVT999*                         TDS-FALSE,                              05590000
CVT999*                         DB-CLIENT-TYPE,                         05600000
CVT999*                         WRKLEN1,                                05610000
CVT999*                         CNS-CSR-USERID,                         05620000
CVT999*                         WRKLEN2.                                05630000
057900                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     05650000
058100                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         05670000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       05680000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     05690000
CVT999*    MOVE LENGTH OF RS-CODE-DFA-STATUS TO WRKLEN1.                05700000
CVT999*    MOVE LENGTH OF CNS-CODE-DFA-STATUS TO WRKLEN2.               05710000
058700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              05730000
CVT999*                         GWL-RC,                                 05740000
CVT999*                         CTR-COLUMN,                             05750000
CVT999*                         DB-HOST-TYPE,                           05760000
CVT999*                         WRKLEN1,                                05770000
CVT999*                         RS-CODE-DFA-STATUS,                     05780000
CVT999*                         DB-NULL-INDICATOR,                      05790000
CVT999*                         TDS-FALSE,                              05800000
CVT999*                         DB-CLIENT-TYPE,                         05810000
CVT999*                         WRKLEN1,                                05820000
CVT999*                         CNS-CODE-DFA-STATUS,                    05830000
CVT999*                         WRKLEN2.                                05840000
060000                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     05860000
060200                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         05880000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       05890000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     05900000
CVT999*    MOVE LENGTH OF RS-RCNTLY-BLLD-MTH TO WRKLEN1.                05910000
CVT999*    MOVE LENGTH OF CNS-RCNTLY-BLLD-MTH TO WRKLEN2.               05920000
060800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              05940000
CVT999*                         GWL-RC,                                 05950000
CVT999*                         CTR-COLUMN,                             05960000
CVT999*                         DB-HOST-TYPE,                           05970000
CVT999*                         WRKLEN1,                                05980000
CVT999*                         RS-RCNTLY-BLLD-MTH,                     05990000
CVT999*                         DB-NULL-INDICATOR,                      06000000
CVT999*                         TDS-FALSE,                              06010000
CVT999*                         DB-CLIENT-TYPE,                         06020000
CVT999*                         WRKLEN1,                                06030000
CVT999*                         CNS-RCNTLY-BLLD-MTH,                    06040000
CVT999*                         WRKLEN2.                                06050000
062100                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06070000
062300                                                                  
CVT999*    ADD 1        TO CTR-COLUMN.                                  06090000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             06100000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           06110000
CVT999*    MOVE LENGTH OF RS-AMT-UNDEFERD-RECV    TO WRKLEN1.           06120000
CVT999*    MOVE LENGTH OF CNS-AMT-UNDEFERD-RECV   TO WRKLEN2.           06130000
062900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              06150000
CVT999*                           GWL-RC,                               06160000
CVT999*                           CTR-COLUMN,                           06170000
CVT999*                           DB-HOST-TYPE,                         06180000
CVT999*                           WRKLEN1,                              06190000
CVT999*                           RS-AMT-UNDEFERD-RECV,                 06200000
CVT999*                           DB-NULL-INDICATOR,                    06210000
CVT999*                           TDS-FALSE,                            06220000
CVT999*                           DB-CLIENT-TYPE,                       06230000
CVT999*                           WRKLEN1,                              06240000
CVT999*                           CNS-AMT-UNDEFERD-RECV,                06250000
CVT999*                           WRKLEN2.                              06260000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06270000
CVT999*    MOVE +2 TO WRKLEN2.                                          06280000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              06290000
CVT999*                          GWL-RC,                                06300000
CVT999*                          TDS-OBJECT-COL,                        06310000
CVT999*                          CTR-COLUMN,                            06320000
CVT999*                          WRKLEN1,                               06330000
CVT999*                          WRKLEN2.                               06340000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06350000
065100                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         06370000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       06380000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     06390000
CVT999*    MOVE LENGTH OF RS-CODE-DFA-DESC TO WRKLEN1.                  06400000
CVT999*    MOVE LENGTH OF CNS-CODE-DFA-DESC TO WRKLEN2.                 06410000
065700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              06430000
CVT999*                         GWL-RC,                                 06440000
CVT999*                         CTR-COLUMN,                             06450000
CVT999*                         DB-HOST-TYPE,                           06460000
CVT999*                         WRKLEN1,                                06470000
CVT999*                         RS-CODE-DFA-DESC,                       06480000
CVT999*                         DB-NULL-INDICATOR,                      06490000
CVT999*                         TDS-FALSE,                              06500000
CVT999*                         DB-CLIENT-TYPE,                         06510000
CVT999*                         WRKLEN1,                                06520000
CVT999*                         CNS-CODE-DFA-DESC,                      06530000
CVT999*                         WRKLEN2.                                06540000
067000                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06560000
067200                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         06580000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       06590000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     06600000
CVT999*    MOVE LENGTH OF RS-REVERSE-REASON TO WRKLEN1.                 06610000
CVT999*    MOVE LENGTH OF CNS-REVERSE-REASON TO WRKLEN2.                06620000
067800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              06640000
CVT999*                         GWL-RC,                                 06650000
CVT999*                         CTR-COLUMN,                             06660000
CVT999*                         DB-HOST-TYPE,                           06670000
CVT999*                         WRKLEN1,                                06680000
CVT999*                         RS-REVERSE-REASON,                      06690000
CVT999*                         DB-NULL-INDICATOR,                      06700000
CVT999*                         TDS-FALSE,                              06710000
CVT999*                         DB-CLIENT-TYPE,                         06720000
CVT999*                         WRKLEN1,                                06730000
CVT999*                         CNS-REVERSE-REASON,                     06740000
CVT999*                         WRKLEN2.                                06750000
069100                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06770000
069300                                                                  
CVT999*    ADD 1                       TO CTR-COLUMN.                   06790000
CVT999*    MOVE TDSVARYCHAR            TO DB-HOST-TYPE.                 06800000
CVT999*    MOVE TDSVARYCHAR            TO DB-CLIENT-TYPE.               06810000
CVT999*    MOVE LENGTH OF RS-PYMNT-ARNGMNT-CMTS-TEXT TO WRKLEN1.        06820000
CVT999*    MOVE LENGTH OF CNS-PYMNT-ARNGMNT-CMTS TO WRKLEN2.            06830000
069900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              06850000
CVT999*                           GWL-RC,                               06860000
CVT999*                           CTR-COLUMN,                           06870000
CVT999*                           DB-HOST-TYPE,                         06880000
CVT999*                           WRKLEN1,                              06890000
CVT999*                           RS-PYMNT-ARNGMNT-CMTS,                06900000
CVT999*                           DB-NULL-INDICATOR,                    06910000
CVT999*                           TDS-FALSE,                            06920000
CVT999*                           DB-CLIENT-TYPE,                       06930000
CVT999*                           WRKLEN1,                              06940000
CVT999*                           CNS-PYMNT-ARNGMNT-CMTS,               06950000
CVT999*                           WRKLEN2.                              06960000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     06970000
071300                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         06990000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       07000000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     07010000
CVT999*    MOVE LENGTH OF RS-LAST-BILLED-DATE TO WRKLEN1.               07020000
CVT999*    MOVE LENGTH OF CNS-REVERSE-REASON TO WRKLEN2.                07030000
071900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              07050000
CVT999*                         GWL-RC,                                 07060000
CVT999*                         CTR-COLUMN,                             07070000
CVT999*                         DB-HOST-TYPE,                           07080000
CVT999*                         WRKLEN1,                                07090000
CVT999*                         RS-LAST-BILLED-DATE,                    07100000
CVT999*                         DB-NULL-INDICATOR,                      07110000
CVT999*                         TDS-FALSE,                              07120000
CVT999*                         DB-CLIENT-TYPE,                         07130000
CVT999*                         WRKLEN1,                                07140000
CVT999*                         CNS-LAST-BILLED-DATE,                   07150000
CVT999*                         WRKLEN2.                                07160000
073200                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07180000
CVT999*    ADD 1        TO CTR-COLUMN.                                  07190000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             07200000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           07210000
CVT999*    MOVE LENGTH OF RS-LAST-INSTALLMENT  TO WRKLEN1.              07220000
CVT999*    MOVE LENGTH OF CNS-LAST-INSTALLMENT TO WRKLEN2.              07230000
073900                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              07250000
CVT999*                           GWL-RC,                               07260000
CVT999*                           CTR-COLUMN,                           07270000
CVT999*                           DB-HOST-TYPE,                         07280000
CVT999*                           WRKLEN1,                              07290000
CVT999*                           RS-LAST-INSTALLMENT,                  07300000
CVT999*                           DB-NULL-INDICATOR,                    07310000
CVT999*                           TDS-FALSE,                            07320000
CVT999*                           DB-CLIENT-TYPE,                       07330000
CVT999*                           WRKLEN1,                              07340000
CVT999*                           CNS-LAST-INSTALLMENT,                 07350000
CVT999*                           WRKLEN2.                              07360000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07370000
CVT999*    MOVE +2 TO WRKLEN2.                                          07380000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              07390000
CVT999*                          GWL-RC,                                07400000
CVT999*                          TDS-OBJECT-COL,                        07410000
CVT999*                          CTR-COLUMN,                            07420000
CVT999*                          WRKLEN1,                               07430000
CVT999*                          WRKLEN2.                               07440000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07450000
076100                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         07470000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       07480000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     07490000
CVT999*    MOVE LENGTH OF RS-END-DATE         TO WRKLEN1.               07500000
CVT999*    MOVE LENGTH OF CNS-END-DATE       TO WRKLEN2.                07510000
076700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              07530000
CVT999*                         GWL-RC,                                 07540000
CVT999*                         CTR-COLUMN,                             07550000
CVT999*                         DB-HOST-TYPE,                           07560000
CVT999*                         WRKLEN1,                                07570000
CVT999*                         RS-END-DATE,                            07580000
CVT999*                         DB-NULL-INDICATOR,                      07590000
CVT999*                         TDS-FALSE,                              07600000
CVT999*                         DB-CLIENT-TYPE,                         07610000
CVT999*                         WRKLEN1,                                07620000
CVT999*                         CNS-END-DATE,                           07630000
CVT999*                         WRKLEN2.                                07640000
078000                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07660000
078200                                                                  
CVT999*    ADD 1        TO CTR-COLUMN.                                  07680000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             07690000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           07700000
CVT999*    MOVE LENGTH OF RS-AMT-EXTRA-DEPOSIT TO WRKLEN1.              07710000
CVT999*    MOVE LENGTH OF CNS-AMT-EXTRA-DEPOSIT TO WRKLEN2.             07720000
078800                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              07740000
CVT999*                           GWL-RC,                               07750000
CVT999*                           CTR-COLUMN,                           07760000
CVT999*                           DB-HOST-TYPE,                         07770000
CVT999*                           WRKLEN1,                              07780000
CVT999*                           RS-AMT-EXTRA-DEPOSIT,                 07790000
CVT999*                           DB-NULL-INDICATOR,                    07800000
CVT999*                           TDS-FALSE,                            07810000
CVT999*                           DB-CLIENT-TYPE,                       07820000
CVT999*                           WRKLEN1,                              07830000
CVT999*                           CNS-AMT-EXTRA-DEPOSIT,                07840000
CVT999*                           WRKLEN2.                              07850000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07860000
CVT999*    MOVE +2 TO WRKLEN2.                                          07870000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              07880000
CVT999*                          GWL-RC,                                07890000
CVT999*                          TDS-OBJECT-COL,                        07900000
CVT999*                          CTR-COLUMN,                            07910000
CVT999*                          WRKLEN1,                               07920000
CVT999*                          WRKLEN2.                               07930000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     07940000
081000                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         07960000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       07970000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     07980000
CVT999*    MOVE LENGTH OF RS-CODE-COMPLY-HIST TO WRKLEN1.               07990000
CVT999*    MOVE LENGTH OF CNS-CODE-COMPLY-HIST TO WRKLEN2.              08000000
081600                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              08020000
CVT999*                         GWL-RC,                                 08030000
CVT999*                         CTR-COLUMN,                             08040000
CVT999*                         DB-HOST-TYPE,                           08050000
CVT999*                         WRKLEN1,                                08060000
CVT999*                         RS-CODE-COMPLY-HIST,                    08070000
CVT999*                         DB-NULL-INDICATOR,                      08080000
CVT999*                         TDS-FALSE,                              08090000
CVT999*                         DB-CLIENT-TYPE,                         08100000
CVT999*                         WRKLEN1,                                08110000
CVT999*                         CNS-CODE-COMPLY-HIST,                   08120000
CVT999*                         WRKLEN2.                                08130000
082900                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     08150000
083100                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         08170000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       08180000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     08190000
CVT999*    MOVE LENGTH OF RS-FRST-ERNST-PAY-DT TO WRKLEN1.              08200000
CVT999*    MOVE LENGTH OF CNS-FRST-ERNST-PAY-DT TO WRKLEN2.             08210000
083700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              08230000
CVT999*                         GWL-RC,                                 08240000
CVT999*                         CTR-COLUMN,                             08250000
CVT999*                         DB-HOST-TYPE,                           08260000
CVT999*                         WRKLEN1,                                08270000
CVT999*                         RS-FRST-ERNST-PAY-DT,                   08280000
CVT999*                         DB-NULL-INDICATOR,                      08290000
CVT999*                         TDS-FALSE,                              08300000
CVT999*                         DB-CLIENT-TYPE,                         08310000
CVT999*                         WRKLEN1,                                08320000
CVT999*                         CNS-FRST-ERNST-PAY-DT,                  08330000
CVT999*                         WRKLEN2.                                08340000
085000                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     08360000
CVT999*    ADD 1        TO CTR-COLUMN.                                  08370000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             08380000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           08390000
CVT999*    MOVE LENGTH OF RS-FRST-ERNST-PAY-AMT TO WRKLEN1.             08400000
CVT999*    MOVE LENGTH OF CNS-FRST-ERNST-PAY-AMT TO WRKLEN2.            08410000
085700                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              08430000
CVT999*                           GWL-RC,                               08440000
CVT999*                           CTR-COLUMN,                           08450000
CVT999*                           DB-HOST-TYPE,                         08460000
CVT999*                           WRKLEN1,                              08470000
CVT999*                           RS-FRST-ERNST-PAY-AMT,                08480000
CVT999*                           DB-NULL-INDICATOR,                    08490000
CVT999*                           TDS-FALSE,                            08500000
CVT999*                           DB-CLIENT-TYPE,                       08510000
CVT999*                           WRKLEN1,                              08520000
CVT999*                           CNS-FRST-ERNST-PAY-AMT,               08530000
CVT999*                           WRKLEN2.                              08540000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     08550000
CVT999*    MOVE +2 TO WRKLEN2.                                          08560000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              08570000
CVT999*                          GWL-RC,                                08580000
CVT999*                          TDS-OBJECT-COL,                        08590000
CVT999*                          CTR-COLUMN,                            08600000
CVT999*                          WRKLEN1,                               08610000
CVT999*                          WRKLEN2.                               08620000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     08630000
087900                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         08650000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       08660000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     08670000
CVT999*    MOVE LENGTH OF RS-SCND-ERNST-PAY-DT TO WRKLEN1.              08680000
CVT999*    MOVE LENGTH OF CNS-SCND-ERNST-PAY-DT TO WRKLEN2.             08690000
088500                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              08710000
CVT999*                         GWL-RC,                                 08720000
CVT999*                         CTR-COLUMN,                             08730000
CVT999*                         DB-HOST-TYPE,                           08740000
CVT999*                         WRKLEN1,                                08750000
CVT999*                         RS-SCND-ERNST-PAY-DT,                   08760000
CVT999*                         DB-NULL-INDICATOR,                      08770000
CVT999*                         TDS-FALSE,                              08780000
CVT999*                         DB-CLIENT-TYPE,                         08790000
CVT999*                         WRKLEN1,                                08800000
CVT999*                         CNS-SCND-ERNST-PAY-DT,                  08810000
CVT999*                         WRKLEN2.                                08820000
089800                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     08840000
CVT999*    ADD 1        TO CTR-COLUMN.                                  08850000
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             08860000
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           08870000
CVT999*    MOVE LENGTH OF RS-SCND-ERNST-PAY-AMT TO WRKLEN1.             08880000
CVT999*    MOVE LENGTH OF CNS-SCND-ERNST-PAY-AMT TO WRKLEN2.            08890000
090500                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              08910000
CVT999*                           GWL-RC,                               08920000
CVT999*                           CTR-COLUMN,                           08930000
CVT999*                           DB-HOST-TYPE,                         08940000
CVT999*                           WRKLEN1,                              08950000
CVT999*                           RS-SCND-ERNST-PAY-AMT,                08960000
CVT999*                           DB-NULL-INDICATOR,                    08970000
CVT999*                           TDS-FALSE,                            08980000
CVT999*                           DB-CLIENT-TYPE,                       08990000
CVT999*                           WRKLEN1,                              09000000
CVT999*                           CNS-SCND-ERNST-PAY-AMT,               09010000
CVT999*                           WRKLEN2.                              09020000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09030000
CVT999*    MOVE +2 TO WRKLEN2.                                          09040000
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              09050000
CVT999*                          GWL-RC,                                09060000
CVT999*                          TDS-OBJECT-COL,                        09070000
CVT999*                          CTR-COLUMN,                            09080000
CVT999*                          WRKLEN1,                               09090000
CVT999*                          WRKLEN2.                               09100000
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09110000
092700                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09130000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09140000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09150000
CVT999*    MOVE LENGTH OF RS-DATE-CREDIT-ACTION  TO WRKLEN1.            09160000
CVT999*    MOVE LENGTH OF CNS-DATE-CREDIT-ACTION TO WRKLEN2.            09170000
093300                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09190000
CVT999*                         GWL-RC,                                 09200000
CVT999*                         CTR-COLUMN,                             09210000
CVT999*                         DB-HOST-TYPE,                           09220000
CVT999*                         WRKLEN1,                                09230000
CVT999*                         RS-DATE-CREDIT-ACTION,                  09240000
CVT999*                         DB-NULL-INDICATOR,                      09250000
CVT999*                         TDS-FALSE,                              09260000
CVT999*                         DB-CLIENT-TYPE,                         09270000
CVT999*                         WRKLEN1,                                09280000
CVT999*                         CNS-DATE-CREDIT-ACTION,                 09290000
CVT999*                         WRKLEN2.                                09300000
094600                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09320000
094800                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09340000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09350000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09360000
CVT999*    MOVE LENGTH OF RS-LAST-UPDATE-TS    TO WRKLEN1.              09370000
CVT999*    MOVE LENGTH OF CNS-LAST-UPDATE-TS    TO WRKLEN2.             09380000
095400                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09400000
CVT999*                         GWL-RC,                                 09410000
CVT999*                         CTR-COLUMN,                             09420000
CVT999*                         DB-HOST-TYPE,                           09430000
CVT999*                         WRKLEN1,                                09440000
CVT999*                         RS-LAST-UPDATE-TS,                      09450000
CVT999*                         DB-NULL-INDICATOR,                      09460000
CVT999*                         TDS-FALSE,                              09470000
CVT999*                         DB-CLIENT-TYPE,                         09480000
CVT999*                         WRKLEN1,                                09490000
CVT999*                         CNS-LAST-UPDATE-TS,                     09500000
CVT999*                         WRKLEN2.                                09510000
096700                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09530000
096900                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09550000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09560000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09570000
CVT999*    MOVE LENGTH OF RS-CODE-DISC-OK        TO WRKLEN1.            09580000
CVT999*    MOVE LENGTH OF CNS-CODE-DISC-OK       TO WRKLEN2.            09590000
PCR136                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09610000
CVT999*                         GWL-RC,                                 09620000
CVT999*                         CTR-COLUMN,                             09630000
CVT999*                         DB-HOST-TYPE,                           09640000
CVT999*                         WRKLEN1,                                09650000
CVT999*                         RS-CODE-DISC-OK,                        09660000
CVT999*                         DB-NULL-INDICATOR,                      09670000
CVT999*                         TDS-FALSE,                              09680000
CVT999*                         DB-CLIENT-TYPE,                         09690000
CVT999*                         WRKLEN1,                                09691000
CVT999*                         CNS-CODE-DISC-OK,                       09692000
CVT999*                         WRKLEN2.                                09693000
PCR136                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09695000
PCR136                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09697000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09698000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09699000
CVT999*    MOVE LENGTH OF RS-CODE-ACCT-BILLED    TO WRKLEN1.            09699100
CVT999*    MOVE LENGTH OF CNS-CODE-ACCT-BILLED   TO WRKLEN2.            09699200
PCR328                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09699400
CVT999*                         GWL-RC,                                 09699500
CVT999*                         CTR-COLUMN,                             09699600
CVT999*                         DB-HOST-TYPE,                           09699700
CVT999*                         WRKLEN1,                                09699800
CVT999*                         RS-CODE-ACCT-BILLED,                    09699900
CVT999*                         DB-NULL-INDICATOR,                      09700000
CVT999*                         TDS-FALSE,                              09700100
CVT999*                         DB-CLIENT-TYPE,                         09700200
CVT999*                         WRKLEN1,                                09700300
CVT999*                         CNS-CODE-ACCT-BILLED,                   09700400
CVT999*                         WRKLEN2.                                09700500
PCR328                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09700700
PCR328                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09700900
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09701000
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09701100
CVT999*    MOVE LENGTH OF RS-OPT-READ-DATE       TO WRKLEN1.            09701200
CVT999*    MOVE LENGTH OF CNS-OPT-READ-DATE      TO WRKLEN2.            09701300
TP5120                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09701500
CVT999*                         GWL-RC,                                 09701600
CVT999*                         CTR-COLUMN,                             09701700
CVT999*                         DB-HOST-TYPE,                           09701800
CVT999*                         WRKLEN1,                                09701900
CVT999*                         RS-OPT-READ-DATE,                       09702000
CVT999*                         DB-NULL-INDICATOR,                      09702100
CVT999*                         TDS-FALSE,                              09702200
CVT999*                         DB-CLIENT-TYPE,                         09702300
CVT999*                         WRKLEN1,                                09702400
CVT999*                         CNS-OPT-READ-DATE,                      09702500
CVT999*                         WRKLEN2.                                09702600
TP5120                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09702800
TP5120                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09703000
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09703100
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09703200
CVT999*    MOVE LENGTH OF RS-BILL-CYCLE          TO WRKLEN1.            09703300
CVT999*    MOVE LENGTH OF CNS-BILL-CYCLE         TO WRKLEN2.            09703400
TP7987                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09703600
CVT999*                         GWL-RC,                                 09703700
CVT999*                         CTR-COLUMN,                             09703800
CVT999*                         DB-HOST-TYPE,                           09703900
CVT999*                         WRKLEN1,                                09704000
CVT999*                         RS-BILL-CYCLE,                          09704100
CVT999*                         DB-NULL-INDICATOR,                      09704200
CVT999*                         TDS-FALSE,                              09704300
CVT999*                         DB-CLIENT-TYPE,                         09704400
CVT999*                         WRKLEN1,                                09704500
CVT999*                         CNS-BILL-CYCLE,                         09704600
CVT999*                         WRKLEN2.                                09704700
TP7987                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09704900
TP5120                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09705100
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09705200
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09705300
CVT999*    MOVE LENGTH OF RS-USERS-NAME          TO WRKLEN1.            09705400
CVT999*    MOVE LENGTH OF CNS-USERS-NAME         TO WRKLEN2.            09705500
TP7987                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09705700
CVT999*                         GWL-RC,                                 09705800
CVT999*                         CTR-COLUMN,                             09705900
CVT999*                         DB-HOST-TYPE,                           09706000
CVT999*                         WRKLEN1,                                09706100
CVT999*                         RS-USERS-NAME,                          09706200
CVT999*                         DB-NULL-INDICATOR,                      09706300
CVT999*                         TDS-FALSE,                              09706400
CVT999*                         DB-CLIENT-TYPE,                         09706500
CVT999*                         WRKLEN1,                                09706600
CVT999*                         CNS-USERS-NAME,                         09706700
CVT999*                         WRKLEN2.                                09706800
TP7987                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09707000
T12513                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.         09708200
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.       09708300
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.     09708400
CVT999*    MOVE LENGTH OF RS-CREDIT-GROUP        TO WRKLEN1.            09708500
CVT999*    MOVE LENGTH OF CNS-CREDIT-GROUP       TO WRKLEN2.            09708600
T12513                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              09708800
CVT999*                         GWL-RC,                                 09708900
CVT999*                         CTR-COLUMN,                             09709000
CVT999*                         DB-HOST-TYPE,                           09709100
CVT999*                         WRKLEN1,                                09709200
CVT999*                         RS-CREDIT-GROUP,                        09709300
CVT999*                         DB-NULL-INDICATOR,                      09709400
CVT999*                         TDS-FALSE,                              09709500
CVT999*                         DB-CLIENT-TYPE,                         09709600
CVT999*                         WRKLEN1,                                09709700
CVT999*                         CNS-CREDIT-GROUP,                       09709800
CVT999*                         WRKLEN2.                                09709900
T12513                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     09710100
051200                                                                  
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-SECOND-NEXT-READ    TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-SECOND-NEXT-READ   TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                         GWL-RC,                                         
CVT999*                         CTR-COLUMN,                                     
CVT999*                         DB-HOST-TYPE,                                   
CVT999*                         WRKLEN1,                                        
CVT999*                         RS-SECOND-NEXT-READ,                            
CVT999*                         DB-NULL-INDICATOR,                              
CVT999*                         TDS-FALSE,                                      
CVT999*                         DB-CLIENT-TYPE,                                 
CVT999*                         WRKLEN1,                                        
CVT999*                         CNS-SECOND-NEXT-READ,                           
CVT999*                         WRKLEN2.                                        
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
T21107*                                                                         
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-AT-LAST-UPD-TS     TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-AT-LAST-UPD-TS    TO WRKLEN2.                     
T21107                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-AT-LAST-UPD-TS,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-AT-LAST-UPD-TS,                            
CVT999*                          WRKLEN2.                                       
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
053800                                                                  
REARCH*2100-EXIT.                                                       09710400
REARCH*    EXIT.                                                        09711000
097200                                                                  
097300 2200-PROCESS-FETCH.                                              
097400     MOVE PARM-ACCOUNT-NO   TO WS-ACCOUNT-NO.                     
097500     MOVE WS-ACCOUNT-NO   TO WS-ACCOUNT-NO-NUM.                   
097600     MOVE WS-ACCOUNT-NO-NUM TO DA-ACCOUNT-NO.                     
097700     MOVE WS-ACCOUNT-NO-NUM TO AT-ACCOUNT-NO.                     
097800     MOVE PARM-DFA-TYPE       TO DA-CODE-DFA-TYPE.                
097900     PERFORM 7300-SELECT-LAST-BILLED-DATE THRU 7300-EXIT.         
T20242     IF AT-BILL-CYCLE = '00'                                      
T20242        MOVE 3000                 TO RS-RETURN-CODE               
REARCH        PERFORM 2000A-MOVE-RESULT THRU 2000A-EXIT                 
T20242        PERFORM 8100-SEND-RESULT  THRU 8100-EXIT                  
T20242        PERFORM 9999-END-PROGRAM  THRU 9999-EXIT                  
T20242     END-IF.                                                      
T12316     IF WS-NULL-DATE EQUAL -1                                     
T12316        MOVE SPACES              TO RS-LAST-BILLED-DATE           
T12316     ELSE                                                         
T12316        MOVE AT-DATE-BILL-DAY-00 TO RS-LAST-BILLED-DATE           
T12316     END-IF.                                                      
098000     MOVE AT-BILL-CYCLE          TO RS-BILL-CYCLE.                
T12513     MOVE AT-CREDIT-GROUP        TO RS-CREDIT-GROUP.              
PCR328     MOVE AT-CODE-ACCT-BILLED    TO RS-CODE-ACCT-BILLED.          
PCR136     MOVE AT-CODE-DISC-OK        TO RS-CODE-DISC-OK.              
T21107     MOVE AT-LAST-UPDATE-TS      TO RS-AT-LAST-UPD-TS.            
098100     MOVE ZEROS                  TO RS-LAST-INSTALLMENT.          
098200     MOVE SPACES                 TO RS-END-DATE.                  
                                                                        
           PERFORM 5900-NEXT-BILL-DATE                                  
              THRU 5900-NEXT-BILL-DATE-EXIT.                            
                                                                        
T10810* OPT-READ-DATE IS STILL BEING RETURNED BUT IT CONTAINS THE       09713400
T10810* THE NEXT BILL DATE NOT THE NEXT READ DATE.                      09713500
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              MOVE BN-DATE-EXTRACT       TO WS-DATE-CCYY-MM-DD          
              MOVE WS-DATE-CCYY          TO WS-DATE2-CCYY               
              MOVE WS-DATE-MM            TO WS-DATE2-MM                 
              MOVE WS-DATE-DD            TO WS-DATE2-DD                 
              MOVE WS-DATE-MM-DD-YYYY    TO RS-OPT-READ-DATE            
           ELSE                                                         
              MOVE SPACES                TO RS-OPT-READ-DATE            
           END-IF                                                       
T18482     MOVE AT-BILL-CYCLE            TO BN-BILL-CYCLE               
                                            RW-READ-CYCLE.              
T21995*    PERFORM 7301-READ-WINDOW      THRU 7301-EXIT.                        
TP5120*                                                                 09714500
           PERFORM 7200-OPEN-DA-CURSOR THRU 7200-EXIT.                  
098400     PERFORM 7210-FETCH-CURSOR  THRU 7210-EXIT                    
098500        UNTIL WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND.              
098600     PERFORM 7220-CLOSE-DA-CURSOR THRU 7220-EXIT.                 
098700                                                                  
098800 2200-EXIT.                                                       
098900     EXIT.                                                        
099000                                                                  
TP7987 2500-PROCESS-NAME.                                               
      *                                                                 09740001
T13759     PERFORM 7400-SELECT-USER-PROFILE           THRU 7400-EXIT.   
      *                                                                 09740201
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T10976         IF PF-FIRST-NAME > SPACES                                
TP7987            MOVE PF-FIRST-NAME  TO WS-FROM                        
TP7987            PERFORM 2510-PROCESS-FROM-STRING    THRU 2510-EXIT    
TP7987            MOVE WS-FROM        TO PF-FIRST-NAME                  
T10976         ELSE                                                     
T10976            MOVE PF-LAST-NAME   TO RS-USERS-NAME                  
T10976            GO TO 2500-EXIT                                       
T10976         END-IF                                                   
TP7987                                                                  
TP7987         MOVE PF-LAST-NAME      TO WS-FROM                        
TP7987         PERFORM 2510-PROCESS-FROM-STRING       THRU 2510-EXIT    
TP7987         MOVE WS-FROM           TO PF-LAST-NAME                   
TP7987                                                                  
TP7987         IF PF-MIDDLE-NAME NOT = SPACES                           
TP7987            MOVE PF-MIDDLE-NAME TO WS-FROM                        
TP7987            PERFORM 2510-PROCESS-FROM-STRING    THRU 2510-EXIT    
TP7987            MOVE WS-FROM        TO PF-MIDDLE-NAME                 
TP7987         END-IF                                                   
T10976                                                                  
TP7987         STRING PF-LAST-NAME DELIMITED CN-DELIMITER               
TP7987           ', ' DELIMITED SIZE                                    
TP7987           PF-FIRST-NAME DELIMITED CN-DELIMITER                   
TP7987           ' ' DELIMITED SIZE                                     
TP7987           PF-MIDDLE-NAME(1:1) DELIMITED SIZE                     
TP7987         INTO RS-USERS-NAME                                       
TP7987         END-STRING                                               
      *                                                                 09904201
           ELSE                                                         
               MOVE DA-CSR-USERID      TO RS-USERS-NAME                 
           END-IF.                                                      
TP7987                                                                  
TP7987 2500-EXIT.                                                       
TP7987                                                                  
TP7987 2510-PROCESS-FROM-STRING.                                        
TP7987                                                                  
TP7987     PERFORM                                                      
TP7987        VARYING WS-SUB FROM 15 BY -1                              
TP7987            UNTIL WS-SUB < 1                                      
TP7987            OR WS-FROM-X(WS-SUB) NOT = SPACE                      
TP7987     END-PERFORM.                                                 
TP7987     ADD 1      TO   WS-SUB.                                      
TP7987     MOVE CN-DELIMITER  TO WS-FROM-X(WS-SUB).                     
TP7987                                                                  
TP7987 2510-EXIT.                                                       
099000                                                                  
099100 7200-OPEN-DA-CURSOR.                                             
099200     EXEC SQL                                                     
099300          OPEN DFA-CURSOR                                         
099400     END-EXEC.                                                    

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

099500     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
099600     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
099700         NEXT SENTENCE                                            
099800     ELSE                                                         
099900        MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
100000        MOVE '7200'              TO ACTIVE-PARAGRAPH              
100100        MOVE 'OPEN'              TO ABEND-FUNCTION                
100200        MOVE SPACES              TO ABEND-SQL-PREDICATES          
100300                                    ABEND-TABLES                  
100400        MOVE 'CSS_DFA_ACCT'      TO TABLE-1                       
T16088        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
T16088        MOVE 'PYMT_PRIORITY_LVL' TO TABLE-ELEMENT-2               
T16088        MOVE 'DFA ITEM ID'       TO TABLE-ELEMENT-3               
T16088        MOVE  PARM-ACCOUNT-NO    TO HOSTVAR-ELEMENT-1             
T16088        MOVE  90                 TO HOSTVAR-ELEMENT-2             
100500        MOVE  DA-DFA-ITEM-ID     TO HOSTVAR-ELEMENT-3             
100600        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
100700        PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT
           END-IF.          
100800                                                                  
100900 7200-EXIT.                                                       
101000     EXIT.                                                        
101100                                                                  
101200 7210-FETCH-CURSOR.                                               
101300     EXEC SQL                                                     
101400        FETCH DFA-CURSOR                                          
101500        INTO :DA-DFA-ITEM-ID,                                     
101600             :DA-DATE-OF-AGREE :WS-DATE-OF-AGREE-NI,               
101700             :WS-DATE-OF-AGREE :WS-DATE-OF-AGREE-NI,               
101800             :DA-AMT-MO-PYMT,                                     
101900             :DA-DATE-PYMT-START :WS-DATE-PYMT-START-NI,           
102000             :DA-NO-SCHED-PYMTS,                                  
102100             :DA-AMT-ORIG-ENTERED,                                
102200             :DA-CSR-USERID,                                      
102300             :DA-CODE-DFA-STATUS,                                 
102400             :DA-RCNTLY-BLLD-MTH,                                 
102500             :DA-AMT-UNDEFERD-RECV,                               
102600             :DA-CODE-DFA-DESC,                                   
102700             :DA-REVERSE-REASON,                                  
102800             :DA-PYMNT-ARNGMNT-CMTS,                              
102900             :DA-AMT-EXTRA-DEPOSIT,                               
103000             :DA-CODE-COMPLY-HIST,                                
103100             :DA-FRST-ERNST-PAY-DT :WS-FRST-ERNST-PAY-DT-NI,       
103200             :DA-FRST-ERNST-PAY-AMT,                              
103300             :DA-SCND-ERNST-PAY-DT :WS-SCND-ERNST-PAY-DT-NI,       
103400             :DA-SCND-ERNST-PAY-AMT,                              
103500             :DA-LAST-UPDATE-TS                                   
103600     END-EXEC.                                                    

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

103700                                                                  
103800     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
      *                                                                 10251000
103900     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
      *                                                                 10261000
104000         MOVE DA-DFA-ITEM-ID        TO RS-DFA-ITEM-ID             
      *                                                                 10271000
104100         IF WS-DATE-OF-AGREE-NI = -1                              
104200            MOVE SPACES             TO RS-DATE-OF-AGREE           
104300         ELSE                                                     
104400            MOVE DA-DATE-OF-AGREE   TO RS-DATE-OF-AGREE           
104500         END-IF                                                   
      *                                                                 10321000
104600         MOVE DA-AMT-MO-PYMT        TO RS-AMT-MO-PYMT             
      *                                                                 10331000
104700         IF WS-DATE-PYMT-START-NI = -1                            
104800            MOVE SPACES             TO RS-DATE-PYMT-START         
104900         ELSE                                                     
105000            MOVE DA-DATE-PYMT-START TO RS-DATE-PYMT-START         
T21995                                       WS-DATE-MM-DD-YYYY         
T21995            MOVE WS-DATE2-MM        TO WS-DATE-MM                 
T21995            MOVE WS-DATE2-DD        TO WS-DATE-DD                 
T21995            MOVE WS-DATE2-CCYY      TO WS-DATE-CCYY               
105100         END-IF                                                   
      *                                                                 10381000
105200         MOVE DA-NO-SCHED-PYMTS     TO RS-NO-SCHED-PYMTS          
105300         MOVE DA-AMT-ORIG-ENTERED   TO RS-AMT-ORIG-ENTERED        
105400         MOVE DA-CSR-USERID         TO RS-CSR-USERID              
105500         MOVE DA-CODE-DFA-STATUS    TO RS-CODE-DFA-STATUS         
105600         MOVE DA-RCNTLY-BLLD-MTH    TO RS-RCNTLY-BLLD-MTH         
105700         MOVE DA-AMT-UNDEFERD-RECV  TO RS-AMT-UNDEFERD-RECV       
105800         MOVE DA-CODE-DFA-DESC      TO RS-CODE-DFA-DESC           
105900         MOVE DA-REVERSE-REASON     TO RS-REVERSE-REASON          
      *                                                                 10461000
106000         MOVE DA-PYMNT-ARNGMNT-CMTS-LEN                           
106100                                    TO RS-PYMNT-ARNGMNT-CMTS-LEN  
106200         MOVE DA-PYMNT-ARNGMNT-CMTS-TEXT                          
106300                                    TO RS-PYMNT-ARNGMNT-CMTS-TEXT 
106200         MOVE DA-PYMNT-ARNGMNT-CMTS-TEXT                          
106300                                    TO WS-PYMNT-ARNGMNT-CMTS      
106400         MOVE DA-AMT-EXTRA-DEPOSIT  TO RS-AMT-EXTRA-DEPOSIT       
      *                                                                 10511000
106500         MOVE DA-CODE-COMPLY-HIST   TO RS-CODE-COMPLY-HIST        
      *                                                                 10521000
106600         IF WS-FRST-ERNST-PAY-DT-NI = -1                          
106700            MOVE SPACES             TO RS-FRST-ERNST-PAY-DT       
106800         ELSE                                                     
106900            MOVE DA-FRST-ERNST-PAY-DT                             
                                          TO RS-FRST-ERNST-PAY-DT       
107000         END-IF                                                   
      *                                                                 10571000
107100         IF WS-SCND-ERNST-PAY-DT-NI = -1                          
107200            MOVE SPACES             TO RS-SCND-ERNST-PAY-DT       
107300         ELSE                                                     
107400            MOVE DA-SCND-ERNST-PAY-DT                             
                                          TO RS-SCND-ERNST-PAY-DT       
107500         END-IF                                                   
      *                                                                 10621000
107600         IF PARM-DFA-TYPE = 'B'                                   
107700            PERFORM 7215-SELECT-CRED-COLL       THRU 7215-EXIT    
107800         ELSE                                                     
107900            MOVE SPACES             TO RS-DATE-CREDIT-ACTION      
108000         END-IF                                                   
      *                                                                 10671000
108200         MOVE DA-FRST-ERNST-PAY-AMT  TO RS-FRST-ERNST-PAY-AMT     
108300         MOVE DA-SCND-ERNST-PAY-AMT  TO RS-SCND-ERNST-PAY-AMT     
108400         MOVE DA-LAST-UPDATE-TS      TO RS-LAST-UPDATE-TS         
T21995                                                                  
T21995         IF WS-DATE-CCYY-MM-DD > BN-DATE-EXTRACT                  
T21995            MOVE WS-DATE-CCYY-MM-DD TO BN-DATE-EXTRACT            
T21995         END-IF                                                   
T21995                                                                  
T21995         PERFORM 7301-READ-WINDOW      THRU 7301-EXIT             
      *                                                                 10701000
TP7987         PERFORM 2500-PROCESS-NAME              THRU 2500-EXIT    
      *                                                                 10711000
108500         ADD 1 TO WS-ROW-COUNT                                    
      *                                                                 10721000
REARCH         PERFORM 2000A-MOVE-RESULT              THRU 2000A-EXIT   
108600         PERFORM 8100-SEND-RESULT               THRU 8100-EXIT    
P00253         INITIALIZE    DA-PYMNT-ARNGMNT-CMTS                      
      *                                                                 10731000
108700     ELSE                                                         
      *                                                                 10741000
108800     IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
108900        GO TO 7210-EXIT                                           
109000     ELSE                                                         
109100        MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
109200        MOVE '7210'              TO ACTIVE-PARAGRAPH              
109300        MOVE 'FETCH'             TO ABEND-FUNCTION                
109400        MOVE SPACES              TO ABEND-SQL-PREDICATES          
109500                                    ABEND-TABLES                  
109600        MOVE 'CSS_DFA_ACCT'      TO TABLE-1                       
T16088        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
T16088        MOVE 'PYMT_PRIORITY_LVL' TO TABLE-ELEMENT-2               
T16088        MOVE 'DFA ITEM ID'       TO TABLE-ELEMENT-3               
T16088        MOVE  PARM-ACCOUNT-NO    TO HOSTVAR-ELEMENT-1             
T16088        MOVE  90                 TO HOSTVAR-ELEMENT-2             
T16088        MOVE  DA-DFA-ITEM-ID     TO HOSTVAR-ELEMENT-3             
109800        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
109900        PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT
           END-IF
           END-IF.          
110000                                                                  
110100 7210-EXIT.                                                       
110200     EXIT.                                                        
110300*                                                                 10900000
110400 7215-SELECT-CRED-COLL.                                           
110500     EXEC SQL                                                     
F21995*       SELECT COALESCE(CHAR(MIN(DATE_CREDIT_ACTION),USA),        02510200
F21995*                      '01/01/1900')                              02510200
F21995        SELECT CIS.CHAR2$DATE(MIN(DATE_CREDIT_ACTION),'USA')              
110700          INTO :CL-DATE-CREDIT-ACTION :WS-DATE-CREDIT-ACTION-NI    
110800          FROM CSS_CRED_COLL                                      
110900         WHERE ACCOUNT_NO        = :DA-ACCOUNT-NO                 
T10382           AND CODE_SPECIAL_TYPE = 'D'                            
T10382           AND CODE_NOTICE_TYPE  = 'G'                            
111100     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ029
MFA-TR*    EXEC SQL                                                     10920000
MFA-TR*       SELECT COALESCE(CHAR(MIN(DATE_CREDIT_ACTION),USA),        02510200
MFA-TR*                      '01/01/1900')                              02510200
MFA-TR*       SELECT CHAR(MIN(DATE_CREDIT_ACTION),USA)                  02510200
MFA-TR*         INTO :CL-DATE-CREDIT-ACTION:WS-DATE-CREDIT-ACTION-NI    10940000
MFA-TR*         FROM CSS_CRED_COLL                                      10950000
MFA-TR*        WHERE ACCOUNT_NO        = :DA-ACCOUNT-NO                 10960000
MFA-TR*          AND CODE_SPECIAL_TYPE = 'D'                            10970000
MFA-TR*          AND CODE_NOTICE_TYPE  = 'G'                            10980000
MFA-TR*    END-EXEC.                                                    10990000

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

111200     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
111300     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
111400         IF WS-DATE-CREDIT-ACTION-NI = -1                         
111500            MOVE SPACES   TO RS-DATE-CREDIT-ACTION                
111600         ELSE                                                     
111700            MOVE CL-DATE-CREDIT-ACTION TO RS-DATE-CREDIT-ACTION   
111800         END-IF                                                   
111900                                                                  
112000     ELSE                                                         
112100     IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
112200        MOVE 0                   TO SQLCODE                       
112300                                    WS-ACTIVE-RETURN-CODE         
112400        GO TO 7215-EXIT                                           
112500     ELSE                                                         
112600        MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
112700        MOVE '7215'              TO ACTIVE-PARAGRAPH              
112800        MOVE 'SELECT'            TO ABEND-FUNCTION                
112900        MOVE SPACES              TO ABEND-SQL-PREDICATES          
113000                                    ABEND-TABLES                  
113100        MOVE 'CSS_CRED_COLL'     TO TABLE-1                       
T16088        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
T16088        MOVE 'CODE_SPECIAL_TYPE' TO TABLE-ELEMENT-2               
T16088        MOVE 'CODE_NOTICE_TYPE'  TO TABLE-ELEMENT-3               
T16088        MOVE  PARM-ACCOUNT-NO    TO HOSTVAR-ELEMENT-1             
T16088        MOVE  'D'                TO HOSTVAR-ELEMENT-2             
T16088        MOVE  'G'                TO HOSTVAR-ELEMENT-3             
113300        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
113400        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT
           END-IF
           END-IF.           
113500                                                                  
113600 7215-EXIT.                                                       
113700     EXIT.                                                        
TP5120                                                                  
113900 7220-CLOSE-DA-CURSOR.                                            
114000     EXEC SQL                                                     
114100          CLOSE DFA-CURSOR                                        
114200     END-EXEC.                                                    

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

114300     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
114400     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
114500         NEXT SENTENCE                                            
114600     ELSE                                                         
114700        MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
114800        MOVE '7220'              TO ACTIVE-PARAGRAPH              
114900        MOVE 'CLOSE'             TO ABEND-FUNCTION                
115000        MOVE SPACES              TO ABEND-SQL-PREDICATES          
115100                                    ABEND-TABLES                  
115200        MOVE 'CSS_DFA_ACCT'      TO TABLE-1                       
T16088        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
T16088        MOVE 'PYMT_PRIORITY_LVL' TO TABLE-ELEMENT-2               
T16088        MOVE 'DFA ITEM ID'       TO TABLE-ELEMENT-3               
T16088        MOVE  PARM-ACCOUNT-NO    TO HOSTVAR-ELEMENT-1             
T16088        MOVE  90                 TO HOSTVAR-ELEMENT-2             
T16088        MOVE  DA-DFA-ITEM-ID     TO HOSTVAR-ELEMENT-3             
115400        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
115500        PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT
           END-IF.          
115600                                                                  
115700 7220-EXIT.                                                       
115800     EXIT.                                                        
115900                                                                  
116000 7300-SELECT-LAST-BILLED-DATE.                                    
116100     EXEC SQL                                                     
C37440          SELECT COALESCE(CIS.CHAR2$DATE(DATE_BILL_DAY_00,'USA'),         
C37440                       '01/01/1900'),                             
PCR136                 CODE_DISC_OK,                                    
PCR328                 CODE_ACCT_BILLED,                                
                       BILL_CYCLE,                                      
T10810                 CODE_BILL_FREQ,                                  
T10810                 REV_MTH_LST_NRML,                                
T12513                 CREDIT_GROUP,                                    
T10810                 CAST(SYSDATETIMEOFFSET() AS DATE),                       
T21107                 REPLACE(REPLACE(CONVERT(CHAR(26), LAST_UPDATE_TS
           , 121), ' ', '-'), ':', '.') LAST_UPDATE_TS                         
T12316          INTO :AT-DATE-BILL-DAY-00 :WS-NULL-DATE,                 
PCR136               :AT-CODE-DISC-OK,                                  
PCR328               :AT-CODE-ACCT-BILLED,                              
                     :AT-BILL-CYCLE,                                    
T10810               :AT-CODE-BILL-FREQ,                                
T10810               :AT-REV-MTH-LST-NRML,                              
T12513               :AT-CREDIT-GROUP,                                  
T10810               :WS-CURRENT-DATE,                                  
T21107               :AT-LAST-UPDATE-TS                                 
116400          FROM CSS_ACCOUNT                                        
116500          WHERE ACCOUNT_NO = :AT-ACCOUNT-NO                       
116600     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ028
MFA-TR* MSQ029
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                     11400900
MFA-TR*         SELECT COALESCE(CHAR(DATE_BILL_DAY_00,USA),             02510200
MFA-TR*                      '01/01/1900'),                             02510200
MFA-TR*                CODE_DISC_OK,                                    11402000
MFA-TR*                CODE_ACCT_BILLED,                                11403000
MFA-TR*                BILL_CYCLE,                                      11404000
MFA-TR*                CODE_BILL_FREQ,                                  11404100
MFA-TR*                REV_MTH_LST_NRML,                                11404200
MFA-TR*                CREDIT_GROUP,                                    11404300
MFA-TR*                CURRENT DATE,                                    11404400
MFA-TR*                LAST_UPDATE_TS                                           
MFA-TR*         INTO :AT-DATE-BILL-DAY-00:WS-NULL-DATE,                 11405000
MFA-TR*              :AT-CODE-DISC-OK,                                  11406000
MFA-TR*              :AT-CODE-ACCT-BILLED,                              11407000
MFA-TR*              :AT-BILL-CYCLE,                                    11408000
MFA-TR*              :AT-CODE-BILL-FREQ,                                11408100
MFA-TR*              :AT-REV-MTH-LST-NRML,                              11408200
MFA-TR*              :AT-CREDIT-GROUP,                                  11408300
MFA-TR*              :WS-CURRENT-DATE,                                  11408400
MFA-TR*              :AT-LAST-UPDATE-TS                                         
MFA-TR*         FROM CSS_ACCOUNT                                        11409000
MFA-TR*         WHERE ACCOUNT_NO = :AT-ACCOUNT-NO                       11410000
MFA-TR*    END-EXEC.                                                    11420000

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

116700     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
116800     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
116900         NEXT SENTENCE                                            
117000     ELSE                                                         
117100        MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
117200        MOVE '7300'              TO ACTIVE-PARAGRAPH              
117300        MOVE 'SELECT'            TO ABEND-FUNCTION                
117400        MOVE SPACES              TO ABEND-SQL-PREDICATES          
117500                                    ABEND-TABLES                  
117600        MOVE 'CSS_ACCOUNT'       TO TABLE-1                       
T16088        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
117700        MOVE PARM-ACCOUNT-NO     TO HOSTVAR-ELEMENT-1             
117800        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
117900        PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT
           END-IF.          
118000                                                                  
118100 7300-EXIT.                                                       
118200     EXIT.                                                        
      *                                                                 11580100
T18482 7301-READ-WINDOW.                                                
      *                                                                         
           EXEC SQL                                                     
              SELECT  MIN(OPTIMUM_READ_DATE)                            
T21323        INTO    :RW-OPTIMUM-READ-DATE :WS-NULL-IND                
              FROM    CSS_READ_WINDOW                                   
              WHERE   READ_CYCLE    = :RW-READ-CYCLE                    
              AND     REVENUE_MONTH >                                   
              (SELECT REVENUE_MONTH                                     
              FROM    CSS_BILL_WINDOW                                   
              WHERE   BILL_CYCLE    = :BN-BILL-CYCLE                    
              AND     DATE_EXTRACT  = IIF(TRY_CONVERT(DATE, 
                                                       :BN-DATE-EXTRACT
              ) IS NULL OR (PATINDEX('%.%', :BN-DATE-EXTRACT
              ) <> 0) OR (LEN(:BN-DATE-EXTRACT) <> 10), CIS.CHAR2DATE(
                                                       :BN-DATE-EXTRACT
              ), CONVERT(DATE, :BN-DATE-EXTRACT) ))                 
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT  MIN(OPTIMUM_READ_DATE)                                    
MFA-TR*       INTO    :RW-OPTIMUM-READ-DATE :WS-NULL-IND                        
MFA-TR*       FROM    CSS_READ_WINDOW                                           
MFA-TR*       WHERE   READ_CYCLE    = :RW-READ-CYCLE                            
MFA-TR*       AND     REVENUE_MONTH >                                           
MFA-TR*       (SELECT REVENUE_MONTH                                             
MFA-TR*       FROM    CSS_BILL_WINDOW                                           
MFA-TR*       WHERE   BILL_CYCLE    = :BN-BILL-CYCLE                            
MFA-TR*       AND     DATE_EXTRACT  = :BN-DATE-EXTRACT)                         
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

      *                                                                 11590501
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
      *                                                                 11590701
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T21323        IF  WS-NULL-IND = WS-NULL                                 
T21323            MOVE SPACES                TO RS-SECOND-NEXT-READ     
T21323        ELSE                                                      
                  MOVE RW-OPTIMUM-READ-DATE  TO RS-SECOND-NEXT-READ     
T21323        END-IF                                                    
           ELSE                                                         
              MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
              MOVE '7301'              TO ACTIVE-PARAGRAPH              
              MOVE 'SELECT'            TO ABEND-FUNCTION                
              MOVE SPACES              TO ABEND-SQL-PREDICATES          
                                          ABEND-TABLES                  
              MOVE 'CSS_READ_WINDOW'   TO TABLE-1                       
              MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
              MOVE PARM-ACCOUNT-NO     TO HOSTVAR-ELEMENT-1             
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
      *                                                                         
       7301-EXIT.                                                       
T18482      EXIT.                                                       
                                                                        
      ******************************************************************11580201
      *                                                                 11580301
      *  7400-SELECT-USER-PROFILE                                       11580401
      *                                                                 11580501
      ******************************************************************11580601
      *                                                                 11580701
T13759 7400-SELECT-USER-PROFILE.                                        
      *                                                                 11581101
           EXEC SQL                                                     
             SELECT                                                     
               FIRST_NAME,                                              
               LAST_NAME,                                               
               MIDDLE_NAME                                              
             INTO                                                       
               :PF-FIRST-NAME,                                          
               :PF-LAST-NAME,                                           
               :PF-MIDDLE-NAME                                          
             FROM                                                       
               CSS_USER_PROFILE                                         
             WHERE                                                      
              USER_ID    = :DA-CSR-USERID                               
           END-EXEC.                                                    

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

      *                                                                 11590501
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
      *                                                                 11590701
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                     
                   MOVE SPACES         TO PF-FIRST-NAME                 
                                          PF-LAST-NAME                  
                                          PF-MIDDLE-NAME                
               END-IF                                                   
           ELSE                                                         
              MOVE PROGRAM-NAME        TO ABEND-PROGRAM                 
              MOVE '7400'              TO ACTIVE-PARAGRAPH              
              MOVE 'SELECT'            TO ABEND-FUNCTION                
              MOVE SPACES              TO ABEND-SQL-PREDICATES          
                                          ABEND-TABLES                  
              MOVE 'CSS_USER_PROFILE'  TO TABLE-1                       
T16088        MOVE 'USER_ID'           TO TABLE-ELEMENT-1               
              MOVE  DA-CSR-USERID      TO HOSTVAR-ELEMENT-1             
      *                                                                 11592201
              PERFORM 9000-SEND-ERROR-RESULT          THRU 9000-EXIT    
              PERFORM 9900-SQL-ERROR-ROUTINE          THRU 9900-EXIT    
           END-IF.                                                      
                                                                        
       7400-EXIT.                                                       
           EXIT.                                                        
      *                                                                 11592901
      ***************************************************************** 11593000
      * COMMON NEXT READ DATE COPYBOOK                                * 11600000
      ***************************************************************** 11610000
                                                                        
118300     EXEC SQL                                                     11630000
118300        INCLUDE CPD00309                                          11631000
118300     END-EXEC.                                                    11631100
118300                                                                  
118300***************************************************************** 11631300
118300     EXEC SQL                                                     11631400
118300        INCLUDE CPD0023C                                          11631500
118300     END-EXEC.                                                    11631600
118400                                                                  
118500***************************************************************** 11631800
118600* 9900 - JOURNALING / ERROR HANDLING ROUTINE                     *11631900
118700******************************************************************11632000
118800     EXEC SQL                                                     11633000
118900        INCLUDE CPDSP300                                          11634000
119000     END-EXEC.                                                    11635000
119100                                                                  
119200******************************************************************11637000
119300*       END PROGRAM COPYLIB                                      *11638000
119400******************************************************************11639000
CVT999*    COPY CPD00302.                                               11640000
119600                                                                  
119700                                                                  
CVT000 8100-SEND-RESULT.                                                
CVT000     EXEC SQL                                                     
CVT000       INSERT INTO #CSR02068_R1                            
CVT000       (                                                          
CVT000        RETURN_CODE                                               
CVT000       ,DFA_ITEM_ID                                               
CVT000       ,DATE_OF_AGREE                                             
CVT000       ,AMT_MO_PYMT                                               
CVT000       ,DATE_PYMT_START                                           
CVT000       ,NO_SCHED_PYMTS                                            
CVT000       ,AMT_ORIG_ENTERED                                          
CVT000       ,CSR_USERID                                                
CVT000       ,CODE_DFA_STATUS                                           
CVT000       ,RCNTLY_BLLD_MTH                                           
CVT000       ,AMT_UNDEFERD_RECV                                         
CVT000       ,CODE_DFA_DESC                                             
CVT000       ,REVERSE_REASON                                            
CVT000       ,PYMNT_ARNGMNT_CMTS                                        
CVT000       ,LAST_BILLED_DATE                                          
CVT000       ,LAST_INSTALLMENT                                          
CVT000       ,END_DATE                                                  
CVT000       ,AMT_EXTRA_DEPOSIT                                         
CVT000       ,CODE_COMPLY_HIST                                          
CVT000       ,FRST_ERNST_PAY_DT                                         
CVT000       ,FRST_ERNST_PAY_AMT                                        
CVT000       ,SCND_ERNST_PAY_DT                                         
CVT000       ,SCND_ERNST_PAY_AMT                                        
CVT000       ,DATE_CREDIT_ACTION                                        
CVT000       ,LAST_UPDATE_TS                                            
CVT000       ,CODE_DISC_OK                                              
CVT000       ,CODE_ACCT_BILLED                                          
CVT000       ,OPT_READ_DATE                                             
CVT000       ,BILL_CYCLE                                                
CVT000       ,USERS_NAME                                                
CVT000       ,CREDIT_GROUP                                              
CVT000       ,SECOND_NEXT_READ                                          
CVT000       ,AT_LAST_UPD_TS                                            
CVT000       )                                                          
CVT000       VALUES                                                     
CVT000       (                                                          
REARCH        :S-RETURN-CODE                                            
REARCH       ,:S-DFA-ITEM-ID                                            
REARCH       ,:S-DATE-OF-AGREE                                          
REARCH       ,:S-AMT-MO-PYMT                                            
REARCH       ,:S-DATE-PYMT-START                                        
REARCH       ,:S-NO-SCHED-PYMTS                                         
REARCH       ,:S-AMT-ORIG-ENTERED                                       
REARCH       ,:S-CSR-USERID                                             
REARCH       ,:S-CODE-DFA-STATUS                                        
REARCH       ,:S-RCNTLY-BLLD-MTH                                        
REARCH       ,:S-AMT-UNDEFERD-RECV                                      
REARCH       ,:S-CODE-DFA-DESC                                          
REARCH       ,:S-REVERSE-REASON                                         
REARCH       ,:S-PYMNT-ARNGMNT-CMTS-TEXT                                
REARCH       ,:S-LAST-BILLED-DATE                                       
REARCH       ,:S-LAST-INSTALLMENT                                       
REARCH       ,:S-END-DATE                                               
REARCH       ,:S-AMT-EXTRA-DEPOSIT                                      
REARCH       ,:S-CODE-COMPLY-HIST                                       
REARCH       ,:S-FRST-ERNST-PAY-DT                                      
REARCH       ,:S-FRST-ERNST-PAY-AMT                                     
REARCH       ,:S-SCND-ERNST-PAY-DT                                      
REARCH       ,:S-SCND-ERNST-PAY-AMT                                     
REARCH       ,:S-DATE-CREDIT-ACTION                                     
REARCH       ,:S-LAST-UPDATE-TS                                         
REARCH       ,:S-CODE-DISC-OK                                           
REARCH       ,:S-CODE-ACCT-BILLED                                       
REARCH       ,:S-OPT-READ-DATE                                          
REARCH       ,:S-BILL-CYCLE                                             
REARCH       ,:S-USERS-NAME                                             
REARCH       ,:S-CREDIT-GROUP                                           
REARCH       ,:S-SECOND-NEXT-READ                                       
REARCH       ,:S-AT-LAST-UPD-TS                                         
CVT000       )                                                          
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO SESSION.CSR02068_R1                                    
MFA-TR*      (                                                                  
MFA-TR*       RETURN_CODE                                                       
MFA-TR*      ,DFA_ITEM_ID                                                       
MFA-TR*      ,DATE_OF_AGREE                                                     
MFA-TR*      ,AMT_MO_PYMT                                                       
MFA-TR*      ,DATE_PYMT_START                                                   
MFA-TR*      ,NO_SCHED_PYMTS                                                    
MFA-TR*      ,AMT_ORIG_ENTERED                                                  
MFA-TR*      ,CSR_USERID                                                        
MFA-TR*      ,CODE_DFA_STATUS                                                   
MFA-TR*      ,RCNTLY_BLLD_MTH                                                   
MFA-TR*      ,AMT_UNDEFERD_RECV                                                 
MFA-TR*      ,CODE_DFA_DESC                                                     
MFA-TR*      ,REVERSE_REASON                                                    
MFA-TR*      ,PYMNT_ARNGMNT_CMTS                                                
MFA-TR*      ,LAST_BILLED_DATE                                                  
MFA-TR*      ,LAST_INSTALLMENT                                                  
MFA-TR*      ,END_DATE                                                          
MFA-TR*      ,AMT_EXTRA_DEPOSIT                                                 
MFA-TR*      ,CODE_COMPLY_HIST                                                  
MFA-TR*      ,FRST_ERNST_PAY_DT                                                 
MFA-TR*      ,FRST_ERNST_PAY_AMT                                                
MFA-TR*      ,SCND_ERNST_PAY_DT                                                 
MFA-TR*      ,SCND_ERNST_PAY_AMT                                                
MFA-TR*      ,DATE_CREDIT_ACTION                                                
MFA-TR*      ,LAST_UPDATE_TS                                                    
MFA-TR*      ,CODE_DISC_OK                                                      
MFA-TR*      ,CODE_ACCT_BILLED                                                  
MFA-TR*      ,OPT_READ_DATE                                                     
MFA-TR*      ,BILL_CYCLE                                                        
MFA-TR*      ,USERS_NAME                                                        
MFA-TR*      ,CREDIT_GROUP                                                      
MFA-TR*      ,SECOND_NEXT_READ                                                  
MFA-TR*      ,AT_LAST_UPD_TS                                                    
MFA-TR*      )                                                                  
MFA-TR*      VALUES                                                             
MFA-TR*      (                                                                  
MFA-TR*       :S-RETURN-CODE                                                    
MFA-TR*      ,:S-DFA-ITEM-ID                                                    
MFA-TR*      ,:S-DATE-OF-AGREE                                                  
MFA-TR*      ,:S-AMT-MO-PYMT                                                    
MFA-TR*      ,:S-DATE-PYMT-START                                                
MFA-TR*      ,:S-NO-SCHED-PYMTS                                                 
MFA-TR*      ,:S-AMT-ORIG-ENTERED                                               
MFA-TR*      ,:S-CSR-USERID                                                     
MFA-TR*      ,:S-CODE-DFA-STATUS                                                
MFA-TR*      ,:S-RCNTLY-BLLD-MTH                                                
MFA-TR*      ,:S-AMT-UNDEFERD-RECV                                              
MFA-TR*      ,:S-CODE-DFA-DESC                                                  
MFA-TR*      ,:S-REVERSE-REASON                                                 
MFA-TR*      ,:S-PYMNT-ARNGMNT-CMTS-TEXT                                        
MFA-TR*      ,:S-LAST-BILLED-DATE                                               
MFA-TR*      ,:S-LAST-INSTALLMENT                                               
MFA-TR*      ,:S-END-DATE                                                       
MFA-TR*      ,:S-AMT-EXTRA-DEPOSIT                                              
MFA-TR*      ,:S-CODE-COMPLY-HIST                                               
MFA-TR*      ,:S-FRST-ERNST-PAY-DT                                              
MFA-TR*      ,:S-FRST-ERNST-PAY-AMT                                             
MFA-TR*      ,:S-SCND-ERNST-PAY-DT                                              
MFA-TR*      ,:S-SCND-ERNST-PAY-AMT                                             
MFA-TR*      ,:S-DATE-CREDIT-ACTION                                             
MFA-TR*      ,:S-LAST-UPDATE-TS                                                 
MFA-TR*      ,:S-CODE-DISC-OK                                                   
MFA-TR*      ,:S-CODE-ACCT-BILLED                                               
MFA-TR*      ,:S-OPT-READ-DATE                                                  
MFA-TR*      ,:S-BILL-CYCLE                                                     
MFA-TR*      ,:S-USERS-NAME                                                     
MFA-TR*      ,:S-CREDIT-GROUP                                                   
MFA-TR*      ,:S-SECOND-NEXT-READ                                               
MFA-TR*      ,:S-AT-LAST-UPD-TS                                                 
MFA-TR*      )                                                                  
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

CVT000     MOVE SQLCODE                 TO WS-ACTIVE-RETURN-CODE.       
CVT000                                                                  
CVT000     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
CVT000        NEXT SENTENCE                                             
CVT000     ELSE                                                         
CVT000        MOVE PROGRAM-NAME         TO ABEND-PROGRAM                
CVT000         MOVE SQLCODE              TO ABEND-SQLCODE               
CVT000         MOVE SQLSTATE             TO ABEND-SQLSTATE              
CVT000        MOVE '8100'               TO ACTIVE-PARAGRAPH             
CVT000        MOVE 'INSERT'             TO ABEND-FUNCTION               
CVT000        MOVE 'CSR02068_R1'        TO TABLE-1                      
CVT000        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
CVT000     END-IF.                                                      
CVT000                                                                  
CVT000     ADD 1 TO CTR-ROWS.                                           
CVT000*    INITIALIZE GTT-RETURN-FIELDS.                                00001900
CVT000*                                                                 00002000
CVT000 8100-EXIT.                                                       
CVT000      EXIT.                                                       
CVT000******************************************************************00000100
CVT000* 8000A-DELETE-GTT-ROWS.                                         *00000200
CVT000******************************************************************00000300
CVT000 8000A-DELETE-GTT-ROWS.                                           
CVT000*                                                                 00000500
CVT000     MOVE                                                         
CVT000     'DELETE ROWS'                                                
CVT000         TO S-SQL-STATEMENT-V.                                    
CVT000*                                                                 00000900
CVT000      EXEC SQL                                                    
CVT000          DELETE FROM #CSR02068_R1                         
CVT000      END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*     EXEC SQL                                                    00001000
MFA-TR*         DELETE FROM SESSION.CSR02068_R1                         00001100
MFA-TR*     END-EXEC.                                                   00001200

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

CVT000*                                                                 00001300
CVT000      MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                      
CVT000*                                                                 00001500
CVT000      IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND     
CVT000          NEXT SENTENCE                                           
CVT000      ELSE                                                        
CVT000         MOVE PROGRAM-NAME         TO ABEND-PROGRAM               
CVT000         MOVE SQLCODE              TO ABEND-SQLCODE               
CVT000         MOVE SQLSTATE             TO ABEND-SQLSTATE              
CVT000         MOVE '8000A'              TO ACTIVE-PARAGRAPH            
CVT000         MOVE 'DELETE'             TO ABEND-FUNCTION              
CVT000         MOVE SPACES               TO ABEND-SQL-PREDICATES        
CVT000                                      ABEND-TABLES                
CVT000         MOVE 'CSR02068_R1'        TO TABLE-1                     
CVT000         MOVE SPACES               TO TABLE-ELEMENT-1             
CVT000         MOVE SPACES               TO HOSTVAR-ELEMENT-1           
CVT000         PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT           
CVT000     END-IF.                                                      
CVT000*                                                                 00003100
CVT000 8000A-EXIT.                                                      
CVT000     EXIT.                                                        
CVT000*                                                                 00003400
CVT000     EXEC SQL                                                     00000100
CVT000         INCLUDE CPD00320                                         00000200
CVT000     END-EXEC.                                                    00000300
