       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02143.                                         
COB303 DATE-WRITTEN.      AUGUST 16,1995.                               
       DATE-COMPILED.                                                   
                                                                        
CVT000******************************************************************00000100
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *00000200
CVT000*         S143 CONVERTED TO DB2 SP CSR02143 ON 08/17/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
      ******************************************************************00070000
      *                SOUTH CAROLINA ELECTRIC & GAS                   *00080000
      *                                                                *00090000
      *  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).   *00100000
      *                                                                *00110000
      *  TRANID:        S143                                           *00120000
      *  PROGRAM:       S143                                           *00130000
      *  CALLING SP:    PA_S143                                        *00140000
      *  PANEL:         260                                            *00150000
      ******************************************************************00160000
      *                 P R O G R A M  S U M M A R Y                   *00170000
      *                                                                *00180000
      *  THIS PROGRAM IS A REMOTE PROCEDURE CALL MADE FROM             *00190000
      *  DESKTOP 2000 VIA THE SYBASE NETGATEWAY.                       *00200000
      *                                                                *00210000
      *  THIS PROGRAM RETRIEVES STREE LIGHTS DATA BY PREMISE.          *00220000
      *                                                                *00230000
      *                                                                *00240000
      ******************************************************************00250000
      *                                                                *00260000
      *                     PROGRAM MODIFICATION LOG                   *00270000
      *                                                                *00280000
      *    DATE    INITIALS   COMMENTS                                 *00290000
      *  --------  --------   ---------------------------------------  *00300000
      *  08/16/95    AS       CREATED.                                 *00310000
      *  06/17/96    CS       REMOVED FIELD PUB_RATE_PLAN_NO FROM      *00320000
      *                       SELECT AND RETURNERATE_PLAN_NO FROM      *00321000
CBSI  *  08/28/98    CBSI     ABEND LOG MODIFIED TO INCLUDE ALL THE    *00321100
CBSI  *              MADRAS    ABEND PARAMETERS                        *00322000
      *                                                                *00328000
T19350*  03/26/99    CBSI     CHANGES MADE TO USE CPD00099 COPYBOOK    *        
T19350*                       FOR GETTING THE MOST CURRENT ACCOUNT     *        
T19350*                       AT THE PREMISE.                          *        
      *                                                                *00328000
C31196*  01/27/05    DD       ADDED PARA 2220- TO DETERMINE IF A CHANGE*        
C31196*                       WAS MADE TO REV DISTRICT OR RATE ITEM    *        
C31196*                       CODE DURING LIFE OF SERVICE ORDER        *        
C31196*                                                                *        
C31196*  06/02/05    DD       ADDED TRANS_HIST_SEQ_NO FROM             *        
C31196*                       CSS_MNT_TRANS_HST_DET TO WHERE CLAUSE    *        
C31196*                       IN PARA 2220.                            *        
C29536*  06/23/05    LHO      CHANGE SELECT TO RETURN SHARED LIGHTING. *        
REARCH*  08/17/05    CVNS     RPC TO COBOL DB2 SP CONVERSION.          *        
REARCH*              CHENNAI                                           *        
      ******************************************************************00330000
      ******************************************************************00340000
      *                                                                *00350000
      *                ---- BASIC SEQUENCE STRUCTURE ----              *00360000
      *                                                                *00370000
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION             *00380000
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                    *00390000
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                   *00400000
      *  3000 - 4999  NOT USED                                         *00410000
      *  5000 - 5999  COMMON PROGRAM MODULES                           *00420000
      *  6000 - 6999  COMMON SYSTEM MODULES                            *00430000
      *  7000 - 7999  INPUT MODULES                                    *00440000
      *  8000 - 8999  OUTPUT MODULES                                   *00450000
      *  9000 - 9999  TERMINATION,ABEND, MESSAGING MODULES             *00460000
      *                                                                *00470000
      ******************************************************************00480000
                                                                        
       ENVIRONMENT DIVISION.                                            
       DATA DIVISION.                                                   
       WORKING-STORAGE SECTION.                                         

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

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'CSR02143'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-START                                   PIC X(40) VALUE   
REARCH     'WORKING STORAGE FOR CSR02143 STARTS HERE'.                  
                                                                        
      ******************************************************************00580000
      *    DB2 INCLUDES                                                *00590000
      ******************************************************************00600000
                                                                        
           EXEC SQL                                                     00620000
              INCLUDE SQLCA                                             00630000
           END-EXEC.                                                    00640000
                                                                        
           EXEC SQL                                                     00660000
              INCLUDE TBUMPLAN                                          00670000
           END-EXEC.                                                    00680000
                                                                        
           EXEC SQL                                                     00680200
              INCLUDE TBACCT                                            00680300
           END-EXEC.                                                    00680400
                                                                        
           EXEC SQL                                                     00680600
              INCLUDE TBPREM                                            00680700
           END-EXEC.                                                    00680800
                                                                        
           EXEC SQL                                                     00681000
              INCLUDE TBUTLENV                                          00681100
           END-EXEC.                                                    00681200
                                                                        
           EXEC SQL                                                     00681400
              INCLUDE TBCSTPLN                                          00681500
           END-EXEC.                                                    00681600
                                                                        
           EXEC SQL                                                     00681800
              INCLUDE TBRTCRTR                                          00681900
           END-EXEC.                                                    00682000
                                                                        
           EXEC SQL                                                     00682200
              INCLUDE TBUMEQP                                           00682300
           END-EXEC.                                                    00683000
                                                                        
           EXEC SQL                                                     00691000
              INCLUDE TBRTDESC                                          00692000
           END-EXEC.                                                    00693000
                                                                        
           EXEC SQL                                                     00700000
              INCLUDE TBMODEL                                           00710000
           END-EXEC.                                                    00720000
                                                                        
      ******************************************************************00750000
      *    COBOL WORKING STORAGE COPY BOOKS                            *00760000
      ******************************************************************00770000
                                                                        
CVT999*    COPY SYGWCOB.                                                00790000
CVT999*    COPY SYDBCOB.                                                00800000
           COPY CCA00001.                                               00810000
CVT999*    COPY CWS00010.                                               00820000
           COPY CWS00027.                                               00830000
           COPY CWS00303.                                               00840000
                                                                        
T19350     EXEC SQL                                                             
T19350         INCLUDE CWS00099                                                 
T19350     END-EXEC.                                                            
T19350*                                                                         
      ******************************************************************00860000
      *    WORK AREAS                                                  *00870000
      ******************************************************************00880000
                                                                        
       01  GW-LIB-MISC-FIELDS.                                          
CVT999*    05  GWL-PROC                POINTER.                         00910000
CVT999*    05  GWL-INIT-HANDLE         POINTER.                         00920000
CVT999*    05  GWL-RC                  PIC S9(9) COMP.                  00930000
CVT999*    05  GWL-STATUS-NR           PIC S9(9) COMP.                  00940000
CVT999*    05  GWL-STATUS-DONE         PIC S9(9) COMP.                  00950000
CVT999*    05  GWL-STATUS-COUNT        PIC S9(9) COMP.                  00960000
CVT999*    05  GWL-STATUS-COMM         PIC S9(9) COMP.                  00970000
CVT999*    05  GWL-STATUS-RETURN-CODE  PIC S9(9) COMP.                  00980000
           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.                  
CVT999*    05  PARM-ID1                PIC S9(9) COMP VALUE 1.          01050000
           05  PARM-PREMISE-NO         PIC X(10)  VALUE SPACES.         
           05  PARM-PREMISE-NO-RED     REDEFINES PARM-PREMISE-NO        
                                       PIC 9(10).                       
C31196     05  PARM-ORDER-INITIATION   PIC X(26).                       
C31196     05  PARM-ORDER-COMPLETION   PIC X(26).                       
                                                                        
                                                                        
       01  SNA-FIELDS.                                                  
           05  SNA-SUBC                PIC S9(9) COMP.                  
CVT999*    05  SNA-CONNECTION-NAME     PIC X(8)  VALUE SPACES.          01120000
                                                                        
       01  COUNTER-FIELDS.                                              
CVT999*    05  CTR-COLUMN              PIC S9(9) COMP VALUE 1.          01150000
           05  CTR-ROWS                PIC S9(9) COMP VALUE 0.          
           05  WS-ROW-COUNT            PIC S9(9) COMP VALUE 0.          
                                                                        
       01  WORK-FIELDS.                                                 
CVT999*    05  MAX-LENGTH-PARM         PIC S9(9) COMP.                  01200000
CVT999*    05  WRKLEN1                 PIC S9(9) COMP.                  01210000
CVT999*    05  WRKLEN2                 PIC S9(9) COMP.                  01220000
           05  WRK-DONE-STATUS         PIC S9(9) COMP.                  
                                                                        
       01  WS-MISC.                                                     
REARCH     05  PROGRAM-NAME            PIC X(8)   VALUE 'CSR02143'.     
           05  WS-PREMISE-NO           PIC 9(10)  VALUE 0.              
           05  WS-PREMISE-NO-NUM       PIC S9(10) COMP-3 VALUE ZERO.    
           05  WS-ORDER-INITIATION     PIC X(26)  VALUE SPACES.         
           05  WS-ORDER-COMPLETION     PIC X(26)  VALUE SPACES.         
           05  USA-DATE-FORMAT.                                         
               10  USA-MONTH           PIC X(2).                        
               10  FILLER              PIC X(1) VALUE '/'.              
               10  USA-DAY             PIC X(2).                        
               10  FILLER              PIC X(1) VALUE '/'.              
               10  USA-YEAR            PIC X(4).                        
           05  WS-NULL-DATE-IND1       PIC S9(4) COMP VALUE 0.          
           05  WS-NULL-DATE-IND2       PIC S9(4) COMP VALUE 0.          
                                                                        
           05  WS-RATE-DESC.                                            
               10  WS-RATE-PLAN-DESC   PIC X(25).                       
               10  FILLER              PIC X(1) VALUE ' '.              
               10  WS-EQUIP-SHRT-DESC  PIC X(17).                       
                                                                        
       01  WS-FLAG-VALUES.                                              
           05  WS-U                    PIC X(1)  VALUE 'U'.             
           05  WS-CHANGED              PIC X(1)  VALUE 'N'.             
                                                                        
       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-LOCAL-OFFICE         PIC X(3)    VALUE SPACE.         
           05  RS-POLE-NO              PIC X(7)    VALUE SPACE.         
           05  RS-LIGHT-NO             PIC S9(4)   COMP VALUE 0.        
           05  RS-NO-UNITS             PIC S9(4)   COMP VALUE 0.        
           05  RS-STATUS               PIC X(1)    VALUE SPACE.         
           05  RS-RATE-DESC            PIC X(45)   VALUE SPACE.         
           05  RS-DATE-INSTALLED       PIC X(10)   VALUE SPACE.         
           05  RS-DATE-REMOVED         PIC X(10)   VALUE SPACE.         
           05  RS-ACCOUNT-NO           PIC S9(13)V COMP-3 VALUE 0.      
           05  RS-CODE-UTIL-TYPE       PIC X(1)    VALUE SPACE.         
           05  RS-IC-NO                PIC S9(4)   COMP VALUE 0.        
           05  RS-RATE-ITEM-CODE       PIC S9(4)   COMP VALUE 0.        
           05  RS-ITEM-SEQ-NO          PIC S9(4)   COMP VALUE 0.        
           05  RS-VALID-LOC-OFF        PIC X(3)    VALUE SPACE.         
           05  RS-COMPANY-NO           PIC X(2)    VALUE SPACES.        
           05  RS-CODE-SERVICE-TYPE    PIC X(1)    VALUE SPACES.        
           05  RS-RATE-PLAN-NO         PIC X(3)    VALUE SPACES.        
