       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02202.                                         
COB303 DATE-WRITTEN.      JANUARY 9, 1995.                              
       DATE-COMPILED.                                                   
                                                                        
CVT000******************************************************************00000100
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *00000200
CVT000*         S202 CONVERTED TO DB2 SP CSR02202 ON 07/20/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
      ***************************************************************** 00060000
      *                                                               * 00070000
      *                SOUTH CAROLINA ELECTRIC & GAS                  * 00080000
      *                                                               * 00090000
      *  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).  * 00100000
      *                                                               * 00110000
      *  TRANID:        S202                                          * 00120000
      *  PROGRAM:       S202                                          * 00130000
      *  CALLING SP:    PA_CUSTINFOGET                                * 00140000
      *                                                               * 00150000
      ***************************************************************** 00160000
      *                P R O G R A M  S U M M A R Y                   * 00170000
      *                                                               * 00180000
      *  THIS PROGRAM RETRIEVES DATA TO POPULATE THE MAINTAIN         * 00190000
      *  CUSTOMER DETAILS WINDOW.  DATA SUCH AS RESIDENTIAL/BUSINESS  * 00200000
      *  NAME, PHONE NUMBERS, OCCUPATION AND OTHER CUSTOMER STATISTIC * 00210000
      *  INFORMATION IS RETURNED.                                     * 00220000
      ******************************************************************00230000
      *                                                               * 00240000
      *                     PROGRAM MODIFICATION LOG                  * 00250000
      *                                                               * 00260000
      *    DATE    INITIALS   COMMENTS                                * 00270000
      *  --------  --------   --------------------------------------- * 00280000
      *  01/09/95    JHR      REMOTE PROCEDURE ORIGINALLY CODED.      * 00290000
      *  04/10/95    JHR      TPR 5075/5048 ADD CUSTOMER LAST VISIT   * 00291000
      *                       DATE TO RETRIEVAL SET.                  * 00292000
      *  07/30/96    RTO      PCR308 REMOVE SELECT FOR SERV_ORDER_NO  * 00293000
      *                       AND IND FROM CSS_CUST_MISC_INFO. REMOVE * 00294000
      *                       THESE AND ADD AND SELECT FOR CUST_ENDV_ * 00300000
      *                       HIST.                                   * 00301000
      *  10/14/98    JVH      TPR 17662 PASS BACK DISABLE FLAG (X) IF * 00302000
      *                       NAME_ID = 1800000000002 OR 1800000100001* 00302100
      *                       FOR 'ACCOUNT INACTIVE', BUSINESS AND    * 00302202
      *                       INDIVIDUAL                              * 00302302
      *                                                               * 00303000
CBSI  *  10/28/98   CBSI      ABEND LOG MODIFIED TO INCLUDE ALL THE   *         
CBSI  *             MADRAS    ABEND PARAMETERS                        *         
22131 *  12/06/01   PRA       NEED TO DETERMINE IF CUSTOMER HAS A     *         
      *                       SECURED RATE ACCOUNT                    *         
T27707*  01/20/03   MJG       NEW CUSTOMER CML TO BRING BACK ADDL DATA*         
      *                       FOR CUSTOMER DETAILS PANEL              *         
T29772*  10/10/03   FMB       CHECK FOR SECURED RATE SHOULD USE       *         
T29772*                       ACCOUNT INSTEAD OF PREMISE.             *         
C31904*  09/12/05   PA11954   ADD RETRIEVE OF LANGUAGE PREFERENCE CODE*         
REARCH*  07/19/05   CVNS      RPC TO COBOL CONVERSION.                *         
REARCH*             CHENNAI                                           *         
REARCH*  11/28/05   CVNS      ADDED REARCH CHANGES TO LANGUAGE        *         
REARCH*             CHENNAI   PREFERENCE CODE.                        *         
T35745*  05/18/07   SP94986   REMOVED DISTINCT FOR SELECT AND ADDED   *         
      *                       WITH UR TO SINGLETON SELECT.            *         
C35671*  12/06/07   CVNS      NAME AND ADDRESS FORMAT CHANGES          *        
C35671*             CHENNAI                                            *        
C37303*  12/15/08   SR82046   REMOVE CALL TO 7350- PARA AND DEFAULT    *        
C37303*                       REV_PROT_IND TO 'N'.                     *        
ID0113*  01/08/09   DB18339   ADDED DOB_VERIFIED_CD.                   *        
A00998*  04/24/09   MSR       ADDED CREDIT_FL.                         *        
A01255*  06/08/09   FMB       DISABLE DELETE ICON IF CUSTOMER EXISTS   *        
A01255*                       ON CSS_PREM_GAS_LINE.                    *        
P00172*  06/30/09   FMB       RETURN DHR FLAG.                         *        
A37302*  07/06/09   FMB       REMOVE REFERENCES TO CSS_CUST_ENDV_HIST. *        
P00422*  06/02/10   FMB       RETURN LANDLORD AND CREDIT WORTHY FLAGS.*         
P00465*  04/26/11   PK98692   PSNC EWELCOME KIT CHANGES                *        
P00740*  04/29/15   FMB       RETURN PRIMARY PHONE AS BUSINESS PHONE  *         
P00740*                       IF BUSINESS PHONE DOES NOT EXIST.       *         
      ***************************************************************** 00310000
      ***************************************************************** 00310000
      ***************************************************************** 00320000
      *                                                               * 00330000
      *                ---- BASIC SEQUENCE STRUCTURE ----             * 00340000
      *                                                               * 00350000
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION            * 00360000
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                   * 00370000
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                  * 00380000
      *  3000 - 4999  NOT USED                                        * 00390000
      *  5000 - 5999  COMMON PROGRAM MODULES                          * 00400000
      *  6000 - 6999  COMMON SYSTEM MODULES                           * 00410000
      *  7000 - 7999  INPUT MODULES                                   * 00420000
      *  8000 - 8999  OUTPUT MODULES                                  * 00430000
      *  9000 - 9999  TERMINATION, ABEND, MESSAGING MODULES           * 00440000
      *                                                               * 00450000
      ***************************************************************** 00460000
                                                                        
       ENVIRONMENT DIVISION.                                            
       DATA DIVISION.                                                   
       WORKING-STORAGE SECTION.                                         

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

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'CSR02202'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-START                                   PIC X(40) VALUE   
REARCH     'WORKING STORAGE FOR CSR02202 STARTS HERE'.                  
                                                                        
      ******************************************************************00550000
      *    DB2 INCLUDES                                                *00560000
      ******************************************************************00570000
                                                                        
           EXEC SQL                                                     00590000
              INCLUDE SQLCA                                             00600000
           END-EXEC.                                                    00610000
                                                                        
           EXEC SQL                                                     00630000
              INCLUDE TBCUST                                            00640000
           END-EXEC.                                                    00650000
                                                                        
           EXEC SQL                                                     00670000
              INCLUDE TBCSTSTS                                          00680000
           END-EXEC.                                                    00690000
                                                                        
           EXEC SQL                                                     00710000
              INCLUDE TBBSCSTS                                          00720000
           END-EXEC.                                                    00730000
                                                                        
           EXEC SQL                                                     00771000
              INCLUDE TBNAME                                            00772000
           END-EXEC.                                                    00773000
                                                                        
           EXEC SQL                                                     00781000
              INCLUDE TBCSTMSC                                          00782000
           END-EXEC.                                                    00783000
                                                                        
           EXEC SQL                                                     00783200
              INCLUDE TBCSTPHN                                          00783300
           END-EXEC.                                                    00783400
                                                                        
           EXEC SQL                                                     00790000
              INCLUDE TBMODEL                                           00800000
           END-EXEC.                                                    00810000
                                                                        
22131      EXEC SQL                                                     00785001
              INCLUDE TBACCT                                            00786001
           END-EXEC.                                                    00787001
                                                                        
22131      EXEC SQL                                                     00785001
              INCLUDE TBUTLENV                                          00786001
           END-EXEC.                                                    00787001
                                                                        
22131      EXEC SQL                                                     00785001
              INCLUDE TBRTDESC                                          00786001
           END-EXEC.                                                    00787001
                                                                        
T27707     EXEC SQL                                                     00785001
              INCLUDE TBCSTEML                                          00786001
           END-EXEC.                                                    00787001
                                                                        
P00422     EXEC SQL                                                     00785001
P00422        INCLUDE TBLNDLRD                                          00786001
P00422     END-EXEC.                                                    00787001
                                                                        
P00465*  CSS_HOLIDAY                                                            
P00465*    EXEC SQL                                                             
P00465*        INCLUDE TBHLDAY                                                  
P00465*    END-EXEC.                                                            
                                                                        
P00465*  CSS_BATCH_EMAIL (PREFIX = AE)                                          
P00465     EXEC SQL                                                             
P00465         INCLUDE TBBEMAIL                                                 
P00465     END-EXEC.                                                            
                                                                        
P00465*  CSS_CUST_PREM_HIST  (PREFIX = CH)                                      
P00465     EXEC SQL                                                             
P00465         INCLUDE TBCSTPRM                                                 
P00465     END-EXEC.                                                            
                                                                        
      ******************************************************************00830000
      *    COBOL WORKING STORAGE COPY BOOKS                            *00840000
      ******************************************************************00850000
                                                                        
           COPY CCA00001.                                               00890000
           COPY CWS00027.                                               00910000
           COPY CWS00303.                                               00920000
      * PREV AND NEXT BUSINESS DAYS.                                            
P00465*    COPY CWS00315                                                        
                                                                        
                                                                        
                                                                        
      ******************************************************************00940000
      *    WORK AREAS                                                  *00950000
      ******************************************************************00960000
                                                                        
       01  GW-LIB-MISC-FIELDS.                                          
           05  GWL-STATUS-SUBCODE      PIC S9(9) COMP.                  
                                                                        
       01  FILLER                      PIC X(11) VALUE 'PARM FIELDS'.   
                                                                        
       01  PARM-FIELDS.                                                 
           05  PARM-L                  PIC S9(9) COMP.                  
           05  PARM-CUSTOMER-NO        PIC X(10)      VALUE SPACES.     
           05  PARM-CUSTOMER-NO-RED    REDEFINES PARM-CUSTOMER-NO       
                                       PIC 9(10).                       
                                                                        
       01  SNA-FIELDS.                                                  
           05  SNA-SUBC                PIC S9(9) COMP.                  
                                                                        
       01  COUNTER-FIELDS.                                              
           05  CTR-ROWS                PIC S9(9) COMP VALUE 0.          
                                                                        
       01  WORK-FIELDS.                                                 
           05  WRK-DONE-STATUS         PIC S9(9) COMP.                  
                                                                        
                                                                        
       01  FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.      
                                                                        
REARCH 01  TDS-RETURN-FIELDS.                                           
           05  RS-RETURN-CODE          PIC S9(9) COMP VALUE 0.          
           05  RS-CUSTOMER-NO          PIC X(10) VALUE SPACES.          
           05  RS-CUSTOMER-EST-DATE    PIC X(08) VALUE SPACES.          
C37303     05  RS-REV-PROT-IND         PIC X(01) VALUE 'N'.             
           05  RS-SERV-EST-DATE        PIC X(08) VALUE SPACES.          
           05  RS-CUSTOMER-TYPE        PIC X(01) VALUE SPACES.          
           05  RS-FIRST-NAME           PIC X(15) VALUE SPACES.          
           05  RS-MIDDLE-NAME          PIC X(15) VALUE SPACES.          
C35671*    05  RS-LAST-NAME            PIC X(20) VALUE SPACES.          01390000
C35671     05  RS-LAST-NAME            PIC X(40) VALUE SPACES.          
C35671*    05  RS-NICKNAME             PIC X(12) VALUE SPACES.          01391000
C35671     05  RS-NICKNAME             PIC X(50) VALUE SPACES.          
           05  RS-TITLE-PREFIX         PIC X(09) VALUE SPACES.          
           05  RS-TITLE-SUFFIX         PIC X(03) VALUE SPACES.          
C35671*    05  RS-BUSINESS-NAME        PIC X(50) VALUE SPACES.          01460000
C35671     05  RS-BUSINESS-NAME        PIC X(70) VALUE SPACES.          
           05  RS-CUST-OCCUP           PIC X(15) VALUE SPACES.          
           05  RS-CUST-WORK-PHONE      PIC X(10) VALUE SPACES.          
           05  RS-CUST-WORK-PHONE-EXT  PIC X(06) VALUE SPACES.          
           05  RS-CUST-HOME-PHONE      PIC X(10) VALUE SPACES.          
           05  RS-CUST-BUS-PHONE       PIC X(10) VALUE SPACES.          
           05  RS-CUST-EMPLOYER        PIC X(23) VALUE SPACES.          
           05  RS-EMPLOYED-DATE        PIC X(08) VALUE SPACES.          
           05  RS-EMPLOYEE-NBR         PIC X(05) VALUE SPACES.          
           05  RS-CUST-SSN             PIC X(09) VALUE SPACES.          
           05  RS-CODE-STATE-ID        PIC X(02) VALUE SPACES.          
           05  RS-LICENSE-NO           PIC X(19) VALUE SPACES.          
           05  RS-DATE-OF-BIRTH        PIC X(08) VALUE SPACES.          
           05  RS-DRVR-LIC-ISS-DT      PIC X(08) VALUE SPACES.          
           05  RS-OTHER-ID-TYPE        PIC X(12) VALUE SPACES.          
           05  RS-OTHER-ID             PIC X(16) VALUE SPACES.          
           05  RS-ALIAS                PIC X(07) VALUE SPACES.          
           05  RS-TAX-ID               PIC X(09) VALUE SPACES.          
           05  RS-COMPANY-IND          PIC X(01) VALUE SPACES.          
           05  RS-BUSINESS-TYPE-CD     PIC X(01) VALUE SPACES.          
           05  RS-CONTRACTOR-TYPE      PIC X(30) VALUE SPACES.          
           05  RS-CONSULTING-PROJ      PIC X(30) VALUE SPACES.          
           05  RS-CONSLT-PRJ-END-DT    PIC X(08) VALUE SPACES.          
           05  RS-SERV-ORDER-NO        PIC S9(13)V COMP-3 VALUE ZERO.   
           05  RS-LAST-VISIT-DATE      PIC X(08) VALUE SPACES.          
           05  RS-LOCAL-OFFICE         PIC X(03) VALUE SPACES.          
           05  RS-COMPANY-NO           PIC X(02) VALUE SPACES.          
           05  RS-DISABLE-NAME-FLAG    PIC X(01) VALUE SPACES.          