C31196     05  RS-PRICE-PER-SERV       PIC S9(3)V9(6) COMP-3 VALUE +0.  
C31196     05  RS-CHANGED-FL           PIC X(1)    VALUE 'N'.           
                                                                        
REARCH 01  GTT-RETURN-FIELDS.                                           
REARCH     05  S-RETURN-CODE          PIC S9(9)   COMP VALUE 0.         
REARCH     05  S-LOCAL-OFFICE         PIC X(3)    VALUE SPACE.          
REARCH     05  S-POLE-NO              PIC X(7)    VALUE SPACE.          
REARCH     05  S-LIGHT-NO             PIC S9(4)   COMP VALUE 0.         
REARCH     05  S-NO-UNITS             PIC S9(4)   COMP VALUE 0.         
REARCH     05  S-STATUS               PIC X(1)    VALUE SPACE.          
REARCH     05  S-RATE-DESC            PIC X(45)   VALUE SPACE.          
REARCH     05  S-DATE-INSTALLED       PIC X(10)   VALUE SPACE.          
REARCH     05  S-DATE-REMOVED         PIC X(10)   VALUE SPACE.          
REARCH     05  S-ACCOUNT-NO           PIC S9(13)V COMP-3 VALUE 0.       
REARCH     05  S-CODE-UTIL-TYPE       PIC X(1)    VALUE SPACE.          
REARCH     05  S-IC-NO                PIC S9(4)   COMP VALUE 0.         
REARCH     05  S-RATE-ITEM-CODE       PIC S9(4)   COMP VALUE 0.         
REARCH     05  S-ITEM-SEQ-NO          PIC S9(4)   COMP VALUE 0.         
REARCH     05  S-VALID-LOC-OFF        PIC X(3)    VALUE SPACE.          
REARCH     05  S-COMPANY-NO           PIC X(2)    VALUE SPACES.         
REARCH     05  S-CODE-SERVICE-TYPE    PIC X(1)    VALUE SPACES.         
REARCH     05  S-RATE-PLAN-NO         PIC X(3)    VALUE SPACES.         
REARCH     05  S-PRICE-PER-SERV       PIC S9(3)V9(6) COMP-3 VALUE +0.   
REARCH     05  S-CHANGED-FL           PIC X(1)    VALUE 'N'.            
CVT999*01  CNS-COLUMN-NAMES.                                            01890200
CVT999*    05  CNS-RETURN-CODE         PIC X(11) VALUE                  01890300
CVT999*                                        'RETURN_CODE'.           01890400
CVT999*    05  CNS-LOCAL-OFFICE        PIC X(12) VALUE                  01890500
CVT999*                                        'LOCAL_OFFICE'.          01890600
CVT999*    05  CNS-POLE-NO             PIC X(7)  VALUE                  01890700
CVT999*                                        'POLE_NO'.               01890800
CVT999*    05  CNS-LIGHT-NO            PIC X(8)   VALUE                 01890900
CVT999*                                        'LIGHT_NO'.              01891000
CVT999*    05  CNS-NO-UNITS            PIC X(8)   VALUE                 01891100
CVT999*                                        'NO_UNITS'.              01891200
CVT999*    05  CNS-STATUS              PIC X(16)  VALUE                 01892000
CVT999*                                        'CODE_PLAN_STATUS'.      01893000
CVT999*    05  CNS-RATE-DESC           PIC X(9)   VALUE                 01894000
CVT999*                                        'RATE_DESC'.             01895000
CVT999*    05  CNS-DATE-INSTALLED      PIC X(15)  VALUE                 01896000
CVT999*                                        'DATE_PLAN_START'.       01897000
CVT999*    05  CNS-DATE-REMOVED        PIC X(12)  VALUE                 02710600
CVT999*                                        'DATE_REMOVED'.          02710700
CVT999*    05  CNS-ACCOUNT-NO          PIC X(10)  VALUE                 02710800
CVT999*                                        'ACCOUNT_NO'.            02710900
CVT999*    05  CNS-CODE-UTIL-TYPE      PIC X(14)  VALUE                 02711000
CVT999*                                        'CODE_UTIL_TYPE'.        02711100
CVT999*    05  CNS-IC-NO               PIC X(5)   VALUE                 02711200
CVT999*                                        'IC_NO'.                 02711300
CVT999*    05  CNS-RATE-ITEM-CODE      PIC X(14)  VALUE                 02711400
CVT999*                                        'RATE_ITEM_CODE'.        02711500
CVT999*    05  CNS-ITEM-SEQ-NO         PIC X(11)  VALUE                 02711600
CVT999*                                        'ITEM_SEQ_NO'.           02711700
CVT999*    05  CNS-VALID-LOC-OFF       PIC X(13) VALUE                  02711800
CVT999*                                        'VALID_LOC_OFF'.         02711900
CVT999*    05  CNS-COMPANY-NO          PIC X(10) VALUE                  02712200
CVT999*                                        'COMPANY_NO'.            02712300
CVT999*    05  CNS-CODE-SERVICE-TYPE   PIC X(17) VALUE                  02712400
CVT999*                                        'CODE_SERVICE_TYPE'.     02712500
CVT999*    05  CNS-RATE-PLAN-NO        PIC X(12) VALUE                  02712600
CVT999*                                        'RATE_PLAN_NO'.          02712700
CVT999*    05  CNS-PRICE-PER-SERV      PIC X(14) VALUE                  02712600
CVT999*                                        'PRICE_PER_SERV'.        02712700
CVT999*    05  CNS-CHANGED-FL          PIC X(10) VALUE                          
CVT999*                                        'CHANGED_FL'.                    
CVT999*                                                                 02712800
       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'.             
                                                                        
      ***************************************************************** 02713700
      *    CURSOR DECLARATION                                           02713800
      ***************************************************************** 02713900
      *                                                                 02714700
      ************                                                      02714800
      *                                                                 02714900
           EXEC SQL DECLARE UTILENV CURSOR FOR                          
               SELECT IC_NO,                                            
                      RATE_PLAN_NO,                                     
C29536                CODE_UTIL_TYPE                                    
               FROM   CSS_UTIL_ENVRNMT                                  
               WHERE  ACCOUNT_NO     = :AT-ACCOUNT-NO                   
               AND    (CODE_UTIL_TYPE = :WS-U                           
C29536          OR    RATE_PLAN_NO IN ('013','029','069',               
C29536                 '079','68A','68B','69A','69B','69C',             
C29536                 '69D','A68','A69','B69','B69','C69',             
C29536                 'C69'))                                          
           END-EXEC.                                                    
      *                                                                 02890100
      ************                                                      02890200
      *                                                                 02890300
           EXEC SQL DECLARE CUSTPLAN CURSOR FOR                         
               SELECT RATE_ITEM_CODE,                                   
                      ITEM_SEQ_NO,                                      
                      CODE_PLAN_STATUS,                                 
                      DATE_PLAN_START,                                  
                      REMOVE_DATE,                                      
                      DIST_NO,                                          
                      LIGHT_NO,                                         
                      POLE_NO,                                          
                      NO_UNITS,                                         
                      CODE_SERVICE_TYPE                                 
               FROM   CSS_CUST_PLAN                                     
               WHERE  ACCOUNT_NO        = :AT-ACCOUNT-NO                
      *        AND    CODE_UTIL_TYPE    = :WS-U                         02891700
               AND    CODE_UTIL_TYPE    = :UT-CODE-UTIL-TYPE            
               AND    IC_NO             = :UT-IC-NO                     
           END-EXEC.                                                    
                                                                        
      *                                                                 02893000
      ************                                                      02894000
      *                                                                 02895000
           EXEC SQL DECLARE VERSION-NO CURSOR FOR                       
               SELECT VERSION_NO_CNTRL                                  
               FROM CSS_RATE_CREATOR                                    
               WHERE CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE                
               AND   RATE_PLAN_NO   = :UT-RATE-PLAN-NO                  
               ORDER BY VERSION_NO_CNTRL DESC
            OPTION(FAST 1)
            FOR READ ONLY                        
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ004
MFA-TR* MSQ021
MFA-TR*    EXEC SQL DECLARE VERSION-NO CURSOR FOR                       02896000
MFA-TR*        SELECT VERSION_NO_CNTRL                                  02898000
MFA-TR*        FROM CSS_RATE_CREATOR                                    02900000
MFA-TR*        WHERE CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE                02901000
MFA-TR*        AND   RATE_PLAN_NO   = :UT-RATE-PLAN-NO                  02901100
MFA-TR*        ORDER BY VERSION_NO_CNTRL DESC                           02901200
MFA-TR*        OPTIMIZE FOR 1 ROW FOR FETCH ONLY                        02901300
MFA-TR*    END-EXEC.                                                    02901400
                                                                        
HPCCDM*EJECT                                                            02902300
CVT000     EXEC SQL                                                     00000010
CVT000         INCLUDE CWSX0010                                         00000020
CVT000     END-EXEC.                                                    00000030
CVT000                                                                  
CVT000 01  CSRERLOG-P.                                                  
CVT000     10  S-SP-NAME                 PIC X(18) VALUE SPACES.        
CVT000     10  S-SQLCODE                 PIC S9(9) COMP VALUE 0.        
CVT000     10  S-SQLSTATE                PIC X(5)  VALUE ' '.           
CVT000     10  S-TABLE-NAME              PIC X(18) VALUE SPACES.        
CVT000     10  S-HOST-VARIABLES.                                        
CVT000         49  S-HOST-VARIABLES-L    PIC S9(4) USAGE COMP.          
CVT000         49  S-HOST-VARIABLES-V    PIC X(255).                    
CVT000     10  S-SQL-STATEMENT.                                         
CVT000         49  S-SQL-STATEMENT-L     PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-STATEMENT-V     PIC X(255).                    
CVT000     10  S-SQL-DESCRIPTION.                                       
CVT000         49  S-SQL-DESCRIPTION-L   PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-DESCRIPTION-V   PIC X(255).                    
CVT000     10  WS-ABEND-SQLERRMC.                                       
CVT000         49  WS-ABEND-SQLERRMC-L   PIC S9(4) USAGE COMP.          
CVT000         49  WS-ABEND-SQLERRMC-V   PIC X(255).                    
REARCH*    10  S-RETURN-CODE             PIC S9(9) COMP VALUE 0.        00001701
CVT000     10  WS-SQLSTATE               PIC X(05) VALUE SPACES.        
CVT000                                                                  
CVT000                                                                  
CVT000                                                                  
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         DECLARE C1 CURSOR  FOR                        
CVT000         SELECT                                                   
REARCH            RETURN_CODE                                           
REARCH           ,LTRIM(RTRIM(LOCAL_OFFICE))            AS  LOCAL_OFFICE       
REARCH           ,LTRIM(RTRIM(POLE_NO))                 AS  POLE_NO            
REARCH           ,LIGHT_NO                                              
REARCH           ,NO_UNITS                                              
REARCH           ,LTRIM(RTRIM(STATUS))                  AS  
           CODE_PLAN_STATUS   
REARCH           ,LTRIM(RTRIM(RATE_DESC))               AS  RATE_DESC          
REARCH           ,LTRIM(RTRIM(DATE_INSTALLED))          AS  
           DATE_PLAN_START    
REARCH           ,LTRIM(RTRIM(DATE_REMOVED))            AS  DATE_REMOVED       
REARCH           ,ACCOUNT_NO                                            
REARCH           ,LTRIM(RTRIM(CODE_UTIL_TYPE))          AS  
           CODE_UTIL_TYPE     
REARCH           ,IC_NO                                                 
REARCH           ,RATE_ITEM_CODE                                        
REARCH           ,ITEM_SEQ_NO                                           
REARCH           ,LTRIM(RTRIM(VALID_LOC_OFF))           AS  
           VALID_LOC_OFF      
REARCH           ,LTRIM(RTRIM(COMPANY_NO))              AS  COMPANY_NO         
REARCH           ,LTRIM(RTRIM(CODE_SERVICE_TYPE))       AS  
           CODE_SERVICE_TYPE  
REARCH           ,LTRIM(RTRIM(RATE_PLAN_NO))            AS  RATE_PLAN_NO       
REARCH           ,PRICE_PER_SERV                                        
REARCH           ,LTRIM(RTRIM(CHANGED_FL))              AS  CHANGED_FL         
CVT000         FROM #CSR02143_R1                                 
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ029
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                     00000100
MFA-TR*        DECLARE C1 CURSOR WITH RETURN FOR                        00000300
MFA-TR*        SELECT                                                   00000400
MFA-TR*           RETURN_CODE                                                   
MFA-TR*          ,STRIP(LOCAL_OFFICE)            AS  LOCAL_OFFICE               
MFA-TR*          ,STRIP(POLE_NO)                 AS  POLE_NO                    
MFA-TR*          ,LIGHT_NO                                                      
MFA-TR*          ,NO_UNITS                                                      
MFA-TR*          ,STRIP(STATUS)                  AS  CODE_PLAN_STATUS           
MFA-TR*          ,STRIP(RATE_DESC)               AS  RATE_DESC                  
MFA-TR*          ,STRIP(DATE_INSTALLED)          AS  DATE_PLAN_START            
MFA-TR*          ,STRIP(DATE_REMOVED)            AS  DATE_REMOVED               
MFA-TR*          ,ACCOUNT_NO                                                    
MFA-TR*          ,STRIP(CODE_UTIL_TYPE)          AS  CODE_UTIL_TYPE             
MFA-TR*          ,IC_NO                                                         
MFA-TR*          ,RATE_ITEM_CODE                                                
MFA-TR*          ,ITEM_SEQ_NO                                                   
MFA-TR*          ,STRIP(VALID_LOC_OFF)           AS  VALID_LOC_OFF              
MFA-TR*          ,STRIP(COMPANY_NO)              AS  COMPANY_NO                 
MFA-TR*          ,STRIP(CODE_SERVICE_TYPE)       AS  CODE_SERVICE_TYPE          
MFA-TR*          ,STRIP(RATE_PLAN_NO)            AS  RATE_PLAN_NO               
MFA-TR*          ,PRICE_PER_SERV                                                
MFA-TR*          ,STRIP(CHANGED_FL)              AS  CHANGED_FL                 
MFA-TR*        FROM SESSION.CSR02143_R1                                 00000500
MFA-TR*    END-EXEC.                                                    00000700
CVT000                                                                  
                                                                        
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-PREMISE-NO          PIC X(10)                .          
CVT000 01  LINK-PREMISE-NO-RED      PIC 9(10)                .          
CVT000 01  LINK-ORDER-INITIATION    PIC X(26)                .          
CVT000 01  LINK-ORDER-COMPLETION    PIC X(26)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-PREMISE-NO                                         
CVT000         ,LINK-ORDER-INITIATION                                   
CVT000         ,LINK-ORDER-COMPLETION                                   
CVT000         .                                                        
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLWARNING                                      
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLERROR                                        
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER NOT FOUND                                       
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT999*PROCEDURE DIVISION.                                              02902400
                                                                        
      ******************************************************************02902600
      * 0000-MAINLINE                                                  *02902700
      *     CONTROLS THE MAIN PATH OF THE PROGRAM                      *02902800
      ******************************************************************02902900
       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.                                                        
                                                                        
      ******************************************************************02904000
      * 0100-INITIALIZE                                                *02904100
      *                                                                *02904200
      *     1. RESET DB2 ERROR HANDLERS                                *02904300
      *     2. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *02904400
      *     3. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *02904500
      *     4. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*02904600
      *                                                                *02904700
      ******************************************************************02904800
       0100-INITIALIZE.                                                 
                                                                        
CVT999*    EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.              02905100
CVT999*    EXEC SQL WHENEVER SQLERROR   CONTINUE END-EXEC.              02905200
CVT999*    EXEC SQL WHENEVER NOT FOUND  CONTINUE END-EXEC.              02905300
CVT999*    CALL 'TDINIT'   USING DFHEIBLK, GWL-RC, GWL-INIT-HANDLE.     02905400
                                                                        
CVT999*    CALL 'TDACCEPT' USING GWL-PROC, GWL-RC, GWL-INIT-HANDLE,     02905600
CVT999*                          SNA-CONNECTION-NAME, SNA-SUBC.         02905700
                                                                        
CVT999*    CALL 'TDRESULT' USING GWL-PROC, GWL-RC.                      02905900
                                                                        
CVT999*    IF GWL-RC NOT = TDS-PARM-PRESENT                             02906100
CVT999*       MOVE PROGRAM-NAME    TO ABEND-PROGRAM                     02906200
CVT999*       MOVE '0100'          TO ACTIVE-PARAGRAPH                  02906300
CVT999*       MOVE 'TDRESULT - NO RPC PARM SENT' TO ABEND-FUNCTION      02906400
CVT999*       MOVE 'CICS TRANSACTION'   TO TABLE-1                      02906500
CVT999*       MOVE GWL-RC               TO WS-ACTIVE-RETURN-CODE        02906600
CVT999*       PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            02906700
CVT999*       PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            02906800
CVT999*    END-IF.                                                      02906900
                                                                        
CVT000     MOVE LINK-PREMISE-NO           TO PARM-PREMISE-NO          . 
CVT000     MOVE LINK-ORDER-INITIATION     TO PARM-ORDER-INITIATION    . 
CVT000     MOVE LINK-ORDER-COMPLETION     TO PARM-ORDER-COMPLETION    . 
CVT000     PERFORM 0100A-DECLARE-GTT                                    
CVT000       THRU 0100A-EXIT.                                           
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
CVT000 0100A-DECLARE-GTT.                                               
CVT000     EXEC SQL
             CALL CIS.DROP_TEMP_TABLE('#CSR02143_R1')
           END-EXEC
           EXEC SQL
             CREATE TABLE #CSR02143_R1
              (                                                          
CVT000         RETURN_CODE              INT                         
CVT000        ,LOCAL_OFFICE CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,POLE_NO CHAR(7)  COLLATE LATIN1_GENERAL_100_BIN2                 
CVT000        ,LIGHT_NO                 SMALLINT                        
CVT000        ,NO_UNITS                 SMALLINT                        
CVT000        ,STATUS CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2                  
CVT000        ,RATE_DESC CHAR(45)  COLLATE LATIN1_GENERAL_100_BIN2              
CVT000        ,DATE_INSTALLED CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,DATE_REMOVED CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,ACCOUNT_NO               DECIMAL(13,0)                   
CVT000        ,CODE_UTIL_TYPE CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,IC_NO                    SMALLINT                        
CVT000        ,RATE_ITEM_CODE           SMALLINT                        
CVT000        ,ITEM_SEQ_NO              SMALLINT                        
CVT000        ,VALID_LOC_OFF CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,COMPANY_NO CHAR(2)  COLLATE LATIN1_GENERAL_100_BIN2              
CVT000        ,CODE_SERVICE_TYPE CHAR(1)  COLLATE 
                            LATIN1_GENERAL_100_BIN2                         
CVT000        ,RATE_PLAN_NO CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,PRICE_PER_SERV           DECIMAL(09,6)                   
CVT000        ,CHANGED_FL CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2              
CVT000       )
           END-EXEC.                                                    

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

           MOVE SQLSTATE TO WS-SQLSTATE.                                
           MOVE SQLCODE  TO WS-ACTIVE-RETURN-CODE.                      
                                                                        
           IF WS-SQLSTATE = '42710'                                     
              PERFORM 8000A-DELETE-GTT-ROWS THRU 8000A-EXIT             
           ELSE                                                         
               IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL               
                   NEXT SENTENCE                                        
               ELSE                                                     
                  MOVE PROGRAM-NAME         TO ABEND-PROGRAM            
                  MOVE SQLCODE              TO ABEND-SQLCODE            
                  MOVE SQLSTATE             TO ABEND-SQLSTATE           
                  MOVE '0100A'               TO ACTIVE-PARAGRAPH        
                  MOVE 'DECLARE GTT'        TO ABEND-FUNCTION           
                  MOVE SPACES               TO ABEND-SQL-PREDICATES     
                                               ABEND-TABLES             
                  MOVE 'CSR02143_R1'        TO TABLE-1                  
                  MOVE SPACES               TO TABLE-ELEMENT-1          
                  MOVE SPACES               TO HOSTVAR-ELEMENT-1        
                  PERFORM 9900-SQL-ERROR-ROUTINE  THRU  9900-EXIT       
               END-IF                                                   
           END-IF.                                                      
CVT000 0100A-EXIT.                                                      
CVT000         EXIT.                                                    
                                                                        
                                                                        
      ******************************************************************02907400
      * 1000-PROCESS-INPUT                                             *02907500
      *                                                                *02907600
      *     1. RECEIVE PARMS.                                          *02907700
      *                                                                *02907800
      ******************************************************************02907900
       1000-PROCESS-INPUT.                                              
                                                                        
REARCH*    PERFORM 1100-RECEIVE-PARMS     THRU 1100-EXIT.               02908200
           MOVE PARM-PREMISE-NO-RED       TO WS-PREMISE-NO.             
           MOVE WS-PREMISE-NO             TO WS-PREMISE-NO-NUM.         
           MOVE PARM-ORDER-INITIATION     TO WS-ORDER-INITIATION.       
           MOVE PARM-ORDER-COMPLETION     TO WS-ORDER-COMPLETION.       
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************02908900
      * 1100-RECEIVE-PARMS.                                            *02909000
      *     THIS MODULE RECEIVES THE PROGRAM PARAMETERS THAT WERE      *02909100
      *     PASSED IN BY THE DESKTOP APPLICATION.                      *02909200
      ******************************************************************02909300
REARCH*1100-RECEIVE-PARMS.                                              02909400
CVT999*    MOVE 1                          TO PARM-ID1.                 02909500
CVT999*    MOVE LENGTH OF PARM-PREMISE-NO  TO MAX-LENGTH-PARM.          02909600
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              02909800
CVT999*                          GWL-RC,                                02909900
CVT999*                          PARM-ID1,                              02910000
CVT999*                          PARM-PREMISE-NO,                       02910100
CVT999*                          TDSCHAR,                               02910200
CVT999*                          MAX-LENGTH-PARM,                       02911000
CVT999*                          PARM-L.                                02920000
                                                                        