22131      05  RS-SECURED-RATE-FLAG    PIC X(01) VALUE SPACES.          
T27707     05  RS-REFUSED-SSN-FL       PIC X(01) VALUE SPACES.          
T27707     05  RS-CUST-ALT-PHONE       PIC X(10) VALUE SPACES.          
T27707     05  RS-EMAIL-ADDR           PIC X(100) VALUE SPACES.         
T27707     05  RS-EMAIL-DISP-PREF      PIC X(01) VALUE SPACES.          
T27707     05  RS-PASSWORD             PIC X(16) VALUE SPACES.          
T27707     05  RS-PASSWORD-HINT        PIC X(02) VALUE SPACES.          
C31904     05  RS-LANGUAGE-PREF-CD     PIC X(02) VALUE SPACES.          
ID0113     05  RS-DOB-VERIFIED-CD      PIC X(01) VALUE SPACES.          
A00998     05  RS-CREDIT-FL            PIC X(01) VALUE SPACES.          
P00172     05  RS-DHR-FL               PIC X(01) VALUE SPACES.          
P00422     05  RS-PROP-MGR-FL          PIC X(01) VALUE SPACES.          
P00422     05  RS-REVERT-ELIG-FL       PIC X(01) VALUE SPACES.          
P00465     05  RS-WELCOME-KIT-CD       PIC X(01) VALUE SPACES.          
P00465     05  RS-WELCOME-DISP-FL      PIC X(01) VALUE SPACES.          
                                                                        
REARCH 01  GTT-RETURN-FIELDS.                                           
REARCH     05  S-RETURN-CODE           PIC S9(9) COMP VALUE 0.          
REARCH     05  S-CUSTOMER-NO           PIC X(10) VALUE SPACES.          
REARCH     05  S-CUSTOMER-EST-DATE     PIC X(08) VALUE SPACES.          
REARCH     05  S-REV-PROT-IND          PIC X(01) VALUE SPACES.          
REARCH     05  S-SERV-EST-DATE         PIC X(08) VALUE SPACES.          
REARCH     05  S-CUSTOMER-TYPE         PIC X(01) VALUE SPACES.          
REARCH     05  S-FIRST-NAME            PIC X(15) VALUE SPACES.          
REARCH     05  S-MIDDLE-NAME           PIC X(15) VALUE SPACES.          
REARCH*    05  S-LAST-NAME             PIC X(20) VALUE SPACES.          01390000
C35671     05  S-LAST-NAME             PIC X(40) VALUE SPACES.          
REARCH*    05  S-NICKNAME              PIC X(12) VALUE SPACES.          01391000
C35671     05  S-NICKNAME              PIC X(50) VALUE SPACES.          
REARCH     05  S-TITLE-PREFIX          PIC X(09) VALUE SPACES.          
REARCH     05  S-TITLE-SUFFIX          PIC X(03) VALUE SPACES.          
REARCH*    05  S-BUSINESS-NAME         PIC X(50) VALUE SPACES.          01460000
C35671     05  S-BUSINESS-NAME         PIC X(70) VALUE SPACES.          
REARCH     05  S-CUST-OCCUP            PIC X(15) VALUE SPACES.          
REARCH     05  S-CUST-WORK-PHONE       PIC X(10) VALUE SPACES.          
REARCH     05  S-CUST-WORK-PHONE-EXT   PIC X(06) VALUE SPACES.          
REARCH     05  S-CUST-HOME-PHONE       PIC X(10) VALUE SPACES.          
REARCH     05  S-CUST-BUS-PHONE        PIC X(10) VALUE SPACES.          
REARCH     05  S-CUST-EMPLOYER         PIC X(23) VALUE SPACES.          
REARCH     05  S-EMPLOYED-DATE         PIC X(08) VALUE SPACES.          
REARCH     05  S-EMPLOYEE-NBR          PIC X(05) VALUE SPACES.          
REARCH     05  S-CUST-SSN              PIC X(09) VALUE SPACES.          
REARCH     05  S-CODE-STATE-ID         PIC X(02) VALUE SPACES.          
REARCH     05  S-LICENSE-NO            PIC X(19) VALUE SPACES.          
REARCH     05  S-DATE-OF-BIRTH         PIC X(08) VALUE SPACES.          
REARCH     05  S-DRVR-LIC-ISS-DT       PIC X(08) VALUE SPACES.          
REARCH     05  S-OTHER-ID-TYPE         PIC X(12) VALUE SPACES.          
REARCH     05  S-OTHER-ID              PIC X(16) VALUE SPACES.          
REARCH     05  S-ALIAS                 PIC X(07) VALUE SPACES.          
REARCH     05  S-TAX-ID                PIC X(09) VALUE SPACES.          
REARCH     05  S-COMPANY-IND           PIC X(01) VALUE SPACES.          
REARCH     05  S-BUSINESS-TYPE-CD      PIC X(01) VALUE SPACES.          
REARCH     05  S-CONTRACTOR-TYPE       PIC X(30) VALUE SPACES.          
REARCH     05  S-CONSULTING-PROJ       PIC X(30) VALUE SPACES.          
REARCH     05  S-CONSLT-PRJ-END-DT     PIC X(08) VALUE SPACES.          
REARCH     05  S-SERV-ORDER-NO         PIC S9(13)V COMP-3 VALUE ZERO.   
REARCH     05  S-LAST-VISIT-DATE       PIC X(08) VALUE SPACES.          
REARCH     05  S-LOCAL-OFFICE          PIC X(03) VALUE SPACES.          
REARCH     05  S-COMPANY-NO            PIC X(02) VALUE SPACES.          
REARCH     05  S-DISABLE-NAME-FLAG     PIC X(01) VALUE SPACES.          
REARCH     05  S-SECURED-RATE-FLAG     PIC X(01) VALUE SPACES.          
REARCH     05  S-REFUSED-SSN-FL        PIC X(01) VALUE SPACES.          
REARCH     05  S-CUST-ALT-PHONE        PIC X(10) VALUE SPACES.          
REARCH     05  S-EMAIL-ADDR            PIC X(100) VALUE SPACES.         
REARCH     05  S-EMAIL-DISP-PREF       PIC X(01) VALUE SPACES.          
REARCH     05  S-PASSWORD              PIC X(16) VALUE SPACES.          
REARCH     05  S-PASSWORD-HINT         PIC X(02) VALUE SPACES.          
REARCH     05  S-LANGUAGE-PREF-CD      PIC X(02) VALUE SPACES.          
ID0113     05  S-DOB-VERIFIED-CD       PIC X(01) VALUE SPACES.          
A00998     05  S-CREDIT-FL             PIC X(01) VALUE SPACES.          
P00172     05  S-DHR-FL                PIC X(01) VALUE SPACES.          
P00422     05  S-PROP-MGR-FL           PIC X(01) VALUE SPACES.          
P00422     05  S-REVERT-ELIG-FL        PIC X(01) VALUE SPACES.          
P00465     05  S-WELCOME-KIT-CD        PIC X(01) VALUE SPACES.          
P00465     05  S-WELCOME-DISP-FL       PIC X(01) VALUE SPACES.          
                                                                        
       01  SWITCHES.                                                    
           05  ALL-DONE-SW             PIC X(01) VALUE 'N'.             
               88 NOT-ALL-DONE                   VALUE 'N'.             
               88 ALL-DONE                       VALUE 'Y'.             
           05  SEND-DONE-SW            PIC X(01) VALUE 'Y'.             
               88 SEND-DONE-ERROR                VALUE 'N'.             
               88 SEND-DONE-OK                   VALUE 'Y'.             
                                                                        
       01  WS-SELECT-DATE-FORM.                                         
           10  WS-SELECT-YEAR          PIC X(04) VALUE SPACES.          
           10  FILLER                  PIC X(01) VALUE SPACES.          
           10  WS-SELECT-MONTH         PIC X(02) VALUE SPACES.          
           10  FILLER                  PIC X(01) VALUE SPACES.          
           10  WS-SELECT-DAY           PIC X(02) VALUE SPACES.          
                                                                        
       01  WS-RETURN-DATE-FORM.                                         
           10  WS-RETURN-MONTH         PIC X(02) VALUE SPACES.          
           10  WS-RETURN-DAY           PIC X(02) VALUE SPACES.          
           10  WS-RETURN-YEAR          PIC X(04) VALUE SPACES.          
                                                                        
P00465******************************************************************02554000
P00465* CSR01416 - GET DATE X NUMBER OF BUSINESS DAYS                  *02554000
P00465******************************************************************02554000
P00465                                                                  
P00465 01  CSR01416-CALL-DATA.                                          
P00465     05  INPUT-DATE-1416           PIC X(26) VALUE SPACES.        
P00465     05  BUSINESS-DAYS-1416        PIC S9(4) COMP VALUE 0.        
P00465                                                                  
P00465 01  CSR01416-RETURN-DATA.                                        
P00465     05  OUTPUT-DATE-1416          PIC X(26) VALUE SPACES.        
                                                                        
       01  WS-MISCELLANEOUS.                                            
REARCH     05  PROGRAM-NAME            PIC X(08)   VALUE 'CSR02202'.    
           05  WS-Y                    PIC X(01).                       
           05  WS-X                    PIC X(01)   VALUE 'X'.           
           05  WS-FOUND-MANY           PIC S9(09) COMP VALUE -811.      
COB305     05 WS-CUSTOMER-NO-NUM        PIC S9(10)V COMP-3 VALUE 0.             
           05  WS-NULL-EMP-DT          PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-CNSLT-END-DT    PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-SERV-EST-DT     PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-CUST-EST-DT     PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-BIRTH-DT        PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-DRV-LIC-DT      PIC S9(04)  COMP VALUE ZERO.     
           05  WS-NULL-VISIT-DT        PIC S9(04)  COMP VALUE ZERO.     
           05  WS-CUST-NAME-TYPE       PIC X(02)   VALUE 'CN'.          
           05  WS-CUST-NAME-FORMAT     PIC X(01)   VALUE 'I'.           
           05  WS-CUST-CUSTOMER-TYPE   PIC X(01)   VALUE 'C'.           
           05  WS-PHONE-TYPE           PIC X(02)   VALUE SPACES.        
           05  WS-WORK-PHONE-TYPE      PIC X(02)   VALUE 'W1'.          
           05  WS-HOME-PHONE-TYPE      PIC X(02)   VALUE 'H1'.          
T27707     05  WS-ALT-PHONE-TYPE       PIC X(02)   VALUE 'A1'.          
           05  WS-BUS-PHONE-TYPE       PIC X(02)   VALUE 'B1'.          
A00998     05  WS-CUT-OFF-DT           PIC X(10)   VALUE SPACES.        
P00465     05  LAST-WKIT-DATE          PIC X(10)   VALUE SPACES.        
P00465     05  WS-WELCOME-DISP-FL      PIC X(01)   VALUE SPACES.        
P00465     05  WS-CURRENT-TIMESTAMP    PIC X(26) VALUE SPACES.          
T7662 * I - INDIVIDUAL, B - BUSINESS                                    02683102
           05  WS-INACTIVE-NAME-IDI    PIC S9(13)V COMP-3 VALUE         
                                                   1800000000002.       
           05  WS-INACTIVE-NAME-IDB    PIC S9(13)V COMP-3 VALUE         
                                                   1800000100001.       
CVT000     EXEC SQL                                                     00000010
CVT000         INCLUDE CWSX0010                                         00000020
CVT000     END-EXEC.                                                    00000030
CVT000                                                                  
CVT000 01  CSRERLOG-P.                                                  
CVT000     10  S-SP-NAME                 PIC X(18) VALUE SPACES.        
CVT000     10  S-SQLCODE                 PIC S9(9) COMP VALUE 0.        
CVT000     10  S-SQLSTATE                PIC X(5)  VALUE ' '.           
CVT000     10  S-TABLE-NAME              PIC X(18) VALUE SPACES.        
CVT000     10  S-HOST-VARIABLES.                                        
CVT000         49  S-HOST-VARIABLES-L    PIC S9(4) USAGE COMP.          
CVT000         49  S-HOST-VARIABLES-V    PIC X(255).                    
CVT000     10  S-SQL-STATEMENT.                                         
CVT000         49  S-SQL-STATEMENT-L     PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-STATEMENT-V     PIC X(255).                    
CVT000     10  S-SQL-DESCRIPTION.                                       
CVT000         49  S-SQL-DESCRIPTION-L   PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-DESCRIPTION-V   PIC X(255).                    
CVT000     10  WS-ABEND-SQLERRMC.                                       
CVT000         49  WS-ABEND-SQLERRMC-L   PIC S9(4) USAGE COMP.          
CVT000         49  WS-ABEND-SQLERRMC-V   PIC X(255).                    
CVT000*    10  S-RETURN-CODE             PIC S9(9) COMP VALUE 0.        00001701
CVT000     10  WS-SQLSTATE               PIC X(05) VALUE SPACES.        
CVT000                                                                  
P00465*01 LOC1416 USAGE SQL TYPE IS RESULT-SET-LOCATOR VARYING.         
MSQ001        EXEC SQL
MSQ001          DECLARE RESULT_SET_CSR_1416 CURSOR
MSQ001          FOR CALL CSR01416                                             
P00465            ( :INPUT-DATE-1416
                  , :BUSINESS-DAYS-1416
                  )
MSQ001        END-EXEC.
         
CVT000                                                                  
CVT000                                                                  
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-CUSTOMER-NO         PIC X(10)                .          
CVT000 01  LINK-CUSTOMER-NO-RED     PIC 9(10)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-CUSTOMER-NO                                        
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.                                                    
                                                                        
      ******************************************************************02730000
      * 0000-MAINLINE                                                  *02740000
      *     CONTROLS THE MAIN PATH OF THE PROGRAM                      *02750000
      ******************************************************************02760000
       0000-MAINLINE.                                                   
                                                                        
           PERFORM 0100-INITIALIZE     THRU 0100-EXIT.                  
           PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT.                  
           PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT.                  
           PERFORM 9999-END-PROGRAM    THRU 9999-EXIT.                  
                                                                        
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************02880000
      * 0100-INITIALIZE                                                *02890000
      *                                                                *02900000
      *     1. RESET DB2 ERROR HANDLERS                                *02910000
      *     2. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *02920000
      *     3. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *02930000
      *     4. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*02940000
      *                                                                *02950000
      ******************************************************************02960000
       0100-INITIALIZE.                                                 
                                                                        