CVT999*    ADD 1                                TO PARM-ID1.            02909500
CVT999*    MOVE LENGTH OF PARM-ORDER-INITIATION TO MAX-LENGTH-PARM.     02909600
                                                                        
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              02909800
CVT999*                          GWL-RC,                                02909900
CVT999*                          PARM-ID1,                              02910000
CVT999*                          PARM-ORDER-INITIATION,                 02910100
CVT999*                          TDSCHAR,                               02910200
CVT999*                          MAX-LENGTH-PARM,                       02911000
CVT999*                          PARM-L.                                02920000
                                                                        
CVT999*    ADD 1                                TO PARM-ID1.            02909500
CVT999*    MOVE LENGTH OF PARM-ORDER-COMPLETION TO MAX-LENGTH-PARM.     02909600
                                                                        
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              02909800
CVT999*                          GWL-RC,                                02909900
CVT999*                          PARM-ID1,                              02910000
CVT999*                          PARM-ORDER-COMPLETION,                 02910100
CVT999*                          TDSCHAR,                               02910200
CVT999*                          MAX-LENGTH-PARM,                       02911000
CVT999*                          PARM-L.                                02920000
REARCH*1100-EXIT.                                                       03221300
REARCH*    EXIT.                                                        03221400
                                                                        
      ******************************************************************03242500
      * 2000-PROCESS-OUTPUT.                                           *03242600
      *                                                                *03242700
      ******************************************************************03242800
       2000-PROCESS-OUTPUT.                                             
                                                                        
REARCH*    PERFORM 2100-DESCRIBE-RESULT THRU 2100-EXIT.                 03243100
           MOVE '2000' TO ACTIVE-PARAGRAPH.                             
           PERFORM 2200-BUILD-RESULT     THRU 2200-EXIT.                
      *--- SEND A ROW IF NO  DATA FOUND                                 03243500
           IF WS-ROW-COUNT = 0                                          
              MOVE 100 TO RS-RETURN-CODE                                
REARCH        PERFORM 2000A-MOVE-RESULT  THRU 2000A-EXIT                
              PERFORM 8100-SEND-RESULT THRU 8100-EXIT                   
           END-IF.                                                      
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
REARCH******************************************************************        
REARCH*2000A-MOVE-RESULT.                                                       
REARCH******************************************************************        
REARCH 2000A-MOVE-RESULT.                                               
REARCH     MOVE RS-RETURN-CODE       TO S-RETURN-CODE.                  
REARCH     MOVE RS-LOCAL-OFFICE      TO S-LOCAL-OFFICE.                 
REARCH     MOVE RS-POLE-NO           TO S-POLE-NO.                      
REARCH     MOVE RS-LIGHT-NO          TO S-LIGHT-NO.                     
REARCH     MOVE RS-NO-UNITS          TO S-NO-UNITS.                     
REARCH     MOVE RS-STATUS            TO S-STATUS.                       
REARCH     MOVE RS-RATE-DESC         TO S-RATE-DESC.                    
REARCH     MOVE RS-DATE-INSTALLED    TO S-DATE-INSTALLED.               
REARCH     MOVE RS-DATE-REMOVED      TO S-DATE-REMOVED.                 
REARCH     MOVE RS-ACCOUNT-NO        TO S-ACCOUNT-NO.                   
REARCH     MOVE RS-CODE-UTIL-TYPE    TO S-CODE-UTIL-TYPE.               
REARCH     MOVE RS-IC-NO             TO S-IC-NO.                        
REARCH     MOVE RS-RATE-ITEM-CODE    TO S-RATE-ITEM-CODE.               
REARCH     MOVE RS-ITEM-SEQ-NO       TO S-ITEM-SEQ-NO.                  
REARCH     MOVE RS-VALID-LOC-OFF     TO S-VALID-LOC-OFF.                
REARCH     MOVE RS-COMPANY-NO        TO S-COMPANY-NO.                   
REARCH     MOVE RS-CODE-SERVICE-TYPE TO S-CODE-SERVICE-TYPE.            
REARCH     MOVE RS-RATE-PLAN-NO      TO S-RATE-PLAN-NO.                 
REARCH     MOVE RS-PRICE-PER-SERV    TO S-PRICE-PER-SERV.               
REARCH     MOVE RS-CHANGED-FL        TO S-CHANGED-FL.                   
REARCH 2000A-EXIT.                                                      
REARCH     EXIT.                                                        
      ******************************************************************03244300
      * 2100-DESCRIBE-RESULT                                           *03244400
      ******************************************************************03244500
                                                                        
REARCH*2100-DESCRIBE-RESULT.                                            03244700
                                                                        
REARCH*    MOVE '2100' TO ACTIVE-PARAGRAPH.                             03244900
                                                                        
CVT999*    MOVE 1       TO CTR-COLUMN.                                  03245100
CVT999*    MOVE TDSINT4 TO DB-HOST-TYPE.                                03245200
CVT999*    MOVE TDSINT4 TO DB-CLIENT-TYPE.                              03245300
CVT999*    MOVE LENGTH OF RS-RETURN-CODE      TO WRKLEN1.               03245400
CVT999*    MOVE LENGTH OF CNS-RETURN-CODE     TO WRKLEN2.               03245500
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03245700
CVT999*                          GWL-RC,                                03245800
CVT999*                          CTR-COLUMN,                            03245900
CVT999*                          DB-HOST-TYPE,                          03246000
CVT999*                          WRKLEN1,                               03246100
CVT999*                          RS-RETURN-CODE,                        03246200
CVT999*                          DB-NULL-INDICATOR,                     03246300
CVT999*                          TDS-FALSE,                             03246400
CVT999*                          DB-CLIENT-TYPE,                        03246500
CVT999*                          WRKLEN1,                               03246600
CVT999*                          CNS-RETURN-CODE,                       03246700
CVT999*                          WRKLEN2.                               03246800
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03247000
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03260000
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03270000
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03280000
CVT999*    MOVE LENGTH OF RS-LOCAL-OFFICE    TO WRKLEN1.                03290000
CVT999*    MOVE LENGTH OF CNS-LOCAL-OFFICE   TO WRKLEN2.                03291000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03293000
CVT999*                          GWL-RC,                                03294000
CVT999*                          CTR-COLUMN,                            03295000
CVT999*                          DB-HOST-TYPE,                          03296000
CVT999*                          WRKLEN1,                               03297000
CVT999*                          RS-LOCAL-OFFICE,                       03298000
CVT999*                          DB-NULL-INDICATOR,                     03299000
CVT999*                          TDS-FALSE,                             03299100
CVT999*                          DB-CLIENT-TYPE,                        03299200
CVT999*                          WRKLEN1,                               03299300
CVT999*                          CNS-LOCAL-OFFICE,                      03299400
CVT999*                          WRKLEN2.                               03299500
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03299700
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03299900
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03300000
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03300100
CVT999*    MOVE LENGTH OF RS-POLE-NO         TO WRKLEN1.                03300200
CVT999*    MOVE LENGTH OF CNS-POLE-NO        TO WRKLEN2.                03300300
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03300500
CVT999*                          GWL-RC,                                03300600
CVT999*                          CTR-COLUMN,                            03300700
CVT999*                          DB-HOST-TYPE,                          03300800
CVT999*                          WRKLEN1,                               03300900
CVT999*                          RS-POLE-NO,                            03301000
CVT999*                          DB-NULL-INDICATOR,                     03301100
CVT999*                          TDS-FALSE,                             03301200
CVT999*                          DB-CLIENT-TYPE,                        03301300
CVT999*                          WRKLEN1,                               03301400
CVT999*                          CNS-POLE-NO,                           03301500
CVT999*                          WRKLEN2.                               03301600
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03301800
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03302000
CVT999*    MOVE TDSINT2 TO DB-HOST-TYPE.                                03302100
CVT999*    MOVE TDSINT2 TO DB-CLIENT-TYPE.                              03302200
CVT999*    MOVE LENGTH OF RS-LIGHT-NO        TO WRKLEN1.                03302300
CVT999*    MOVE LENGTH OF CNS-LIGHT-NO       TO WRKLEN2.                03302400
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03302600
CVT999*                          GWL-RC,                                03302700
CVT999*                          CTR-COLUMN,                            03302800
CVT999*                          DB-HOST-TYPE,                          03302900
CVT999*                          WRKLEN1,                               03303000
CVT999*                          RS-LIGHT-NO,                           03303100
CVT999*                          DB-NULL-INDICATOR,                     03303200
CVT999*                          TDS-FALSE,                             03303300
CVT999*                          DB-CLIENT-TYPE,                        03303400
CVT999*                          WRKLEN1,                               03303500
CVT999*                          CNS-LIGHT-NO,                          03303600
CVT999*                          WRKLEN2.                               03303700
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03303900
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03304100
CVT999*    MOVE TDSINT2 TO DB-HOST-TYPE.                                03304200
CVT999*    MOVE TDSINT2 TO DB-CLIENT-TYPE.                              03304300
CVT999*    MOVE LENGTH OF RS-NO-UNITS        TO WRKLEN1.                03304400
CVT999*    MOVE LENGTH OF CNS-NO-UNITS       TO WRKLEN2.                03304500
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03304700
CVT999*                          GWL-RC,                                03304800
CVT999*                          CTR-COLUMN,                            03304900
CVT999*                          DB-HOST-TYPE,                          03305000
CVT999*                          WRKLEN1,                               03305100
CVT999*                          RS-NO-UNITS,                           03305200
CVT999*                          DB-NULL-INDICATOR,                     03305300
CVT999*                          TDS-FALSE,                             03305400
CVT999*                          DB-CLIENT-TYPE,                        03305500
CVT999*                          WRKLEN1,                               03305600
CVT999*                          CNS-NO-UNITS,                          03305700
CVT999*                          WRKLEN2.                               03305800
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03306000
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03306200
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03306300
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03306400
CVT999*    MOVE LENGTH OF RS-STATUS          TO WRKLEN1.                03306500
CVT999*    MOVE LENGTH OF CNS-STATUS         TO WRKLEN2.                03306600
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03306800
CVT999*                          GWL-RC,                                03306900
CVT999*                          CTR-COLUMN,                            03307000
CVT999*                          DB-HOST-TYPE,                          03307100
CVT999*                          WRKLEN1,                               03307200
CVT999*                          RS-STATUS,                             03307300
CVT999*                          DB-NULL-INDICATOR,                     03307400
CVT999*                          TDS-FALSE,                             03307500
CVT999*                          DB-CLIENT-TYPE,                        03307600
CVT999*                          WRKLEN1,                               03307700
CVT999*                          CNS-STATUS,                            03307800
CVT999*                          WRKLEN2.                               03307900
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03308100
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03308300
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03308400
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03308500
CVT999*    MOVE LENGTH OF RS-RATE-DESC       TO WRKLEN1.                03308600
CVT999*    MOVE LENGTH OF CNS-RATE-DESC      TO WRKLEN2.                03308700
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03308900
CVT999*                          GWL-RC,                                03309000
CVT999*                          CTR-COLUMN,                            03309100
CVT999*                          DB-HOST-TYPE,                          03309200
CVT999*                          WRKLEN1,                               03309300
CVT999*                          RS-RATE-DESC,                          03309400
CVT999*                          DB-NULL-INDICATOR,                     03309500
CVT999*                          TDS-FALSE,                             03309600
CVT999*                          DB-CLIENT-TYPE,                        03309700
CVT999*                          WRKLEN1,                               03309800
CVT999*                          CNS-RATE-DESC,                         03309900
CVT999*                          WRKLEN2.                               03310000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03310200
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03310400
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03310500
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03310600
CVT999*    MOVE LENGTH OF RS-DATE-INSTALLED  TO WRKLEN1.                03310700
CVT999*    MOVE LENGTH OF CNS-DATE-INSTALLED TO WRKLEN2.                03310800
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03311000
CVT999*                          GWL-RC,                                03311100
CVT999*                          CTR-COLUMN,                            03311200
CVT999*                          DB-HOST-TYPE,                          03311300
CVT999*                          WRKLEN1,                               03311400
CVT999*                          RS-DATE-INSTALLED,                     03311500
CVT999*                          DB-NULL-INDICATOR,                     03311600
CVT999*                          TDS-FALSE,                             03311700
CVT999*                          DB-CLIENT-TYPE,                        03311800
CVT999*                          WRKLEN1,                               03311900
CVT999*                          CNS-DATE-INSTALLED,                    03312000
CVT999*                          WRKLEN2.                               03312100
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03312300
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03312500
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03312600
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03312700
CVT999*    MOVE LENGTH OF RS-DATE-REMOVED    TO WRKLEN1.                03312800
CVT999*    MOVE LENGTH OF CNS-DATE-REMOVED   TO WRKLEN2.                03312900
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03313100
CVT999*                          GWL-RC,                                03313200
CVT999*                          CTR-COLUMN,                            03313300
CVT999*                          DB-HOST-TYPE,                          03313400
CVT999*                          WRKLEN1,                               03313500
CVT999*                          RS-DATE-REMOVED,                       03313600
CVT999*                          DB-NULL-INDICATOR,                     03313700
CVT999*                          TDS-FALSE,                             03313800
CVT999*                          DB-CLIENT-TYPE,                        03313900
CVT999*                          WRKLEN1,                               03314000
CVT999*                          CNS-DATE-REMOVED,                      03314100
CVT999*                          WRKLEN2.                               03314200
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03314400
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03314600
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             03314700
CVT999*    MOVE TDSFLT8    TO DB-CLIENT-TYPE.                           03314800
CVT999*    MOVE LENGTH OF RS-ACCOUNT-NO      TO WRKLEN1.                03314900
CVT999*    MOVE LENGTH OF CNS-ACCOUNT-NO     TO WRKLEN2.                03315000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03315200
CVT999*                          GWL-RC,                                03315300
CVT999*                          CTR-COLUMN,                            03315400
CVT999*                          DB-HOST-TYPE,                          03315500
CVT999*                          WRKLEN1,                               03315600
CVT999*                          RS-ACCOUNT-NO,                         03315700
CVT999*                          DB-NULL-INDICATOR,                     03315800
CVT999*                          TDS-FALSE,                             03315900
CVT999*                          DB-CLIENT-TYPE,                        03316000
CVT999*                          WRKLEN1,                               03316100
CVT999*                          CNS-ACCOUNT-NO,                        03316200
CVT999*                          WRKLEN2.                               03316300
                                                                        
CVT999*    MOVE +0 TO WRKLEN2.                                          03316500
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                              03316600
CVT999*                          GWL-RC,                                03316700
CVT999*                          TDS-OBJECT-COL,                        03316800
CVT999*                          CTR-COLUMN,                            03316900
CVT999*                          WRKLEN1,                               03317000
CVT999*                          WRKLEN2.                               03317100
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03317300
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03317500
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03318000
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03320000
CVT999*    MOVE LENGTH OF RS-CODE-UTIL-TYPE  TO WRKLEN1.                03550000
CVT999*    MOVE LENGTH OF CNS-CODE-UTIL-TYPE TO WRKLEN2.                03560000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03580000
CVT999*                          GWL-RC,                                03590000
CVT999*                          CTR-COLUMN,                            03600000
CVT999*                          DB-HOST-TYPE,                          03610000
CVT999*                          WRKLEN1,                               03620000
CVT999*                          RS-CODE-UTIL-TYPE,                     03630000
CVT999*                          DB-NULL-INDICATOR,                     03640000
CVT999*                          TDS-FALSE,                             03650000
CVT999*                          DB-CLIENT-TYPE,                        03660000
CVT999*                          WRKLEN1,                               03670000
CVT999*                          CNS-CODE-UTIL-TYPE,                    03680000
CVT999*                          WRKLEN2.                               03690000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03710000
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03719500
CVT999*    MOVE TDSINT2 TO DB-HOST-TYPE.                                03719600
CVT999*    MOVE TDSINT2 TO DB-CLIENT-TYPE.                              03719700
CVT999*    MOVE LENGTH OF RS-IC-NO       TO WRKLEN1.                    03719800
CVT999*    MOVE LENGTH OF CNS-IC-NO       TO WRKLEN2.                   03719900
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03720100
CVT999*                          GWL-RC,                                03720200
CVT999*                          CTR-COLUMN,                            03720300
CVT999*                          DB-HOST-TYPE,                          03720400
CVT999*                          WRKLEN1,                               03720500
CVT999*                          RS-IC-NO,                              03720600
CVT999*                          DB-NULL-INDICATOR,                     03720700
CVT999*                          TDS-FALSE,                             03720800
CVT999*                          DB-CLIENT-TYPE,                        03720900
CVT999*                          WRKLEN1,                               03721000
CVT999*                          CNS-IC-NO,                             03721100
CVT999*                          WRKLEN2.                               03721200
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03721400
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03721600
CVT999*    MOVE TDSINT2 TO DB-HOST-TYPE.                                03721700
CVT999*    MOVE TDSINT2 TO DB-CLIENT-TYPE.                              03721800
CVT999*    MOVE LENGTH OF RS-RATE-ITEM-CODE    TO WRKLEN1.              03721900
CVT999*    MOVE LENGTH OF CNS-RATE-ITEM-CODE   TO WRKLEN2.              03722000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03722200
CVT999*                          GWL-RC,                                03722300
CVT999*                          CTR-COLUMN,                            03722400
CVT999*                          DB-HOST-TYPE,                          03722500
CVT999*                          WRKLEN1,                               03722600
CVT999*                          RS-RATE-ITEM-CODE,                     03722700
CVT999*                          DB-NULL-INDICATOR,                     03722800
CVT999*                          TDS-FALSE,                             03722900
CVT999*                          DB-CLIENT-TYPE,                        03723000
CVT999*                          WRKLEN1,                               03723100
CVT999*                          CNS-RATE-ITEM-CODE,                    03723200
CVT999*                          WRKLEN2.                               03723300
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03723500
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03723700
CVT999*    MOVE TDSINT2 TO DB-HOST-TYPE.                                03723800
CVT999*    MOVE TDSINT2 TO DB-CLIENT-TYPE.                              03723900
CVT999*    MOVE LENGTH OF RS-ITEM-SEQ-NO       TO WRKLEN1.              03724000
CVT999*    MOVE LENGTH OF CNS-ITEM-SEQ-NO      TO WRKLEN2.              03724100
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03724300
CVT999*                          GWL-RC,                                03724400
CVT999*                          CTR-COLUMN,                            03724500
CVT999*                          DB-HOST-TYPE,                          03724600
CVT999*                          WRKLEN1,                               03724700
CVT999*                          RS-ITEM-SEQ-NO,                        03724800
CVT999*                          DB-NULL-INDICATOR,                     03724900
CVT999*                          TDS-FALSE,                             03725000
CVT999*                          DB-CLIENT-TYPE,                        03725100
CVT999*                          WRKLEN1,                               03725200
CVT999*                          CNS-ITEM-SEQ-NO,                       03725300
CVT999*                          WRKLEN2.                               03725400
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03725600
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  03725800
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                03725900
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              03726000
CVT999*    MOVE LENGTH OF RS-VALID-LOC-OFF   TO WRKLEN1.                03726100
CVT999*    MOVE LENGTH OF CNS-VALID-LOC-OFF  TO WRKLEN2.                03727000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              03729000
CVT999*                          GWL-RC,                                03730000
CVT999*                          CTR-COLUMN,                            03740000
CVT999*                          DB-HOST-TYPE,                          03750000
CVT999*                          WRKLEN1,                               03760000
CVT999*                          RS-VALID-LOC-OFF,                      03770000
CVT999*                          DB-NULL-INDICATOR,                     03780000
CVT999*                          TDS-FALSE,                             03790000
CVT999*                          DB-CLIENT-TYPE,                        03800000
CVT999*                          WRKLEN1,                               03810000
CVT999*                          CNS-VALID-LOC-OFF,                     03820000
CVT999*                          WRKLEN2.                               03830000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     03850000
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  04135600
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                04135700
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              04135800
CVT999*    MOVE LENGTH OF RS-COMPANY-NO TO WRKLEN1.                     04135900
CVT999*    MOVE LENGTH OF CNS-COMPANY-NO  TO WRKLEN2.                   04136000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04136200
CVT999*                          GWL-RC,                                04136300
CVT999*                          CTR-COLUMN,                            04136400
CVT999*                          DB-HOST-TYPE,                          04136500
CVT999*                          WRKLEN1,                               04136600
CVT999*                          RS-COMPANY-NO,                         04136700
CVT999*                          DB-NULL-INDICATOR,                     04136800
CVT999*                          TDS-FALSE,                             04136900
CVT999*                          DB-CLIENT-TYPE,                        04137000
CVT999*                          WRKLEN1,                               04137100
CVT999*                          CNS-COMPANY-NO,                        04137200
CVT999*                          WRKLEN2.                               04137300
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04137500
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  04137700
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                04137800
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              04137900
CVT999*    MOVE LENGTH OF RS-CODE-SERVICE-TYPE   TO WRKLEN1.            04138000
CVT999*    MOVE LENGTH OF CNS-CODE-SERVICE-TYPE  TO WRKLEN2.            04138100
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04138300
CVT999*                          GWL-RC,                                04138400
CVT999*                          CTR-COLUMN,                            04138500
CVT999*                          DB-HOST-TYPE,                          04138600
CVT999*                          WRKLEN1,                               04138700
CVT999*                          RS-CODE-SERVICE-TYPE,                  04138800
CVT999*                          DB-NULL-INDICATOR,                     04138900
CVT999*                          TDS-FALSE,                             04139000
CVT999*                          DB-CLIENT-TYPE,                        04139100
CVT999*                          WRKLEN1,                               04139200
CVT999*                          CNS-CODE-SERVICE-TYPE,                 04139300
CVT999*                          WRKLEN2.                               04139400
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04139600
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  04139800
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                04139900
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              04140000
CVT999*    MOVE LENGTH OF RS-RATE-PLAN-NO        TO WRKLEN1.            04140100
CVT999*    MOVE LENGTH OF CNS-RATE-PLAN-NO       TO WRKLEN2.            04140200
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04140400
CVT999*                          GWL-RC,                                04140500
CVT999*                          CTR-COLUMN,                            04140600
CVT999*                          DB-HOST-TYPE,                          04140700
CVT999*                          WRKLEN1,                               04140800
CVT999*                          RS-RATE-PLAN-NO,                       04140900
CVT999*                          DB-NULL-INDICATOR,                     04141000
CVT999*                          TDS-FALSE,                             04141100
CVT999*                          DB-CLIENT-TYPE,                        04141200
CVT999*                          WRKLEN1,                               04141300
CVT999*                          CNS-RATE-PLAN-NO,                      04141400
CVT999*                          WRKLEN2.                               04141500
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04141700
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  04139800
CVT999*    MOVE TDSDECIMAL TO DB-HOST-TYPE.                             04139900
CVT999*    MOVE TDSFLT8 TO DB-CLIENT-TYPE.                              04140000
CVT999*    MOVE LENGTH OF RS-PRICE-PER-SERV      TO WRKLEN1.            04140100
CVT999*    MOVE LENGTH OF CNS-PRICE-PER-SERV     TO WRKLEN2.            04140200
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04140400
CVT999*                          GWL-RC,                                04140500
CVT999*                          CTR-COLUMN,                            04140600
CVT999*                          DB-HOST-TYPE,                          04140700
CVT999*                          WRKLEN1,                               04140800
CVT999*                          RS-PRICE-PER-SERV,                     04140900
CVT999*                          DB-NULL-INDICATOR,                     04141000
CVT999*                          TDS-FALSE,                             04141100
CVT999*                          DB-CLIENT-TYPE,                        04141200
CVT999*                          WRKLEN1,                               04141300
CVT999*                          CNS-PRICE-PER-SERV,                    04141400
CVT999*                          WRKLEN2.                               04141500
                                                                        