CVT000     EXEC SQL                                                     
CVT000       DECLARE C1 CURSOR  FOR                          
CVT000       SELECT                                                     
REARCH        :S-RETURN-CODE              AS    RETURN_CODE             
REARCH       ,:S-CUSTOMER-NO              AS    CUSTOMER_NO             
REARCH       ,:S-REV-PROT-IND             AS    REV_PROT_IND            
REARCH       ,:S-CUSTOMER-EST-DATE        AS    CUSTOMER_EST_DATE       
REARCH       ,LTRIM(RTRIM(:S-SERV-EST-DATE))     AS    SERVICE_EST_DATE        
REARCH       ,:S-CUSTOMER-TYPE            AS    CUSTOMER_TYPE           
REARCH       ,LTRIM(RTRIM(:S-TITLE-PREFIX))      AS    PREFIX                  
REARCH       ,LTRIM(RTRIM(:S-FIRST-NAME))        AS    FIRST_NAME              
REARCH       ,LTRIM(RTRIM(:S-MIDDLE-NAME))       AS    MIDDLE_NAME             
REARCH       ,LTRIM(RTRIM(:S-LAST-NAME))         AS    LAST_NAME               
REARCH       ,LTRIM(RTRIM(:S-TITLE-SUFFIX))      AS    SUFFIX                  
REARCH       ,LTRIM(RTRIM(:S-BUSINESS-NAME))     AS    BUSINESS_NAME           
REARCH       ,LTRIM(RTRIM(:S-NICKNAME))          AS    NICKNAME                
REARCH       ,LTRIM(RTRIM(:S-CUST-HOME-PHONE))   AS    CUST_HOME_PHONE         
REARCH       ,LTRIM(RTRIM(:S-CUST-BUS-PHONE))    AS    CUST_BUS_PHONE          
REARCH       ,LTRIM(RTRIM(:S-CUST-OCCUP))        AS    CUST_OCCUP              
REARCH       ,LTRIM(RTRIM(:S-CUST-WORK-PHONE))   AS    CUST_WORK_PHONE         
REARCH       ,LTRIM(RTRIM(:S-CUST-WORK-PHONE-EXT)) AS    
           CUST_WORK_PHONE_EX    
REARCH       ,LTRIM(RTRIM(:S-CUST-EMPLOYER))     AS    CUST_EMPLOYER           
REARCH       ,LTRIM(RTRIM(:S-EMPLOYED-DATE))     AS    EMPLOYED_DATE           
REARCH       ,LTRIM(RTRIM(:S-EMPLOYEE-NBR))      AS    EMPLOYEE_NBR            
REARCH       ,LTRIM(RTRIM(:S-CUST-SSN))          AS    CUST_SSN                
REARCH       ,LTRIM(RTRIM(:S-DATE-OF-BIRTH))     AS    DATE_OF_BIRTH           
REARCH       ,LTRIM(RTRIM(:S-LICENSE-NO))        AS    LICENSE_NO              
REARCH       ,:S-CODE-STATE-ID            AS    CODE_STATE_ID           
REARCH       ,LTRIM(RTRIM(:S-DRVR-LIC-ISS-DT))   AS    DRVR_LIC_ISS_DT         
REARCH       ,LTRIM(RTRIM(:S-OTHER-ID-TYPE))     AS    OTHER_ID_TYPE           
REARCH       ,LTRIM(RTRIM(:S-OTHER-ID))          AS    OTHER_ID                
REARCH       ,LTRIM(RTRIM(:S-ALIAS))             AS    ALIAS                   
REARCH       ,LTRIM(RTRIM(:S-TAX-ID))            AS    TAX_ID                  
REARCH       ,LTRIM(RTRIM(:S-COMPANY-IND))       AS    COMPANY_IND             
REARCH       ,LTRIM(RTRIM(:S-BUSINESS-TYPE-CD))  AS    BUSINESS_TYPE_CD        
REARCH       ,LTRIM(RTRIM(:S-CONTRACTOR-TYPE))   AS    CONTRACTOR_TYPE         
REARCH       ,LTRIM(RTRIM(:S-CONSULTING-PROJ))   AS    CONSULTING_PROJ         
REARCH       ,LTRIM(RTRIM(:S-CONSLT-PRJ-END-DT)) AS    CONSLT_PRJ_END_DT       
REARCH       ,:S-SERV-ORDER-NO            AS    SERV_ORDER_NO           
REARCH       ,LTRIM(RTRIM(:S-LAST-VISIT-DATE))   AS    LAST_VISIT_DATE         
REARCH       ,LTRIM(RTRIM(:S-LOCAL-OFFICE))      AS    LOCAL_OFFICE            
REARCH       ,:S-COMPANY-NO               AS    COMPANY_NO              
REARCH       ,LTRIM(RTRIM(:S-DISABLE-NAME-FLAG)) AS    DISABLE_NAME_FLAG       
REARCH       ,:S-SECURED-RATE-FLAG        AS    SECURED_RATE_FLAG       
REARCH       ,LTRIM(RTRIM(:S-REFUSED-SSN-FL))    AS    REFUSED_SSN             
REARCH       ,LTRIM(RTRIM(:S-CUST-ALT-PHONE))    AS    CUST_ALT_PHONE          
REARCH       ,LTRIM(RTRIM(:S-EMAIL-ADDR))        AS    EMAIL_ADDR              
REARCH       ,LTRIM(RTRIM(:S-EMAIL-DISP-PREF))   AS    EMAIL_DISP_PREF         
REARCH       ,LTRIM(RTRIM(:S-PASSWORD))          AS    PASSWORD                
REARCH       ,LTRIM(RTRIM(:S-PASSWORD-HINT))     AS    PASSWORD_HINT           
REARCH       ,LTRIM(RTRIM(:S-LANGUAGE-PREF-CD))  AS    LANGUAGE_PREF_CD        
ID0113       ,:S-DOB-VERIFIED-CD          AS    DOB_VERIFIED_CD         
A00998       ,LTRIM(RTRIM(:S-CREDIT-FL))         AS    CREDIT_FL               
P00172       ,LTRIM(RTRIM(:S-DHR-FL))            AS    DHR_FL                  
P00422       ,LTRIM(RTRIM(:S-PROP-MGR-FL))       AS    PROP_MGR_FL             
P00422       ,LTRIM(RTRIM(:S-REVERT-ELIG-FL))    AS    REVERT_ELIG_FL          
P00465       ,LTRIM(RTRIM(:S-WELCOME-KIT-CD))    AS    WELCOME_KIT_CD          
P00465       ,LTRIM(RTRIM(:S-WELCOME-DISP-FL))   AS    WELCOME_DISP_FL         
CVT000          FROM CIS.SYSDUMMY1                                   
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ027
MFA-TR* MSQ029
MFA-TR*    EXEC SQL                                                             
MFA-TR*      DECLARE C1 CURSOR WITH RETURN FOR                                  
MFA-TR*      SELECT                                                             
MFA-TR*       :S-RETURN-CODE              AS    RETURN_CODE                     
MFA-TR*      ,:S-CUSTOMER-NO              AS    CUSTOMER_NO                     
MFA-TR*      ,:S-REV-PROT-IND             AS    REV_PROT_IND                    
MFA-TR*      ,:S-CUSTOMER-EST-DATE        AS    CUSTOMER_EST_DATE               
MFA-TR*      ,STRIP(:S-SERV-EST-DATE)     AS    SERVICE_EST_DATE                
MFA-TR*      ,:S-CUSTOMER-TYPE            AS    CUSTOMER_TYPE                   
MFA-TR*      ,STRIP(:S-TITLE-PREFIX)      AS    PREFIX                          
MFA-TR*      ,STRIP(:S-FIRST-NAME)        AS    FIRST_NAME                      
MFA-TR*      ,STRIP(:S-MIDDLE-NAME)       AS    MIDDLE_NAME                     
MFA-TR*      ,STRIP(:S-LAST-NAME)         AS    LAST_NAME                       
MFA-TR*      ,STRIP(:S-TITLE-SUFFIX)      AS    SUFFIX                          
MFA-TR*      ,STRIP(:S-BUSINESS-NAME)     AS    BUSINESS_NAME                   
MFA-TR*      ,STRIP(:S-NICKNAME)          AS    NICKNAME                        
MFA-TR*      ,STRIP(:S-CUST-HOME-PHONE)   AS    CUST_HOME_PHONE                 
MFA-TR*      ,STRIP(:S-CUST-BUS-PHONE)    AS    CUST_BUS_PHONE                  
MFA-TR*      ,STRIP(:S-CUST-OCCUP)        AS    CUST_OCCUP                      
MFA-TR*      ,STRIP(:S-CUST-WORK-PHONE)   AS    CUST_WORK_PHONE                 
MFA-TR*      ,STRIP(:S-CUST-WORK-PHONE-EXT) AS    CUST_WORK_PHONE_EX            
MFA-TR*      ,STRIP(:S-CUST-EMPLOYER)     AS    CUST_EMPLOYER                   
MFA-TR*      ,STRIP(:S-EMPLOYED-DATE)     AS    EMPLOYED_DATE                   
MFA-TR*      ,STRIP(:S-EMPLOYEE-NBR)      AS    EMPLOYEE_NBR                    
MFA-TR*      ,STRIP(:S-CUST-SSN)          AS    CUST_SSN                        
MFA-TR*      ,STRIP(:S-DATE-OF-BIRTH)     AS    DATE_OF_BIRTH                   
MFA-TR*      ,STRIP(:S-LICENSE-NO)        AS    LICENSE_NO                      
MFA-TR*      ,:S-CODE-STATE-ID            AS    CODE_STATE_ID                   
MFA-TR*      ,STRIP(:S-DRVR-LIC-ISS-DT)   AS    DRVR_LIC_ISS_DT                 
MFA-TR*      ,STRIP(:S-OTHER-ID-TYPE)     AS    OTHER_ID_TYPE                   
MFA-TR*      ,STRIP(:S-OTHER-ID)          AS    OTHER_ID                        
MFA-TR*      ,STRIP(:S-ALIAS)             AS    ALIAS                           
MFA-TR*      ,STRIP(:S-TAX-ID)            AS    TAX_ID                          
MFA-TR*      ,STRIP(:S-COMPANY-IND)       AS    COMPANY_IND                     
MFA-TR*      ,STRIP(:S-BUSINESS-TYPE-CD)  AS    BUSINESS_TYPE_CD                
MFA-TR*      ,STRIP(:S-CONTRACTOR-TYPE)   AS    CONTRACTOR_TYPE                 
MFA-TR*      ,STRIP(:S-CONSULTING-PROJ)   AS    CONSULTING_PROJ                 
MFA-TR*      ,STRIP(:S-CONSLT-PRJ-END-DT) AS    CONSLT_PRJ_END_DT               
MFA-TR*      ,:S-SERV-ORDER-NO            AS    SERV_ORDER_NO                   
MFA-TR*      ,STRIP(:S-LAST-VISIT-DATE)   AS    LAST_VISIT_DATE                 
MFA-TR*      ,STRIP(:S-LOCAL-OFFICE)      AS    LOCAL_OFFICE                    
MFA-TR*      ,:S-COMPANY-NO               AS    COMPANY_NO                      
MFA-TR*      ,STRIP(:S-DISABLE-NAME-FLAG) AS    DISABLE_NAME_FLAG               
MFA-TR*      ,:S-SECURED-RATE-FLAG        AS    SECURED_RATE_FLAG               
MFA-TR*      ,STRIP(:S-REFUSED-SSN-FL)    AS    REFUSED_SSN                     
MFA-TR*      ,STRIP(:S-CUST-ALT-PHONE)    AS    CUST_ALT_PHONE                  
MFA-TR*      ,STRIP(:S-EMAIL-ADDR)        AS    EMAIL_ADDR                      
MFA-TR*      ,STRIP(:S-EMAIL-DISP-PREF)   AS    EMAIL_DISP_PREF                 
MFA-TR*      ,STRIP(:S-PASSWORD)          AS    PASSWORD                        
MFA-TR*      ,STRIP(:S-PASSWORD-HINT)     AS    PASSWORD_HINT                   
MFA-TR*      ,STRIP(:S-LANGUAGE-PREF-CD)  AS    LANGUAGE_PREF_CD                
MFA-TR*      ,:S-DOB-VERIFIED-CD          AS    DOB_VERIFIED_CD                 
MFA-TR*      ,STRIP(:S-CREDIT-FL)         AS    CREDIT_FL                       
MFA-TR*      ,STRIP(:S-DHR-FL)            AS    DHR_FL                          
MFA-TR*      ,STRIP(:S-PROP-MGR-FL)       AS    PROP_MGR_FL                     
MFA-TR*      ,STRIP(:S-REVERT-ELIG-FL)    AS    REVERT_ELIG_FL                  
MFA-TR*      ,STRIP(:S-WELCOME-KIT-CD)    AS    WELCOME_KIT_CD                  
MFA-TR*      ,STRIP(:S-WELCOME-DISP-FL)   AS    WELCOME_DISP_FL                 
MFA-TR*         FROM SYSIBM.SYSDUMMY1                                           
MFA-TR*    END-EXEC.                                                            
CVT000     MOVE LINK-CUSTOMER-NO          TO PARM-CUSTOMER-NO         . 
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************03240000
      * 1000-PROCESS-INPUT                                             *03250000
      *                                                                *03260000
      *     RECEIVE PARMS FROM THE CALLING STORED PROCEDURE.           *03270000
      *                                                                *03280000
      ******************************************************************03290000
       1000-PROCESS-INPUT.                                              
                                                                        
           MOVE PARM-CUSTOMER-NO      TO RS-CUSTOMER-NO.                
           MOVE PARM-CUSTOMER-NO-RED  TO WS-CUSTOMER-NO-NUM.            
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ************************************************************      03580000
      *   2000-PROCESS-OUTPUT                                    *      03590000
      *                                                          *      03600000
      *   1. DESCRIBE RESULT SET                                 *      03610000
      *   2. RETRIEVE DB2 DATA AND BUILD RESULT SET              *      03620000
      *   3. SEND RESULT SET                                     *      03630000
      *                                                          *      03640000
      ************************************************************      03650000
       2000-PROCESS-OUTPUT.                                             
                                                                        
            PERFORM 2200-BUILD-RESULT    THRU 2200-EXIT.                
            MOVE '2000'          TO ACTIVE-PARAGRAPH.                   