CVT999*    MOVE +6 TO WRKLEN2.                                                  
CVT999*    CALL 'TDSETBCD' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          TDS-OBJECT-COL,                                
CVT999*                          CTR-COLUMN,                                    
CVT999*                          WRKLEN1,                                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04141700
                                                                        
CVT999*    ADD 1        TO CTR-COLUMN.                                  04139800
CVT999*    MOVE TDSCHAR TO DB-HOST-TYPE.                                04139900
CVT999*    MOVE TDSCHAR TO DB-CLIENT-TYPE.                              04140000
CVT999*    MOVE LENGTH OF RS-CHANGED-FL          TO WRKLEN1.            04140100
CVT999*    MOVE LENGTH OF CNS-CHANGED-FL         TO WRKLEN2.            04140200
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04140400
CVT999*                          GWL-RC,                                04140500
CVT999*                          CTR-COLUMN,                            04140600
CVT999*                          DB-HOST-TYPE,                          04140700
CVT999*                          WRKLEN1,                               04140800
CVT999*                          RS-CHANGED-FL,                         04140900
CVT999*                          DB-NULL-INDICATOR,                     04141000
CVT999*                          TDS-FALSE,                             04141100
CVT999*                          DB-CLIENT-TYPE,                        04141200
CVT999*                          WRKLEN1,                               04141300
CVT999*                          CNS-CHANGED-FL,                        04141400
CVT999*                          WRKLEN2.                               04141500
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                     04141700
                                                                        
REARCH*2100-EXIT.                                                       04142000
REARCH*    EXIT.                                                        04150000
                                                                        
      ******************************************************************04220000
      * 2200-BUILD-RESULT                                              *04230000
      ******************************************************************04240000
                                                                        
       2200-BUILD-RESULT.                                               
                                                                        
      *--- GET VALID LOCAL OFFICE FOR THIS PREMISE                      04270000
           PERFORM 7600-SELECT-VALID-LOC-OFFICE THRU 7600-EXIT.         
                                                                        
      *--- FETCH ACCOUNT DATA                                           04280000
T19350     MOVE WS-PREMISE-NO-NUM          TO WS-CPD99-PREMISE-NO.      
T19350     PERFORM 6990-FETCH-CUR-ACCOUNT THRU 6990-EXIT.               
T19350     MOVE WS-CPD99-ACCOUNT-NO        TO AT-ACCOUNT-NO.            
T19350*                                                                         
C31196*------ FETCH CHANGED FLAG INFORMATION                            05790000
C31196     PERFORM 2220-GET-CHANGE-DATA THRU 2220-EXIT.                 
                                                                        
      *------ FETCH DATA FROM UTIL ENVIRONMENT                          04342400
T19350     PERFORM 2210-GET-UTIL-DATA THRU 2210-EXIT.                   
                                                                        
       2200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ***************************************************************** 06471000
      * 2210-GET-UTIL-DATA                                            * 06472000
      * THIS MODULE OBTAINS UTIL ENVIRONMENT DATA                     * 06473000
      ***************************************************************** 06474000
                                                                        
       2210-GET-UTIL-DATA.                                              
                                                                        
      *--- FETCH UTIL ENVIRONMENT DATA                                  06479300
           PERFORM 7000-OPEN-UTILENV    THRU 7000-EXIT.                 
           PERFORM 7010-FETCH-UTILENV   THRU 7010-EXIT.                 
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
              NEXT SENTENCE                                             
           ELSE                                                         
      *------ FETCH DATA FROM CUST PLAN AND SEND ROWS                   06479900
              PERFORM 2300-GET-CP-DATA THRU 2300-EXIT                   
                      UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND           
           END-IF.                                                      
           PERFORM 7020-CLOSE-UTILENV THRU 7020-EXIT.                   
                                                                        
       2210-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ***************************************************************** 06471000
      * 2220-GET-CHANGE-DATA                                          * 06472000
      * THIS MODULE OBTAINS MNT TRANS HISTORY DATA                    * 06473000
      ***************************************************************** 06474000
                                                                        
       2220-GET-CHANGE-DATA.                                            
                                                                        
           MOVE 'N'   TO WS-CHANGED.                                    
                                                                        
           EXEC SQL                                                     
               SELECT TOP(1) 'Y'                                               
                  INTO :WS-CHANGED                                      
               FROM CSS_MNT_TRANS_HIST MH,                              
                    CSS_MT_TRN_HST_DET MI                               
               WHERE MH.PREMISE_NO = :WS-PREMISE-NO-NUM                 
                 AND MH.TRANS_HIST_SEQ_NO = MI.TRANS_HIST_SEQ_NO        
                 AND MI.COLUMN_DESC IN ('REV DISTRICT',                 
                                        'SUBDIVISION',                  
                                        'RATE ITEM CODE')               
                 AND MH.TRANS_HIST_SEQ_NO >= CIS.CHAR2TIMESTAMP(
                                                   :WS-ORDER-INITIATION
              )       
                 AND MH.TRANS_HIST_SEQ_NO <= CIS.CHAR2TIMESTAMP(
                                                   :WS-ORDER-COMPLETION
              )       
                 AND MI.TRANS_HIST_SEQ_NO >= CIS.CHAR2TIMESTAMP(
                                                   :WS-ORDER-INITIATION
              )       
                 AND MI.TRANS_HIST_SEQ_NO <= CIS.CHAR2TIMESTAMP(
                                                   :WS-ORDER-COMPLETION
              )       
                                                 
            END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ020
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*           INTO :WS-CHANGED                                              
MFA-TR*        FROM CSS_MNT_TRANS_HIST MH,                                      
MFA-TR*             CSS_MT_TRN_HST_DET MI                                       
MFA-TR*        WHERE MH.PREMISE_NO = :WS-PREMISE-NO-NUM                         
MFA-TR*          AND MH.TRANS_HIST_SEQ_NO = MI.TRANS_HIST_SEQ_NO                
MFA-TR*          AND MI.COLUMN_DESC IN ('REV DISTRICT',                         
MFA-TR*                                 'SUBDIVISION',                          
MFA-TR*                                 'RATE ITEM CODE')                       
MFA-TR*          AND MH.TRANS_HIST_SEQ_NO >= :WS-ORDER-INITIATION               
MFA-TR*          AND MH.TRANS_HIST_SEQ_NO <= :WS-ORDER-COMPLETION               
MFA-TR*          AND MI.TRANS_HIST_SEQ_NO >= :WS-ORDER-INITIATION               
MFA-TR*          AND MI.TRANS_HIST_SEQ_NO <= :WS-ORDER-COMPLETION               
MFA-TR*        FETCH FIRST 1 ROWS ONLY                                          
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

      *DO NOT CHANGE ABOVE SQL EVEN THOUGH IT LOOKS ILLOGICAL.  DD   *          
                                                                        
            MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                      
                                                                        
            EVALUATE WS-ACTIVE-RETURN-CODE                              
                WHEN SUCCESSFUL-CALL                                    
                    MOVE WS-CHANGED TO RS-CHANGED-FL                    
                WHEN NOT-FOUND                                          
                    MOVE WS-CHANGED TO RS-CHANGED-FL                    
                WHEN OTHER                                              
                    MOVE PROGRAM-NAME       TO ABEND-PROGRAM            
                    MOVE '2220'              TO ACTIVE-PARAGRAPH        
                    MOVE 'SELECT'            TO ABEND-FUNCTION          
                    MOVE SPACES             TO ABEND-SQL-PREDICATES     
                                                     ABEND-TABLES       
                    MOVE 'CSS_MNT_TRANS_HIST' TO TABLE-1                
                    MOVE 'PREMISE_NO'        TO TABLE-ELEMENT-1         
                    MOVE WS-PREMISE-NO-NUM   TO HOSTVAR-ELEMENT-1       
                    PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT       
                    PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT       
                END-EVALUATE.                                           
                                                                        
       2220-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ***************************************************************** 06482000
      * 2300-GET-CP-DATA                                              * 06490000
      * THIS MODULE OBTAINS CUSTOMER PLAN DATA                        * 06491000
      ***************************************************************** 06500000
                                                                        
       2300-GET-CP-DATA.                                                
                                                                        
           MOVE AT-ACCOUNT-NO        TO RS-ACCOUNT-NO.                  
           MOVE UT-CODE-UTIL-TYPE    TO RS-CODE-UTIL-TYPE.              
           MOVE UT-IC-NO             TO RS-IC-NO.                       
                                                                        
      *--- GET CUST PLAN DATA                                           06540900
           PERFORM 7100-OPEN-CUSTPLAN  THRU 7100-EXIT.                  
           PERFORM 7110-FETCH-CUSTPLAN THRU 7110-EXIT.                  
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
              NEXT SENTENCE                                             
           ELSE                                                         
      *------ SEND STREET LIGHTS DATA                                   06544000
              PERFORM 2310-SEND-LIGHTS-DATA THRU 2310-EXIT              
                      UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND           
           END-IF.                                                      
           PERFORM 7120-CLOSE-CUSTPLAN THRU 7120-EXIT.                  
           PERFORM 7010-FETCH-UTILENV THRU 7010-EXIT.                   
                                                                        
       2300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************06751400
      *     2310-SEND-LIGHTS-DATA                                      *06751500
      *     THIS MODULE OBTAINS AND RETURNS STREET LIGHTS DATA         *06751600
      ******************************************************************06751800
       2310-SEND-LIGHTS-DATA.                                           
                                                                        
           MOVE CP-RATE-ITEM-CODE        TO RS-RATE-ITEM-CODE.          
           MOVE CP-ITEM-SEQ-NO           TO RS-ITEM-SEQ-NO.             
           MOVE CP-CODE-PLAN-STATUS      TO RS-STATUS.                  
           MOVE CP-DIST-NO               TO RS-LOCAL-OFFICE.            
           MOVE CP-LIGHT-NO              TO RS-LIGHT-NO.                
           MOVE CP-POLE-NO               TO RS-POLE-NO.                 
           MOVE CP-NO-UNITS              TO RS-NO-UNITS.                
           MOVE CP-CODE-SERVICE-TYPE     TO RS-CODE-SERVICE-TYPE.       
           IF WS-NULL-DATE-IND1 = -1                                    
              MOVE SPACE TO  RS-DATE-INSTALLED                          
           ELSE                                                         
              MOVE CP-DATE-PLAN-START(1:4)  TO USA-YEAR                 
              MOVE CP-DATE-PLAN-START(6:2)  TO USA-MONTH                
              MOVE CP-DATE-PLAN-START(9:2)  TO USA-DAY                  
              MOVE USA-DATE-FORMAT          TO RS-DATE-INSTALLED        
           END-IF.                                                      
           IF WS-NULL-DATE-IND2 = -1                                    
              MOVE SPACE TO  RS-DATE-REMOVED                            
           ELSE                                                         
              MOVE CP-REMOVE-DATE(1:4)      TO USA-YEAR                 
              MOVE CP-REMOVE-DATE(6:2)      TO USA-MONTH                
              MOVE CP-REMOVE-DATE(9:2)      TO USA-DAY                  
              MOVE USA-DATE-FORMAT          TO RS-DATE-REMOVED          
           END-IF.                                                      
                                                                        
      *--- GET RATE PLAN DESCRIPTION                                    06754800
           PERFORM 7200-SELECT-RATE-DESC   THRU 7200-EXIT.              
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
              MOVE  SPACE        TO WS-RATE-PLAN-DESC                   
           ELSE                                                         
              MOVE  RD-RATE-DESC TO WS-RATE-PLAN-DESC                   
           END-IF.                                                      
                                                                        
      *------ GET VERSION CONTROL NUMBER                                06755600
           PERFORM 7300-OPEN-VERSION-NO     THRU 7300-EXIT.             
           PERFORM 7310-FETCH-VERSION-NO    THRU 7310-EXIT.             
           PERFORM 7320-CLOSE-VERSION-NO    THRU 7320-EXIT.             
      *------ GET EQUIPMENT NUMBER                                      06756000
           PERFORM 7400-SELECT-EQUIPMENT-NO THRU 7400-EXIT.             
C31196     MOVE UP-PRICE-PER-SERV TO RS-PRICE-PER-SERV.                 
                                                                        
      *------ GET EQUIPMENT DESCRIPTION                                 06756300
           PERFORM 7500-SELECT-EQUIPMENT-DESC THRU 7500-EXIT.           
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
              MOVE SPACE                  TO WS-EQUIP-SHRT-DESC         
           ELSE                                                         
              MOVE L9-UM-EQUIP-SHRT-DESC  TO WS-EQUIP-SHRT-DESC         
           END-IF.                                                      
                                                                        
      *------ SEND STREET LIGHTS DATA                                   06757100
           MOVE WS-RATE-DESC TO RS-RATE-DESC.                           
           MOVE RD-COMPANY-NO       TO RS-COMPANY-NO.                   
REARCH     PERFORM 2000A-MOVE-RESULT          THRU 2000A-EXIT           
           PERFORM 8100-SEND-RESULT           THRU 8100-EXIT.           
           ADD 1 TO WS-ROW-COUNT.                                       
           PERFORM 7110-FETCH-CUSTPLAN        THRU 7110-EXIT.           
                                                                        
       2310-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07092200
T19350* 6990-FETCH-CUR-ACCOUNT                                         *42840000
T19350*  TO FETCH THE MOST CURRENT ACCOUNT AT THE PREMISE.             *31300000
T19350******************************************************************43111000
T19350     EXEC SQL                                                             
T19350         INCLUDE CPD00099                                                 
T19350     END-EXEC.                                                            
T19350*                                                                         
T19350 6995-CPD99-ERROR-ROUTINE.                                        
T19350*                                                                         
T19350     MOVE PROGRAM-NAME               TO ABEND-PROGRAM.            
T19350     PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT.              
T19350     PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT.              
T19350*                                                                         
T19350 6995-EXIT.                                                       
T19350     EXIT.                                                        
T19350*                                                                         
      ******************************************************************07092200
      * 7000-OPEN-UTILENV                                              *07092300
      ******************************************************************07092400
       7000-OPEN-UTILENV.                                               
                                                                        
           EXEC SQL                                                     
               OPEN UTILENV                                             
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7000'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'OPEN'                   TO ABEND-FUNCTION           
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_UTIL_ENVRNMT'       TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'CODE_UTIL_TYPE'         TO TABLE-ELEMENT-2          
              MOVE AT-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE UT-CODE-UTIL-TYPE        TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************07553100
      * 7010-FETCH-UTILENV                                             *07553200
      ******************************************************************07553300
       7010-FETCH-UTILENV.                                              
                                                                        
           EXEC SQL                                                     
               FETCH UTILENV                                            
                 INTO   :UT-IC-NO,                                      
                        :UT-RATE-PLAN-NO,                               
                        :UT-CODE-UTIL-TYPE                              
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              MOVE UT-RATE-PLAN-NO TO RS-RATE-PLAN-NO                   
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7010'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'FETCH'                  TO ABEND-FUNCTION           
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_UTIL_ENVRNMT'       TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'CODE_UTIL_TYPE'         TO TABLE-ELEMENT-2          
              MOVE AT-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE UT-CODE-UTIL-TYPE        TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7010-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************07559300
      * 7020-CLOSE-UTILENV.                                            *07559400
      ******************************************************************07559500
       7020-CLOSE-UTILENV.                                              
                                                                        
           EXEC SQL                                                     
               CLOSE UTILENV                                            
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7020'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'CLOSE'                  TO ABEND-FUNCTION           
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_UTIL_ENVRNMT'       TO TABLE-1                  
              MOVE 'ACCOUNT_NO'             TO TABLE-ELEMENT-1          
              MOVE 'CODE_UTIL_TYPE'         TO TABLE-ELEMENT-2          
              MOVE AT-ACCOUNT-NO            TO HOSTVAR-ELEMENT-1        
              MOVE UT-CODE-UTIL-TYPE        TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7020-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07562400
      * 7100-OPEN-CUSTPLAN                                             *07562500
      ******************************************************************07562600
       7100-OPEN-CUSTPLAN.                                              
                                                                        
           EXEC SQL                                                     
               OPEN CUSTPLAN                                            
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7100'                    TO ACTIVE-PARAGRAPH        
CBSI          MOVE 'OPEN'                    TO ABEND-FUNCTION          
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_CUST_PLAN'           TO TABLE-1                 
              MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-1         
              MOVE 'CODE_UTIL_TYPE'          TO TABLE-ELEMENT-2         
              MOVE 'IC_NO'                   TO TABLE-ELEMENT-3         
              MOVE AT-ACCOUNT-NO             TO HOSTVAR-ELEMENT-1       
              MOVE UT-CODE-UTIL-TYPE         TO HOSTVAR-ELEMENT-2       
              MOVE UT-IC-NO                  TO HOSTVAR-ELEMENT-3       
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************07565700
      * 7110-FETCH-CUSTPLAN                                            *07565800
      ******************************************************************07565900
       7110-FETCH-CUSTPLAN.                                             
                                                                        
           EXEC SQL                                                     
               FETCH CUSTPLAN                                           
                 INTO   :CP-RATE-ITEM-CODE,                             
                        :CP-ITEM-SEQ-NO,                                
                        :CP-CODE-PLAN-STATUS,                           
                        :CP-DATE-PLAN-START :WS-NULL-DATE-IND1,          
                        :CP-REMOVE-DATE :WS-NULL-DATE-IND2,              
                        :CP-DIST-NO,                                    
                        :CP-LIGHT-NO,                                   
                        :CP-POLE-NO,                                    
                        :CP-NO-UNITS,                                   
                        :CP-CODE-SERVICE-TYPE                           
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE '7110'                     TO ACTIVE-PARAGRAPH       
CBSI          MOVE 'FETCH'                    TO ABEND-FUNCTION         
CBSI          MOVE SPACES                     TO ABEND-SQL-PREDICATES   
CBSI                                             ABEND-TABLES           
              MOVE 'CSS_CUST_PLAN'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
              MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
              MOVE AT-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
              MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7110-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07569900
      * 7120-CLOSE-CUSTPLAN.                                           *07570000
      ******************************************************************07570100
       7120-CLOSE-CUSTPLAN.                                             
                                                                        
           EXEC SQL                                                     
               CLOSE CUSTPLAN                                           
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE '7120'                     TO ACTIVE-PARAGRAPH       
CBSI          MOVE 'CLOSE'                    TO ABEND-FUNCTION         
CBSI          MOVE SPACES                     TO ABEND-SQL-PREDICATES   
CBSI                                             ABEND-TABLES           
              MOVE 'CSS_CUST_PLAN'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
              MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
              MOVE AT-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
              MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7120-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07575400
      * 7200-SELECT-RATE-DESC                                          *07575500
      ******************************************************************07575600
       7200-SELECT-RATE-DESC.                                           
                                                                        
           EXEC SQL                                                     
               SELECT RATE_DESC,                                        
                      COMPANY_NO                                        
               INTO   :RD-RATE-DESC,                                    
                      :RD-COMPANY-NO                                    
               FROM CSS_RATE_PLAN_DESC                                  
               WHERE CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE                
               AND   RATE_PLAN_NO   = :UT-RATE-PLAN-NO                  
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7200'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'SELECT'                 TO ABEND-FUNCTION           
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_RATE_PLAN_DESC'     TO TABLE-1                  
              MOVE 'CODE_UTIL_TYPE'         TO TABLE-ELEMENT-1          
              MOVE 'RATE_PLAN_NO'           TO TABLE-ELEMENT-2          
CBSI          MOVE 'PREMISE_NO'             TO TABLE-ELEMENT-3          
              MOVE UT-CODE-UTIL-TYPE        TO HOSTVAR-ELEMENT-1        
              MOVE UT-RATE-PLAN-NO          TO HOSTVAR-ELEMENT-2        
CBSI          MOVE PARM-PREMISE-NO          TO HOSTVAR-ELEMENT-3        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07579200
      * 7300-OPEN-VERSION-NO                                           *07579300
      ******************************************************************07579400
       7300-OPEN-VERSION-NO.                                            
                                                                        
           EXEC SQL                                                     
               OPEN VERSION-NO                                          
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME              TO ABEND-PROGRAM           
              MOVE '7300'                    TO ACTIVE-PARAGRAPH        
CBSI          MOVE 'OPEN'                    TO ABEND-FUNCTION          
CBSI          MOVE SPACES                    TO ABEND-SQL-PREDICATES    
CBSI                                            ABEND-TABLES            
              MOVE 'CSS_RATE_CREATOR'        TO TABLE-1                 
              MOVE 'CODE_UTIL_TYPE'          TO TABLE-ELEMENT-1         
              MOVE 'RATE_PLAN_NO'            TO TABLE-ELEMENT-2         
CBSI          MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-3         
              MOVE UT-CODE-UTIL-TYPE         TO HOSTVAR-ELEMENT-1       
              MOVE UT-RATE-PLAN-NO           TO HOSTVAR-ELEMENT-2       
CBSI          MOVE PARM-PREMISE-NO           TO HOSTVAR-ELEMENT-3       
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07582200
      * 7310-FETCH-VERSION-NO                                          *07582300
      ******************************************************************07582400
       7310-FETCH-VERSION-NO.                                           
                                                                        
           EXEC SQL                                                     
               FETCH VERSION-NO                                         
                 INTO   :RT-VERSION-NO-CNTRL                            
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE '7310'                     TO ACTIVE-PARAGRAPH       
CBSI          MOVE 'FETCH'                    TO ABEND-FUNCTION         
CBSI          MOVE SPACES                     TO ABEND-SQL-PREDICATES   
CBSI                                             ABEND-TABLES           
              MOVE 'CSS_RATE_CREATOR'         TO TABLE-1                
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-1        
              MOVE 'RATE_PLAN_NO'             TO TABLE-ELEMENT-2        