REARCH      PERFORM 2000A-MOVE-RESULT    THRU 2000A-EXIT.               
            PERFORM 8100-SEND-RESULT     THRU 8100-EXIT.                
                                                                        
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
REARCH******************************************************************03760000
REARCH*2000A-MOVE-RESULT.                                               03760000
REARCH******************************************************************03760000
REARCH 2000A-MOVE-RESULT.                                               
REARCH*                                                                 03760000
REARCH     MOVE RS-RETURN-CODE         TO S-RETURN-CODE.                
REARCH     MOVE RS-CUSTOMER-NO         TO S-CUSTOMER-NO.                
REARCH     MOVE RS-CUSTOMER-EST-DATE   TO S-CUSTOMER-EST-DATE.          
REARCH     MOVE RS-REV-PROT-IND        TO S-REV-PROT-IND.               
REARCH     MOVE RS-SERV-EST-DATE       TO S-SERV-EST-DATE.              
REARCH     MOVE RS-CUSTOMER-TYPE       TO S-CUSTOMER-TYPE.              
REARCH     MOVE RS-FIRST-NAME          TO S-FIRST-NAME.                 
REARCH     MOVE RS-MIDDLE-NAME         TO S-MIDDLE-NAME.                
REARCH     MOVE RS-LAST-NAME           TO S-LAST-NAME.                  
REARCH     MOVE RS-NICKNAME            TO S-NICKNAME.                   
REARCH     MOVE RS-TITLE-PREFIX        TO S-TITLE-PREFIX.               
REARCH     MOVE RS-TITLE-SUFFIX        TO S-TITLE-SUFFIX.               
REARCH     MOVE RS-BUSINESS-NAME       TO S-BUSINESS-NAME.              
REARCH     MOVE RS-CUST-OCCUP          TO S-CUST-OCCUP.                 
REARCH     MOVE RS-CUST-WORK-PHONE     TO S-CUST-WORK-PHONE.            
REARCH     MOVE RS-CUST-WORK-PHONE-EXT TO S-CUST-WORK-PHONE-EXT.        
REARCH     MOVE RS-CUST-HOME-PHONE     TO S-CUST-HOME-PHONE.            
REARCH     MOVE RS-CUST-BUS-PHONE      TO S-CUST-BUS-PHONE.             
REARCH     MOVE RS-CUST-EMPLOYER       TO S-CUST-EMPLOYER.              
REARCH     MOVE RS-EMPLOYED-DATE       TO S-EMPLOYED-DATE.              
REARCH     MOVE RS-EMPLOYEE-NBR        TO S-EMPLOYEE-NBR.               
REARCH     MOVE RS-CUST-SSN            TO S-CUST-SSN.                   
REARCH     MOVE RS-CODE-STATE-ID       TO S-CODE-STATE-ID.              
REARCH     MOVE RS-LICENSE-NO          TO S-LICENSE-NO.                 
REARCH     MOVE RS-DATE-OF-BIRTH       TO S-DATE-OF-BIRTH.              
REARCH     MOVE RS-DRVR-LIC-ISS-DT     TO S-DRVR-LIC-ISS-DT.            
REARCH     MOVE RS-OTHER-ID-TYPE       TO S-OTHER-ID-TYPE.              
REARCH     MOVE RS-OTHER-ID            TO S-OTHER-ID.                   
REARCH     MOVE RS-ALIAS               TO S-ALIAS.                      
REARCH     MOVE RS-TAX-ID              TO S-TAX-ID.                     
REARCH     MOVE RS-COMPANY-IND         TO S-COMPANY-IND.                
REARCH     MOVE RS-BUSINESS-TYPE-CD    TO S-BUSINESS-TYPE-CD.           
REARCH     MOVE RS-CONTRACTOR-TYPE     TO S-CONTRACTOR-TYPE.            
REARCH     MOVE RS-CONSULTING-PROJ     TO S-CONSULTING-PROJ.            
REARCH     MOVE RS-CONSLT-PRJ-END-DT   TO S-CONSLT-PRJ-END-DT.          
REARCH     MOVE RS-SERV-ORDER-NO       TO S-SERV-ORDER-NO.              
REARCH     MOVE RS-LAST-VISIT-DATE     TO S-LAST-VISIT-DATE.            
REARCH     MOVE RS-LOCAL-OFFICE        TO S-LOCAL-OFFICE.               
REARCH     MOVE RS-COMPANY-NO          TO S-COMPANY-NO.                 
REARCH     MOVE RS-DISABLE-NAME-FLAG   TO S-DISABLE-NAME-FLAG.          
REARCH     MOVE RS-SECURED-RATE-FLAG   TO S-SECURED-RATE-FLAG.          
REARCH     MOVE RS-REFUSED-SSN-FL      TO S-REFUSED-SSN-FL.             
REARCH     MOVE RS-CUST-ALT-PHONE      TO S-CUST-ALT-PHONE.             
REARCH     MOVE RS-EMAIL-ADDR          TO S-EMAIL-ADDR.                 
REARCH     MOVE RS-EMAIL-DISP-PREF     TO S-EMAIL-DISP-PREF.            
REARCH     MOVE RS-PASSWORD            TO S-PASSWORD.                   
REARCH     MOVE RS-PASSWORD-HINT       TO S-PASSWORD-HINT.              
REARCH     MOVE RS-LANGUAGE-PREF-CD    TO S-LANGUAGE-PREF-CD.           
ID0113     MOVE RS-DOB-VERIFIED-CD     TO S-DOB-VERIFIED-CD.            
A00998     MOVE RS-CREDIT-FL           TO S-CREDIT-FL.                  
P00172     MOVE RS-DHR-FL              TO S-DHR-FL.                     
P00422     MOVE RS-PROP-MGR-FL         TO S-PROP-MGR-FL.                
P00422     MOVE RS-REVERT-ELIG-FL      TO S-REVERT-ELIG-FL.             
P00465     MOVE RS-WELCOME-KIT-CD      TO S-WELCOME-KIT-CD.             
P00465     MOVE RS-WELCOME-DISP-FL     TO S-WELCOME-DISP-FL.            
REARCH*                                                                 03760000
REARCH 2000A-EXIT.                                                      
REARCH     EXIT.                                                        
REARCH******************************************************************03760000
      ******************************************************************11460000
      *   2200-BUILD-RESULT                                            *11470000
      *                                                                *11480000
      *   1.  SELECT AND FORMAT ALL CUSTOMER DETAIL INFORMATION        *11500000
      *       TO BE RETURNED.                                          *11512000
      *                                                                *11520000
      ******************************************************************11530000
       2200-BUILD-RESULT.                                               
                                                                        
            PERFORM 7000-SELECT-CUSTOMER-DTLS   THRU 7000-EXIT.         
                                                                        
            PERFORM 7100-SELECT-RES-STATS       THRU 7100-EXIT.         
                                                                        
            PERFORM 7200-SELECT-BUS-STATS       THRU 7200-EXIT.         
                                                                        
            PERFORM 7300-SELECT-MISC-INFO       THRU 7300-EXIT.         
                                                                        
            MOVE WS-HOME-PHONE-TYPE     TO WS-PHONE-TYPE.               
            PERFORM 7400-SELECT-PHONE-NO     THRU 7400-EXIT.            
            IF WS-ACTIVE-RETURN-CODE  = SUCCESSFUL-CALL                 
               MOVE CB-PHONE-NO         TO RS-CUST-HOME-PHONE           
            ELSE                                                        
               MOVE SPACES              TO RS-CUST-HOME-PHONE           
            END-IF.                                                     
                                                                        
            MOVE WS-WORK-PHONE-TYPE     TO WS-PHONE-TYPE.               
            PERFORM 7400-SELECT-PHONE-NO     THRU 7400-EXIT.            
            IF WS-ACTIVE-RETURN-CODE  = SUCCESSFUL-CALL                 
               MOVE CB-PHONE-NO         TO RS-CUST-WORK-PHONE           
               MOVE CB-EXTENSION-NO     TO RS-CUST-WORK-PHONE-EXT       
            ELSE                                                        
               MOVE SPACES              TO RS-CUST-WORK-PHONE           
               MOVE SPACES              TO RS-CUST-WORK-PHONE-EXT       
            END-IF.                                                     
                                                                        
            MOVE WS-BUS-PHONE-TYPE      TO WS-PHONE-TYPE.               
            PERFORM 7400-SELECT-PHONE-NO     THRU 7400-EXIT.            
            IF WS-ACTIVE-RETURN-CODE  = SUCCESSFUL-CALL                 
               MOVE CB-PHONE-NO         TO RS-CUST-BUS-PHONE            
            ELSE                                                        
P00740          IF DQ-NAME-FORMAT = 'B'                                 
P00740             MOVE RS-CUST-HOME-PHONE TO RS-CUST-BUS-PHONE         
P00740          END-IF                                                  
            END-IF.                                                     
                                                                        
T27707      MOVE WS-ALT-PHONE-TYPE     TO WS-PHONE-TYPE.                
T27707      PERFORM 7400-SELECT-PHONE-NO     THRU 7400-EXIT.            
T27707      IF WS-ACTIVE-RETURN-CODE  = SUCCESSFUL-CALL                 
T27707         MOVE CB-PHONE-NO         TO RS-CUST-ALT-PHONE            
T27707      ELSE                                                        
T27707         MOVE SPACES              TO RS-CUST-ALT-PHONE            
T27707      END-IF.                                                     
                                                                        
22131       PERFORM 7500-SELECT-SEC-RATE-FL THRU 7500-EXIT.             
                                                                        
T27707      PERFORM 7550-SELECT-EMAIL       THRU 7550-EXIT.             
A00998      PERFORM 7560-CHECK-CREDIT-HIST  THRU 7560-EXIT.             
A01255      IF RS-CREDIT-FL = 'Y'                                       
A01255          NEXT SENTENCE                                           
A01255      ELSE                                                        
A01255          PERFORM 7570-CHECK-PREM-GAS-LINE THRU 7570-EXIT
            END-IF.        
                                                                        
P00422      PERFORM 7600-GET-LANDLORD THRU 7600-EXIT.                   
P00465      PERFORM 5200-GET-WELCOME-DISP-FL      THRU 5200-EXIT.       
                                                                        
       2200-EXIT.                                                       
           EXIT.                                                        
                                                                        
P00465****************************************************************  13250000
P00465**  CALL CSR01416 TO GET THE DATE THAT IS X NUMBER OF         **  13250000
P00465**  BUSINESS DAYS IN THE FUTURE OR PAST                       **  13250000
P00465****************************************************************  13250000
P00465                                                                  
P00465 5100-CALL-CSR01416.                                              
P00465                                                                  
P00465*    EXEC SQL                                                     
P00465*       CALL CSR01416                                             
P00465*           (:INPUT-DATE-1416,                                    
P00465*            :BUSINESS-DAYS-1416)                                 
P00465*    END-EXEC.                                                    

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

MSQ001        MOVE SQLCA TO MSQ001-SQLCABACK
MSQ001        MOVE 0 TO SQLD
MSQ001        EXEC SQL
MSQ001          DESCRIBE CURSOR RESULT_SET_CSR_1416 INTO :SQLDA
MSQ001        END-EXEC
MSQ001        MOVE MSQ001-SQLCABACK TO SQLCA
MSQ001        IF SQLD > 0 AND SQLCODE = 0 THEN
MSQ001          MOVE 466 TO SQLCODE
MSQ001        END-IF
P00465                                                                  
P00465     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
P00465                                                                  
P00465     IF WS-ACTIVE-RETURN-CODE NOT EQUAL +466                      
P00465        MOVE PROGRAM-NAME          TO ABEND-PROGRAM               
P00465        MOVE '5100'                TO ACTIVE-PARAGRAPH            
P00465        MOVE 'CALL'                TO ABEND-FUNCTION              
P00465        MOVE 'CSR01416'            TO TABLE-1                     
P00465        MOVE 'INPUT_DATE'          TO TABLE-ELEMENT-1             
P00465        MOVE INPUT-DATE-1416       TO HOSTVAR-ELEMENT-1           
P00465        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
P00465        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00465     END-IF.                                                      
P00465                                                                  
P00465*    EXEC SQL                                                     
P00465*       ASSOCIATE LOCATORS                                        
P00465*       (:LOC1416)                                                
P00465*       WITH PROCEDURE CSR01416                                   
P00465*    END-EXEC.                                                    
P00465                                                                  
P00465*    EXEC SQL                                                     
P00465*       ALLOCATE RESULT_SET_CSR_1416 CURSOR FOR RESULT SET        
P00465*       :LOC1416                                                  
P00465*    END-EXEC.                                                    
P00465                                                                  
P00465     EXEC SQL                                                     
P00465        FETCH RESULT_SET_CSR_1416 INTO                            
P00465           :OUTPUT-DATE-1416                                      
P00465     END-EXEC.                                                    

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