CBSI          MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-3        
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
              MOVE UT-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PARM-PREMISE-NO            TO HOSTVAR-ELEMENT-3      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7310-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************07585700
      * 7320-CLOSE-VERSION-NO.                                         *07585800
      ******************************************************************07585900
       7320-CLOSE-VERSION-NO.                                           
                                                                        
           EXEC SQL                                                     
               CLOSE VERSION-NO                                         
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE '7320'                     TO ACTIVE-PARAGRAPH       
CBSI          MOVE 'CLOSE'                    TO ABEND-FUNCTION         
CBSI          MOVE SPACES                     TO ABEND-SQL-PREDICATES   
CBSI                                             ABEND-TABLES           
              MOVE 'CSS_RATE_CREATOR'         TO TABLE-1                
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-1        
              MOVE 'RATE_PLAN_NO'             TO TABLE-ELEMENT-2        
CBSI          MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-3        
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
              MOVE UT-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PARM-PREMISE-NO            TO HOSTVAR-ELEMENT-3      
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7320-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************08303000
      * 7400-SELECT-EQUIPMENT-NO                                       *08303100
      ******************************************************************08303200
       7400-SELECT-EQUIPMENT-NO.                                        
                                                                        
           EXEC SQL                                                     
               SELECT UM_EQUIP_ID,                                      
                      PRICE_PER_SERV                                    
               INTO   :UP-UM-EQUIP-ID,                                  
                      :UP-PRICE-PER-SERV                                
               FROM CSS_UNMTR_PLAN                                      
               WHERE CODE_UTIL_TYPE    = :UT-CODE-UTIL-TYPE             
               AND   RATE_PLAN_NO      = :UT-RATE-PLAN-NO               
               AND   VERSION_NO_CNTRL  = :RT-VERSION-NO-CNTRL           
               AND   RATE_ITEM_CODE    = :CP-RATE-ITEM-CODE             
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7400'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'SELECT'                 TO ABEND-FUNCTION           
CBSI          MOVE SPACES                    TO ABEND-SQL-PREDICATES    
CBSI                                            ABEND-TABLES            
              MOVE 'CSS_UNMTR_PLAN'         TO TABLE-1                  
              MOVE 'CODE_UTIL_TYPE'         TO TABLE-ELEMENT-1          
              MOVE 'RATE_PLAN_NO'           TO TABLE-ELEMENT-2          
              MOVE 'VERSION_NO_CNTRL'       TO TABLE-ELEMENT-3          
              MOVE 'RATE_ITEM_CODE'         TO TABLE-ELEMENT-4          
              MOVE UT-CODE-UTIL-TYPE        TO HOSTVAR-ELEMENT-1        
              MOVE UT-RATE-PLAN-NO          TO HOSTVAR-ELEMENT-2        
              MOVE RT-VERSION-NO-CNTRL      TO HOSTVAR-ELEMENT-3        
              MOVE CP-RATE-ITEM-CODE        TO HOSTVAR-ELEMENT-4        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7400-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************08307000
      * 7500-SELECT-EQUIPMENT-DESC                                     *08307100
      ******************************************************************08307200
       7500-SELECT-EQUIPMENT-DESC.                                      
                                                                        
           EXEC SQL                                                     
               SELECT UM_EQUIP_SHRT_DESC                                
               INTO   :L9-UM-EQUIP-SHRT-DESC                            
               FROM CSS_UM_EQUIPMENT                                    
               WHERE UM_EQUIP_ID = :UP-UM-EQUIP-ID                      
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7500'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'SELECT'                 TO ABEND-FUNCTION           
CBSI          MOVE SPACES                    TO ABEND-SQL-PREDICATES    
CBSI                                            ABEND-TABLES            
              MOVE 'CSS_UM_EQUIPMENT'       TO TABLE-1                  
              MOVE 'UM_EQUIP_ID'            TO TABLE-ELEMENT-1          
CBSI          MOVE 'PREMISE_NO'             TO TABLE-ELEMENT-2          
              MOVE UP-UM-EQUIP-ID           TO HOSTVAR-ELEMENT-1        
CBSI          MOVE PARM-PREMISE-NO          TO HOSTVAR-ELEMENT-2        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7500-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************08310300
      * 7600-SELECT-VALID-LOC-OFFICE                                   *08310400
      ******************************************************************08310500
       7600-SELECT-VALID-LOC-OFFICE.                                    
                                                                        
           EXEC SQL                                                     
               SELECT LOCAL_OFFICE                                      
               INTO   :RS-VALID-LOC-OFF                                 
               FROM CSS_PREMISE                                         
               WHERE PREMISE_NO = :WS-PREMISE-NO-NUM                    
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
                           RS-RETURN-CODE.                              
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME             TO ABEND-PROGRAM            
              MOVE '7600'                   TO ACTIVE-PARAGRAPH         
CBSI          MOVE 'SELECT'                 TO ABEND-FUNCTION           
CBSI          MOVE SPACES                   TO ABEND-SQL-PREDICATES     
CBSI                                           ABEND-TABLES             
              MOVE 'CSS_PREMISE'            TO TABLE-1                  
CBSI          MOVE 'PREMISE_NO'             TO TABLE-ELEMENT-1          
              MOVE WS-PREMISE-NO-NUM        TO HOSTVAR-ELEMENT-1        
              PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7600-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************08313300
      * 9900- JOURNALING / ERROR HANDLING INCLUDE *                     08322300
      ******************************************************************08322400
           EXEC SQL                                                     08322500
              INCLUDE CPDSP300                                          08322600
           END-EXEC.                                                    08322700
                                                                        
      ******************************************************************08322900
      *       END PROGRAM COPYLIB                                      *08323000
      ******************************************************************08323100
CVT999*    COPY CPD00302.                                               08324000
                                                                        
CVT000 8100-SEND-RESULT.                                                
CVT000     EXEC SQL                                                     
CVT000       INSERT INTO #CSR02143_R1                            
CVT000       (                                                          
CVT000        RETURN_CODE                                               
CVT000       ,LOCAL_OFFICE                                              
CVT000       ,POLE_NO                                                   
CVT000       ,LIGHT_NO                                                  
CVT000       ,NO_UNITS                                                  
CVT000       ,STATUS                                                    
CVT000       ,RATE_DESC                                                 
CVT000       ,DATE_INSTALLED                                            
CVT000       ,DATE_REMOVED                                              
CVT000       ,ACCOUNT_NO                                                
CVT000       ,CODE_UTIL_TYPE                                            
CVT000       ,IC_NO                                                     
CVT000       ,RATE_ITEM_CODE                                            
CVT000       ,ITEM_SEQ_NO                                               
CVT000       ,VALID_LOC_OFF                                             
CVT000       ,COMPANY_NO                                                
CVT000       ,CODE_SERVICE_TYPE                                         
CVT000       ,RATE_PLAN_NO                                              
CVT000       ,PRICE_PER_SERV                                            
CVT000       ,CHANGED_FL                                                
CVT000       )                                                          
CVT000       VALUES                                                     
CVT000       (                                                          
REARCH        :S-RETURN-CODE                                            
REARCH       ,:S-LOCAL-OFFICE                                           
REARCH       ,:S-POLE-NO                                                
REARCH       ,:S-LIGHT-NO                                               
REARCH       ,:S-NO-UNITS                                               
REARCH       ,:S-STATUS                                                 
REARCH       ,:S-RATE-DESC                                              
REARCH       ,:S-DATE-INSTALLED                                         
REARCH       ,:S-DATE-REMOVED                                           
REARCH       ,:S-ACCOUNT-NO                                             
REARCH       ,:S-CODE-UTIL-TYPE                                         
REARCH       ,:S-IC-NO                                                  
REARCH       ,:S-RATE-ITEM-CODE                                         
REARCH       ,:S-ITEM-SEQ-NO                                            
REARCH       ,:S-VALID-LOC-OFF                                          
REARCH       ,:S-COMPANY-NO                                             
REARCH       ,:S-CODE-SERVICE-TYPE                                      
REARCH       ,:S-RATE-PLAN-NO                                           
REARCH       ,:S-PRICE-PER-SERV                                         
REARCH       ,:S-CHANGED-FL                                             
CVT000       )                                                          
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO SESSION.CSR02143_R1                                    
MFA-TR*      (                                                                  
MFA-TR*       RETURN_CODE                                                       
MFA-TR*      ,LOCAL_OFFICE                                                      
MFA-TR*      ,POLE_NO                                                           
MFA-TR*      ,LIGHT_NO                                                          
MFA-TR*      ,NO_UNITS                                                          
MFA-TR*      ,STATUS                                                            
MFA-TR*      ,RATE_DESC                                                         
MFA-TR*      ,DATE_INSTALLED                                                    
MFA-TR*      ,DATE_REMOVED                                                      
MFA-TR*      ,ACCOUNT_NO                                                        
MFA-TR*      ,CODE_UTIL_TYPE                                                    
MFA-TR*      ,IC_NO                                                             
MFA-TR*      ,RATE_ITEM_CODE                                                    
MFA-TR*      ,ITEM_SEQ_NO                                                       
MFA-TR*      ,VALID_LOC_OFF                                                     
MFA-TR*      ,COMPANY_NO                                                        
MFA-TR*      ,CODE_SERVICE_TYPE                                                 
MFA-TR*      ,RATE_PLAN_NO                                                      
MFA-TR*      ,PRICE_PER_SERV                                                    
MFA-TR*      ,CHANGED_FL                                                        
MFA-TR*      )                                                                  
MFA-TR*      VALUES                                                             
MFA-TR*      (                                                                  
MFA-TR*       :S-RETURN-CODE                                                    
MFA-TR*      ,:S-LOCAL-OFFICE                                                   
MFA-TR*      ,:S-POLE-NO                                                        
MFA-TR*      ,:S-LIGHT-NO                                                       
MFA-TR*      ,:S-NO-UNITS                                                       
MFA-TR*      ,:S-STATUS                                                         
MFA-TR*      ,:S-RATE-DESC                                                      
MFA-TR*      ,:S-DATE-INSTALLED                                                 
MFA-TR*      ,:S-DATE-REMOVED                                                   
MFA-TR*      ,:S-ACCOUNT-NO                                                     
MFA-TR*      ,:S-CODE-UTIL-TYPE                                                 
MFA-TR*      ,:S-IC-NO                                                          
MFA-TR*      ,:S-RATE-ITEM-CODE                                                 
MFA-TR*      ,:S-ITEM-SEQ-NO                                                    
MFA-TR*      ,:S-VALID-LOC-OFF                                                  
MFA-TR*      ,:S-COMPANY-NO                                                     
MFA-TR*      ,:S-CODE-SERVICE-TYPE                                              
MFA-TR*      ,:S-RATE-PLAN-NO                                                   
MFA-TR*      ,:S-PRICE-PER-SERV                                                 
MFA-TR*      ,:S-CHANGED-FL                                                     
MFA-TR*      )                                                                  
MFA-TR*    END-EXEC.                                                            

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

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

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

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

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