P00465                                                                  
P00465     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
P00465     EVALUATE WS-ACTIVE-RETURN-CODE                               
P00465         WHEN SUCCESSFUL-CALL                                     
P00465             CONTINUE                                             
P00465         WHEN OTHER                                               
P00465             MOVE PROGRAM-NAME          TO ABEND-PROGRAM          
P00465             MOVE '5100'                TO ACTIVE-PARAGRAPH       
P00465             MOVE 'FETCH'               TO ABEND-FUNCTION         
P00465             MOVE 'CSR01416'            TO TABLE-1                
P00465             MOVE 'INPUT_DATE'          TO TABLE-ELEMENT-1        
P00465             MOVE INPUT-DATE-1416       TO HOSTVAR-ELEMENT-1      
P00465             PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT        
P00465             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
P00465     END-EVALUATE.                                                
P00465                                                                  
P00465 5100-EXIT.                                                       
P00465      EXIT.                                                       
                                                                        
                                                                        
P00465 5200-GET-WELCOME-DISP-FL.                                        
P00465      IF CU-COMPANY-NO-ORIG= '26'                                 
P00465         PERFORM 7610-GET-WELCOME-FL-CUONLY  THRU 7610-EXIT       
P00465      ELSE                                                        
P00465         MOVE 'N' TO RS-WELCOME-DISP-FL                           
P00465      END-IF.                                                     
P00465      IF RS-WELCOME-DISP-FL = 'N'                                 
P00465         PERFORM 7620-GET-WELCOME-FL-PEND THRU 7620-EXIT          
P00465         IF RS-WELCOME-DISP-FL = 'N'                              
P00465            PERFORM 7630-GET-WELCOME-FL   THRU 7630-EXIT          
P00465         END-IF                                                   
P00465      END-IF.                                                     
P00465                                                                  
P00465 5200-EXIT.                                                       
P00465      EXIT.                                                       
                                                                        
                                                                        
      ******************************************************************13260000
      *   7000-SELECT-CUSTOMER-DTLS.                                   *13270000
      *                                                                *13271000
      *   1.  DETERMINE NAME_ID BASED ON PASSED CUSTOMER_NO.           *13272000
      *       USE BOTH CUSTOMER_NO AND NAME_ID TO SELECT CUSTOMER      *13272100
      *       INFORMATION FROM CSS_CUSTOMER AND CSS_NAME TABLES.       *13273000
      ******************************************************************13280000
       7000-SELECT-CUSTOMER-DTLS.                                       
                                                                        
           EXEC SQL                                                     
              SELECT A.CUSTOMER_EST_DATE,                               
                     A.SERVICE_EST_DATE,                                
                     A.CUST_LAST_VISIT_DT,                              
                     A.LOCAL_OFFICE_ORIG,                               
                     A.COMPANY_NO_ORIG,                                 
                     B.NAME_FORMAT,                                     
                     B.FIRST_NAME,                                      
                     B.MIDDLE_NAME,                                     
                     B.LAST_NAME,                                       
                     B.NICKNAME,                                        
                     B.TITLE_PREFIX,                                    
                     B.TITLE_SUFFIX_1,                                  
                     B.FULL_NAME,                                       
                     B.NAME_ID,                                         
P00172               A.DHR_FL,                                          
P00422               A.LANDLORD_REVERT_FL,                              
P00465               A.WELCOME_KIT_CD                                   
              INTO  :CU-CUSTOMER-EST-DATE :WS-NULL-CUST-EST-DT,          
                    :CU-SERVICE-EST-DATE :WS-NULL-SERV-EST-DT,           
                    :CU-CUST-LAST-VISIT-DT :WS-NULL-VISIT-DT,            
                    :CU-LOCAL-OFFICE-ORIG,                              
                    :CU-COMPANY-NO-ORIG,                                
                    :DQ-NAME-FORMAT,                                    
                    :DQ-FIRST-NAME,                                     
                    :DQ-MIDDLE-NAME,                                    
                    :DQ-LAST-NAME,                                      
                    :DQ-NICKNAME,                                       
                    :DQ-TITLE-PREFIX,                                   
                    :DQ-TITLE-SUFFIX-1,                                 
                    :DQ-FULL-NAME,                                      
                    :DQ-NAME-ID,                                        
P00172              :CU-DHR-FL,                                         
P00422              :CU-LANDLORD-REVERT-FL,                             
P00465              :CU-WELCOME-KIT-CD                                  
              FROM   CSS_CUSTOMER A WITH(READUNCOMMITTED),                      
                     CSS_NAME B WITH(READUNCOMMITTED)                           
              WHERE  A.CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                
                AND  B.NAME_ID     =  A.NAME_ID                         
                AND  B.NAME_TYPE   = :WS-CUST-NAME-TYPE                 
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     13320000
MFA-TR*       SELECT A.CUSTOMER_EST_DATE,                               13330000
MFA-TR*              A.SERVICE_EST_DATE,                                13330200
MFA-TR*              A.CUST_LAST_VISIT_DT,                              13330300
MFA-TR*              A.LOCAL_OFFICE_ORIG,                               13330400
MFA-TR*              A.COMPANY_NO_ORIG,                                 13330500
MFA-TR*              B.NAME_FORMAT,                                     13330700
MFA-TR*              B.FIRST_NAME,                                      13330800
MFA-TR*              B.MIDDLE_NAME,                                     13330900
MFA-TR*              B.LAST_NAME,                                       13331000
MFA-TR*              B.NICKNAME,                                        13331100
MFA-TR*              B.TITLE_PREFIX,                                    13332000
MFA-TR*              B.TITLE_SUFFIX_1,                                  13380000
MFA-TR*              B.FULL_NAME,                                       13390000
MFA-TR*              B.NAME_ID,                                         13400000
MFA-TR*              A.DHR_FL,                                                  
MFA-TR*              A.LANDLORD_REVERT_FL,                                      
MFA-TR*              A.WELCOME_KIT_CD                                           
MFA-TR*       INTO  :CU-CUSTOMER-EST-DATE:WS-NULL-CUST-EST-DT,          13440101
MFA-TR*             :CU-SERVICE-EST-DATE:WS-NULL-SERV-EST-DT,           13440300
MFA-TR*             :CU-CUST-LAST-VISIT-DT:WS-NULL-VISIT-DT,            13440400
MFA-TR*             :CU-LOCAL-OFFICE-ORIG,                              13440500
MFA-TR*             :CU-COMPANY-NO-ORIG,                                13440600
MFA-TR*             :DQ-NAME-FORMAT,                                    13440700
MFA-TR*             :DQ-FIRST-NAME,                                     13440800
MFA-TR*             :DQ-MIDDLE-NAME,                                    13440900
MFA-TR*             :DQ-LAST-NAME,                                      13441000
MFA-TR*             :DQ-NICKNAME,                                       13441100
MFA-TR*             :DQ-TITLE-PREFIX,                                   13441200
MFA-TR*             :DQ-TITLE-SUFFIX-1,                                 13441300
MFA-TR*             :DQ-FULL-NAME,                                      13442000
MFA-TR*             :DQ-NAME-ID,                                        13443000
MFA-TR*             :CU-DHR-FL,                                         13443000
MFA-TR*             :CU-LANDLORD-REVERT-FL,                             13443000
MFA-TR*             :CU-WELCOME-KIT-CD                                  13443000
MFA-TR*       FROM   CSS_CUSTOMER A,                                    13550000
MFA-TR*              CSS_NAME B                                         13551000
MFA-TR*       WHERE  A.CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                13560000
MFA-TR*         AND  B.NAME_ID     =  A.NAME_ID                         13561000
MFA-TR*         AND  B.NAME_TYPE   = :WS-CUST-NAME-TYPE                 13562000
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7000                                                    
MFA-TR*    END-EXEC.                                                    13570000

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

                                                                        
                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     
              MOVE '7000'          TO ACTIVE-PARAGRAPH                  
              MOVE 'SELECT'             TO ABEND-FUNCTION               
              MOVE 'CSS_NAME'           TO TABLE-1                      
CBSI          MOVE 'CSS_CUSTOMER'       TO TABLE-2                      
              MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
              MOVE 'NAME_TYPE'          TO TABLE-ELEMENT-2              
              MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
CBSI          MOVE WS-CUST-NAME-TYPE    TO HOSTVAR-ELEMENT-2            
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
                                                                        
           MOVE DQ-NAME-FORMAT         TO RS-CUSTOMER-TYPE.             
           MOVE DQ-NICKNAME            TO RS-NICKNAME.                  
           MOVE CU-LOCAL-OFFICE-ORIG   TO RS-LOCAL-OFFICE.              
           MOVE CU-COMPANY-NO-ORIG     TO RS-COMPANY-NO.                
P00172     MOVE CU-DHR-FL              TO RS-DHR-FL.                    
P00422     MOVE CU-LANDLORD-REVERT-FL  TO RS-REVERT-ELIG-FL.            
P00465     MOVE CU-WELCOME-KIT-CD      TO RS-WELCOME-KIT-CD.            
                                                                        
           IF DQ-NAME-FORMAT = WS-CUST-NAME-FORMAT                      
              MOVE DQ-FIRST-NAME       TO RS-FIRST-NAME                 
              MOVE DQ-MIDDLE-NAME      TO RS-MIDDLE-NAME                
              MOVE DQ-LAST-NAME        TO RS-LAST-NAME                  
              MOVE DQ-TITLE-PREFIX     TO RS-TITLE-PREFIX               
              MOVE DQ-TITLE-SUFFIX-1   TO RS-TITLE-SUFFIX               
           ELSE                                                         
              MOVE DQ-FULL-NAME        TO RS-BUSINESS-NAME              
           END-IF.                                                      
                                                                        
17662      IF DQ-NAME-ID EQUAL WS-INACTIVE-NAME-IDI OR                  
              DQ-NAME-ID EQUAL WS-INACTIVE-NAME-IDB                     
              MOVE WS-X                TO RS-DISABLE-NAME-FLAG          
                                                                        
              MOVE DQ-FIRST-NAME       TO RS-FIRST-NAME                 
              MOVE DQ-LAST-NAME        TO RS-LAST-NAME                  
           END-IF.                                                      
                                                                        
           IF WS-NULL-CUST-EST-DT = -1                                  
              MOVE SPACES               TO RS-CUSTOMER-EST-DATE         
           ELSE                                                         
              MOVE CU-CUSTOMER-EST-DATE TO WS-SELECT-DATE-FORM          
              MOVE WS-SELECT-YEAR       TO WS-RETURN-YEAR               
              MOVE WS-SELECT-MONTH      TO WS-RETURN-MONTH              
              MOVE WS-SELECT-DAY        TO WS-RETURN-DAY                
              MOVE WS-RETURN-DATE-FORM  TO RS-CUSTOMER-EST-DATE         
           END-IF.                                                      
                                                                        
           IF WS-NULL-SERV-EST-DT = -1                                  
              MOVE SPACES               TO RS-SERV-EST-DATE             
           ELSE                                                         
              MOVE CU-SERVICE-EST-DATE  TO WS-SELECT-DATE-FORM          
              MOVE WS-SELECT-YEAR       TO WS-RETURN-YEAR               
              MOVE WS-SELECT-MONTH      TO WS-RETURN-MONTH              
              MOVE WS-SELECT-DAY        TO WS-RETURN-DAY                
              MOVE WS-RETURN-DATE-FORM  TO RS-SERV-EST-DATE             
           END-IF.                                                      
                                                                        
           IF WS-NULL-VISIT-DT = -1                                     
              MOVE SPACES                TO RS-LAST-VISIT-DATE          
           ELSE                                                         
              MOVE CU-CUST-LAST-VISIT-DT TO WS-SELECT-DATE-FORM         
              MOVE WS-SELECT-YEAR        TO WS-RETURN-YEAR              
              MOVE WS-SELECT-MONTH       TO WS-RETURN-MONTH             
              MOVE WS-SELECT-DAY         TO WS-RETURN-DAY               
              MOVE WS-RETURN-DATE-FORM   TO RS-LAST-VISIT-DATE          
           END-IF.                                                      
                                                                        
       7000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************14140000
      *   7100-SELECT-RES-STATS                                        *14150000
      *                                                                *14151000
      *   1. SELECT RESIDENTIAL INFORMATION FROM CSS_CUST_STATS.       *14151100
      *                                                                *14152000
      ******************************************************************14160000
       7100-SELECT-RES-STATS.                                           
                                                                        
           EXEC SQL                                                     
              SELECT SSN,                                               
                     CODE_STATE_ID,                                     
                     DRIVERS_LICENSE_NO,                                
                     EMPLOYER,                                          
                     EMPLOYED_DATE,                                     
                     OCCUPATION,                                        
                     OTHER_ID_TYPE,                                     
                     OTHER_ID,                                          
                     DRVR_LIC_ISS_DT,                                   
                     DATE_OF_BIRTH,                                     
                     EMPLOYEE_NBR,                                      
                     INTR_CO_IND,                                       
T27707               PASSWORD_HINT_CD,                                  
T27707               PASSWORD_TX,                                       
T27707               REFUSED_SSN_FL,                                    
C31904               LANGUAGE_PREF_CD,                                  
ID0113               DOB_VERIFIED_CD                                    
              INTO  :CE-SSN,                                            
                    :CE-CODE-STATE-ID,                                  
                    :CE-DRIVERS-LICENSE-NO,                             
                    :CE-EMPLOYER,                                       
                    :CE-EMPLOYED-DATE :WS-NULL-EMP-DT,                   
                    :CE-OCCUPATION,                                     
                    :CE-OTHER-ID-TYPE,                                  
                    :CE-OTHER-ID,                                       
                    :CE-DRVR-LIC-ISS-DT :WS-NULL-DRV-LIC-DT,             
                    :CE-DATE-OF-BIRTH :WS-NULL-BIRTH-DT,                 
                    :CE-EMPLOYEE-NBR,                                   
                    :CE-INTR-CO-IND,                                    
T27707              :CE-PASSWORD-HINT-CD,                               
T27707              :CE-PASSWORD-TX,                                    
T27707              :CE-REFUSED-SSN-FL,                                 
C31904              :CE-LANGUAGE-PREF-CD,                               
ID0113              :CE-DOB-VERIFIED-CD                                 
              FROM   CSS_CUST_STATS WITH(READUNCOMMITTED)                       
              WHERE  CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM                
                AND  CUSTOMER_TYPE = :WS-CUST-CUSTOMER-TYPE             
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     14200000
MFA-TR*       SELECT SSN,                                               14210000
MFA-TR*              CODE_STATE_ID,                                     14240000
MFA-TR*              DRIVERS_LICENSE_NO,                                14250000
MFA-TR*              EMPLOYER,                                          14260000
MFA-TR*              EMPLOYED_DATE,                                     14270000
MFA-TR*              OCCUPATION,                                        14280000
MFA-TR*              OTHER_ID_TYPE,                                     14310000
MFA-TR*              OTHER_ID,                                          14320000
MFA-TR*              DRVR_LIC_ISS_DT,                                   14330000
MFA-TR*              DATE_OF_BIRTH,                                     14340000
MFA-TR*              EMPLOYEE_NBR,                                      14350000
MFA-TR*              INTR_CO_IND,                                       14370000
MFA-TR*              PASSWORD_HINT_CD,                                  14370000
MFA-TR*              PASSWORD_TX,                                       14370000
MFA-TR*              REFUSED_SSN_FL,                                    14370000
MFA-TR*              LANGUAGE_PREF_CD,                                          
MFA-TR*              DOB_VERIFIED_CD                                            
MFA-TR*       INTO  :CE-SSN,                                            14380000
MFA-TR*             :CE-CODE-STATE-ID,                                  14410000
MFA-TR*             :CE-DRIVERS-LICENSE-NO,                             14420000
MFA-TR*             :CE-EMPLOYER,                                       14430000
MFA-TR*             :CE-EMPLOYED-DATE:WS-NULL-EMP-DT,                   14440000
MFA-TR*             :CE-OCCUPATION,                                     14450000
MFA-TR*             :CE-OTHER-ID-TYPE,                                  14480000
MFA-TR*             :CE-OTHER-ID,                                       14490000
MFA-TR*             :CE-DRVR-LIC-ISS-DT:WS-NULL-DRV-LIC-DT,             14500000
MFA-TR*             :CE-DATE-OF-BIRTH:WS-NULL-BIRTH-DT,                 14510000
MFA-TR*             :CE-EMPLOYEE-NBR,                                   14520000
MFA-TR*             :CE-INTR-CO-IND,                                    14540000
MFA-TR*             :CE-PASSWORD-HINT-CD,                               14540000
MFA-TR*             :CE-PASSWORD-TX,                                    14540000
MFA-TR*             :CE-REFUSED-SSN-FL,                                 14540000
MFA-TR*             :CE-LANGUAGE-PREF-CD,                                       
MFA-TR*             :CE-DOB-VERIFIED-CD                                         
MFA-TR*       FROM   CSS_CUST_STATS                                     14550000
MFA-TR*       WHERE  CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM                14560000
MFA-TR*         AND  CUSTOMER_TYPE = :WS-CUST-CUSTOMER-TYPE             14561000
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7100                                                    
MFA-TR*    END-EXEC.                                                    14570000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND OR SUCCESSFUL-CALL      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME         TO ABEND-PROGRAM                
              MOVE '7100'               TO ACTIVE-PARAGRAPH             
              MOVE 'SELECT'             TO ABEND-FUNCTION               
              MOVE 'CSS_CUST_STATS'     TO TABLE-1                      
              MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
CBSI          MOVE 'CUSTOMER_TYPE'      TO TABLE-ELEMENT-2              
              MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
CBSI          MOVE WS-CUST-CUSTOMER-TYPE TO HOSTVAR-ELEMENT-2           
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              MOVE CE-SSN                TO RS-CUST-SSN                 
              MOVE CE-CODE-STATE-ID      TO RS-CODE-STATE-ID            
              MOVE CE-DRIVERS-LICENSE-NO TO RS-LICENSE-NO               
              MOVE CE-EMPLOYER           TO RS-CUST-EMPLOYER            
              MOVE CE-OCCUPATION         TO RS-CUST-OCCUP               
              MOVE CE-OTHER-ID-TYPE      TO RS-OTHER-ID-TYPE            
              MOVE CE-OTHER-ID           TO RS-OTHER-ID                 
              MOVE CE-EMPLOYEE-NBR       TO RS-EMPLOYEE-NBR             
T27707        MOVE CE-PASSWORD-HINT-CD   TO RS-PASSWORD-HINT            
T27707        MOVE CE-PASSWORD-TX        TO RS-PASSWORD                 
T27707        MOVE CE-REFUSED-SSN-FL     TO RS-REFUSED-SSN-FL           
C31904        MOVE CE-LANGUAGE-PREF-CD   TO RS-LANGUAGE-PREF-CD         
ID0113        MOVE CE-DOB-VERIFIED-CD    TO RS-DOB-VERIFIED-CD          
                                                                        
              IF WS-NULL-EMP-DT = -1                                    
                 MOVE SPACES             TO RS-EMPLOYED-DATE            
              ELSE                                                      
                 MOVE CE-EMPLOYED-DATE    TO WS-SELECT-DATE-FORM        
                 MOVE WS-SELECT-YEAR      TO WS-RETURN-YEAR             
                 MOVE WS-SELECT-MONTH     TO WS-RETURN-MONTH            
                 MOVE WS-SELECT-DAY       TO WS-RETURN-DAY              
                 MOVE WS-RETURN-DATE-FORM TO RS-EMPLOYED-DATE           
              END-IF                                                    
                                                                        
              IF WS-NULL-DRV-LIC-DT = -1                                
                 MOVE SPACES             TO RS-DRVR-LIC-ISS-DT          
              ELSE                                                      
                 MOVE CE-DRVR-LIC-ISS-DT  TO WS-SELECT-DATE-FORM        
                 MOVE WS-SELECT-YEAR      TO WS-RETURN-YEAR             
                 MOVE WS-SELECT-MONTH     TO WS-RETURN-MONTH            
                 MOVE WS-SELECT-DAY       TO WS-RETURN-DAY              
                 MOVE WS-RETURN-DATE-FORM TO RS-DRVR-LIC-ISS-DT         
              END-IF                                                    
                                                                        
              IF WS-NULL-BIRTH-DT = -1                                  
                 MOVE SPACES             TO RS-DATE-OF-BIRTH            
              ELSE                                                      
                 MOVE CE-DATE-OF-BIRTH    TO WS-SELECT-DATE-FORM        
                 MOVE WS-SELECT-YEAR      TO WS-RETURN-YEAR             
                 MOVE WS-SELECT-MONTH     TO WS-RETURN-MONTH            
                 MOVE WS-SELECT-DAY       TO WS-RETURN-DAY              
                 MOVE WS-RETURN-DATE-FORM TO RS-DATE-OF-BIRTH           
              END-IF                                                    
                                                                        
           ELSE                                                         
              MOVE SPACES                 TO RS-CUST-SSN                
              MOVE SPACES                 TO RS-CODE-STATE-ID           
              MOVE SPACES                 TO RS-LICENSE-NO              
              MOVE SPACES                 TO RS-CUST-EMPLOYER           
              MOVE SPACES                 TO RS-CUST-OCCUP              
              MOVE SPACES                 TO RS-OTHER-ID-TYPE           
              MOVE SPACES                 TO RS-OTHER-ID                
              MOVE SPACES                 TO RS-EMPLOYEE-NBR            
              MOVE SPACES                 TO RS-EMPLOYED-DATE           
              MOVE SPACES                 TO RS-DRVR-LIC-ISS-DT         
              MOVE SPACES                 TO RS-DATE-OF-BIRTH           
T27707        MOVE SPACES                 TO RS-PASSWORD-HINT           
T27707        MOVE SPACES                 TO RS-PASSWORD                
T27707        MOVE SPACES                 TO RS-REFUSED-SSN-FL          
C31904        MOVE SPACES                 TO RS-LANGUAGE-PREF-CD        
ID0113        MOVE SPACES                 TO RS-DOB-VERIFIED-CD         
           END-IF.                                                      
                                                                        
       7100-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************14770000
      *   7200-SELECT-BUS-STATS.                                       *14780000
      *                                                                *14781000
      *   1. SELECT BUSINESS INFORMATION FROM CSS_BUS_CUST_STATS.      *14781100
      *                                                                *14783000
      ******************************************************************14790000
       7200-SELECT-BUS-STATS.                                           
                                                                        
           EXEC SQL                                                     
              SELECT BUSINESS_TYPE_CD,                                  
                     TAX_ID,                                            
                     ALIAS,                                             
                     INTRA_CO_IND,                                      
                     SUBSIDIARY_IND,                                    
                     TRADE_ALLY_IND,                                    
                     CONTRACTOR_TYPE                                    
              INTO  :BS-BUSINESS-TYPE-CD,                               
                    :BS-TAX-ID,                                         
                    :BS-ALIAS,                                          
                    :BS-INTRA-CO-IND,                                   
                    :BS-SUBSIDIARY-IND,                                 
                    :BS-TRADE-ALLY-IND,                                 
                    :BS-CONTRACTOR-TYPE                                 
              FROM  CSS_BUS_CUST_STATS WITH(READUNCOMMITTED)                    
              WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     14830000
MFA-TR*       SELECT BUSINESS_TYPE_CD,                                  14850000
MFA-TR*              TAX_ID,                                            14851000
MFA-TR*              ALIAS,                                             14860000
MFA-TR*              INTRA_CO_IND,                                      14870000
MFA-TR*              SUBSIDIARY_IND,                                    14880000
MFA-TR*              TRADE_ALLY_IND,                                    14890000
MFA-TR*              CONTRACTOR_TYPE                                    14900000
MFA-TR*       INTO  :BS-BUSINESS-TYPE-CD,                               14930000
MFA-TR*             :BS-TAX-ID,                                         14931000
MFA-TR*             :BS-ALIAS,                                          14940000
MFA-TR*             :BS-INTRA-CO-IND,                                   14950000
MFA-TR*             :BS-SUBSIDIARY-IND,                                 14960000
MFA-TR*             :BS-TRADE-ALLY-IND,                                 14970000
MFA-TR*             :BS-CONTRACTOR-TYPE                                 14980000
MFA-TR*       FROM  CSS_BUS_CUST_STATS                                  15000000
MFA-TR*       WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              15010000
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7200                                                    
MFA-TR*    END-EXEC.                                                    15020000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND OR SUCCESSFUL-CALL      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME         TO ABEND-PROGRAM                
              MOVE '7200'               TO ACTIVE-PARAGRAPH             
              MOVE 'SELECT'             TO ABEND-FUNCTION               
              MOVE 'CSS_BUS_CUST_STATS' TO TABLE-1                      
              MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
              MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              MOVE BS-BUSINESS-TYPE-CD   TO RS-BUSINESS-TYPE-CD         
              MOVE BS-TAX-ID             TO RS-TAX-ID                   
              MOVE BS-ALIAS              TO RS-ALIAS                    
              MOVE BS-CONTRACTOR-TYPE    TO RS-CONTRACTOR-TYPE          
                                                                        
              IF BS-INTRA-CO-IND = 'Y'                                  
                 MOVE 'I'                TO RS-COMPANY-IND              
              ELSE                                                      
                 IF BS-SUBSIDIARY-IND = 'Y'                             
                    MOVE 'S'             TO RS-COMPANY-IND              
                 ELSE                                                   
                    IF BS-TRADE-ALLY-IND = 'Y'                          
                       MOVE 'T'          TO RS-COMPANY-IND              
                    END-IF                                              
                 END-IF                                                 
              END-IF                                                    
                                                                        
           ELSE                                                         
              MOVE SPACES                TO RS-BUSINESS-TYPE-CD         
              MOVE SPACES                TO RS-TAX-ID                   
              MOVE SPACES                TO RS-ALIAS                    
              MOVE SPACES                TO RS-CONTRACTOR-TYPE          
              MOVE SPACES                TO RS-COMPANY-IND              
           END-IF.                                                      
                                                                        
       7200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************15201000
      *   7300-SELECT-MISC-INFO.                                       *15202000
      *                                                                *15202100
      *   1. SELECT CONSULTING PROJECT INFORMATION FROM CSS_MISC_INFO. *15202200
      *                                                                *15202300
      ******************************************************************15203000
       7300-SELECT-MISC-INFO.                                           
                                                                        
           EXEC SQL                                                     
              SELECT CONSULTING_PROJECT,                                
                     CONSLT_PRJ_END_DT                                  
              INTO  :LQ-CONSULTING-PROJECT,                             
                    :LQ-CONSLT-PRJ-END-DT :WS-NULL-CNSLT-END-DT          
              FROM  CSS_CUST_MISC_INFO WITH(READUNCOMMITTED)                    
              WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                   
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     15210900
MFA-TR*       SELECT CONSULTING_PROJECT,                                15211000
MFA-TR*              CONSLT_PRJ_END_DT                                  15211200
MFA-TR*       INTO  :LQ-CONSULTING-PROJECT,                             15211400
MFA-TR*             :LQ-CONSLT-PRJ-END-DT:WS-NULL-CNSLT-END-DT          15211600
MFA-TR*       FROM  CSS_CUST_MISC_INFO                                  15211800
MFA-TR*       WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                   15211900
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7300                                                    
MFA-TR*    END-EXEC.                                                    15212000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND OR SUCCESSFUL-CALL      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     
              MOVE '7300'          TO ACTIVE-PARAGRAPH                  
              MOVE 'SELECT'             TO ABEND-FUNCTION               
              MOVE 'CSS_CUST_MISC_INFO' TO TABLE-1                      
              MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
CBSI          MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              MOVE LQ-CONSULTING-PROJECT   TO RS-CONSULTING-PROJ        
                                                                        
              IF WS-NULL-CNSLT-END-DT = -1                              
                 MOVE SPACES               TO RS-CONSLT-PRJ-END-DT      
              ELSE                                                      
                 MOVE LQ-CONSLT-PRJ-END-DT TO WS-SELECT-DATE-FORM       
                 MOVE WS-SELECT-YEAR       TO WS-RETURN-YEAR            
                 MOVE WS-SELECT-MONTH      TO WS-RETURN-MONTH           
                 MOVE WS-SELECT-DAY        TO WS-RETURN-DAY             
                 MOVE WS-RETURN-DATE-FORM  TO RS-CONSLT-PRJ-END-DT      
              END-IF                                                    
           ELSE                                                         
              MOVE SPACES                  TO RS-CONSULTING-PROJ        
              MOVE SPACES                  TO RS-CONSLT-PRJ-END-DT      
           END-IF.                                                      
                                                                        
       7300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************15224200
      *   7400-SELECT-PHONE-NO.                                        *15224300
      *                                                                *15224400
      *   1. SELECTS PHONE NUMBERS BASED ON THE CUSTOMER NUMBER,       *15224500
      *      CUSTOMER TYPE AND PHONE TYPE.                             *15224600
      *                                                                *15224700
      ******************************************************************15224800
       7400-SELECT-PHONE-NO.                                            
                                                                        
           EXEC SQL                                                     
              SELECT PHONE_NO,                                          
                     EXTENSION_NO                                       
              INTO  :CB-PHONE-NO,                                       
                    :CB-EXTENSION-NO                                    
              FROM  CSS_CUST_PHONE WITH(READUNCOMMITTED)                        
              WHERE CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM                 
                AND PHONE_TYPE    = :WS-PHONE-TYPE                      
                AND CUSTOMER_TYPE = :WS-CUST-CUSTOMER-TYPE              
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     15225100
MFA-TR*       SELECT PHONE_NO,                                          15225200
MFA-TR*              EXTENSION_NO                                       15225300
MFA-TR*       INTO  :CB-PHONE-NO,                                       15225400
MFA-TR*             :CB-EXTENSION-NO                                    15225500
MFA-TR*       FROM  CSS_CUST_PHONE                                      15225600
MFA-TR*       WHERE CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM                 15225700
MFA-TR*         AND PHONE_TYPE    = :WS-PHONE-TYPE                      15225800
MFA-TR*         AND CUSTOMER_TYPE = :WS-CUST-CUSTOMER-TYPE              15225900
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7400                                                    
MFA-TR*    END-EXEC.                                                    15226000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND OR SUCCESSFUL-CALL      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     
              MOVE '7400'          TO ACTIVE-PARAGRAPH                  
              MOVE 'SELECT'             TO ABEND-FUNCTION               
              MOVE 'CSS_CUST_PHONE'     TO TABLE-1                      
              MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
              MOVE 'PHONE_TYPE'         TO TABLE-ELEMENT-2              
              MOVE 'CUSTOMER_TYPE'      TO TABLE-ELEMENT-3              
              MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
              MOVE WS-PHONE-TYPE        TO HOSTVAR-ELEMENT-2            
              MOVE WS-CUST-CUSTOMER-TYPE TO HOSTVAR-ELEMENT-3           
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7400-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************15224200
22131 *   7500-SELECT-SEC-RATE-FL.                                     *15224300
      *                                                                *15224400
      *   1. SELECTS RATE SECURED FLAG FOR SECURITY PURPOSES           *15224500
      *                                                                *15224700
      ******************************************************************15224800
       7500-SELECT-SEC-RATE-FL.                                         
                                                                        
           EXEC SQL                                                     
T35745        SELECT TOP(1) RD.SECURED_RATE_FL                                 
              INTO  :RS-SECURED-RATE-FLAG                               
              FROM  CSS_ACCOUNT AT WITH(READUNCOMMITTED),                       
                    CSS_UTIL_ENVRNMT UT WITH(READUNCOMMITTED),                  
                    CSS_RATE_PLAN_DESC RD WITH(READUNCOMMITTED)                 
              WHERE AT.CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM              
C29772          AND AT.ACCOUNT_NO    = UT.ACCOUNT_NO                    
                AND UT.RATE_PLAN_NO  = RD.RATE_PLAN_NO                  
                AND RD.SECURED_RATE_FL = 'Y'                            
T35745                                            
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     15225100
MFA-TR*       SELECT RD.SECURED_RATE_FL                                 15225200
MFA-TR*       INTO  :RS-SECURED-RATE-FLAG                               15225400
MFA-TR*       FROM  CSS_ACCOUNT AT,                                     15225600
MFA-TR*             CSS_UTIL_ENVRNMT UT,                                        
MFA-TR*             CSS_RATE_PLAN_DESC RD                                       
MFA-TR*       WHERE AT.CUSTOMER_NO   = :WS-CUSTOMER-NO-NUM              15225700
MFA-TR*         AND AT.ACCOUNT_NO    = UT.ACCOUNT_NO                    15225800
MFA-TR*         AND UT.RATE_PLAN_NO  = RD.RATE_PLAN_NO                  15225900
MFA-TR*         AND RD.SECURED_RATE_FL = 'Y'                                    
MFA-TR*         FETCH FIRST 1 ROW ONLY                                          
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7500                                                    
MFA-TR*    END-EXEC.                                                    15226000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           EVALUATE WS-ACTIVE-RETURN-CODE                               
               WHEN SUCCESSFUL-CALL                                     
                   CONTINUE                                             
               WHEN NOT-FOUND                                           
                   MOVE 'N' TO RS-SECURED-RATE-FLAG                     
               WHEN OTHER                                               
                   MOVE PROGRAM-NAME    TO ABEND-PROGRAM                
                   MOVE '7500'          TO ACTIVE-PARAGRAPH             
                   MOVE 'SELECT'             TO ABEND-FUNCTION          
                   MOVE 'CSS_ACCOUNT'        TO TABLE-1                 
                   MOVE 'CSS_UTIL_ENVRNMT'   TO TABLE-2                 
                   MOVE 'CSS_RATE_PLAN_DESC' TO TABLE-3                 
                   MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1         
                   MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1       
                   PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT       
                   PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT       
           END-EVALUATE.                                                
                                                                        
       7500-EXIT.                                                       
           EXIT.                                                        
                                                                        
T27707******************************************************************15224200
T27707*   7550-SELECT-EMAIL                                            *15224300
T27707*                                                                *15224400
      *   1. SELECTS EMAIL INFORMATION FROM THE CUST_EMAIL TABLE       *15224500
      *                                                                *15224700
      ******************************************************************15224800
       7550-SELECT-EMAIL.                                               
                                                                        
           EXEC SQL                                                     
              SELECT EMAIL_DISP_PREF_CD,                                
                     EMAIL_ADDRESS_TX                                   
              INTO  :RS-EMAIL-DISP-PREF,                                
                    :RS-EMAIL-ADDR                                      
              FROM  CSS_CUST_EMAIL WITH(READUNCOMMITTED)                        
              WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              
                AND EMAIL_TYPE_CD    = 'P1'                             
T35745                                                           
                                                            
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     15225100
MFA-TR*       SELECT EMAIL_DISP_PREF_CD,                                15225200
MFA-TR*              EMAIL_ADDRESS_TX                                           
MFA-TR*       INTO  :RS-EMAIL-DISP-PREF,                                15225400
MFA-TR*             :RS-EMAIL-ADDR                                      15225400
MFA-TR*       FROM  CSS_CUST_EMAIL                                      15225600
MFA-TR*       WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              15225700
MFA-TR*         AND EMAIL_TYPE_CD    = 'P1'                             15225800
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7550                                                    
MFA-TR*    END-EXEC.                                                    15226000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
                                                                        
           EVALUATE WS-ACTIVE-RETURN-CODE                               
               WHEN SUCCESSFUL-CALL                                     
                   CONTINUE                                             
               WHEN NOT-FOUND                                           
                   MOVE SPACES     TO    RS-EMAIL-DISP-PREF             
                   MOVE SPACES     TO    RS-EMAIL-ADDR                  
               WHEN OTHER                                               
                   MOVE PROGRAM-NAME    TO ABEND-PROGRAM                
                   MOVE '7550'          TO ACTIVE-PARAGRAPH             
                   MOVE 'SELECT'             TO ABEND-FUNCTION          
                   MOVE 'CSS_CUST_EMAIL'     TO TABLE-1                 
                   MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1         
                   MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1       
                   PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT       
                   PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT       
           END-EVALUATE.                                                
                                                                        
       7550-EXIT.                                                       
           EXIT.                                                        
                                                                        
A00998******************************************************************15224200
A00998*   7560-CHECK-CREDIT-HIST                                       *15224300
A00998*                                                                *15224400
A00998*   1. CHECKS IF THE CREDIT HIST IS LESS THAN 3 YRS.             *15224500
A00998*                                                                *15224700
A00998******************************************************************15224800
A00998 7560-CHECK-CREDIT-HIST.                                          
A00998                                                                  
A00998     EXEC SQL                                                     
A00998        SELECT
              DATEADD( YEAR, -3, CAST(SYSDATETIMEOFFSET() AS DATE) )
            INTO
              :WS-CUT-OFF-DT             
A00998     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR* MSQ044
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SET :WS-CUT-OFF-DT = (CURRENT DATE - 3 YEARS)                     
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

A00998                                                                  
A00998     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
A00998                                                                  
A00998     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
A00998        CONTINUE                                                  
A00998     ELSE                                                         
A00998        MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     
A00998        MOVE '7560'          TO ACTIVE-PARAGRAPH                  
A00998        MOVE 'SET'                TO ABEND-FUNCTION               
A00998        MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1              
A00998        MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1            
A00998        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
A00998        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
A00998     END-IF.                                                      
A00998                                                                  
A00998     EXEC SQL                                                     
A00998        SELECT 'Y'                                                
A00998        INTO  :RS-CREDIT-FL                                       
A00998        FROM  CSS_CREDIT_HIST WITH(READUNCOMMITTED)                       
A00998        WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              
A00998          AND CR_HIST_TRAN_DT >= IIF(TRY_CONVERT(DATE, 
                                                         :WS-CUT-OFF-DT
              ) IS NULL OR (PATINDEX('%.%', :WS-CUT-OFF-DT
              ) <> 0) OR (LEN(:WS-CUT-OFF-DT) <> 10), CIS.CHAR2DATE(
                                                         :WS-CUT-OFF-DT
              ), CONVERT(DATE, :WS-CUT-OFF-DT) )                   
A00998                                                           
                                                            
A00998     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     15225100
MFA-TR*       SELECT 'Y'                                                15225200
MFA-TR*       INTO  :RS-CREDIT-FL                                       15225400
MFA-TR*       FROM  CSS_CREDIT_HIST                                     15225600
MFA-TR*       WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              15225700
MFA-TR*         AND CR_HIST_TRAN_DT >= :WS-CUT-OFF-DT                   15225800
MFA-TR*         WITH UR                                                 13562000
MFA-TR*         QUERYNO 7560                                                    
MFA-TR*    END-EXEC.                                                    15226000

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

A00998                                                                  
A00998     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
A00998                                                                  
A00998     EVALUATE WS-ACTIVE-RETURN-CODE                               
A00998         WHEN SUCCESSFUL-CALL                                     
A00998         WHEN -811                                                
A00998             CONTINUE                                             
A00998         WHEN NOT-FOUND                                           
A00998             MOVE SPACES     TO    RS-CREDIT-FL                   
A00998         WHEN OTHER                                               
A00998             MOVE PROGRAM-NAME    TO ABEND-PROGRAM                
A00998             MOVE '7560'          TO ACTIVE-PARAGRAPH             
A00998             MOVE 'SELECT'             TO ABEND-FUNCTION          
A00998             MOVE 'CSS_CREDIT_HIST'    TO TABLE-1                 
A00998             MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1         
A00998             MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1       
A00998             PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT       
A00998             PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT       
A00998     END-EVALUATE.                                                
A00998                                                                  
A00998 7560-EXIT.                                                       
A00998     EXIT.                                                        
                                                                        
A01255 7570-CHECK-PREM-GAS-LINE.                                        
A01255                                                                  
A01255     EXEC SQL                                                     
A01255        SELECT 'Y'                                                
A01255        INTO  :RS-CREDIT-FL                                       
A01255        FROM  CSS_PREM_GAS_LINE WITH(READUNCOMMITTED)                     
A01255        WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              
A01255           OR BUILDER_CUST_NO  = :WS-CUSTOMER-NO-NUM              
A01255                                                           
                                                            
A01255     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     15225100
MFA-TR*       SELECT 'Y'                                                15225200
MFA-TR*       INTO  :RS-CREDIT-FL                                       15225400
MFA-TR*       FROM  CSS_PREM_GAS_LINE                                   15225600
MFA-TR*       WHERE CUSTOMER_NO      = :WS-CUSTOMER-NO-NUM              15225700
MFA-TR*          OR BUILDER_CUST_NO  = :WS-CUSTOMER-NO-NUM              15225800
MFA-TR*       WITH UR                                                   13562000
MFA-TR*       QUERYNO 7570                                                      
MFA-TR*    END-EXEC.                                                    15226000

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

A01255                                                                  
A01255     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
A01255                                                                  
A01255     EVALUATE WS-ACTIVE-RETURN-CODE                               
A01255         WHEN SUCCESSFUL-CALL                                     
A01255         WHEN -811                                                
A01255             CONTINUE                                             
A01255         WHEN NOT-FOUND                                           
A01255             MOVE SPACES     TO    RS-CREDIT-FL                   
A01255         WHEN OTHER                                               
A01255             MOVE PROGRAM-NAME    TO ABEND-PROGRAM                
A01255             MOVE '7570'          TO ACTIVE-PARAGRAPH             
A01255             MOVE 'SELECT'             TO ABEND-FUNCTION          
A01255             MOVE 'CSS_PREM_GAS_LINE'  TO TABLE-1                 
A01255             MOVE 'CUSTOMER_NO'        TO TABLE-ELEMENT-1         
A01255             MOVE WS-CUSTOMER-NO-NUM   TO HOSTVAR-ELEMENT-1       
A01255             PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT       
A01255             PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT       
A01255     END-EVALUATE.                                                
A01255                                                                  
A01255 7570-EXIT.                                                       
A01255     EXIT.                                                        
                                                                        
P00422 7600-GET-LANDLORD.                                               
P00422                                                                  
P00422     EXEC SQL                                                     
P00422         SELECT TOP(1) CUSTOMER_NO                                       
P00422           INTO :SI-CUSTOMER-NO                                   
P00422           FROM CSS_LANDLORD WITH(READUNCOMMITTED)                        
P00422          WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                 
P00422                                           
P00422                                                           
P00422                                                      
P00422     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT CUSTOMER_NO                                               
MFA-TR*          INTO :SI-CUSTOMER-NO                                           
MFA-TR*          FROM CSS_LANDLORD                                              
MFA-TR*         WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM                         
MFA-TR*         FETCH FIRST 1 ROWS ONLY                                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7600                                                    
MFA-TR*    END-EXEC.                                                            

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

P00422                                                                  
P00422     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
P00422                                                                  
P00422     EVALUATE WS-ACTIVE-RETURN-CODE                               
P00422         WHEN SUCCESSFUL-CALL                                     
P00422             MOVE 'Y' TO RS-PROP-MGR-FL                           
P00422         WHEN NOT-FOUND                                           
P00422             MOVE 'N' TO RS-PROP-MGR-FL                           
P00422         WHEN OTHER                                               
P00422             MOVE PROGRAM-NAME       TO ABEND-PROGRAM             
P00422             MOVE '7600 '            TO ACTIVE-PARAGRAPH          
P00422             MOVE 'SELECT'           TO ABEND-FUNCTION            
P00422             MOVE SPACES             TO ABEND-SQL-PREDICATES      
P00422                                        ABEND-TABLES              
P00422             MOVE 'CSS_LANDLORD'     TO TABLE-1                   
P00422             MOVE 'CUSTOMER_NO'      TO TABLE-ELEMENT-1           
P00422             MOVE WS-CUSTOMER-NO-NUM TO HOSTVAR-ELEMENT-1         
P00422             PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT        
P00422             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
P00422     END-EVALUATE.                                                
P00422                                                                  
P00422 7600-EXIT.                                                       
P00422     EXIT.                                                        
                                                                        
P00465 7610-GET-WELCOME-FL-CUONLY.                                      
P00465                                                                  
P00465     EXEC SQL                                                     
P00465         SELECT TOP(1) 'N'                                               
P00465           INTO :WS-WELCOME-DISP-FL                               
P00465           FROM CSS_ACCOUNT  AT WITH(READUNCOMMITTED)                     
P00465          WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM               
P00465                                            
P00465                                                           
P00465                                                      
P00465     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'N'                                                       
MFA-TR*          INTO :WS-WELCOME-DISP-FL                                       
MFA-TR*          FROM CSS_ACCOUNT  AT                                           
MFA-TR*         WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM                       
MFA-TR*         FETCH FIRST 1 ROW ONLY                                          
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7610                                                    
MFA-TR*    END-EXEC.                                                            

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

P00465                                                                  
P00465     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
P00465                                                                  
P00465     EVALUATE WS-ACTIVE-RETURN-CODE                               
P00465         WHEN SUCCESSFUL-CALL                                     
P00465             MOVE 'N' TO RS-WELCOME-DISP-FL                       
P00465         WHEN NOT-FOUND                                           
P00465             MOVE 'Y' TO RS-WELCOME-DISP-FL                       
P00465         WHEN OTHER                                               
P00465             MOVE PROGRAM-NAME       TO ABEND-PROGRAM             
P00465             MOVE '7610 '            TO ACTIVE-PARAGRAPH          
P00465             MOVE 'SELECT'           TO ABEND-FUNCTION            
P00465             MOVE SPACES             TO ABEND-SQL-PREDICATES      
P00465                                        ABEND-TABLES              
P00465             MOVE 'CSS_CUSTOMER'     TO TABLE-1                   
P00465             MOVE 'CUSTOMER_NO'      TO TABLE-ELEMENT-1           
P00465             MOVE WS-CUSTOMER-NO-NUM TO HOSTVAR-ELEMENT-1         
P00465             PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT        
P00465             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
P00465     END-EVALUATE.                                                
P00465                                                                  
P00465 7610-EXIT.                                                       
P00465      EXIT.                                                       
P00465                                                                  
P00465 7620-GET-WELCOME-FL-PEND.                                        
P00465                                                                  
P00465     EXEC SQL                                                     
P00465         SELECT TOP(1) 'Y'                                               
P00465           INTO :WS-WELCOME-DISP-FL                               
P00465           FROM CSS_ACCOUNT AT WITH(READUNCOMMITTED)                      
P00465          WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM               
P00465            AND AT.ACCOUNT_TYPE_CODE = 'R'                        
P00465            AND AT.COMPANY_NO = '26'                              
P00465            AND AT.CODE_ACCT_STAT = 'P'                           
P00465          AND NOT EXISTS (SELECT 1                                
P00465                          FROM CSS_ACCOUNT AT1
                           WITH(READUNCOMMITTED),                   
P00465                               CSS_CUST_PREM_HIST CH1
                           WITH(READUNCOMMITTED)             
P00465                         WHERE AT.ACCOUNT_NO <> AT1.ACCOUNT_NO    
P00465                           AND AT.CUSTOMER_NO = AT1.CUSTOMER_NO   
P00465                           AND AT1.ACCOUNT_NO = CH1.ACCOUNT_NO    
P00465                           AND AT1.COMPANY_NO = '26'              
P00465                           AND AT1.ACCOUNT_TYPE_CODE = 'R')       
P00465                                           
P00465                                                           
P00465                                                      
P00465     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*          INTO :WS-WELCOME-DISP-FL                                       
MFA-TR*          FROM CSS_ACCOUNT AT                                            
MFA-TR*         WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM                       
MFA-TR*           AND AT.ACCOUNT_TYPE_CODE = 'R'                                
MFA-TR*           AND AT.COMPANY_NO = '26'                                      
MFA-TR*           AND AT.CODE_ACCT_STAT = 'P'                                   
MFA-TR*         AND NOT EXISTS (SELECT 1                                        
MFA-TR*                         FROM CSS_ACCOUNT AT1,                           
MFA-TR*                              CSS_CUST_PREM_HIST CH1                     
MFA-TR*                        WHERE AT.ACCOUNT_NO <> AT1.ACCOUNT_NO            
MFA-TR*                          AND AT.CUSTOMER_NO = AT1.CUSTOMER_NO           
MFA-TR*                          AND AT1.ACCOUNT_NO = CH1.ACCOUNT_NO            
MFA-TR*                          AND AT1.COMPANY_NO = '26'                      
MFA-TR*                          AND AT1.ACCOUNT_TYPE_CODE = 'R')               
MFA-TR*         FETCH FIRST 1 ROWS ONLY                                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7620                                                    
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

P00465                                                                  
P00465     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
P00465                                                                  
P00465     EVALUATE WS-ACTIVE-RETURN-CODE                               
P00465         WHEN SUCCESSFUL-CALL                                     
P00465             MOVE 'Y' TO RS-WELCOME-DISP-FL                       
P00465         WHEN NOT-FOUND                                           
P00465             MOVE 'N' TO RS-WELCOME-DISP-FL                       
P00465         WHEN OTHER                                               
P00465             MOVE PROGRAM-NAME       TO ABEND-PROGRAM             
P00465             MOVE '7620 '            TO ACTIVE-PARAGRAPH          
P00465             MOVE 'SELECT'           TO ABEND-FUNCTION            
P00465             MOVE SPACES             TO ABEND-SQL-PREDICATES      
P00465                                        ABEND-TABLES              
P00465             MOVE 'CSS_CUSTOMER'     TO TABLE-1                   
P00465             MOVE 'CUSTOMER_NO'      TO TABLE-ELEMENT-1           
P00465             MOVE WS-CUSTOMER-NO-NUM TO HOSTVAR-ELEMENT-1         
P00465             PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT        
P00465             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
P00465     END-EVALUATE.                                                
P00465                                                                  
P00465 7620-EXIT.                                                       
P00465     EXIT.                                                        
                                                                        
P00465 7630-GET-WELCOME-FL.                                             
P00465                                                                  
P00465     EXEC SQL                                                     
P00465          SELECT
              REPLACE(REPLACE(CONVERT(CHAR(26), CIS.CURRENT$TIMESTAMP()
           , 121), ' ', '-'), ':', '.')
            INTO
              :WS-CURRENT-TIMESTAMP           
P00465     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SET :WS-CURRENT-TIMESTAMP = CURRENT TIMESTAMP                   
MFA-TR*    END-EXEC.                                                            

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

P00465     MOVE WS-CURRENT-TIMESTAMP TO INPUT-DATE-1416.                
P00465     MOVE -11 TO BUSINESS-DAYS-1416.                              
P00465     PERFORM 5100-CALL-CSR01416 THRU 5100-EXIT.                   
P00465     MOVE OUTPUT-DATE-1416(1:10) TO LAST-WKIT-DATE                
P00465     MOVE SPACES TO WS-WELCOME-DISP-FL.                           
P00465                                                                  
P00465     EXEC SQL                                                     
P00465         SELECT TOP(1) 'Y'                                               
P00465           INTO :WS-WELCOME-DISP-FL                               
P00465           FROM CSS_ACCOUNT AT WITH(READUNCOMMITTED),                     
P00465                CSS_CUST_PREM_HIST CH WITH(READUNCOMMITTED)               
P00465          WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM               
P00465            AND AT.ACCOUNT_TYPE_CODE = 'R'                        
P00465            AND AT.COMPANY_NO = '26'                              
P00465            AND AT.CODE_ACCT_STAT = 'A'                           
P00465            AND AT.ACCOUNT_NO = CH.ACCOUNT_NO                     
P00465            AND CH.DATE_UTIL_SVC_STRT >= IIF(TRY_CONVERT(DATE, 
                                                        :LAST-WKIT-DATE
              ) IS NULL OR (PATINDEX('%.%', :LAST-WKIT-DATE
              ) <> 0) OR (LEN(:LAST-WKIT-DATE) <> 10), CIS.CHAR2DATE(
                                                        :LAST-WKIT-DATE
              ), CONVERT(DATE, :LAST-WKIT-DATE) )          
P00465            AND CH.DATE_UTIL_SVC_STRT <= CAST(SYSDATETIMEOFFSET() 
           AS DATE)             
P00465          AND NOT EXISTS (SELECT 1                                
P00465                          FROM CSS_ACCOUNT AT1
                           WITH(READUNCOMMITTED),                   
P00465                               CSS_CUST_PREM_HIST CH1
                           WITH(READUNCOMMITTED)             
P00465                         WHERE AT.ACCOUNT_NO <> AT1.ACCOUNT_NO    
P00465                           AND AT.CUSTOMER_NO = AT1.CUSTOMER_NO   
P00465                           AND AT1.ACCOUNT_NO = CH1.ACCOUNT_NO    
P00465                           AND AT1.COMPANY_NO = '26'              
P00465                           AND AT1.ACCOUNT_TYPE_CODE = 'R'        
P00465                           AND CH1.DATE_UTIL_SVC_STRT <           
P00465                                    CH.DATE_UTIL_SVC_STRT)        
P00465          AND NOT EXISTS (SELECT 1                                
P00465                            FROM CSS_BATCH_EMAIL AE
                           WITH(READUNCOMMITTED)               
P00465                           WHERE AE.CUSTOMER_NO = AT.CUSTOMER_NO  
P00465                             AND EMAIL_EVENT_CD = 'ECS20'         
P00465                             AND PROCESSED_CD IN ('S', 'R'))      
P00465                                           
P00465                                                           
P00465                                                      
P00465     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR* MSQ028
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*          INTO :WS-WELCOME-DISP-FL                                       
MFA-TR*          FROM CSS_ACCOUNT AT,                                           
MFA-TR*               CSS_CUST_PREM_HIST CH                                     
MFA-TR*         WHERE AT.CUSTOMER_NO =:WS-CUSTOMER-NO-NUM                       
MFA-TR*           AND AT.ACCOUNT_TYPE_CODE = 'R'                                
MFA-TR*           AND AT.COMPANY_NO = '26'                                      
MFA-TR*           AND AT.CODE_ACCT_STAT = 'A'                                   
MFA-TR*           AND AT.ACCOUNT_NO = CH.ACCOUNT_NO                             
MFA-TR*           AND CH.DATE_UTIL_SVC_STRT >= :LAST-WKIT-DATE                  
MFA-TR*           AND CH.DATE_UTIL_SVC_STRT <= CURRENT_DATE                     
MFA-TR*         AND NOT EXISTS (SELECT 1                                        
MFA-TR*                         FROM CSS_ACCOUNT AT1,                           
MFA-TR*                              CSS_CUST_PREM_HIST CH1                     
MFA-TR*                        WHERE AT.ACCOUNT_NO <> AT1.ACCOUNT_NO            
MFA-TR*                          AND AT.CUSTOMER_NO = AT1.CUSTOMER_NO           
MFA-TR*                          AND AT1.ACCOUNT_NO = CH1.ACCOUNT_NO            
MFA-TR*                          AND AT1.COMPANY_NO = '26'                      
MFA-TR*                          AND AT1.ACCOUNT_TYPE_CODE = 'R'                
MFA-TR*                          AND CH1.DATE_UTIL_SVC_STRT <                   
MFA-TR*                                   CH.DATE_UTIL_SVC_STRT)                
MFA-TR*         AND NOT EXISTS (SELECT 1                                        
MFA-TR*                           FROM CSS_BATCH_EMAIL AE                       
MFA-TR*                          WHERE AE.CUSTOMER_NO = AT.CUSTOMER_NO          
MFA-TR*                            AND EMAIL_EVENT_CD = 'ECS20'                 
MFA-TR*                            AND PROCESSED_CD IN ('S', 'R'))              
MFA-TR*         FETCH FIRST 1 ROWS ONLY                                         
MFA-TR*         WITH UR                                                         
MFA-TR*         QUERYNO 7630                                                    
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

P00465                                                                  
P00465     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
P00465                                                                  
P00465     EVALUATE WS-ACTIVE-RETURN-CODE                               
P00465         WHEN SUCCESSFUL-CALL                                     
P00465             MOVE 'Y' TO RS-WELCOME-DISP-FL                       
P00465         WHEN NOT-FOUND                                           
P00465             MOVE 'N' TO RS-WELCOME-DISP-FL                       
P00465         WHEN OTHER                                               
P00465             MOVE PROGRAM-NAME       TO ABEND-PROGRAM             
P00465             MOVE '7630 '            TO ACTIVE-PARAGRAPH          
P00465             MOVE 'SELECT'           TO ABEND-FUNCTION            
P00465             MOVE SPACES             TO ABEND-SQL-PREDICATES      
P00465                                        ABEND-TABLES              
P00465             MOVE 'CSS_CUSTOMER'     TO TABLE-1                   
P00465             MOVE 'CUSTOMER_NO'      TO TABLE-ELEMENT-1           
P00465             MOVE WS-CUSTOMER-NO-NUM TO HOSTVAR-ELEMENT-1         
P00465             PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT        
P00465             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
P00465     END-EVALUATE.                                                
P00465                                                                  
P00465 7630-EXIT.                                                       
P00465     EXIT.                                                        
                                                                        
      ******************************************************************15230000
      * 9900- JOURNALING / ERROR HANDLING INCLUDE *                     15240000
      ******************************************************************15250000
           EXEC SQL                                                     15260000
              INCLUDE CPDSP300                                          15270000
           END-EXEC.                                                    15280000
                                                                        
      ******************************************************************15300000
      *       END PROGRAM COPYLIB                                      *15310000
      ******************************************************************15320000
                                                                        
CVT000 8100-SEND-RESULT.                                                
CVT000       ADD 1 TO CTR-ROWS.                                         
CVT000 8100-EXIT.                                                       
CVT000        EXIT.                                                     
CVT000     EXEC SQL                                                     00000100
CVT000         INCLUDE CPD00321                                         00000200
CVT000     END-EXEC.                                                    00000300
