       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02210.                                         
COB303 DATE-WRITTEN.     MARCH 10, 1995.                                
       DATE-COMPILED.                                                   
                                                                        
CVT000******************************************************************        
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *        
CVT000*         S210 CONVERTED TO DB2 SP CSR02210 ON 01/30/2007        *        
CVT000*             -NOTE: AUTOMATED CONVERSION PROGRAM USED           *        
CVT000*                                                                *        
CVT000*                    CVT000 - CONVERTED CODE                     *        
CVT000*                    CVT004 - NEEDED REVIEW                      *        
CVT000*                    CVT999 - COMMENTED OUT CODE THAT CAN        *        
CVT000*                             POTENTIALLY BE DELETED             *        
CVT000*                                                                *        
CVT000******************************************************************        
      ******************************************************************        
      *                SOUTH CAROLINA ELECTRIC & GAS                   *        
      *                                                                *        
      *  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).   *        
      *                                                                *        
      *  TRANID:        S210                                           *        
      *  PROGRAM:       S210                                           *        
      *  CALLING SP:    PA_S210                                        *        
      *                                                                *        
      ******************************************************************        
      *                 P R O G R A M  S U M M A R Y                   *        
      *                                                                *        
      *  THIS PROGRAM IS A REMOTE PROCEDURE CALL MADE FROM             *        
      *  DESKTOP 2000 VIA THE SYBASE NETGATEWAY.                       *        
      *  THIS PROGRAM RETRIEVES ROWS FROM CSS_UTIL_ENVRNMT,            *        
      *  CSS_MTRD_ENVRNMT, CSS_REGISTER_READ, CSS_CUST_PLAN            *        
      *  FOR AN ACCOUNT.                                               *        
      ******************************************************************        
      *                                                                *        
      *                     PROGRAM MODIFICATION LOG                   *        
      *                                                                *        
      *    DATE    INITIALS   COMMENTS                                 *        
      *  --------  --------   ---------------------------------------  *        
      *  03/10/95    RC       CREATED.                                 *        
      *  09/18/95    WMG      MODIFIED TO ADD 3 DECIMAL PLACES TO THE  *        
      *                       RS-MN-CONSTANT RETURN VALUE.             *        
      *  01/24/96    DMD      ADDED 5025-FETCH-ACCOUNT INFO TO         *        
      *                       POPULATE FIELDS NEEDED IN PROCEDURE 3300 *        
      *                       IN CPD00068 - TPR 2828                   *        
      *  01/29/96    WMG      ADDED TBDELQ, TBARHIST ADN TBDFAACT      *        
      *                       DCLGENS.                                 *        
      *  02/01/96    RC       PERFORMANCE TUNING                       *        
      *  02/29/96    DMD      TPR 3370 - PROCEDURE 5025- NOT FOUND IS  *        
      *                       OK FOR PREMISE ONLY SO                   *        
      *                       TPR 3320 - TOTAL SECURITIES AMOUNT       *        
      *                       SHOULD ONLY INCLUDE ACTIVE AMOUNTS       *        
      *                       TPR 3346 - SUBDIV PLAN NO WAS NOT BEING  *        
      *                       POPULATED CORRECTLY                      *        
      *  03/28/96    WMG      ADDED 7951 TO CHECK IF THE UTILITY       *        
      *                       SERVICE START DATE FOR THE SELECTED      *        
      *                       ACCOUNT IS FOR THE MOST CURRENT ACCOUNT  *        
      *                       AT THE PREMISE - (TPR 3672).             *        
      *  04/03/96    WMG      TPR 3772 - ADDED RS-DATE-BNKRPT-FL    AND*        
      *                       RS-FILED-CASE-NO TO THE VARIABLE RETURN  *        
      *                       LIST.                                    *        
      *  04/09/96    WMG      TPR 3744 - ADDED RIGHT-HAND DECIMAL      *        
      *                       DESCRIBE LOGIC OF +0 PLACES TO THE 2259  *        
      *                       PARAGRAPH.                               *        
      *  04/17/96    WMG      TPR 3926 - ADD JOIN TO CSS_ACCOUNT TABLE *        
      *                       IN SECOND SELECT IN PARAGRAPH 7951 TO    *        
      *                       BYPASS SETTING THE CURRENT ACCOUNT       *        
      *                       INDICATOR WHEN THE MOST CURRENT ACCOUNT  *        
      *                       IS INACTIVE.                             *        
      *  05/07/96    WMG      ADDED LOGIC TO RETURN ADDITIONAL FIELDS: *        
      *                       DRIVERS LICENSE NUMBER,                  *        
      *                       DRIVERS LICENSE STATE,                   *        
      *                       SOCIAL SECURITY NUMBER,                  *        
      *                       READ CYCLE            (CPD00124),        *        
      *                       SERVICE START DATE    (CPD00124),        *        
      *                       DEPOSIT INTEREST RATE (CPD00124)         *        
      *                       ALSO ADDED CPD00124, CPD00125,           *        
      *  05/29/96    WMG      TPR 4157 - RETURN THE STATUS OF THE PRIOR*        
      *                       ACCOUNT NUMBER THAT IS PASSED TO S210.   *        
      *  06/11/96    WMG      TPR 4513 - REMOVED REFERENCES TO         *        
      *                       WS-ACTIVE-PARAGRAPH.                     *        
      *  06/13/96    JHR      TPR 4581 - ALLOWED A SQLCODE OF +100 TO  *        
      *                       BE SUCCESSFUL IN PARAGRAPH 5010.  5010   *        
      *                       WAS ADDED AS A RESULT OF TPR 4157 AND    *        
      *                       DID NOT TAKE INTO CONSIDERATION THAT     *        
      *                       THIS RPC CAN BE CALLED FOR A PREMISE     *        
      *                       ONLY.                                    *        
      *                                                                *        
      *  07/15/96    AG       PCR 112  - ADDED SOME RETURN VARIABLES   *        
      *                       TO BE RETRIEVED FROM THE TABLE           *        
      *                       CSS_MTRD_ENVIROMENT                      *        
      *                                                                *        
      *  07/31/96    SR       THE LENGTH OF SPECIAL READ INSTRUCTION   *        
      *                       IS CHANGED FROM 50 TO 114 DUE TO PCR#152 *        
      *                                                                *        
      *  10/01/96    WMG      PCR 361 - ADDED TO CALLING PARAMETERS:   *        
      *                       RETURN-DISC-BAL AND ORDER REASON.  ADDED *        
      *                       TBLOCOFC AND TBNSFHST INCLUDES.          *        
      *  10/17/96    MRB      PCR #361 - ADDED TWO ADDITIONAL SWITCHES *        
      *                       TO THE CPD00068 CALL TO GET CORRECT BAL. *        
      *                                                                *        
      *  01/10/97    WMG      TPR 8469 - RETURN THE ACCOUNT TYPE CODE  *        
      *                       INSTEAD OF THE ACCOUNT TYPE DESCRIPTION  *        
      *                       IN PARAGRAPH 7400.  ALSO RENAME THIS     *        
      *                       RETURN VARIABLE FROM RS-PREM-TYPE TO     *        
      *                       RS-ACCT-TYPE.                            *        
      *                                                                *        
      *  01/15/97    WMG      TPR 8534 - INITIALIZE THE AT-CUSTOMER-NO *        
      *                       VARIABLE WHEN ORDER IS A PREMISE ONLY    *        
      *                       ORDER.                                   *        
      *                                                                *        
PCR482*  03/05/97    MAD      MODIFIED PARAGRAPHS 7990 AND 7992 TO     *        
      *                       RETURN ONLY 'BILLING' AND 'PAID' DEPOSITS*        
      *  03/31/97    MJG      ADDED 2 NEW DCLGENS BECAUSE CPD00068     *        
      *                       CHANGED.                                 *        
T12460*  08/01/97    EMS      ADDED CSS_DNP DCLGEN FOR CPD68 CHANGES   *        
T14720*  02/26/98    TQT      REMOVED NOT FOUND CONDITION FROM SELECT  *        
      *                       CSS_ELEC_METER.  IF THE SELECT IS NOT    *        
      *                       FOUND, THE PROGRAM SHOULD ABEND          *        
T14862*  03/19/98    RK       CHANGED TO PULL BACK UNMETERED ROWS.     *        
T16498*  05/21/98    FB       ABEND DISPLAYS.                          *        
T16853*  06/23/98    EMS      ADDED CSS_AR_TRN_HST_DET DCLGEN          *        
T18326*  11/12/98    FB       DETERMINE CURRENT ACCOUNT AT PREMISE     *        
T18326*                       FROM END DATE ON CSS_CUST_PREM_HIST.     *        
CBSI  *  11/30/98    CBSI     ABEND LOG MODIFIED TO INCLUDE ALL ABEND  *        
CBSI  *              INDIA    PARAMETERS                               *        
T18721*  12/22/98    FB       USE MAXIMUM ACCT_CREATE_DT AS THE FINAL  *        
T18721*                       TIEBREAKER IN DETERMINING CURRENT ACCT.  *        
T20147*  08/12/99    AHF      TPR 20147 - ADDED AN ADDITIONAL CONDITION*        
T20147*                       TO THE WHERE CLAUSE IN THE SELECT OF PARA*        
T20147*                       7000-FETCH-RATE-ITEM-CODE. CLARIFY CASE  *        
T20147*                       C807349 AND C808365.                              
T19557*  04/03/00    CBSI     COPYBOOK CDP00068 CHANGED TO SUB PROGRAM *        
T19557*              MADRAS   SCSCO068.                                *        
T20443*  04/19/00    PRA      RETURN DATE_PLAN_START FR CSS_CUST_PLAN  *        
      *                       IF DATE_PLAN_START IS LESS THAN OR EQUAL *        
      *                       WS-DATE-UTIL-SVC-STRT AND REMOVE_DATE IS *        
      *                       NULL                                     *        
T22359*  06/21/00    MDJ      MADE CHANGES TO KEEP IDENTITY OF PROGRAM *        
      *                       CALLING SCSCO068 OR SCSCB068.  THERE IS  *        
      *                       SPECIFIC LOGIC IN CPD00068 FOR CERTAIN   *        
      *                       PROGRAMS WHICH WAS NOT BEING EXECUTED    *        
      *                       PROPERLY BECAUSE THE PROGRAM NAME WAS    *        
      *                       ALWAYS SCSCO068 OR SCSCB068.             *        
T22243*  07/25/00    CBSI     CHANGES MADE TO IMPLEMENT MULTI-COMPANY  *        
T22243*              MADRAS   IN METER INVENTORY TABLES.               *        
T23507*  05/30/01    FMB      RETURN ACTIVE CONTRACT FLAG.             *        
T22131*  12/13/01    PRA      RETURN SECURED RATE FLAG.                *        
T26014*  02/11/02    SS19371  ADDED CODE TO PREVENT SOC-7              *        
T24056*  02/20/03    LHO      ADDED CODE TO PASS GIS-POINT-ID BACK     *        
T24056*                       INSTEAD OF POINT-ID.  OMS INTERFACE.     *        
C28788*  07/07/03    MDJ      GET IVR-EXEMPT-CD FOR CPD00068.          *        
C30058*  03/02/04    LHO      PASS BACK ACTIVE CONTRACT IF CONTRACT    *        
C30058*                       TYPE IS B AND CODE BILL TYPE IS C.  OMIT *        
C30058*                       THIRD PARTY CONTRACT(CONTRACT NAME CODE  *        
C30058*                       = 1080.                                  *        
302442*  09/21/04    PRA      RETURN CODE_MTR_RD_INST1                 *        
C34652*  10/11/06    VV90387  ADDED METER PRESSURE FIELD.              *        
REARCH*  03/12/07    VD41351  REPLACE MODEL_SQL WITH SET COMMAND       *        
REARCH*  05/24/07    PA94870  CHANGE STATIC CALL TO DYNAMIC CALL       *        
A00759*  03/18/09    VV90387  SEND LIGHT WQ IF PLAN STATUS NOT REMOVED *        
A00714*  03/30/09    DB18339  SET DEFAULTS WHEN MN-CURSOR IS NOT FOUND *        
A00714*                       OR RG-CURSOR IS NOT FOUND                *        
A00714*  09/09/09    PA94870  MISSING METER LOCATION ROW.              *        
A00714*                       IF THE METER LOCATION ON MN IS INVALID   *        
A00714*                       ROW WILL NOT BE RETURNED.ADDED OUTER JOIN*        
P00390*  04/22/10    VV90387  SPECIAL MESSAGE FOR BARRIER ISLANDS      *        
P00390*  05/06/10    VV90387  SPECIAL MESSAGE FOR FOLLY BEACH          *        
P00390*  06/18/10    VV90387  RETURN 0 TO RS-RETURN-CD IN NOT-FOUND    *        
P00390*                       SITUATIONS IN PARA 7994/7320/7330 TO     *        
P00390*                       PREVENT CSR04106 FROM ERRORING OUT       *        
P00447*  09/07/10    SJ97149  ADD CHECK FOR CONSTANT = 0 FOR SENDING **         
P00447*                       'Y' FOR METER-IND                      **         
P00480*  05/30/13    FMB      IF PRICE_PER_SERV < $1, PASS BACK 1.   **         
P00480*                       DECIMAL PLACES ARE NOT RETURNED.       **         
A#5305**   06/25/15 SS95855      ACT002 REMOVE COMMENTED CODE.       **         
A05460*  09/21/16    MR7E794  REMOVED THE MAIN USER TABLE AS PART    **         
      *              ACT282   OF TABLE CHANGE AND GETTING THE SAME   **         
      *                       VALUE FROM CODE VALUE TABLE.           **         
      ******************************************************************        
      ******************************************************************        
      *                                                                *        
      *                ---- BASIC SEQUENCE STRUCTURE ----              *        
      *                                                                *        
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION             *        
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                    *        
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                   *        
      *  3000 - 4999  NOT USED                                         *        
      *  5000 - 5999  COMMON PROGRAM MODULES                           *        
      *  6000 - 6999  COMMON SYSTEM MODULES                            *        
      *  7000 - 7999  INPUT MODULES                                    *        
      *  8000 - 8999  OUTPUT MODULES                                   *        
      *  9000 - 9999  TERMINATION,ABEND, MESSAGING MODULES             *        
      *                                                                *        
      ******************************************************************        
      *  PARAMETERS                                                    *        
      *    ACCOUNT_NO                                                  *        
      *    PREMISE_NO *                                                         
      *    COMPANY_NO *                                                         
      *    MARKETING_ORDER *                                                    
      *        VALUES *                                                         
      *            Y - IF IT IS A MARKETING ORDER *                             
      *            N - IF IT IS NOT A MARKETING OR A DNP ORDER *                
      *            D - IF IT IS A DNP ORDER *                                   
      *    RETURN_UTILS *                                                       
      *        VALUES *                                                         
      *            N - IF YOU DON'T WANT THE UTILITIES RETURNED *               
      *            Y - IF YOU WANT THE UTILITIES RETURNED *                     
      ******************************************************************        
                                                                        
       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 'CSR02210'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-START                                   PIC X(40) VALUE   
           'WORKING STORAGE FOR RPC S210 STARTS HERE'.                  
                                                                        
      ******************************************************************        
      *    DB2 INCLUDES                                                *        
      ******************************************************************        
                                                                        
           EXEC SQL                                                             
              INCLUDE SQLCA                                                     
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_UTIL_ENVRNMT  >                                     
           EXEC SQL                                                             
              INCLUDE TBUTLENV                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_MTRD_ENVRNMT  >                                     
           EXEC SQL                                                             
              INCLUDE TBMTRENV                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_MTR_CAP       >                                     
           EXEC SQL                                                             
              INCLUDE TBMTRCAP                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_METER_LOC     >                                     
           EXEC SQL                                                             
              INCLUDE TBMTRLOC                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_REGISTER_READ >                                     
           EXEC SQL                                                             
              INCLUDE TBRGREAD                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_CUST_PLAN     >                                     
           EXEC SQL                                                             
              INCLUDE TBCSTPLN                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_ACCOUNT       >                                     
           EXEC SQL                                                             
              INCLUDE TBACCT                                                    
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_PREMISE       >                                     
           EXEC SQL                                                             
              INCLUDE TBPREM                                                    
           END-EXEC.                                                            
                                                                        
ACT282*-------< CSS_SO_CODE_DESC          >                                     
ACT282     EXEC SQL                                                             
ACT282       INCLUDE TBSOCODE                                                   
ACT282     END-EXEC.                                                            
      *-------< INCLUDE CSS_RATE_CREATOR  >                                     
           EXEC SQL                                                             
              INCLUDE TBRTCRTR                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_UNMTR_PLAN    >                                     
           EXEC SQL                                                             
              INCLUDE TBUMPLAN                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_UM_EQUIPMENT   >                                    
           EXEC SQL                                                             
              INCLUDE TBUMEQP                                                   
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_RATE_PLAN_DESC >                                    
           EXEC SQL                                                             
              INCLUDE TBRTDESC                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_CUST_PREM_HIST >                                    
           EXEC SQL                                                             
              INCLUDE TBCSTPRM                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_LANDLORD       >                                    
           EXEC SQL                                                             
              INCLUDE TBLNDLRD                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_DEP_ON_HAND    >                                    
           EXEC SQL                                                             
              INCLUDE TBDEPHND                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_SURETY_BOND    >                                    
           EXEC SQL                                                             
              INCLUDE TBSTYBND                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_GUARANTOR      >                                    
           EXEC SQL                                                             
              INCLUDE TBGTNTR                                                   
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_CREDIT_PROFILE >                                    
           EXEC SQL                                                             
              INCLUDE TBCRPROF                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_BANKRUPTCY     >                                    
           EXEC SQL                                                             
              INCLUDE TBBNKRPT                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_DEP_INT_RATE   >                                    
           EXEC SQL                                                             
              INCLUDE TBDEPINT                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_CUST_STATS     >                                    
           EXEC SQL                                                             
              INCLUDE TBCSTSTS                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_CUSTOMER       >                                    
           EXEC SQL                                                             
              INCLUDE TBCUST                                                    
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CSS_ELEC_METER     >                                    
           EXEC SQL                                                             
              INCLUDE TBELMTR                                                   
           END-EXEC.                                                            
                                                                        
T23507*-------< INCLUDE CSS_CONTRACT       >                                    
T23507     EXEC SQL                                                             
T23507        INCLUDE TBCNTRCT                                                  
T23507     END-EXEC.                                                            
                                                                        
P00390*-------< INCLUDE CSS_LOC_OFF_CYC_RT (O2) >                               
P00390     EXEC SQL                                                             
P00390        INCLUDE TBLCOFRT                                                  
P00390     END-EXEC.                                                            
                                                                        
P00390*-------< INCLUDE CSS_ADDR_FORMATTED (DY) >                               
P00390     EXEC SQL                                                             
P00390        INCLUDE TBADRFMT                                                  
P00390     END-EXEC.                                                            
                                                                        
P00390*-------< INCLUDE CSS_ZIP_CODE       (A4) >                               
P00390     EXEC SQL                                                             
P00390        INCLUDE TBZIPCD                                                   
P00390     END-EXEC.                                                            
                                                                        
PCR361     EXEC SQL                                                             
              INCLUDE TBMODEL                                                   
           END-EXEC.                                                            
      *-------< INCLUDE CWS00056           >                                    
           EXEC SQL                                                             
              INCLUDE CWS00056                                                  
           END-EXEC.                                                            
                                                                        
      *-------< INCLUDE CWS00068           >                                    
           EXEC SQL                                                             
              INCLUDE CWS00068                                                  
           END-EXEC.                                                            
                                                                        
      ******************************************************************        
      *    COBOL WORKING STORAGE COPY BOOKS                            *        
      ******************************************************************        
                                                                        
      *--------< CONTAINS THE COBOL EQUATES NEEDED FOR USING THE >              
      *--------< SYBASE OPEN SERVER FOR CICS FACILITIES.         >              
      *--------< ADDED TO SUPPORT CICS RPCS >                                   
      *--------<COMMON SYSTEM AREA >                                            
           COPY CCA00001.                                                       
      *--------< ERROR HANDLING >                                               
      *--------< ERROR WORK AREA - SUPPORTS ONLINE/CSR JOURNALS >               
           COPY CWS00027.                                                       
      *--------< SUPPORTS DB2 AND SQL ERROR CHECKING >                          
           COPY CWS00303.                                                       
T19557*--------< LINKAGE SECTION VARIABLES FOR SCSCO068 >                       
T19557     COPY CWS0068L.                                                       
                                                                        
      ******************************************************************        
      *    WORK AREAS                                                  *        
      ******************************************************************        
                                                                        
       01  GW-LIB-MISC-FIELDS.                                          
           05  PROGRAM-NAME            PIC X(08) VALUE 'S210    '.      
CVT999*    05  GWL-PROC                POINTER.                                 
CVT999*    05  GWL-INIT-HANDLE         POINTER.                                 
CVT999*    05  GWL-RC                  PIC S9(9) COMP.                          
CVT999*    05  GWL-STATUS-NR           PIC S9(9) COMP.                          
CVT999*    05  GWL-STATUS-DONE         PIC S9(9) COMP.                          
CVT999*    05  GWL-STATUS-COUNT        PIC S9(9) COMP.                          
CVT999*    05  GWL-STATUS-COMM         PIC S9(9) COMP.                          
CVT999*    05  GWL-STATUS-RETURN-CODE  PIC S9(9) COMP.                          
           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.                  
           05  PARM-ACCOUNT-NO         PIC X(13).                       
           05  PARM-ACCOUNT-NO-NUM REDEFINES PARM-ACCOUNT-NO            
                                       PIC S9(13).                      
           05  PARM-PREMISE-NO         PIC X(10).                       
           05  PARM-PREMISE-NO-NUM REDEFINES PARM-PREMISE-NO            
                                       PIC S9(10).                      
           05  PARM-COMPANY-NO         PIC X(02) VALUE SPACES.          
           05  PARM-MKTG-ORDER         PIC X(01).                       
           05  PARM-RETURN-UTILS       PIC X(01).                       
PCR361     05  PARM-RTN-DISC-BAL       PIC X(01).                       
PCR361     05  PARM-ORDER-REASON       PIC X(01).                       
                                                                        
       01  SNA-FIELDS.                                                  
           05  SNA-SUBC                PIC S9(9) COMP.                  
CVT999*    05  SNA-CONNECTION-NAME     PIC X(8)  VALUE SPACES.                  
                                                                        
       01  COUNTER-FIELDS.                                              
CVT999*    05  CTR-COLUMN              PIC S9(9) COMP VALUE 1.                  
CVT999*    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.                          
CVT999*    05  WRKLEN1                 PIC S9(9) COMP.                          
CVT999*    05  WRKLEN2                 PIC S9(9) COMP.                          
           05  WRK-DONE-STATUS         PIC S9(9) COMP.                  
                                                                        
       01  WS-DYNAMIC-PGMS.                                             
           05  WS-MCSCB068            PIC X(08) VALUE 'MCSCB068'.       
                                                                        
       01  WS-MISC.                                                     
           05  WS-DATE-CCYY-MM-DD.                                      
               10  WS-DATE-CCYY       PIC X(04) VALUE SPACES.           
               10  FILLER             PIC X(01) VALUE SPACES.           
               10  WS-DATE-MM         PIC X(02) VALUE SPACES.           
               10  FILLER             PIC X(01) VALUE SPACES.           
               10  WS-DATE-DD         PIC X(02) VALUE SPACES.           
           05  WS-DATE-MM-DD-YYYY.                                      
               10  WS-DATE2-MM        PIC X(02) VALUE SPACES.           
               10  FILLER             PIC X(01) VALUE '/'.              
               10  WS-DATE2-DD        PIC X(02) VALUE SPACES.           
               10  FILLER             PIC X(01) VALUE '/'.              
               10  WS-DATE2-CCYY      PIC X(04) VALUE SPACES.           
PCR361     05  WS-BILL-DAY-00-NI      PIC S9(04) COMP VALUE +0.         
T19557     05 WS-EIBRESP              PIC S9(08) COMP SYNC              
T19557                                          VALUE ZERO.             
CVT000     05  WS-SQLSTATE            PIC X(05) VALUE SPACES.           
                                                                        
       01  WS-FLAG-VALUES.                                              
           05  WS-YES                  PIC X(01) VALUE 'Y'.             
           05  WS-NO                   PIC X(01) VALUE 'N'.             
           05  WS-ACTIVE-CODE          PIC X(01) VALUE 'A'.             
                                                                        
       01  FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.      
                                                                        
       01  GTT-RETURN-FIELDS.                                           
           05  RS-RETURN-CODE           PIC S9(9)     COMP VALUE 0.     
CVT000     05   S-RETURN-CODE           PIC S9(9)     COMP VALUE 0.     
           05  RS-ACTIVE-PARA           PIC X(30)     VALUE SPACES.     
           05  RS-TABLE-NAME            PIC X(30)     VALUE SPACES.     
           05  RS-TABLE-ID              PIC X(2)      VALUE SPACES.     
           05  RS-UT-CODE-UTIL-TY       PIC X(1)      VALUE SPACES.     
           05  RS-UT-IC-NO              PIC S9(4)     COMP VALUE 0.     
           05  RS-UT-READ-ROUTE         PIC S9(4)     COMP VALUE 0.     
           05  RS-UT-RATE-PLAN-NO       PIC X(3)      VALUE SPACES.     
           05  RS-UT-RATE-DESC          PIC X(25)     VALUE SPACES.     
           05  RS-UT-CODE-REV-CLA       PIC X(3)      VALUE SPACES.     
           05  RS-UT-READ-CYCLE         PIC X(2)      VALUE SPACES.     
           05  RS-UT-CODE-SIC-NO        PIC X(4)      VALUE SPACES.     
           05  RS-MN-METER-NO           PIC X(9)      VALUE SPACES.     
           05  RS-MN-MTR-REF-NO         PIC S9(4)     COMP VALUE 0.     
           05  RS-MN-CODE-TIME-PE       PIC S9(4)     COMP VALUE 0.     
           05  RS-MN-LAST-READ-VA       PIC S9(12)V999 COMP-3 VALUE 0.  
           05  RS-MN-CD-STUS-RS         PIC X(1)      VALUE SPACES.     
           05  RS-MN-CODE-USAGE-T       PIC X(1)      VALUE SPACES.     
           05  RS-MN-CODE-USAGE-I       PIC X(1)      VALUE SPACES.     
           05  RS-MN-CODE-USAGE-S       PIC X(1)      VALUE SPACES.     
           05  RS-MN-CODE-METER-S       PIC X(1)      VALUE SPACES.     
           05  RS-MN-METER-SUPPLY       PIC X(15)     VALUE SPACES.     
           05  RS-MN-CODE-METER-L       PIC X(2)      VALUE SPACES.     
           05  RS-MN-METER-LOC-DE       PIC X(14)     VALUE SPACES.     
           05  RS-MN-METER-IND          PIC X(1)      VALUE SPACES.     
           05  RS-MN-CONSTANT           PIC S9(6)V9(3) COMP-3 VALUE 0.  
           05  RS-MN-NO-DIALS           PIC S9(4) COMP VALUE 0.         
           05  RS-MN-DIST-NODE-PO       PIC X(20)     VALUE SPACES.     
           05  RS-MN-POINT-ID           PIC X(10)     VALUE SPACES.     
           05  RS-MN-SEAL-CODE-ID       PIC X(01)     VALUE SPACES.     
           05  RS-MN-HEX-LOCATION       PIC X(02)     VALUE SPACES.     
           05  RS-MN-INSULATED-IN       PIC X(01)     VALUE SPACES.     
           05  RS-MN-LOCK-TYPE-ID       PIC X(01)     VALUE SPACES.     
           05  RS-MN-DELIVERY-LEV       PIC X(01)     VALUE SPACES.     
           05  RS-MN-UTILITY-SOUR       PIC X(01)     VALUE SPACES.     
           05  RS-MN-IDR-RECIPIEN       PIC X(01)     VALUE SPACES.     
           05  RS-MN-PROGRAM-ID         PIC X(02)     VALUE SPACES.     
           05  RS-MN-MTR-READ-SO        PIC X(01)     VALUE SPACES.     
           05  RS-RG-CODE-REG-ST        PIC X(1)      VALUE SPACES.     
           05  RS-RG-CODE-STATUS        PIC X(1)      VALUE SPACES.     
           05  RS-RG-CODE-TIME-P        PIC S9(4)     COMP VALUE 0.     
           05  RS-RG-CODE-USAGE         PIC X(1)      VALUE SPACES.     
           05  RS-RG-CD-USG-SRC         PIC X(1)      VALUE SPACES.     
           05  RS-RG-CD-USG-TYP         PIC X(1)      VALUE SPACES.     
           05  RS-RG-LAST-READD         PIC X(10)     VALUE SPACES.     
           05  RS-RG-LST-READVL         PIC S9(12)V9(3) COMP-3 VALUE 0. 
           05  RS-RG-REG-ID-NO          PIC S9(4)     COMP VALUE 0.     
           05  RS-CP-NO-UNITS           PIC S9(9)     COMP VALUE 0.     
           05  RS-CP-CODE-PLAN          PIC X(1)      VALUE SPACES.     
           05  RS-CP-CD-STATRS          PIC X(1)      VALUE SPACES.     
           05  RS-CP-CD-SVC-TYP         PIC X(1)      VALUE SPACES.     
           05  RS-CP-MTLY-AMT-FX        PIC S9(9)V9(2) COMP-3 VALUE 0.  
           05  RS-CP-RT-ITEM-CD         PIC S9(4)     COMP VALUE 0.     
           05  RS-CP-LIGHT-NO           PIC S9(4)     COMP VALUE 0.     
           05  RS-CP-POLE-NO            PIC X(7)      VALUE SPACES.     
           05  RS-CP-DIST-NO            PIC X(3)      VALUE SPACES.     
           05  RS-CP-USAGE-FIXED        PIC S9(9)V    COMP-3 VALUE 0.   
           05  RS-CP-ITEM-SEQ-NO        PIC S9(4)     COMP VALUE 0.     
           05  RS-CP-EQUIP-ID           PIC X(2)      VALUE SPACES.     
           05  RS-PREM-DIR-IND          PIC X(1)      VALUE SPACES.     
           05  RS-SUBDIV-LIGHT PIC S9(3)V9(6) USAGE COMP-3 VALUE 0.     
           05  RS-ACCT-TYPE             PIC X(1)      VALUE SPACES.     
           05  RS-CD-RNTL-PROP          PIC X(1)      VALUE SPACES.     
           05  RS-LL-CUSTOMER-NO        PIC S9(10)    COMP-3 VALUE 0.   
           05  RS-REV-DIST-CD           PIC X(3)      VALUE SPACES.     
           05  RS-DISC-BAL              PIC S9(11)V99 COMP-3 VALUE 0.   
           05  RS-ACCOUNT-NO            PIC S9(13)V   COMP-3 VALUE 0.   
           05  RS-ACCT-STATUS           PIC X(1)      VALUE SPACES.     
           05  RS-ROW-NO                PIC S9(4)     COMP VALUE 0.     
           05  RS-DEPOSIT-AMT           PIC S9(9)V99  COMP-3 VALUE 0.   
           05  RS-SEC-TOT-AMT           PIC S9(9)V99  COMP-3 VALUE 0.   
           05  RS-CUR-MTH-ARR-CD        PIC X(01)     VALUE SPACES.     
           05  RS-CREDIT-GROUP          PIC X(01)     VALUE SPACES.     
           05  RS-CURRENT-ACCOUNT       PIC X(01)     VALUE 'Y'.        
           05  RS-DATE-BNKRPT-FL        PIC X(10)     VALUE SPACES.     
           05  RS-FILED-CASE-NO         PIC X(10)     VALUE SPACES.     
           05  RS-DL-NO                 PIC X(19)     VALUE SPACES.     
           05  RS-DL-STATE              PIC X(02)     VALUE SPACES.     
           05  RS-SSN                   PIC X(09)     VALUE SPACES.     
           05  RS-PRIOR-ACCT-STAT       PIC X(01)     VALUE SPACES.     
T20443     05  RS-CP-DT-PLN-ST          PIC X(10)     VALUE SPACES.     
T23507     05  RS-ACTIVE-CONTRACT       PIC X(01)     VALUE SPACES.     
T22131     05  RS-SECURED-RATE-FL       PIC X(01)     VALUE 'N'.        
302442     05  RS-MN-CODE-MTR-RD        PIC X(02)     VALUE SPACES.     
C34652     05  RS-MN-MTR-PRESS          PIC X(03)     VALUE SPACES.     
CVT000**************************************************************            
CVT000* RETURN VALUES FOR CPD00124 AND CPD00125                    *            
CVT000**************************************************************            
CVT000     05  RS-READ-CYCLE           PIC X(02) VALUE SPACES.          
CVT000     05  RS-SERV-STRT-DT         PIC X(10) VALUE SPACES.          
CVT000     05  RS-DEP-INTST-RT         PIC S9(2)V99 COMP-3 VALUE 0.     
P00390**************************************************************            
P00390     05  RS-O2-ERROR-MSG-NO-RTE  PIC X(05) VALUE SPACES.          
P00390     05  RS-A4-ERROR-MSG-NO-ZIP  PIC X(05) VALUE SPACES.          
                                                                        
CVT999*01  CNS-COLUMN-NAMES.                                                    
CVT999*    05  CNS-RETURN-CODE          PIC X(11)                               
CVT999*                                 VALUE 'RETURN_CODE'.                    
CVT999*    05  CNS-ACTIVE-PARA          PIC X(11)                               
CVT999*                                 VALUE 'ACTIVE_PARA'.                    
CVT999*    05  CNS-TABLE-NAME           PIC X(10)                               
CVT999*                                 VALUE 'TABLE_NAME'.                     
CVT999*    05  CNS-TABLE-ID             PIC X(08)                               
CVT999*                                 VALUE 'TABLE_ID'.                       
CVT999*    05  CNS-UT-CODE-UTIL-TYPE    PIC X(17)                               
CVT999*                                 VALUE 'UT_CODE_UTIL_TYPE'.              
CVT999*    05  CNS-UT-IC-NO             PIC X(08)                               
CVT999*                                 VALUE 'UT_IC_NO'.                       
CVT999*    05  CNS-UT-READ-ROUTE        PIC X(13)                               
CVT999*                                 VALUE 'UT_READ_ROUTE'.                  
CVT999*    05  CNS-UT-RATE-PLAN-NO      PIC X(15)                               
CVT999*                                 VALUE 'UT_RATE_PLAN_NO'.                
CVT999*    05  CNS-UT-RATE-DESC         PIC X(12)                               
CVT999*                                 VALUE 'UT_RATE_DESC'.                   
CVT999*    05  CNS-UT-CODE-REV-CLASS    PIC X(17)                               
CVT999*                                 VALUE 'UT_CODE_REV_CLASS'.              
CVT999*    05  CNS-UT-READ-CYCLE        PIC X(13)                               
CVT999*                                 VALUE 'UT_READ_CYCLE'.                  
CVT999*    05  CNS-UT-CODE-SIC-NO       PIC X(14)                               
CVT999*                                 VALUE 'UT_CODE_SIC_NO'.                 
CVT999*    05  CNS-MN-METER-NO          PIC X(11)                               
CVT999*                                 VALUE 'MN_METER_NO'.                    
CVT999*    05  CNS-MN-MTR-REF-NO        PIC X(13)                               
CVT999*                                 VALUE 'MN_MTR_REF_NO'.                  
CVT999*    05  CNS-MN-CODE-TIME-PERIOD  PIC X(19)                               
CVT999*                                 VALUE 'MN_CODE_TIME_PERIOD'.            
CVT999*    05  CNS-MN-LAST-READ-VALUE   PIC X(18)                               
CVT999*                                 VALUE 'MN_LAST_READ_VALUE'.             
CVT999*    05  CNS-MN-CODE-STATUS-REAS  PIC X(19)                               
CVT999*                                 VALUE 'MN_CODE_STATUS_REAS'.            
CVT999*    05  CNS-MN-CODE-USAGE-TYPE   PIC X(18)                               
CVT999*                                 VALUE 'MN_CODE_USAGE_TYPE'.             
CVT999*    05  CNS-MN-CODE-USAGE-ID     PIC X(16)                               
CVT999*                                 VALUE 'MN_CODE_USAGE_ID'.               
CVT999*    05  CNS-MN-CODE-USAGE-SOURCE PIC X(20)                               
CVT999*                                 VALUE 'MN_CODE_USAGE_SOURCE'.           
CVT999*    05  CNS-MN-CODE-METER-STATUS PIC X(20)                               
CVT999*                                 VALUE 'MN_CODE_METER_STATUS'.           
CVT999*    05  CNS-MN-METER-SUPPLYING   PIC X(18)                               
CVT999*                                 VALUE 'MN_METER_SUPPLYING'.             
CVT999*    05  CNS-MN-CODE-METER-LOC    PIC X(17)                               
CVT999*                                 VALUE 'MN_CODE_METER_LOC'.              
CVT999*    05  CNS-MN-METER-LOC-DESC    PIC X(17)                               
CVT999*                                 VALUE 'MN_METER_LOC_DESC'.              
CVT999*    05  CNS-MN-METER-IND         PIC X(09)                               
CVT999*                                 VALUE 'METER_IND'.                      
CVT999*    05  CNS-MN-CONSTANT          PIC X(11)                               
CVT999*                                 VALUE 'MN_CONSTANT'.                    
CVT999*    05  CNS-MN-NO-DIALS          PIC X(11)                               
CVT999*                                 VALUE 'MN_NO_DIALS'.                    
CVT999*    05  CNS-MN-DIST-NODE-POINT   PIC X(15)                               
CVT999*                                 VALUE 'DIST_NODE_POINT'.                
CVT999*    05  CNS-MN-POINT-ID          PIC X(08)                               
CVT999*                                 VALUE 'POINT_ID'.                       
CVT999*    05  CNS-MN-SEAL-CODE-ID      PIC X(12)                               
CVT999*                                 VALUE 'SEAL_CODE_ID'.                   
CVT999*    05  CNS-MN-HEX-LOCATION      PIC X(12)                               
CVT999*                                 VALUE 'HEX_LOCATION'.                   
CVT999*    05  CNS-MN-INSULATED-IND     PIC X(13)                               
CVT999*                                 VALUE 'INSULATED_IND'.                  
CVT999*    05  CNS-MN-LOCK-TYPE-ID      PIC X(12)                               
CVT999*                                 VALUE 'LOCK_TYPE_ID'.                   
CVT999*    05  CNS-MN-DELIVERY-LEVEL-CD PIC X(17)                               
CVT999*                                 VALUE 'DELIVERY_LEVEL_CD'.              
CVT999*    05  CNS-MN-UTILITY-SOURCE-CD PIC X(17)                               
CVT999*                                 VALUE 'UTILITY_SOURCE_CD'.              
CVT999*    05  CNS-MN-IDR-RECIPIENT-CD  PIC X(16)                               
CVT999*                                 VALUE 'IDR_RECIPIENT_CD'.               
CVT999*    05  CNS-MN-PROGRAM-ID        PIC X(10)                               
CVT999*                                 VALUE 'PROGRAM_ID'.                     
CVT999*    05  CNS-MN-MTR-READ-SOURCE-CD   PIC X(15)                            
CVT999*                                 VALUE 'MTR_READ_SOURCE'.                
CVT999*    05  CNS-RG-CODE-REG-STATUS   PIC X(18)                               
CVT999*                                 VALUE 'RG_CODE_REG_STATUS'.             
CVT999*    05  CNS-RG-CODE-STATUS-REAS  PIC X(19)                               
CVT999*                                 VALUE 'RG_CODE_STATUS_REAS'.            
CVT999*    05  CNS-RG-CODE-TIME-PERIOD  PIC X(19)                               
CVT999*                                 VALUE 'RG_CODE_TIME_PERIOD'.            
CVT999*    05  CNS-RG-CODE-USAGE-ID     PIC X(16)                               
CVT999*                                 VALUE 'RG_CODE_USAGE_ID'.               
CVT999*    05  CNS-RG-CODE-USAGE-SOURCE PIC X(20)                               
CVT999*                                 VALUE 'RG_CODE_USAGE_SOURCE'.           
CVT999*    05  CNS-RG-CODE-USAGE-TYPE   PIC X(18)                               
CVT999*                                 VALUE 'RG_CODE_USAGE_TYPE'.             
CVT999*    05  CNS-RG-LAST-READ-DT      PIC X(15)                               
CVT999*                                 VALUE 'RG_LAST_READ_DT'.                
CVT999*    05  CNS-RG-LAST-READ-VALUE   PIC X(18)                               
CVT999*                                 VALUE 'RG_LAST_READ_VALUE'.             
CVT999*    05  CNS-RG-REG-ID-NO         PIC X(12)                               
CVT999*                                 VALUE 'RG_REG_ID_NO'.                   
CVT999*    05  CNS-CP-NO-UNITS          PIC X(11)                               
CVT999*                                 VALUE 'CP_NO_UNITS'.                    
CVT999*    05  CNS-CP-CODE-PLAN-STATUS  PIC X(19)                               
CVT999*                                 VALUE 'CP_CODE_PLAN_STATUS'.            
CVT999*    05  CNS-CP-CODE-STAT-REASON  PIC X(19)                               
CVT999*                                 VALUE 'CP_CODE_PLAN_REASON'.            
CVT999*    05  CNS-CP-CODE-SERVICE-TYPE PIC X(20)                               
CVT999*                                 VALUE 'CP_CODE_SERVICE_TYPE'.           
CVT999*    05  CNS-CP-MTHLY-AMOUNT-FIXED PIC X(21)                              
CVT999*                                 VALUE 'CP_MTHLY_AMOUNT_FIXED'.          
CVT999*    05  CNS-CP-RATE-ITEM-CODE    PIC X(17)                               
CVT999*                                 VALUE 'CP_RATE_ITEM_CODE'.              
CVT999*    05  CNS-CP-LIGHT-NO          PIC X(11)                               
CVT999*                                 VALUE 'CP_LIGHT_NO'.                    
CVT999*    05  CNS-CP-POLE-NO           PIC X(10)                               
CVT999*                                 VALUE 'CP_POLE_NO'.                     
CVT999*    05  CNS-CP-DIST-NO           PIC X(10)                               
CVT999*                                 VALUE 'CP_DIST_NO'.                     
CVT999*    05  CNS-CP-USAGE-FIXED       PIC X(14)                               
CVT999*                                 VALUE 'CP_USAGE_FIXED'.                 
CVT999*    05  CNS-CP-ITEM-SEQ-NO       PIC X(14)                               
CVT999*                                 VALUE 'CP_ITEM_SEQ_NO'.                 
CVT999*    05  CNS-CP-EQUIP-ID          PIC X(11)                               
CVT999*                                 VALUE 'CP_EQUIP_ID'.                    
CVT999*    05  CNS-PREM-DIR-IND         PIC X(12)                               
CVT999*                                 VALUE 'PREM_DIR_IND'.                   
CVT999*    05  CNS-SUBDIV-LIGHT         PIC X(12)                               
CVT999*                                 VALUE 'SUBDIV_LIGHT'.                   
CVT999*    05  CNS-ACCT-TYPE            PIC X(09)                               
CVT999*                                 VALUE 'ACCT_TYPE'.                      
CVT999*    05  CNS-CODE-RENTAL-PROP     PIC X(16)                               
CVT999*                                 VALUE 'CODE_RENTAL_PROP'.               
CVT999*    05  CNS-LL-CUSTOMER-NO       PIC X(14)                               
CVT999*                                 VALUE 'LL_CUSTOMER_NO'.                 
CVT999*    05  CNS-REV-DIST-CD          PIC X(11)                               
CVT999*                                 VALUE 'REV_DIST_CD'.                    
CVT999*    05  CNS-DISC-BAL             PIC X(08)                               
CVT999*                                 VALUE 'DISC_BAL'.                       
CVT999*    05  CNS-ACCOUNT-NO           PIC X(10)                               
CVT999*                                 VALUE 'ACCOUNT_NO'.                     
CVT999*    05  CNS-ACCT-STATUS          PIC X(11)                               
CVT999*                                 VALUE 'ACCT_STATUS'.                    
CVT999*    05  CNS-ROW-NO               PIC X(06)                               
CVT999*                                 VALUE 'ROW_NO'.                         
CVT999*    05  CNS-DEPOSIT-AMT          PIC X(11)                               
CVT999*                                 VALUE 'DEPOSIT_AMT'.                    
CVT999*    05  CNS-SECURITIES-TOT-AMT   PIC X(18)                               
CVT999*                                 VALUE 'SECURITIES_TOT_AMT'.             
CVT999*    05  CNS-CUR-MTH-ARREARS-CD   PIC X(18)                               
CVT999*                                 VALUE 'CUR_MTH_ARREARS_CD'.             
CVT999*    05  CNS-CREDIT-GROUP         PIC X(12)                               
CVT999*                                 VALUE 'CREDIT_GROUP'.                   
CVT999*    05  CNS-CURRENT-ACCOUNT      PIC X(19)                               
CVT999*                                 VALUE 'CURRENT_ACTIVE_ACCT'.            
CVT999*    05  CNS-DATE-BNKRPT-FILED    PIC X(17)                               
CVT999*                                 VALUE 'DATE_BNKRPT_FILED'.              
CVT999*    05  CNS-FILED-CASE-NO        PIC X(13)                               
CVT999*                                 VALUE 'FILED_CASE_NO'.                  
CVT999*    05  CNS-DL-NO                PIC X(18)                               
CVT999*                                 VALUE 'DRIVERS LICENSE NO'.             
CVT999*    05  CNS-DL-STATE             PIC X(21)                               
CVT999*                                 VALUE 'DRIVERS LICENSE STATE'.          
CVT999*    05  CNS-SSN                  PIC X(22)                               
CVT999*                                 VALUE 'SOCIAL SECURITY NUMBER'.         
CVT999*    05  CNS-PRIOR-ACCT-STAT      PIC X(20)                               
CVT999*                                 VALUE 'PRIOR ACCOUNT STATUS'.           
CVT999*    05  CNS-CP-DATE-PLAN-START   PIC X(18)                               
CVT999*                                 VALUE 'CP_DATE_PLAN_START'.             
CVT999*    05  CNS-ACTIVE-CONTRACT      PIC X(15)                               
CVT999*                                 VALUE 'ACTIVE_CONTRACT'.                
CVT999*    05  CNS-SECURED-RATE-FLAG    PIC X(17)                               
CVT999*                                 VALUE 'SECURED_RATE_FLAG'.              
CVT999*    05  CNS-MN-CODE-MTR-RD-INST1 PIC X(17)                               
CVT999*                                 VALUE 'CODE_MTR_RD_INST1'.              
CVT999*    05  CNS-MN-METER-PRESSURE    PIC X(14)                               
CVT999*                                 VALUE 'METER_PRESSURE'.                 
CVT999*                                                                         
CVT999**************************************************************            
CVT999* COLUMN NAMES FOR RETURN VALUES FROM CPD00124 AND CPD00125  *            
CVT999**************************************************************            
CVT999*    05  CN-READ-CYCLE           PIC X(10)                                
CVT999*                                VALUE 'READ_CYCLE'.                      
CVT999*    05  CN-SERV-STRT-DT         PIC X(18)                                
CVT999*                                VALUE 'SERVICE_START_DATE'.              
CVT999*    05  CN-DEP-INTST-RT         PIC X(16)                                
CVT999*                                VALUE 'DEPOSIT_INT_RATE'.                
CVT999*                                                                         
CVT999*                                                                         
       01  GENERAL-WORKING-STORAGE.                                     
COB305     05 WS-ACCOUNT-NO        PIC S9(13) USAGE COMP-3 VALUE 0.       
COB305     05 WS-TEMP-ACCOUNT-NO        PIC S9(13) USAGE COMP-3 VALUE 0.       
           05  WS-DUPLICATE-ROWS       PIC S9(4)    COMP VALUE -811.    
           05  WS-MAX-AT-CREATE-DT     PIC X(26)    VALUE SPACES.       
T20443     05  WS-MAX-DT-UTL-SVC-STRT  PIC X(26)    VALUE SPACES.       
T18326     05  WS-MAX-AT-FINAL-DT      PIC X(26)    VALUE SPACES.       
COB305     05 WS-PREMISE-NO        PIC S9(10) USAGE COMP-3 VALUE 0.       
           05  WS-PRICE-PER-SERVICE    PIC S9(3)V9(6) COMP-3 VALUE 0.   
           05  WS-PREMISE-DIRECTIONS   PIC X(255)   VALUE SPACES.       
           05  WS-SPCL-INSTRUCTIONS    PIC X(255)   VALUE SPACES.       
PCR152     05  WS-SPCL-READ-INSTR      PIC X(114)   VALUE SPACES.       
           05  WS-RATE-ITEM-CODE       PIC S9(4)    COMP VALUE 0.       
           05  WS-VERSION-NO-CNTRL     PIC S9(4)    COMP VALUE 0.       
           05  WS-CODE-UTIL-TYPE       PIC X(1)     VALUE SPACES.       
           05  WS-NULL-INDICATOR       PIC S9(4)    USAGE COMP.         
           05  WS-NULL-DATE            PIC S9(4)    USAGE COMP.         
           05  WS-NULL-VALUE           PIC S9(4)    USAGE COMP VALUE -1.
           05  WS-AMT-DEPOSIT-IND      PIC S9(4)    USAGE COMP.         
           05  WS-BNKRPT-DATE-IND      PIC S9(04)   USAGE COMP.         
           05  WS-CODE-STATUS          PIC X(1)     VALUE SPACES.       
           05  WS-CURRENT-DATE         PIC X(10)    VALUE SPACES.       
           05  WS-RATE-PLAN-NO         PIC X(3)     VALUE SPACES.       
           05  WS-SUM-AMT-BOND         PIC S9(9)V99 COMP-3 VALUE 0.     
           05  WS-SUM-AMT-GRNTD        PIC S9(9)V99 COMP-3 VALUE 0.     
           05  WS-SUM-AMT-DEPOSIT      PIC S9(9)V99 COMP-3 VALUE 0.     
           05  WS-TOTAL-AMOUNT         PIC S9(9)V99 COMP-3 VALUE 0.     
           05  WS-ARREARS-HIST         PIC X(24)    VALUE SPACES.       
           05  WS-BILL-DAY-30-NI       PIC S9(04)   COMP VALUE +0.      
           05  WS-BILL-DAY-60-NI       PIC S9(04)   COMP VALUE +0.      
           05  WS-BILL-DAY-90-NI       PIC S9(04)   COMP VALUE +0.      
           05  WS-CODE-UNMETERED       PIC X(01)    VALUE 'U'.          
           05  WS-SUBDIV-PLAN          PIC X(03)    VALUE '064'.        
           05  WS-DATE-UTIL-SVC-STRT   PIC X(10)    VALUE SPACES.       
T18326     05  WS-DATE-UTIL-SVC-END    PIC X(10)    VALUE SPACES.       
           05  WS-ACCT-SVC-STRT        PIC X(10)    VALUE SPACES.       
T18326     05  WS-ACCT-SVC-END         PIC X(10)    VALUE SPACES.       
           05  WS-IND-SSN              PIC S9(04)   COMP VALUE +0.      
           05  WS-IND-DRIVERS-NUMBER   PIC S9(04)   COMP VALUE +0.      
           05  WS-IND-DRIVERS-STATE    PIC S9(04)   COMP VALUE +0.      
           05  WS-IND-READ-CYCLE       PIC S9(04)   COMP VALUE +0.      
           05  WS-IND-DATE-INSTALL     PIC S9(04)   COMP VALUE +0.      
C34652     05  WS-MN-METER-PRESSURE    PIC 9(03).                       
A00714     05  WS-NULL-CONSTANT        PIC S9(4)    USAGE COMP.         
A00714     05  WS-NULL-CONSTANT-MLOC   PIC S9(4)    USAGE COMP.         
A00714     05  WS-NULL-NO-DIALS        PIC S9(4)    USAGE COMP.         
A00714     05  WS-NULL-CODE-CAP        PIC S9(4)    USAGE COMP VALUE 0. 
                                                                        
       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'.             
                                                                        
      ******************************************************************        
      *    CURSOR DECLARATIONS                                         *        
      ******************************************************************        
                                                                        
      *--- < CURSOR FOR CSS_UTIL_ENVRNMT >                                      
           EXEC SQL DECLARE UT-CURSOR CURSOR FOR                        
               SELECT ACCOUNT_NO        ,                               
                      CODE_UTIL_TYPE    ,                               
                      IC_NO             ,                               
                      CODE_REVENUE_CLASS,                               
                      RATE_PLAN_NO      ,                               
                      READ_CYCLE        ,                               
                      READ_ROUTE        ,                               
                      CODE_SIC_NO                                       
                 FROM CSS_UTIL_ENVRNMT                                  
                WHERE ACCOUNT_NO = :WS-ACCOUNT-NO                       
                  AND COMPANY_NO = :PARM-COMPANY-NO                     
               ORDER BY ACCOUNT_NO    ,                                 
                        CODE_UTIL_TYPE,                                 
                        IC_NO                                           
           END-EXEC.                                                    
                                                                        
      *--- < CURSOR FOR CSS_MTRD_ENVRNMT >                                      
           EXEC SQL DECLARE MN-CURSOR CURSOR FOR                        
               SELECT MN.ACCOUNT_NO        ,                            
                      MN.CODE_UTIL_TYPE    ,                            
                      MN.METER_NO          ,                            
                      MN.IC_NO             ,                            
                      MN.MTR_REF_NO        ,                            
                      MN.CODE_TIME_PERIOD  ,                            
                      MN.LAST_READ_VALUE   ,                            
                      MN.REG_ID_NO         ,                            
                      MN.LAST_REG_READ_DATE,                            
                      MN.CODE_STATUS_REAS  ,                            
                      MN.CODE_USAGE_TYPE   ,                            
                      MN.CODE_USAGE_ID     ,                            
                      MN.CODE_USAGE_SOURCE ,                            
                      MN.CODE_METER_STATUS ,                            
                      MN.METER_SUPPLYING   ,                            
                      MN.CODE_METER_LOC    ,                            
                      MN.CODE_DATA_PRESENT ,                            
                      MN.DIST_NODE_POINT   ,                            
                      MN.POINT_ID          ,                            
                      MN.SEAL_CODE_ID      ,                            
                      MN.HEXAGRAM_LOCATION ,                            
                      MN.INSULATED_IND     ,                            
                      MN.LOCK_TYPE_ID      ,                            
                      MN.DELIVERY_LEVEL_CD ,                            
                      MN.UTILITY_SOURCE_CD ,                            
                      MN.IDR_RECIPIENT_CD  ,                            
                      MN.PROGRAM_ID        ,                            
                      MN.MTR_READ_SOURCE_CD,                            
                      MN.GIS_POINT_ID      ,                            
                      Q4.METER_LOC_DESC    ,                            
                      MC.CONSTANT,                                      
                      MC.NO_READ_DIALS,                                 
                      MC.CODE_CAP_TYPE,                                 
                      MN.CODE_MTR_RD_INST1 ,                            
C34652                MN.METER_PRESSURE                                 
A00714          FROM CSS_MTRD_ENVRNMT MN                                
A00714          LEFT OUTER JOIN CSS_METER_LOC    Q4                     
A00714            ON MN.CODE_METER_LOC = Q4.CODE_METER_LOC              
A00714          LEFT OUTER JOIN  CSS_MTR_CAP MC                         
A00714            ON  MN.CODE_UTIL_TYPE = MC.CODE_UTIL_TYPE             
A00714            AND MN.METER_NO       = MC.METER_NO                   
A00714            AND MN.REG_ID_NO      = MC.REG_ID_NO                  
A00714            AND MC.COMPANY_NO     = :UT-COMPANY-NO                
                WHERE MN.ACCOUNT_NO     = :WS-ACCOUNT-NO                
                  AND MN.CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE            
                  AND MN.IC_NO          = :UT-IC-NO                     
               ORDER BY MN.ACCOUNT_NO    ,                              
                        MN.CODE_UTIL_TYPE,                              
                        MN.IC_NO         ,                              
                        MN.MTR_REF_NO                                   
           END-EXEC.                                                    
                                                                        
      *--- < CURSOR FOR CSS_REGISTER_READ >                                     
           EXEC SQL DECLARE RG-CURSOR CURSOR FOR                        
               SELECT RG.ACCOUNT_NO       ,                             
                      RG.CODE_UTIL_TYPE   ,                             
                      RG.IC_NO            ,                             
                      RG.MTR_REF_NO       ,                             
                      RG.CODE_REG_STATUS  ,                             
                      RG.CODE_STATUS_REAS ,                             
                      RG.CODE_TIME_PERIOD ,                             
                      RG.CODE_USAGE_ID    ,                             
                      RG.CODE_USAGE_SOURCE,                             
                      RG.CODE_USAGE_TYPE  ,                             
                      RG.LAST_REG_READ_DT ,                             
                      RG.LAST_READ_VALUE  ,                             
                      RG.REG_ID_NO        ,                             
                      MC.CONSTANT,                                      
                      MC.NO_READ_DIALS,                                 
                      MC.CODE_CAP_TYPE                                  
                FROM CSS_REGISTER_READ RG                               
A00714          LEFT OUTER JOIN CSS_MTR_CAP MC                          
A00714            ON RG.REG_ID_NO       = MC.REG_ID_NO                  
A00714            AND RG.CODE_UTIL_TYPE = MC.CODE_UTIL_TYPE             
A00714            AND MC.METER_NO       = :MN-METER-NO                  
                WHERE RG.ACCOUNT_NO     = :WS-ACCOUNT-NO                
                  AND RG.CODE_UTIL_TYPE = :MN-CODE-UTIL-TYPE            
                  AND RG.IC_NO          = :MN-IC-NO                     
                  AND RG.MTR_REF_NO     = :MN-MTR-REF-NO                
               ORDER BY RG.ACCOUNT_NO    ,                              
                        RG.CODE_UTIL_TYPE,                              
                        RG.IC_NO         ,                              
                        RG.MTR_REF_NO    ,                              
                        RG.REG_ID_NO     ,                              
                        RG.CODE_TIME_PERIOD                             
           END-EXEC.                                                    
                                                                        
      *--- < CURSOR FOR CSS_CUST_PLAN >                                         
           EXEC SQL DECLARE CP-CURSOR CURSOR FOR                        
               SELECT ACCOUNT_NO        ,                               
                      CODE_UTIL_TYPE    ,                               
                      IC_NO             ,                               
                      NO_UNITS          ,                               
                      ITEM_SEQ_NO       ,                               
                      CODE_PLAN_STATUS  ,                               
                      CODE_STAT_REASON  ,                               
                      CODE_SERVICE_TYPE ,                               
                      MTHLY_AMOUNT_FIXED,                               
                      RATE_ITEM_CODE    ,                               
                      LIGHT_NO          ,                               
                      POLE_NO           ,                               
                      DIST_NO           ,                               
                      USAGE_FIXED       ,                               
T20443                DATE_PLAN_START   ,                               
T20443                REMOVE_DATE                                       
                 FROM CSS_CUST_PLAN                                     
                WHERE ACCOUNT_NO     = :WS-ACCOUNT-NO                   
                  AND CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE               
                  AND IC_NO          = :UT-IC-NO                        
               ORDER BY ACCOUNT_NO    ,                                 
                        CODE_UTIL_TYPE,                                 
                        IC_NO         ,                                 
                        RATE_ITEM_CODE,                                 
                        ITEM_SEQ_NO                                     
           END-EXEC.                                                    
                                                                        
                                                                        
HPCCDM*EJECT                                                                    
CVT000     EXEC SQL                                                             
CVT000         INCLUDE CWSX0010                                                 
CVT000     END-EXEC.                                                            
CVT000                                                                  
CVT000     EXEC SQL                                                             
CVT000         INCLUDE CWSSP001                                                 
CVT000     END-EXEC.                                                            
CVT000                                                                  
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         DECLARE C1 CURSOR  FOR                        
CVT000         SELECT *                                                 
CVT000         FROM #CSR02210_R1                                 
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                             
MFA-TR*        DECLARE C1 CURSOR WITH RETURN FOR                                
MFA-TR*        SELECT *                                                         
MFA-TR*        FROM SESSION.CSR02210_R1                                         
MFA-TR*    END-EXEC.                                                            
CVT000                                                                  
                                                                        
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-ACCOUNT-NO          PIC X(13)                .          
CVT000 01  LINK-PREMISE-NO          PIC X(10)                .          
CVT000 01  LINK-COMPANY-NO          PIC X(02)                .          
CVT000 01  LINK-MKTG-ORDER          PIC X(01)                .          
CVT000 01  LINK-RETURN-UTILS        PIC X(01)                .          
CVT000 01  LINK-RTN-DISC-BAL        PIC X(01)                .          
CVT000 01  LINK-ORDER-REASON        PIC X(01)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-ACCOUNT-NO                                         
CVT000         ,LINK-PREMISE-NO                                         
CVT000         ,LINK-COMPANY-NO                                         
CVT000         ,LINK-MKTG-ORDER                                         
CVT000         ,LINK-RETURN-UTILS                                       
CVT000         ,LINK-RTN-DISC-BAL                                       
CVT000         ,LINK-ORDER-REASON                                       
CVT000         .                                                        
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLWARNING                                      
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLERROR                                        
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER NOT FOUND                                       
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT999*PROCEDURE DIVISION.                                                      
                                                                        
                                                                        
      ******************************************************************        
      * 0000-MAINLINE                                                  *        
      *                                                                *        
      *     CALLS 0100-INITIALIZE                                      *        
      *           1000-PROCESS-INPUT                                   *        
      *           2000-PROCESS-OUTPUT                                  *        
      *           9999-END-PROGRAM                                     *        
      *                                                                *        
      *     CONTROLS THE MAIN PATH OF THE PROGRAM                      *        
      ******************************************************************        
       0000-MAINLINE.                                                   
                                                                        
           PERFORM 0100-INITIALIZE     THRU 0100-EXIT.                  
           PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT.                  
           PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT.                  
           PERFORM 9999-END-PROGRAM    THRU 9999-EXIT.                  
                                                                        
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 0100-INITIALIZE                                                *        
      *     CALLS 9000-SEND-ERROR-RESULT                               *        
      *           9900-SQL-ERROR-ROUTINE                               *        
      *                                                                *        
      *     CALLED FROM 0000-MAINLINE                                  *        
      *                                                                *        
      *     1. RESET DB2 ERROR HANDLERS                                *        
      *     2. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *        
      *     3. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *        
      *     4. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*        
      *                                                                *        
      ******************************************************************        
                                                                        
       0100-INITIALIZE.                                                 
                                                                        
           MOVE '0100'             TO ACTIVE-PARAGRAPH.                 
           MOVE '0100-INITIALIZE'  TO RS-ACTIVE-PARA.                   
           MOVE 'CICS TRANSACTION' TO RS-TABLE-NAME.                    
                                                                        
CVT999*    EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.                      
CVT999*    EXEC SQL WHENEVER SQLERROR   CONTINUE END-EXEC.                      
CVT999*    EXEC SQL WHENEVER NOT FOUND  CONTINUE END-EXEC.                      
                                                                        
CVT999*    CALL 'TDINIT'   USING DFHEIBLK, GWL-RC, GWL-INIT-HANDLE.             
                                                                        
CVT999*    CALL 'TDACCEPT' USING GWL-PROC, GWL-RC, GWL-INIT-HANDLE,             
CVT999*                          SNA-CONNECTION-NAME, SNA-SUBC.                 
                                                                        
CVT999*    CALL 'TDRESULT' USING GWL-PROC, GWL-RC.                              
                                                                        
CVT999*    IF GWL-RC NOT = TDS-PARM-PRESENT                                     
CVT999*       MOVE PROGRAM-NAME                  TO ABEND-PROGRAM               
CVT999*       MOVE 'CICS TRANSACTION'            TO TABLE-1                     
CVT999*       MOVE 'TDRESULT - NO RPC PARM SENT' TO TABLE-2                     
CVT999*       MOVE GWL-RC                     TO WS-ACTIVE-RETURN-CODE          
CVT999*                                          RS-RETURN-CODE                 
CVT999*       MOVE 'N'                           TO SEND-DONE-SW                
CVT999*       PERFORM 8100-SEND-RESULT           THRU 8100-EXIT                 
CVT999*       PERFORM 8900-SEND-DONE             THRU 8900-EXIT                 
CVT999*       PERFORM 9900-SQL-ERROR-ROUTINE     THRU 9900-EXIT                 
CVT999*    END-IF.                                                              
                                                                        
CVT000     MOVE LINK-ACCOUNT-NO           TO PARM-ACCOUNT-NO          . 
CVT000     MOVE LINK-PREMISE-NO           TO PARM-PREMISE-NO          . 
CVT000     MOVE LINK-COMPANY-NO           TO PARM-COMPANY-NO          . 
CVT000     MOVE LINK-MKTG-ORDER           TO PARM-MKTG-ORDER          . 
CVT000     MOVE LINK-RETURN-UTILS         TO PARM-RETURN-UTILS        . 
CVT000     MOVE LINK-RTN-DISC-BAL         TO PARM-RTN-DISC-BAL        . 
CVT000     MOVE LINK-ORDER-REASON         TO PARM-ORDER-REASON        . 
CVT000     PERFORM 0100A-DECLARE-GTT                                    
CVT000       THRU 0100A-EXIT.                                           
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
CVT000 0100A-DECLARE-GTT.                                               
CVT000     EXEC SQL
             CALL CIS.DROP_TEMP_TABLE('#CSR02210_R1')
           END-EXEC
           EXEC SQL
             CREATE TABLE #CSR02210_R1
              (                                                          
CVT000         RETURN_CODE              INT                         
CVT000        ,ACTIVE_PARA CHAR(30)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,TABLE_NAME CHAR(30)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,TABLE_ID CHAR(2)  COLLATE LATIN1_GENERAL_100_BIN2                
CVT000        ,UT_CODE_UTIL_TY CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,UT_IC_NO                 SMALLINT                        
CVT000        ,UT_READ_ROUTE            SMALLINT                        
CVT000        ,UT_RATE_PLAN_NO CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,UT_RATE_DESC CHAR(25)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,UT_CODE_REV_CLA CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,UT_READ_CYCLE CHAR(2)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,UT_CODE_SIC_NO CHAR(4)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,MN_METER_NO CHAR(9)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,MN_MTR_REF_NO            SMALLINT                        
CVT000        ,MN_CODE_TIME_PE          SMALLINT                        
CVT000        ,MN_LAST_READ_VA          DECIMAL(15,3)                   
CVT000        ,MN_CD_STUS_RS CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,MN_CODE_USAGE_T CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_CODE_USAGE_I CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_CODE_USAGE_S CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_CODE_METER_S CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_METER_SUPPLY CHAR(15)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_CODE_METER_L CHAR(2)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_METER_LOC_DE CHAR(14)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_METER_IND CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,MN_CONSTANT              DECIMAL(06,0)                   
CVT000        ,MN_NO_DIALS              SMALLINT                        
CVT000        ,MN_DIST_NODE_PO CHAR(20)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_POINT_ID CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,MN_SEAL_CODE_ID CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_HEX_LOCATION CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_INSULATED_IN CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_LOCK_TYPE_ID CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_DELIVERY_LEV CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_UTILITY_SOUR CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_IDR_RECIPIEN CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_PROGRAM_ID CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,MN_MTR_READ_SO CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,RG_CODE_REG_ST CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,RG_CODE_STATUS CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,RG_CODE_TIME_P           SMALLINT                        
CVT000        ,RG_CODE_USAGE CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,RG_CD_USG_SRC CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,RG_CD_USG_TYP CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,RG_LAST_READD CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,RG_LST_READVL            DECIMAL(12,3)                   
CVT000        ,RG_REG_ID_NO             SMALLINT                        
CVT000        ,CP_NO_UNITS              INT                         
CVT000        ,CP_CODE_PLAN CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,CP_CD_STATRS CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,CP_CD_SVC_TYP CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,CP_MTLY_AMT_FX           DECIMAL(09,0)                   
CVT000        ,CP_RT_ITEM_CD            SMALLINT                        
CVT000        ,CP_LIGHT_NO              SMALLINT                        
CVT000        ,CP_POLE_NO CHAR(7)  COLLATE LATIN1_GENERAL_100_BIN2              
CVT000        ,CP_DIST_NO CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2              
CVT000        ,CP_USAGE_FIXED           DECIMAL(09,0)                   
CVT000        ,CP_ITEM_SEQ_NO           SMALLINT                        
CVT000        ,CP_EQUIP_ID CHAR(2)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,PREM_DIR_IND CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,SUBDIV_LIGHT             DECIMAL(03,0)                   
CVT000        ,ACCT_TYPE CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2               
CVT000        ,CD_RNTL_PROP CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2            
CVT000        ,LL_CUSTOMER_NO           DECIMAL(10,0)                   
CVT000        ,REV_DIST_CD CHAR(3)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,DISC_BAL                 DECIMAL(13,2)                   
CVT000        ,ACCOUNT_NO               DECIMAL(13,0)                   
CVT000        ,ACCT_STATUS CHAR(1)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,ROW_NO                   SMALLINT                        
CVT000        ,DEPOSIT_AMT              DECIMAL(11,2)                   
CVT000        ,SEC_TOT_AMT              DECIMAL(11,2)                   
CVT000        ,CUR_MTH_ARR_CD CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,CREDIT_GROUP CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,CURRENT_ACCOUNT CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,DATE_BNKRPT_FL CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,FILED_CASE_NO CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2          
CVT000        ,DL_NO CHAR(19)  COLLATE LATIN1_GENERAL_100_BIN2                  
CVT000        ,DL_STATE CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2               
CVT000        ,SSN CHAR(09)  COLLATE LATIN1_GENERAL_100_BIN2                    
CVT000        ,PRIOR_ACCT_STAT CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,READ_CYCLE CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2             
CVT000        ,SERV_STRT_DT CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,DEP_INTST_RT             DECIMAL(04,2)                   
CVT000        ,CP_DT_PLN_ST CHAR(10)  COLLATE LATIN1_GENERAL_100_BIN2           
CVT000        ,ACTIVE_CONTRACT CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,SECURED_RATE_FL CHAR(01)  COLLATE LATIN1_GENERAL_100_BIN2        
CVT000        ,MN_CODE_MTR_RD CHAR(02)  COLLATE LATIN1_GENERAL_100_BIN2         
CVT000        ,MN_MTR_PRESS CHAR(03)  COLLATE LATIN1_GENERAL_100_BIN2           
P00390        ,O2_ERROR_MSG_NO CHAR(05)  COLLATE LATIN1_GENERAL_100_BIN2        
P00390        ,A4_ERROR_MSG_NO CHAR(05)  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 'CSR03501_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.                                                    
                                                                        
                                                                        
      ******************************************************************        
      * 1000-PROCESS-INPUT                                             *        
      *     CALLS 1100-RECEIVE-PARMS                                   *        
      *                                                                *        
      *     CALLED FROM 0000-MAINLINE                                  *        
      *                                                                *        
      *     1. RECEIVE PARMS.                                          *        
      ******************************************************************        
                                                                        
       1000-PROCESS-INPUT.                                              
                                                                        
           PERFORM 1100-RECEIVE-PARMS THRU 1100-EXIT.                   
                                                                        
           MOVE PARM-ACCOUNT-NO-NUM   TO WS-ACCOUNT-NO                  
                                         WS-TEMP-ACCOUNT-NO.            
T26014     IF PARM-PREMISE-NO NUMERIC                                   
              MOVE PARM-PREMISE-NO-NUM   TO WS-PREMISE-NO               
           ELSE                                                         
T26014        MOVE -1                    TO RS-RETURN-CODE              
T26014        MOVE PROGRAM-NAME          TO ABEND-PROGRAM               
T26014        MOVE '1000'                TO ACTIVE-PARAGRAPH            
T26014        MOVE 'MOVE'                TO ABEND-FUNCTION              
T26014        MOVE SPACES                TO ABEND-SQL-PREDICATES        
T26014                                      ABEND-TABLES                
T26014        MOVE 'PARM-PREMISE-NO-NUM' TO TABLE-ELEMENT-1             
T26014        MOVE PARM-PREMISE-NO-NUM   TO HOSTVAR-ELEMENT-1           
T26014        MOVE 'WS-ACCOUNT-NO'       TO TABLE-ELEMENT-2             
T26014        MOVE WS-ACCOUNT-NO         TO HOSTVAR-ELEMENT-2           
T26014        PERFORM 8100-SEND-RESULT  THRU 8100-EXIT                  
T26014        PERFORM 9999-END-PROGRAM  THRU 9999-EXIT                  
T26014     END-IF.                                                      
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 1100-RECEIVE-PARMS                                             *        
      *     CALLS TDRCVPRM                                             *        
      *                                                                *        
      *     CALLED FROM 1000-PROCESS-INPUT                             *        
      *                                                                *        
      *     GET THE PASSED PARMS FROM THE CLIENT                       *        
      ******************************************************************        
                                                                        
       1100-RECEIVE-PARMS.                                              
           MOVE '1100'               TO ACTIVE-PARAGRAPH                
           MOVE '1100-RECEIVE-PARMS' TO RS-ACTIVE-PARA                  
           MOVE 'RECEIVING PARMS'    TO RS-TABLE-NAME.                  
                                                                        
      *-------------< GET ACCOUNT-NO >                                          
CVT999*    MOVE 1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-ACCOUNT-NO        TO MAX-LENGTH-PARM.            
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-ACCOUNT-NO,                               
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
      *-------------< GET PREMISE-NO >                                          
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-PREMISE-NO        TO MAX-LENGTH-PARM.            
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-PREMISE-NO,                               
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
      *-------------< GET COMPANY-NO >                                          
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-COMPANY-NO        TO MAX-LENGTH-PARM.            
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-COMPANY-NO,                               
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
      *-------------< GET MKTG-ORDER >                                          
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-MKTG-ORDER        TO MAX-LENGTH-PARM.            
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-MKTG-ORDER,                               
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
      *-------------< GET RETURN-UTILS >                                        
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-RETURN-UTILS      TO MAX-LENGTH-PARM.            
                                                                        
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-RETURN-UTILS,                             
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
PCR361*-------------< GET RETURN-DISC-BAL>                                      
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-RTN-DISC-BAL      TO MAX-LENGTH-PARM.            
PCR361                                                                  
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-RTN-DISC-BAL,                             
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
PCR361*-------------< GET ORDER-REASON>                                         
CVT999*    ADD  1                                TO PARM-ID1.                   
CVT999*    MOVE LENGTH OF PARM-ORDER-REASON      TO MAX-LENGTH-PARM.            
PCR361                                                                  
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          PARM-ID1,                                      
CVT999*                          PARM-ORDER-REASON,                             
CVT999*                          TDSCHAR,                                       
CVT999*                          MAX-LENGTH-PARM,                               
CVT999*                          PARM-L.                                        
                                                                        
       1100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2000-PROCESS-OUTPUT.                                           *        
      *     CALLS 2100-DESCRIBE-RESULT                                 *        
      *           2300-BUILD-RESULT                                    *        
      *                                                                *        
      *      CALLED FROM 0000-MAINLINE                                 *        
      *                                                                *        
      *      SETS UP PARAMETERS TO BE RETURNED, POPULATES THE PARMS    *        
      *      AND SENDS THEN BACK                                       *        
      ******************************************************************        
                                                                        
       2000-PROCESS-OUTPUT.                                             
                                                                        
           PERFORM 2100-DESCRIBE-RESULT          THRU 2100-EXIT.        
           PERFORM 2300-BUILD-RESULT             THRU 2300-EXIT.        
                                                                        
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2100-DESCRIBE-RESULT                                           *        
      *                                                                *        
      *     CALLED FROM 2000-PROCESS-OUTPUT                            *        
      *                                                                *        
      *     DESCRIBE EACH RESULT FIELD TO THE CLIENT                   *        
      ******************************************************************        
                                                                        
       2100-DESCRIBE-RESULT.                                            
                                                                        
           PERFORM 2110-DESC-RET-CODE              THRU 2110-EXIT.      
           PERFORM 2111-DESC-ACTIVE-PARA           THRU 2111-EXIT.      
           PERFORM 2112-DESC-TABLE-NAME            THRU 2112-EXIT.      
           PERFORM 2115-DESC-TABLE-ID              THRU 2115-EXIT.      
           PERFORM 2120-DESC-UT-CODE-UTIL-TYPE     THRU 2120-EXIT.      
           PERFORM 2125-DESC-UT-IC-NO              THRU 2125-EXIT.      
           PERFORM 2126-DESC-UT-READ-ROUTE         THRU 2126-EXIT.      
           PERFORM 2127-DESC-UT-RATE-PLAN-NO       THRU 2127-EXIT.      
           PERFORM 2128-DESC-UT-RATE-DESC          THRU 2128-EXIT.      
           PERFORM 2130-DESC-UT-CODE-REV-CLASS     THRU 2130-EXIT.      
           PERFORM 2131-DESC-UT-READ-CYCLE         THRU 2131-EXIT.      
           PERFORM 2132-DESC-UT-CODE-SIC-NO        THRU 2132-EXIT.      
           PERFORM 2135-DESC-MN-METER-NO           THRU 2135-EXIT.      
           PERFORM 2145-DESC-MN-MTR-REF-NO         THRU 2145-EXIT.      
           PERFORM 2150-DESC-MN-CODE-TIME-PERIOD   THRU 2150-EXIT.      
           PERFORM 2155-DESC-MN-LAST-READ-VALUE    THRU 2155-EXIT.      
           PERFORM 2160-DESC-MN-CODE-STATUS-REAS   THRU 2160-EXIT.      
           PERFORM 2165-DESC-MN-CODE-USAGE-TYPE    THRU 2165-EXIT.      
           PERFORM 2170-DESC-MN-CODE-USAGE-ID      THRU 2170-EXIT.      
           PERFORM 2175-DESC-MN-CODE-USAGE-SOURCE  THRU 2175-EXIT.      
           PERFORM 2176-DESC-MN-CODE-METER-STATUS  THRU 2176-EXIT.      
           PERFORM 2177-DESC-MN-METER-SUPPLYING    THRU 2177-EXIT.      
           PERFORM 2178-DESC-MN-CODE-METER-LOC     THRU 2178-EXIT.      
           PERFORM 2179-DESC-MN-METER-LOC-DESC     THRU 2179-EXIT.      
           PERFORM 2180-DESC-MN-METER-IND          THRU 2180-EXIT.      
           PERFORM 2181-DESC-MN-CONSTANT           THRU 2181-EXIT.      
           PERFORM 2182-DESC-MN-NO-DIALS           THRU 2182-EXIT.      
           PERFORM 2183-DESC-MN-DIST-NODE-POINT    THRU 2183-EXIT.      
           PERFORM 2184-DESC-MN-POINT-ID           THRU 2184-EXIT.      
           PERFORM 2185-DESC-MN-SEAL-CODE-ID       THRU 2185-EXIT.      
           PERFORM 2186-DESC-MN-HEX-LOCATION       THRU 2186-EXIT.      
           PERFORM 2187-DESC-MN-INSULATED-IND      THRU 2187-EXIT.      
           PERFORM 2188-DESC-MN-LOCK-TYPE-ID       THRU 2188-EXIT.      
           PERFORM 2189-DESC-MN-DELIVERY-LEVEL-CD  THRU 2189-EXIT.      
           PERFORM 2190-DESC-MN-UTILITY-SOURCE-CD  THRU 2190-EXIT.      
           PERFORM 2191-DESC-MN-IDR-RECIPIENT-CD   THRU 2191-EXIT.      
           PERFORM 2192-DESC-MN-PROGRAM-ID-CD      THRU 2192-EXIT.      
           PERFORM 2193-DESC-MN-MTR-RD-SRCE-CD     THRU 2193-EXIT.      
           PERFORM 2194-DESC-RG-CODE-REG-STATUS    THRU 2194-EXIT.      
           PERFORM 2195-DESC-RG-CODE-STATUS-REAS   THRU 2195-EXIT.      
           PERFORM 2196-DESC-RG-CODE-TIME-PERIOD   THRU 2196-EXIT.      
           PERFORM 2200-DESC-RG-CODE-USAGE-ID      THRU 2200-EXIT.      
           PERFORM 2205-DESC-RG-CODE-USAGE-SOURCE  THRU 2205-EXIT.      
           PERFORM 2210-DESC-RG-CODE-USAGE-TYPE    THRU 2210-EXIT.      
           PERFORM 2220-DESC-RG-LAST-READ-DT       THRU 2220-EXIT.      
           PERFORM 2225-DESC-RG-LAST-READ-VALUE    THRU 2225-EXIT.      
           PERFORM 2235-DESC-RG-REG-ID-NO          THRU 2235-EXIT.      
           PERFORM 2250-DESC-CP-NO-UNITS           THRU 2250-EXIT.      
           PERFORM 2251-DESC-CP-STATUS             THRU 2251-EXIT.      
           PERFORM 2252-DESC-CP-REASON             THRU 2252-EXIT.      
           PERFORM 2253-DESC-CP-SERVICE-TYPE       THRU 2253-EXIT.      
           PERFORM 2254-DESC-CP-MTHLY-AMOUNT       THRU 2254-EXIT.      
           PERFORM 2255-DESC-CP-RATE-ITEM          THRU 2255-EXIT.      
           PERFORM 2256-DESC-CP-LIGHT-NO           THRU 2256-EXIT.      
           PERFORM 2257-DESC-CP-POLE-NO            THRU 2257-EXIT.      
           PERFORM 2258-DESC-CP-DIST-NO            THRU 2258-EXIT.      
           PERFORM 2259-DESC-CP-USAGE-FIXED        THRU 2259-EXIT.      
           PERFORM 2260-DESC-CP-ITEM-SEQ-NO        THRU 2260-EXIT.      
           PERFORM 2261-DESC-CP-EQUIP-ID           THRU 2261-EXIT.      
           PERFORM 2263-DESC-PREM-DIR-IND          THRU 2263-EXIT.      
           PERFORM 2264-DESC-SUBDIV-LIGHT          THRU 2264-EXIT.      
           PERFORM 2265-DESC-PREM-TYPE             THRU 2265-EXIT.      
           PERFORM 2270-DESC-CODE-RENTAL-PROP      THRU 2270-EXIT.      
           PERFORM 2275-DESC-LL-CUSTOMER-NO        THRU 2275-EXIT.      
           PERFORM 2280-DESC-REV-DIST-CD           THRU 2280-EXIT.      
           PERFORM 2282-DESC-DISC-BAL              THRU 2282-EXIT.      
           PERFORM 2283-DESC-ACCOUNT-NO            THRU 2283-EXIT.      
           PERFORM 2284-DESC-ACCT-STATUS           THRU 2284-EXIT.      
           PERFORM 2285-DESC-ROW-NO                THRU 2285-EXIT.      
           PERFORM 2286-DESC-DEPOSIT-AMT           THRU 2286-EXIT.      
           PERFORM 2287-DESC-SECURITIES-TOT-AMT    THRU 2287-EXIT.      
           PERFORM 2288-DESC-CUR-MTH-ARREARS-CD    THRU 2288-EXIT.      
           PERFORM 2289-DESC-CREDIT-GROUP          THRU 2289-EXIT.      
           PERFORM 2290-DESC-CURRENT-ACCOUNT       THRU 2290-EXIT.      
           PERFORM 2295-DESC-BNKRPT-DATE-FILED     THRU 2295-EXIT.      
           PERFORM 2296-DESC-FILED-CASE-NO         THRU 2296-EXIT.      
           PERFORM 2297-DESC-DL-NO                 THRU 2297-EXIT.      
           PERFORM 2298-DESC-DL-STATE              THRU 2298-EXIT.      
           PERFORM 2299-DESC-SSN                   THRU 2299-EXIT.      
           PERFORM 2291-DESC-PRIOR-ACCT-STAT       THRU 2291-EXIT.      
                                                                        
T20443     PERFORM 2292-DESC-CP-DATE-PLAN-START    THRU 2292-EXIT.      
T23507     PERFORM 2293-DESC-ACTIVE-CONTRACT       THRU 2293-EXIT.      
T22131     PERFORM 2294-DESC-SECURED-RATE-FLAG     THRU 2294-EXIT.      
302442     PERFORM 2281-DESC-MN-CODE-MTR-RD-INST1  THRU 2281-EXIT.      
C34652     PERFORM 2271-DESC-MN-METER-PRESSURE     THRU 2271-EXIT.      
                                                                        
       2100-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2110-DESC-RET-CODE                                             *        
      *     CALLS       9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE EACH RESULT FIELD TO THE CLIENT                   *        
      ******************************************************************        
       2110-DESC-RET-CODE.                                              
                                                                        
           MOVE '2110'                       TO ACTIVE-PARAGRAPH.       
           MOVE '2110-DESC-RET-CODE'         TO RS-ACTIVE-PARA.         
           MOVE 'DESCRIBE RETURN CODE'       TO RS-TABLE-NAME.          
CVT999*    MOVE 1                            TO CTR-COLUMN.                     
CVT999*    MOVE TDSINT4                      TO DB-HOST-TYPE.                   
CVT999*    MOVE TDSINT4                      TO DB-CLIENT-TYPE.                 
CVT999*    MOVE LENGTH OF RS-RETURN-CODE     TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-RETURN-CODE    TO WRKLEN2.                        
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RETURN-CODE,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RETURN-CODE,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2110-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2111-DESC-ACTIVE-PARA                                          *        
      *     CALLS       9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE ACTIVE-PARA FIELD TO THE CLIENT                   *        
      ******************************************************************        
       2111-DESC-ACTIVE-PARA.                                           
                                                                        
           MOVE '2111'                       TO ACTIVE-PARAGRAPH.       
           MOVE '2111-DESC-ACTIVE-PARA'      TO RS-ACTIVE-PARA.         
           MOVE 'DESCRIBE ACTIVE PARA'       TO RS-TABLE-NAME.          
CVT999*    ADD  1                            TO CTR-COLUMN.                     
CVT999*    MOVE TDSCHAR                      TO DB-HOST-TYPE.                   
CVT999*    MOVE TDSCHAR                      TO DB-CLIENT-TYPE.                 
CVT999*    MOVE LENGTH OF RS-ACTIVE-PARA     TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-ACTIVE-PARA    TO WRKLEN2.                        
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ACTIVE-PARA,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ACTIVE-PARA,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2111-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2112-DESC-TABLE-NAME                                           *        
      *     CALLS       9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE TABLE-NAME  FIELD TO THE CLIENT                   *        
      ******************************************************************        
       2112-DESC-TABLE-NAME.                                            
                                                                        
           MOVE '2112'                       TO ACTIVE-PARAGRAPH.       
CVT999*    ADD  1                            TO CTR-COLUMN.                     
CVT999*    MOVE TDSCHAR                      TO DB-HOST-TYPE.                   
CVT999*    MOVE TDSCHAR                      TO DB-CLIENT-TYPE.                 
CVT999*    MOVE LENGTH OF RS-TABLE-NAME      TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-TABLE-NAME     TO WRKLEN2.                        
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-TABLE-NAME,                                 
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-TABLE-NAME,                                
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2112-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2115-DESC-TABLE-ID                                             *        
      *     CALLS       9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE TABLE-ID    FIELD TO THE CLIENT                   *        
      ******************************************************************        
       2115-DESC-TABLE-ID.                                              
                                                                        
           MOVE '2115'                       TO ACTIVE-PARAGRAPH.       
CVT999*    ADD  1                            TO CTR-COLUMN.                     
CVT999*    MOVE TDSCHAR                      TO DB-HOST-TYPE.                   
CVT999*    MOVE TDSCHAR                      TO DB-CLIENT-TYPE.                 
CVT999*    MOVE LENGTH OF RS-TABLE-ID        TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-TABLE-ID       TO WRKLEN2.                        
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-TABLE-ID,                                   
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-TABLE-ID,                                  
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2115-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2120-DESC-UT-CODE-UTIL-TYPE                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-CODE-UTIL-TYPE RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2120-DESC-UT-CODE-UTIL-TYPE.                                     
                                                                        
           MOVE '2120'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-CODE-UTIL-TY     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-CODE-UTIL-TYPE  TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-CODE-UTIL-TY,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-CODE-UTIL-TYPE,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2120-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2125-DESC-UT-IC-NO                                             *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-IC-NO          RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2125-DESC-UT-IC-NO.                                              
                                                                        
           MOVE '2125'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-UT-IC-NO           TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-UT-IC-NO          TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-IC-NO,                                   
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-IC-NO,                                  
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2125-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2126-DESC-UT-READ-ROUTE                                        *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-READ-ROUTE     RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2126-DESC-UT-READ-ROUTE.                                         
                                                                        
           MOVE '2126'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-UT-READ-ROUTE      TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-UT-READ-ROUTE     TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-READ-ROUTE,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-READ-ROUTE,                             
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2126-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2127-DESC-UT-RATE-PLAN-NO                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-RATE-PLAN-NO   RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2127-DESC-UT-RATE-PLAN-NO.                                       
                                                                        
           MOVE '2127'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-RATE-PLAN-NO     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-RATE-PLAN-NO    TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-RATE-PLAN-NO,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-RATE-PLAN-NO,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2127-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2128-DESC-UT-RATE-DESC                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-RATE-DESC      RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2128-DESC-UT-RATE-DESC.                                          
                                                                        
           MOVE '2128'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-RATE-DESC        TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-RATE-DESC       TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-RATE-DESC,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-RATE-DESC,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2128-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2130-DESC-UT-CODE-REV-CLASS                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-CODE-REV-CLASS RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2130-DESC-UT-CODE-REV-CLASS.                                     
                                                                        
           MOVE '2130'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-CODE-REV-CLA     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-CODE-REV-CLASS  TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-CODE-REV-CLA,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-CODE-REV-CLASS,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2130-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2131-DESC-UT-READ-CYCLE                                        *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-READ-CYCLE     RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2131-DESC-UT-READ-CYCLE.                                         
                                                                        
           MOVE '2131'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-READ-CYCLE       TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-READ-CYCLE      TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-READ-CYCLE,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-READ-CYCLE,                             
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2131-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2132-DESC-UT-CODE-SIC-NO                                       *        
      *     CALLS       TDESCRIB                                       *        
      *                 TDSETBCD                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UT-CODE-SIC-NO    RESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2132-DESC-UT-CODE-SIC-NO.                                        
                                                                        
           MOVE '2132'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD  1                                TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-UT-CODE-SIC-NO      TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-UT-CODE-SIC-NO     TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-UT-CODE-SIC-NO,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-UT-CODE-SIC-NO,                            
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2132-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2135-DESC-MN-METER-NO                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-METER-NO        RESULT FIELD TO THE CLIENT     *        
      ******************************************************************        
       2135-DESC-MN-METER-NO.                                           
                                                                        
           MOVE '2135'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-METER-NO        TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-METER-NO        TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-METER-NO,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-METER-NO,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2135-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2145-DESC-MN-MTR-REF-NO                                        *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-MTR-REF-NO      RESULT FIELD TO THE CLIENT     *        
      ******************************************************************        
       2145-DESC-MN-MTR-REF-NO.                                         
                                                                        
           MOVE '2145'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-MTR-REF-NO      TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-MTR-REF-NO      TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-MTR-REF-NO,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-MTR-REF-NO,                             
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2145-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2150-DESC-MN-CODE-TIME-PERIOD                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-TIME-PERIOD RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2150-DESC-MN-CODE-TIME-PERIOD.                                   
                                                                        
           MOVE '2150'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-TIME-PE TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-CODE-TIME-PERIOD TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-TIME-PE,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-TIME-PERIOD,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2150-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2155-DESC-MN-LAST-READ-VALUE                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-LAST-READ-VALUE  RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2155-DESC-MN-LAST-READ-VALUE.                                    
                                                                        
           MOVE '2155'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-LAST-READ-VA     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-MN-LAST-READ-VALUE  TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-LAST-READ-VA,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-LAST-READ-VALUE,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +3 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.                             
                                                                        
       2155-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2160-DESC-MN-CODE-STATUS-REAS                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-STATUS-REAS RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2160-DESC-MN-CODE-STATUS-REAS.                                   
                                                                        
           MOVE '2160'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CD-STUS-RS TO WRKLEN1.                          
CVT999*    MOVE LENGTH OF CNS-MN-CODE-STATUS-REAS TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CD-STUS-RS,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-STATUS-REAS,                       
CVT999*                          WRKLEN2.                                       
                                                                        
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2160-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2165-DESC-MN-CODE-USAGE-TYPE                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-USAGE-TYPE  RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2165-DESC-MN-CODE-USAGE-TYPE.                                    
                                                                        
           MOVE '2165'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-USAGE-T     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-MN-CODE-USAGE-TYPE  TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-USAGE-T,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-USAGE-TYPE,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2165-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2170-DESC-MN-CODE-USAGE-ID                                     *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-USAGE-ID    RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2170-DESC-MN-CODE-USAGE-ID.                                      
                                                                        
           MOVE '2170'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-USAGE-I     TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-MN-CODE-USAGE-ID    TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-USAGE-I,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-USAGE-ID,                          
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2170-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2175-DESC-MN-CODE-USAGE-SOURCE                                 *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-USAGE-SOURCE RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2175-DESC-MN-CODE-USAGE-SOURCE.                                  
                                                                        
           MOVE '2175'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-USAGE-S TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-CODE-USAGE-SOURCE TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-USAGE-S,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-USAGE-SOURCE,                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2175-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2176-DESC-MN-CODE-METER-STATUS                                 *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-METER-STATUS RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2176-DESC-MN-CODE-METER-STATUS.                                  
                                                                        
           MOVE '2176'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-METER-S TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-CODE-USAGE-SOURCE TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-METER-S,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-METER-STATUS,                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2176-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2177-DESC-MN-METER-SUPPLYING                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-METER-SUPPLYING   RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2177-DESC-MN-METER-SUPPLYING.                                    
                                                                        
           MOVE '2177'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-METER-SUPPLY      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-METER-SUPPLYING   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-METER-SUPPLY,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-METER-SUPPLYING,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2177-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2178-DESC-MN-CODE-METER-LOC                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CODE-METER-LOC    RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2178-DESC-MN-CODE-METER-LOC.                                     
                                                                        
           MOVE '2178'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-METER-L      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-CODE-METER-LOC    TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-METER-L,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-METER-LOC,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2178-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2179-DESC-MN-METER-LOC-DESC                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-METER-LOC-DESC    RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2179-DESC-MN-METER-LOC-DESC.                                     
                                                                        
           MOVE '2178'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-METER-LOC-DE      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-METER-LOC-DESC    TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-METER-LOC-DE,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-METER-LOC-DESC,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2179-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2180-DESC-MN-METER-IND                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-METER-IND         RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2180-DESC-MN-METER-IND.                                          
                                                                        
           MOVE '2180'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-METER-IND         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-METER-IND         TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-METER-IND,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-METER-IND,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2180-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2181-DESC-MN-CONSTANT                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-CONSTANT          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2181-DESC-MN-CONSTANT.                                           
                                                                        
           MOVE '2181'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CONSTANT          TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-CONSTANT          TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CONSTANT,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CONSTANT,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +3 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.                             
                                                                        
       2181-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2182-DESC-MN-NO-DIALS                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-NO-DIALS          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2182-DESC-MN-NO-DIALS.                                           
                                                                        
           MOVE '2182'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-NO-DIALS          TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-NO-DIALS          TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-NO-DIALS,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-NO-DIALS,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2182-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2183-DESC-MN-DIST-NODE-POINT                                *           
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-DIST-NODE-POINTRESULT FIELD TO THE CLIENT      *        
      ******************************************************************        
       2183-DESC-MN-DIST-NODE-POINT.                                    
                                                                        
           MOVE '2183'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-DIST-NODE-PO      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-MN-DIST-NODE-POINT   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-DIST-NODE-PO,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-DIST-NODE-POINT,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2183-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2184-DESC-MN-POINT-ID                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-POINT-ID RESULT FIELD TO THE CLIENT            *        
      ******************************************************************        
       2184-DESC-MN-POINT-ID.                                           
                                                                        
           MOVE '2184'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-POINT-ID        TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-POINT-ID       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-POINT-ID,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-POINT-ID,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2184-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2185-DESC-MN-SEAL-CODE-ID                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-SEAL-CODE-ID FIELD TO THE CLIENT               *        
      ******************************************************************        
       2185-DESC-MN-SEAL-CODE-ID.                                       
                                                                        
           MOVE '2185'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-SEAL-CODE-ID    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-SEAL-CODE-ID   TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-SEAL-CODE-ID,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-SEAL-CODE-ID,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2185-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2186-DESC-MN-HEX-LOCATION                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-HEX-LOCATION FIELD TO THE CLIENT               *        
      ******************************************************************        
       2186-DESC-MN-HEX-LOCATION.                                       
                                                                        
           MOVE '2186'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-HEX-LOCATION    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-HEX-LOCATION   TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-HEX-LOCATION,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-HEX-LOCATION,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2186-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2187-DESC-MN-INSULATED-IND                                     *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-INSULATED-IND FIELD TO THE CLIENT              *        
      ******************************************************************        
       2187-DESC-MN-INSULATED-IND.                                      
                                                                        
           MOVE '2187'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-INSULATED-IN    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-INSULATED-IND  TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-INSULATED-IN,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-INSULATED-IND,                          
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2187-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2188-DESC-MN-LOCK-TYPE-ID                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-LOCK-TYPE-ID FIELD TO THE CLIENT               *        
      ******************************************************************        
       2188-DESC-MN-LOCK-TYPE-ID.                                       
                                                                        
           MOVE '2188'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-LOCK-TYPE-ID    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-LOCK-TYPE-ID   TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-LOCK-TYPE-ID,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-LOCK-TYPE-ID,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2188-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2189-DESC-MN-DELIVERY-LEVEL-CD                                 *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-DELIVERY-LEVEL-CD FIELD TO THE CLIENT          *        
      ******************************************************************        
       2189-DESC-MN-DELIVERY-LEVEL-CD.                                  
                                                                        
           MOVE '2189'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-DELIVERY-LEV TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-DELIVERY-LEVEL-CD TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-DELIVERY-LEV,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-DELIVERY-LEVEL-CD                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2189-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2190-DESC-MN-UTILITY-SOURCE-CD                                 *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-UTILITY-SOURCE-CD FIELD TO THE CLIENT          *        
      ******************************************************************        
       2190-DESC-MN-UTILITY-SOURCE-CD.                                  
                                                                        
           MOVE '2190'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-UTILITY-SOUR TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-UTILITY-SOURCE-CD TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-UTILITY-SOUR,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-UTILITY-SOURCE-CD,                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2190-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2191-DESC-MN-IDR-RECIPIENT-CD                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-UTILITY-SOURCE-CD FIELD TO THE CLIENT          *        
      ******************************************************************        
       2191-DESC-MN-IDR-RECIPIENT-CD.                                   
                                                                        
           MOVE '2191'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-IDR-RECIPIEN TO WRKLEN1.                        
CVT999*    MOVE LENGTH OF CNS-MN-IDR-RECIPIENT-CD TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-IDR-RECIPIEN,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-IDR-RECIPIENT-CD,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2191-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2192-DESC-MN-PROGRAM-ID-CD                                     *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MN-PROGRAM-ID     FIELD TO THE CLIENT             *        
      ******************************************************************        
       2192-DESC-MN-PROGRAM-ID-CD.                                      
                                                                        
           MOVE '2192'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-PROGRAM-ID      TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-PROGRAM-ID    TO WRKLEN2.                      
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-PROGRAM-ID,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-PROGRAM-ID,                             
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2192-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2193-DESC-MN-MTR-RD-SRCE-CD                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RS-MN-MTR-READ-SO FIELD TO THE CLIENT             *        
      ******************************************************************        
       2193-DESC-MN-MTR-RD-SRCE-CD.                                     
                                                                        
           MOVE '2193'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-MTR-READ-SO TO WRKLEN1.                         
CVT999*    MOVE LENGTH OF CNS-MN-MTR-READ-SOURCE-CD TO WRKLEN2.                 
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-MTR-READ-SO,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-MTR-READ-SOURCE-CD                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2193-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2194-DESC-RG-CODE-REG-STATUS                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-REG-STATUS   RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2194-DESC-RG-CODE-REG-STATUS.                                    
                                                                        
           MOVE '2194'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CODE-REG-ST       TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-CODE-REG-STATUS   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CODE-REG-ST,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-REG-STATUS,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2194-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2195-DESC-RG-CODE-STATUS-REAS                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-STATUS-REAS  RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2195-DESC-RG-CODE-STATUS-REAS.                                   
                                                                        
           MOVE '2195'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CODE-STATUS       TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-CODE-STATUS-REAS  TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CODE-STATUS,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-STATUS-REAS,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2195-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2196-DESC-RG-CODE-TIME-PERIOD                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-TIME-PERIOD  RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2196-DESC-RG-CODE-TIME-PERIOD.                                   
                                                                        
           MOVE '2196'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CODE-TIME-P       TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-CODE-TIME-PERIOD  TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CODE-TIME-P,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-TIME-PERIOD,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2196-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2200-DESC-RG-CODE-USAGE-ID                                     *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-USAGE-ID     RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2200-DESC-RG-CODE-USAGE-ID.                                      
                                                                        
           MOVE '2200'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CODE-USAGE        TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-CODE-USAGE-ID     TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CODE-USAGE,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-USAGE-ID,                          
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2205-DESC-RG-CODE-USAGE-SOURCE                                 *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-USAGE-SOURCE RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2205-DESC-RG-CODE-USAGE-SOURCE.                                  
                                                                        
           MOVE '2205'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CD-USG-SRC TO WRKLEN1.                          
CVT999*    MOVE LENGTH OF CNS-RG-CODE-USAGE-SOURCE TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CD-USG-SRC,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-USAGE-SOURCE,                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2205-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2210-DESC-RG-CODE-USAGE-TYPE                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-CODE-USAGE-TYPE   RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2210-DESC-RG-CODE-USAGE-TYPE.                                    
                                                                        
           MOVE '2210'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-CD-USG-TYP        TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-CODE-USAGE-TYPE   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-CD-USG-TYP,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-CODE-USAGE-TYPE,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2210-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2220-DESC-RG-LAST-READ-DT                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-LAST-READ-DT      RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2220-DESC-RG-LAST-READ-DT.                                       
                                                                        
           MOVE '2220'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-LAST-READD        TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-LAST-READ-DT      TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-LAST-READD,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-LAST-READ-DT,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2220-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2225-DESC-RG-LAST-READ-VALUE                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-LAST-READ-VALUE   RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2225-DESC-RG-LAST-READ-VALUE.                                    
                                                                        
           MOVE '2225'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-LST-READVL        TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-LAST-READ-VALUE   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-LST-READVL,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-LAST-READ-VALUE,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
CVT999*    MOVE +3 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.                             
                                                                        
       2225-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2235-DESC-RG-REG-ID-NO                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RG-REG-ID-NO         RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2235-DESC-RG-REG-ID-NO.                                          
                                                                        
           MOVE '2235'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-RG-REG-ID-NO         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-RG-REG-ID-NO         TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-RG-REG-ID-NO,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-RG-REG-ID-NO,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2235-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2250-DESC-CP-NO-UNITS                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CP-NO-UNITS          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2250-DESC-CP-NO-UNITS.                                           
                                                                        
           MOVE '2250'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT4                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT4                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-NO-UNITS          TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CP-NO-UNITS          TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-NO-UNITS,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-NO-UNITS,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2250-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2251-DESC-CP-STATUS                                            *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CODE-PLAN-STATUS     RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2251-DESC-CP-STATUS.                                             
                                                                        
           MOVE '2251'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-CODE-PLAN         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CP-CODE-PLAN-STATUS  TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-CODE-PLAN,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-CODE-PLAN-STATUS,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2251-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2252-DESC-CP-REASON                                            *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CODE-STAT-REASON     RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2252-DESC-CP-REASON.                                             
                                                                        
           MOVE '2252'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-CD-STATRS         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CP-CODE-STAT-REASON  TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-CD-STATRS,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-CODE-STAT-REASON,                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2252-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2253-DESC-CP-SERVICE-TYPE                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CODE-SERVICE-TYPE    RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2253-DESC-CP-SERVICE-TYPE.                                       
                                                                        
           MOVE '2253'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-CD-SVC-TYP TO WRKLEN1.                          
CVT999*    MOVE LENGTH OF CNS-CP-CODE-SERVICE-TYPE TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-CD-SVC-TYP,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-CODE-SERVICE-TYPE,                      
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2253-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2254-DESC-CP-MTHLY-AMOUNT                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE MTHLY-AMOUNT-FIXED  RESULT FIELD TO THE CLIENT    *        
      ******************************************************************        
       2254-DESC-CP-MTHLY-AMOUNT.                                       
                                                                        
           MOVE '2254'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-MTLY-AMT-FX TO WRKLEN1.                         
CVT999*    MOVE LENGTH OF CNS-CP-MTHLY-AMOUNT-FIXED TO WRKLEN2.                 
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-MTLY-AMT-FX,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-MTHLY-AMOUNT-FIXED,                     
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2254-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2255-DESC-CP-RATE-ITEM                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE RATE-ITEM-CODE       RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2255-DESC-CP-RATE-ITEM.                                          
                                                                        
           MOVE '2255'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-RT-ITEM-CD TO WRKLEN1.                          
CVT999*    MOVE LENGTH OF CNS-CP-RATE-ITEM-CODE TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-RT-ITEM-CD,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-RATE-ITEM-CODE,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2255-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2256-DESC-CP-LIGHT-NO                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE LIGHT-NO             RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2256-DESC-CP-LIGHT-NO.                                           
                                                                        
           MOVE '2256'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-LIGHT-NO       TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-LIGHT-NO       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-LIGHT-NO,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-LIGHT-NO,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2256-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2257-DESC-CP-POLE-NO                                           *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE POLE-NO              RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2257-DESC-CP-POLE-NO.                                            
                                                                        
           MOVE '2257'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-POLE-NO        TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-POLE-NO        TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-POLE-NO,                                 
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-POLE-NO,                                
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2257-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2258-DESC-CP-DIST-NO                                           *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE DIST-NO              RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2258-DESC-CP-DIST-NO.                                            
                                                                        
           MOVE '2258'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-DIST-NO        TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-DIST-NO        TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-DIST-NO,                                 
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-DIST-NO,                                
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2258-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2259-DESC-CP-USAGE-FIXED                                       *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE USAGE-FIXED          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2259-DESC-CP-USAGE-FIXED.                                        
                                                                        
           MOVE '2259'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-USAGE-FIXED    TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-USAGE-FIXED    TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-USAGE-FIXED,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-USAGE-FIXED,                            
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +0 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.                             
                                                                        
       2259-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2260-DESC-CP-ITEM-SEQ-NO                                       *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE ITEM_SEQ_NO          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2260-DESC-CP-ITEM-SEQ-NO.                                        
                                                                        
           MOVE '2260'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-ITEM-SEQ-NO    TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-ITEM-SEQ-NO    TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-ITEM-SEQ-NO,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-ITEM-SEQ-NO,                            
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2260-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2261-DESC-CP-EQUIP-ID                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE UM-EQUIP-ID          RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2261-DESC-CP-EQUIP-ID.                                           
                                                                        
           MOVE '2261'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-EQUIP-ID       TO WRKLEN1.                      
CVT999*    MOVE LENGTH OF CNS-CP-EQUIP-ID       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-EQUIP-ID,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-EQUIP-ID,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2261-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2263-DESC-PREM-DIR-IND                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE PREM-DIR-IND         RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2263-DESC-PREM-DIR-IND.                                          
                                                                        
           MOVE '2263'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-PREM-DIR-IND         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-PREM-DIR-IND         TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-PREM-DIR-IND,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-PREM-DIR-IND,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2263-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2264-DESC-SUBDIV-LIGHT                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE SUBDIV-LIGHT         RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2264-DESC-SUBDIV-LIGHT.                                          
                                                                        
           MOVE '2264'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-SUBDIV-LIGHT         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-SUBDIV-LIGHT         TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-SUBDIV-LIGHT,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-SUBDIV-LIGHT,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
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.                             
                                                                        
       2264-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2265-DESC-PREM-TYPE                                            *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE PREM-TYPE            RESULT FIELD TO THE CLIENT  *         
      ******************************************************************        
       2265-DESC-PREM-TYPE.                                             
                                                                        
           MOVE '2265'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-ACCT-TYPE            TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-ACCT-TYPE            TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ACCT-TYPE,                                  
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ACCT-TYPE,                                 
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2265-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2270-DESC-CODE-RENTAL-PROP                                     *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CODE-RENTAL-PROP     RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2270-DESC-CODE-RENTAL-PROP.                                      
                                                                        
           MOVE '2270'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CD-RNTL-PROP         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CODE-RENTAL-PROP     TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CD-RNTL-PROP,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CODE-RENTAL-PROP,                          
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2270-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2275-DESC-LL-CUSTOMER-NO                                       *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE LL-CUSTOMER-NO       RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2275-DESC-LL-CUSTOMER-NO.                                        
                                                                        
           MOVE '2275'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-LL-CUSTOMER-NO     TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-LL-CUSTOMER-NO    TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-LL-CUSTOMER-NO,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-LL-CUSTOMER-NO,                            
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +0 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.                             
                                                                        
                                                                        
       2275-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2280-DESC-REV-DIST-CD                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE REV_DIST_CD          RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2280-DESC-REV-DIST-CD.                                           
                                                                        
           MOVE '2280'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-REV-DIST-CD        TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-REV-DIST-CD       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-REV-DIST-CD,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-REV-DIST-CD,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2280-EXIT.                                                       
           EXIT.                                                        
                                                                        
302442******************************************************************        
302442* 2281-DESC-MN-CODE-MTR-RD-INST1                                 *        
302442*     CALLS       TDESCRIB                                       *        
302442*                 9100-CHECK-ERROR                               *        
302442*                                                                *        
302442*     CALLED FROM 2100-DESCRIBE-RESULT                           *        
302442*                                                                *        
302442*     DESCRIBE MN-CODE-MTR-RD-INST1 RESULT FIELD TO THE CLIENT   *        
302442******************************************************************        
302442 2281-DESC-MN-CODE-MTR-RD-INST1.                                  
302442                                                                  
302442     MOVE '2281'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-CODE-MTR-RD        TO WRKLEN1.                  
CVT999*    MOVE LENGTH OF CNS-MN-CODE-MTR-RD-INST1 TO WRKLEN2.                  
302442                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-CODE-MTR-RD,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-CODE-MTR-RD-INST1,                      
CVT999*                          WRKLEN2.                                       
302442                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
302442                                                                  
302442 2281-EXIT.                                                       
302442     EXIT.                                                        
C34652                                                                  
C34652******************************************************************        
C34652* 2271-DESC-MN-METER-PRESSURE                                    *        
C34652*     CALLS       TDESCRIB                                       *        
C34652*                 9100-CHECK-ERROR                               *        
C34652*                                                                *        
C34652*     CALLED FROM 2100-DESCRIBE-RESULT                           *        
C34652*                                                                *        
C34652*     DESCRIBE MN-METER-PRESSURE RESULT FIELD TO THE CLIENT      *        
C34652******************************************************************        
C34652 2271-DESC-MN-METER-PRESSURE.                                     
C34652                                                                  
C34652     MOVE '2271'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-MN-MTR-PRESS       TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-MN-METER-PRESSURE TO WRKLEN2.                     
C34652                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-MN-MTR-PRESS,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-MN-METER-PRESSURE,                         
CVT999*                          WRKLEN2.                                       
C34652                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
C34652                                                                  
C34652 2271-EXIT.                                                       
C34652     EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2282-DESC-DISC-BAL                                             *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE DISC_BAL             RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2282-DESC-DISC-BAL.                                              
                                                                        
           MOVE '2282'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-DISC-BAL           TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-DISC-BAL          TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DISC-BAL,                                   
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-DISC-BAL,                                  
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +2 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.                             
                                                                        
                                                                        
       2282-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2283-DESC-ACCOUNT-NO                                           *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE ACCOUNT-NO           RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2283-DESC-ACCOUNT-NO.                                            
                                                                        
           MOVE '2283'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-ACCOUNT-NO         TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-ACCOUNT-NO        TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ACCOUNT-NO,                                 
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ACCOUNT-NO,                                
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +0 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.                             
                                                                        
                                                                        
       2283-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2284-DESC-ACCT-STATUS                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE ACCT-STATUS          RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2284-DESC-ACCT-STATUS.                                           
                                                                        
           MOVE '2284'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-ACCT-STATUS        TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-ACCT-STATUS       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ACCT-STATUS,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ACCT-STATUS,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2284-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2285-DESC-ROW-NO                                               *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE ROW-NO               RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2285-DESC-ROW-NO.                                                
                                                                        
           MOVE '2285'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSINT2                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSINT2                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-ROW-NO               TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-ROW-NO              TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ROW-NO,                                     
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ROW-NO,                                    
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2285-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2286-DESC-DEPOSIT-AMT                                          *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE DEPOSIT-AMT          RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2286-DESC-DEPOSIT-AMT.                                           
                                                                        
           MOVE '2286'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSDECIMAL                      TO DB-HOST-TYPE.                
CVT999*    MOVE TDSFLT8                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-DEPOSIT-AMT        TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-DEPOSIT-AMT       TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DEPOSIT-AMT,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-DEPOSIT-AMT,                               
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +2 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.                             
                                                                        
                                                                        
       2286-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2287-DESC-SECURITIES-TOT-AMT                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE SECURITIES-TOT-AMT   RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2287-DESC-SECURITIES-TOT-AMT.                                    
                                                                        
           MOVE '2286'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD 1                                 TO CTR-COLUMN.                 
CVT999*    MOVE TDSDECIMAL                       TO DB-HOST-TYPE.               
CVT999*    MOVE TDSFLT8                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-SEC-TOT-AMT         TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-SECURITIES-TOT-AMT TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-SEC-TOT-AMT,                                
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-SECURITIES-TOT-AMT,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
CVT999*    MOVE +2 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.                             
                                                                        
                                                                        
       2287-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2288-DESC-CUR-MTH-ARREARS-CD                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CUR-MTH-ARREARS-CD   RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2288-DESC-CUR-MTH-ARREARS-CD.                                    
                                                                        
           MOVE '2288'                           TO ACTIVE-PARAGRAPH.   
CVT999*    ADD 1                                 TO CTR-COLUMN.                 
CVT999*    MOVE TDSCHAR                          TO DB-HOST-TYPE.               
CVT999*    MOVE TDSCHAR                          TO DB-CLIENT-TYPE.             
CVT999*    MOVE LENGTH OF RS-CUR-MTH-ARR-CD      TO WRKLEN1.                    
CVT999*    MOVE LENGTH OF CNS-CUR-MTH-ARREARS-CD TO WRKLEN2.                    
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CUR-MTH-ARR-CD,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CUR-MTH-ARREARS-CD,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2288-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2289-DESC-CREDIT-GROUP                                         *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CREDIT-GROUP         RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2289-DESC-CREDIT-GROUP.                                          
                                                                        
           MOVE '2289'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CREDIT-GROUP       TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-CREDIT-GROUP      TO WRKLEN2.                     
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CREDIT-GROUP,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CREDIT-GROUP,                              
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2289-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2290-DESC-CURRENT-ACCOUNT                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CURRENT-ACCOUNT      RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2290-DESC-CURRENT-ACCOUNT.                                       
                                                                        
           MOVE '2290'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-CURRENT-ACCOUNT      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CURRENT-ACCOUNT     TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CURRENT-ACCOUNT,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CURRENT-ACCOUNT,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2290-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2291-DESC-PRIOR-ACCT-STAT                                      *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE PRIOR ACCT STAT      RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2291-DESC-PRIOR-ACCT-STAT.                                       
                                                                        
           MOVE '2291'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-PRIOR-ACCT-STAT      TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-PRIOR-ACCT-STAT     TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-PRIOR-ACCT-STAT,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-PRIOR-ACCT-STAT,                           
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
CVT000*****                                                                     
CVT999*    ADD  1                         TO CTR-COLUMN.                        
CVT999*    MOVE TDSCHAR                   TO DB-HOST-TYPE.                      
CVT999*    MOVE TDSCHAR                   TO DB-CLIENT-TYPE.                    
CVT999*    MOVE LENGTH OF RS-READ-CYCLE   TO WRKLEN1.                           
CVT999*    MOVE LENGTH OF CN-READ-CYCLE   TO WRKLEN2.                           
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-READ-CYCLE,                                 
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CN-READ-CYCLE,                                 
CVT999*                          WRKLEN2.                                       
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
001900                                                                  
CVT999*    ADD  1                         TO CTR-COLUMN.                        
CVT999*    MOVE TDSCHAR                   TO DB-HOST-TYPE.                      
CVT999*    MOVE TDSCHAR                   TO DB-CLIENT-TYPE.                    
CVT999*    MOVE LENGTH OF RS-SERV-STRT-DT TO WRKLEN1.                           
CVT999*    MOVE LENGTH OF CN-SERV-STRT-DT TO WRKLEN2.                           
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-SERV-STRT-DT,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CN-SERV-STRT-DT,                               
CVT999*                          WRKLEN2.                                       
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
003800                                                                  
CVT999*    ADD  1                         TO CTR-COLUMN.                        
CVT999*    MOVE TDSDECIMAL                TO DB-HOST-TYPE.                      
CVT999*    MOVE TDSFLT8                   TO DB-CLIENT-TYPE.                    
CVT999*    MOVE LENGTH OF RS-DEP-INTST-RT TO WRKLEN1.                           
CVT999*    MOVE LENGTH OF CN-DEP-INTST-RT TO WRKLEN2.                           
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DEP-INTST-RT,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CN-DEP-INTST-RT,                               
CVT999*                          WRKLEN2.                                       
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
005610                                                                  
CVT999*    MOVE +2 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.                             
006500                                                                  
CVT000*****                                                                     
       2291-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
T20443* 2292-DESC-CP-DATE-PLAN-START                                   *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE CP-DATE-PLAN-START   RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2292-DESC-CP-DATE-PLAN-START.                                    
                                                                        
           MOVE '2292'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-CP-DT-PLN-ST         TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-CP-DATE-PLAN-START   TO WRKLEN2.                  
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-CP-DT-PLN-ST,                               
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-CP-DATE-PLAN-START,                        
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2292-EXIT.                                                       
           EXIT.                                                        
                                                                        
T23507******************************************************************        
T23507* 2293-DESC-ACTIVE-CONTRACT                                      *        
T23507*     CALLS       TDESCRIB                                       *        
T23507*                 9100-CHECK-ERROR                               *        
T23507*                                                                *        
T23507*     CALLED FROM 2100-DESCRIBE-RESULT                           *        
T23507*                                                                *        
T23507*     DESCRIBE ACTIVE-CONTRACT      RESULT FIELD TO THE CLIENT   *        
T23507******************************************************************        
T23507 2293-DESC-ACTIVE-CONTRACT.                                       
T23507                                                                  
T23507     MOVE '2293'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-ACTIVE-CONTRACT    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-ACTIVE-CONTRACT   TO WRKLEN2.                     
T23507                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-ACTIVE-CONTRACT,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-ACTIVE-CONTRACT,                           
CVT999*                          WRKLEN2.                                       
T23507                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
T23507                                                                  
T23507 2293-EXIT.                                                       
T23507     EXIT.                                                        
                                                                        
T22131******************************************************************        
T22131* 2294-DESC-SECURED-RATE-FLAG                                    *        
T22131*     CALLS       TDESCRIB                                       *        
T22131*                 9100-CHECK-ERROR                               *        
T22131*                                                                *        
T22131*     CALLED FROM 2100-DESCRIBE-RESULT                           *        
T22131*                                                                *        
T22131*     DESCRIBE SECURED-RATE-FLAG    RESULT FIELD TO THE CLIENT   *        
T22131******************************************************************        
T22131 2294-DESC-SECURED-RATE-FLAG.                                     
T22131                                                                  
T22131     MOVE '2294'                          TO ACTIVE-PARAGRAPH.    
CVT999*    ADD 1                                TO CTR-COLUMN.                  
CVT999*    MOVE TDSCHAR                         TO DB-HOST-TYPE.                
CVT999*    MOVE TDSCHAR                         TO DB-CLIENT-TYPE.              
CVT999*    MOVE LENGTH OF RS-SECURED-RATE-FL    TO WRKLEN1.                     
CVT999*    MOVE LENGTH OF CNS-SECURED-RATE-FLAG TO WRKLEN2.                     
T22131                                                                  
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-SECURED-RATE-FL,                            
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-SECURED-RATE-FLAG,                         
CVT999*                          WRKLEN2.                                       
T22131                                                                  
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
T22131                                                                  
T22131 2294-EXIT.                                                       
T22131     EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2295-DESC-BNKRPT-DATE-FILED                                    *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE BNKRPT-DATE-FILED    RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2295-DESC-BNKRPT-DATE-FILED.                                     
                                                                        
           MOVE '2295'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-DATE-BNKRPT-FL       TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-DATE-BNKRPT-FILED   TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DATE-BNKRPT-FL,                             
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-DATE-BNKRPT-FILED,                         
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
                                                                        
       2295-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2296-DESC-FILED-CASE-NO                                        *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE FILED-CASE-NO        RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2296-DESC-FILED-CASE-NO.                                         
                                                                        
           MOVE '2296'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-FILED-CASE-NO        TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-FILED-CASE-NO       TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-FILED-CASE-NO,                              
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-FILED-CASE-NO,                             
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2296-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2297-DESC-DL-NO                                                *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE DL-NO                RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2297-DESC-DL-NO.                                                 
                                                                        
           MOVE '2297'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-DL-NO                TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-DL-NO               TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DL-NO,                                      
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-DL-NO,                                     
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2297-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2298-DESC-DL-STATE                                             *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE DL-STATE             RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2298-DESC-DL-STATE.                                              
                                                                        
           MOVE '2298'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-DL-STATE             TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-DL-STATE            TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-DL-STATE,                                   
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-DL-STATE,                                  
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2298-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 2299-DESC-SSN                                                  *        
      *     CALLS       TDESCRIB                                       *        
      *                 9100-CHECK-ERROR                               *        
      *                                                                *        
      *     CALLED FROM 2100-DESCRIBE-RESULT                           *        
      *                                                                *        
      *     DESCRIBE SSN                  RESULT FIELD TO THE CLIENT   *        
      ******************************************************************        
       2299-DESC-SSN.                                                   
                                                                        
           MOVE '2299'                            TO ACTIVE-PARAGRAPH.  
CVT999*    ADD 1                                  TO CTR-COLUMN.                
CVT999*    MOVE TDSCHAR                           TO DB-HOST-TYPE.              
CVT999*    MOVE TDSCHAR                           TO DB-CLIENT-TYPE.            
CVT999*    MOVE LENGTH OF RS-SSN                  TO WRKLEN1.                   
CVT999*    MOVE LENGTH OF CNS-SSN                 TO WRKLEN2.                   
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                                      
CVT999*                          GWL-RC,                                        
CVT999*                          CTR-COLUMN,                                    
CVT999*                          DB-HOST-TYPE,                                  
CVT999*                          WRKLEN1,                                       
CVT999*                          RS-SSN,                                        
CVT999*                          DB-NULL-INDICATOR,                             
CVT999*                          TDS-FALSE,                                     
CVT999*                          DB-CLIENT-TYPE,                                
CVT999*                          WRKLEN1,                                       
CVT999*                          CNS-SSN,                                       
CVT999*                          WRKLEN2.                                       
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR THRU 9100-EXIT.                             
                                                                        
       2299-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 2300-BUILD-RESULT                                              *        
      *     CALLS       2210-PROCESS-FETCH                             *        
      *                 7700-OPEN-IA-CURSOR                            *        
      *                 7800-CLOSE-IA-CURSOR                           *        
      *                                                                *        
      *     CALLED FROM 2000-PROCESS-OUTPUT                            *        
      *                                                                *        
      *     BUILD THE RESULT SET DESCRIBED ABOVE.                      *        
      ******************************************************************        
       2300-BUILD-RESULT.                                               
                                                                        
           MOVE '2300'                         TO ACTIVE-PARAGRAPH.     
           MOVE '2300-BUILD-RESULT'            TO RS-ACTIVE-PARA.       
           MOVE 'INCONSISTENT DATA'            TO RS-TABLE-NAME.        
           MOVE 0                              TO RS-ROW-NO.            
                                                                        
           PERFORM 5010-GET-PRIOR-ACCT-STATUS  THRU 5010-EXIT.          
                                                                        
      *--IF IT IS NOT A MARKETING ORDER THEN TRY TO FIND THE -->                
      *--CURRENT ACTIVE ACCOUNT AT THE PREMISE.              -->                
           IF PARM-MKTG-ORDER = 'N' OR 'D'                              
              PERFORM 5000-FETCH-CUR-ACCOUNT   THRU 5000-EXIT           
           ELSE                                                         
              MOVE WS-ACCOUNT-NO TO RS-ACCOUNT-NO                       
           END-IF.                                                      
                                                                        
           PERFORM 5025-FETCH-ACCOUNT-INFO     THRU 5025-EXIT.          
                                                                        
           IF AT-BNKRPT-CASE-NO = SPACES                                
              MOVE LOW-VALUES                  TO RS-DATE-BNKRPT-FL     
              MOVE SPACES                      TO RS-FILED-CASE-NO      
           ELSE                                                         
              PERFORM 5030-FETCH-BNKRPT-FILED-DATE THRU 5030-EXIT       
           END-IF.                                                      
                                                                        
           MOVE AT-CUSTOMER-NO                 TO CE-CUSTOMER-NO.       
           PERFORM 3950-GET-DL-INFO            THRU 3950-EXIT.          
                                                                        
           MOVE WS-PREMISE-NO                  TO AT-PREMISE-NO.        
           MOVE WS-ACCOUNT-NO                  TO UT-ACCOUNT-NO.        
                                                                        
      *-- CALLING CPD00124 -->                                                  
           PERFORM 3900-PROCESS-FORM-DATA      THRU 3900-EXIT.          
                                                                        
           PERFORM 5050-FETCH-SUBDIV-LIGHT     THRU 5050-EXIT.          
           PERFORM 5100-FETCH-PREM-DIR-IND     THRU 5100-EXIT.          
           IF WS-ACCOUNT-NO > 0                                         
               PERFORM 7400-FETCH-ACCT-TYPE    THRU 7400-EXIT           
           END-IF.                                                      
                                                                        
T23507     MOVE 'N' TO RS-ACTIVE-CONTRACT.                              
T23507     IF WS-ACCOUNT-NO > 0                                         
T23507         PERFORM 7410-FETCH-CONTRACT     THRU 7410-EXIT           
T23507     END-IF.                                                      
                                                                        
      *--CALLING CPD00068 TO GET DISCONNECT BALANCE FOR DNP -->                 
           MOVE WS-ACCOUNT-NO           TO AT-ACCOUNT-NO                
T22243     MOVE AT-COMPANY-NO           TO MC-COMPANY-NO                
T22243                                     EM-COMPANY-NO                
T22243                                     UT-COMPANY-NO                
           MOVE ZEROS                   TO RS-DISC-BAL                  
           MOVE WS-CURRENT-DATE         TO WS-CL-DATE-NOTICE-MAIL       
                                           WS-CL-DATE-NOTICE-DUE.       
                                                                        
           IF AT-ACCOUNT-NO > 0 AND PARM-RTN-DISC-BAL = WS-YES          
               MOVE WS-CURRENT-DATE     TO WS-HOLD-DATE                 
               MOVE WS-YES              TO CALC-DNP-BAL-SW              
PCR361                                     CALC-ARREARS-SW              
PCR361                                     CALC-BALANCE-SW              
               MOVE PARM-ORDER-REASON   TO WS-HOLD-DNP-TYPE             
T22359         MOVE PROGRAM-NAME          TO WS-CPD00068-CALLING-PGM    
T19557         MOVE CWS00068-FIELDS       TO WS-CWS68-FIELDS-LK         
T19557         MOVE WS-CODES-DATA-PRESENT TO WS-CODES-DATA-PRESENT-LK   
T19557         MOVE DCLCSS-ACCOUNT        TO WS-DCLCSS-ACCOUNT-LK       
T19557         MOVE ABEND-FILE            TO WS-ABEND-FILE-LK           
T19557         MOVE RS-RETURN-CODE        TO WS-RETURN-CODE-LK          
T19557         MOVE SPACES                TO ABEND-FUNCTION             
T19557         PERFORM 9500-CALL-CPD00068 THRU 9500-EXIT                
T19557         MOVE WS-CWS68-FIELDS-LK    TO CWS00068-FIELDS            
T19557         MOVE WS-ABEND-FILE-LK      TO ABEND-FILE                 
T19557         MOVE WS-DCLCSS-ACCOUNT-LK  TO DCLCSS-ACCOUNT             
T19557         MOVE WS-CODES-DATA-PRESENT-LK TO WS-CODES-DATA-PRESENT   
T19557         MOVE WS-RETURN-CODE-LK     TO RS-RETURN-CODE             
T19557         MOVE RS-RETURN-CODE        TO WS-ACTIVE-RETURN-CODE,     
T19557                                       SQLCODE                    
T19557         IF ABEND-FUNCTION  > SPACES                              
T19557            PERFORM 9700-PROCESS-ABEND   THRU 9700-EXIT           
T19557         END-IF                                                   
               MOVE WS-AMT-DNP-BAL      TO RS-DISC-BAL                  
           END-IF.                                                      
                                                                        
      *--FETCH ANY DEPOSIT PRESENT FOR THE ACCOUNT         -->                  
           PERFORM 7990-SELECT-DEPOSIT            THRU 7990-EXIT.       
                                                                        
      *--FETCH SECURITIES-AMT, ARREARS-CD AND CREDIT-GROUP -->                  
      *--ONLY IF IT IS A DNP ORDER.                        -->                  
           IF PARM-MKTG-ORDER = 'D'                                     
              PERFORM 7992-FETCH-SECURITIES-AMT   THRU 7992-EXIT        
              PERFORM 7993-FETCH-ARREARS-CD       THRU 7993-EXIT        
           ELSE                                                         
              MOVE ZEROS TO RS-SEC-TOT-AMT                              
              MOVE SPACES TO RS-CUR-MTH-ARR-CD                          
              MOVE SPACES TO RS-CREDIT-GROUP                            
           END-IF.                                                      
                                                                        
      *--IF UTILITIES ARE TO BE RETURNED THEN OPEN AND     -->                  
      *--PROCESS UT-CURSOR ELSE RETURN ONE ROW.            -->                  
           IF PARM-RETURN-UTILS = 'Y'                                   
              PERFORM 7500-OPEN-UT-CURSOR            THRU 7500-EXIT     
              PERFORM 5200-PROCESS-FETCH-UT          THRU 5200-EXIT     
                      UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND           
              PERFORM 7520-CLOSE-UT-CURSOR           THRU 7520-EXIT     
           ELSE                                                         
              IF RS-ROW-NO = 0                                          
                 PERFORM 5700-SEND-RESULT      THRU 5700-EXIT           
              END-IF                                                    
           END-IF.                                                      
                                                                        
       2300-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      *--INCLUDE CPD00124   -->                                                 
           EXEC SQL                                                             
              INCLUDE CPD00124                                                  
           END-EXEC.                                                            
                                                                        
                                                                        
      ******************************************************************        
      * 3950-GET-DL-INFO                                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     GET THE DL NUMBER, STATE AND SOCIAL SECURITY NUMBER.       *        
      ******************************************************************        
       3950-GET-DL-INFO.                                                
                                                                        
           PERFORM 3951-GET-CUST-STATS        THRU 3951-EXIT.           
                                                                        
           IF WS-IND-SSN = 0                                            
              MOVE CE-SSN                      TO RS-SSN                
           ELSE                                                         
              MOVE SPACES                      TO RS-SSN                
           END-IF.                                                      
                                                                        
           IF WS-IND-DRIVERS-STATE = 0                                  
              MOVE CE-CODE-STATE-ID            TO RS-DL-STATE           
           ELSE                                                         
              MOVE SPACES                      TO RS-DL-STATE           
           END-IF.                                                      
                                                                        
           IF WS-IND-DRIVERS-NUMBER = 0                                 
              MOVE CE-DRIVERS-LICENSE-NO       TO RS-DL-NO              
           ELSE                                                         
              MOVE SPACES                      TO RS-DL-NO              
           END-IF.                                                      
                                                                        
       3950-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 3951-GET-CUST-STATS                                            *        
      *                                                                *        
      *     CALLED FROM 3950-GET-DL-INFO                               *        
      *                                                                *        
      *     GET THE CUSTOMER STATS FOR THIS ACCOUNT.                   *        
      ******************************************************************        
       3951-GET-CUST-STATS.                                             
                                                                        
           MOVE '3951'                        TO ACTIVE-PARAGRAPH.      
           MOVE '3951-GET-CUST-STATS'         TO RS-ACTIVE-PARA.        
                                                                        
           EXEC SQL                                                     
               SELECT SSN               ,                               
                      DRIVERS_LICENSE_NO,                               
                      CODE_STATE_ID                                     
                 INTO :CE-SSN :WS-IND-SSN,                               
                      :CE-DRIVERS-LICENSE-NO :WS-IND-DRIVERS-NUMBER,     
                      :CE-CODE-STATE-ID :WS-IND-DRIVERS-STATE            
                 FROM CSS_CUST_STATS                                    
                WHERE CUSTOMER_NO   = :CE-CUSTOMER-NO                   
                  AND CUSTOMER_TYPE = 'C'                               
           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  
CBSI                                             RS-RETURN-CODE.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_CUST_STATS'           TO TABLE-1                
              MOVE 'CUSTOMER_NO'              TO TABLE-ELEMENT-1        
              MOVE CE-CUSTOMER-NO             TO HOSTVAR-ELEMENT-1      
              MOVE 'CUSTOMER_TYPE'            TO TABLE-ELEMENT-2        
T16498        MOVE 'C'                        TO HOSTVAR-ELEMENT-2      
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-3      
CBSI          MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       3951-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 5000-FETCH-CUR-ACCOUNT.                                        *        
      *     CALLS       7950-FETCH-CUR-ACCT                            *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     FETCH CURRENT ACCOUNT AT THE PREMISE FOR THE COMPANY.      *        
      ******************************************************************        
                                                                        
       5000-FETCH-CUR-ACCOUNT.                                          
           MOVE '5000'                          TO ACTIVE-PARAGRAPH.    
           MOVE '5000-FETCH-CUR-ACCOUNT'        TO RS-ACTIVE-PARA.      
           MOVE 'FIND CURRENT ACC AT PREMISE'   TO RS-TABLE-NAME.       
                                                                        
      *    PERFORM 7950-FETCH-CUR-ACCT          THRU 7950-EXIT.                 
           PERFORM 7850-NULL-END-DATE THRU 7850-EXIT.                   
                                                                        
      *--IF AN ACTIVE ACCOUNT IS PRESENT USE THAT ELSE          --*             
      *--USE THE ACCOUNT NO PASSED AS PARAMETER.                --*             
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND               
             WS-NULL-INDICATOR NOT EQUAL -1                             
              MOVE RS-ACCOUNT-NO    TO WS-ACCOUNT-NO                    
           ELSE                                                         
              MOVE WS-ACCOUNT-NO    TO RS-ACCOUNT-NO                    
           END-IF.                                                      
                                                                        
      *-- CHECK IF ACCOUNT IS THE CURRENT ACCOUNT AT THE PREMISE --*            
      *    PERFORM 7951-VALIDATE-ACCOUNT     THRU 7951-EXIT.                    
           PERFORM 7880-VALIDATE-ACCOUNT     THRU 7880-EXIT.            
                                                                        
       5000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5010-GET-PRIOR-ACCT-STATUS                                     *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     FETCH THE STATUS OF THE PRIOR ACCOUNT NUMBER THAT WAS      *        
      *     PASSED INTO THE S210 ROUTINE.                                       
      ******************************************************************        
       5010-GET-PRIOR-ACCT-STATUS.                                      
                                                                        
           MOVE '5010'                       TO ACTIVE-PARAGRAPH.       
           MOVE '5010-GET-PRIOR-ACCT-STATUS' TO RS-ACTIVE-PARA.         
           MOVE 'CSS_ACCOUNT'                TO RS-TABLE-NAME.          
                                                                        
           EXEC SQL                                                     
               SELECT CODE_ACCT_STAT                                    
                 INTO :RS-PRIOR-ACCT-STAT                               
                 FROM CSS_ACCOUNT                                       
                WHERE ACCOUNT_NO = :WS-ACCOUNT-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.        
                                                                        
      *    COMMENTED OUT DUE TO TPR #4581.                                      
      *    IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                           
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_ACCOUNT'              TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       5010-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5025-FETCH-ACCOUNT-INFO.                                       *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     FETCH ACCOUNT INFO TO BE USED IN CPD00068                  *        
      ******************************************************************        
       5025-FETCH-ACCOUNT-INFO.                                         
                                                                        
           MOVE '5025'                    TO ACTIVE-PARAGRAPH.          
           MOVE '5025-FETCH-ACCOUNT-INFO' TO RS-ACTIVE-PARA.            
           MOVE 'CSS_ACCOUNT'             TO RS-TABLE-NAME.             
                                                                        
           EXEC SQL                                                     
               SELECT COMPANY_NO        ,                               
                      LOCAL_OFFICE      ,                               
                      BANKRUPTCY_IND    ,                               
                      DATE_BILL_DAY_00  ,                               
                      DATE_BILL_DAY_30  ,                               
                      DATE_BILL_DAY_60  ,                               
                      DATE_BILL_DAY_90  ,                               
                      NOTICE_EXEMPT_CD  ,                               
                      CODE_DISC_OK      ,                               
                      CODES_DATA_PRESENT,                               
                      CREDIT_GROUP      ,                               
                      BNKRPT_CASE_NO    ,                               
                      CODE_ACCT_STAT    ,                               
                      CUSTOMER_NO       ,                               
C28788                IVR_EXEMPT_CD                                     
                 INTO :AT-COMPANY-NO                        ,           
                      :AT-LOCAL-OFFICE                      ,           
                      :AT-BANKRUPTCY-IND                    ,           
                      :AT-DATE-BILL-DAY-00 :WS-BILL-DAY-00-NI,           
                      :AT-DATE-BILL-DAY-30 :WS-BILL-DAY-30-NI,           
                      :AT-DATE-BILL-DAY-60 :WS-BILL-DAY-60-NI,           
                      :AT-DATE-BILL-DAY-90 :WS-BILL-DAY-90-NI,           
                      :AT-NOTICE-EXEMPT-CD                  ,           
                      :AT-CODE-DISC-OK                      ,           
                      :AT-CODES-DATA-PRESENT                ,           
                      :AT-CREDIT-GROUP                      ,           
                      :AT-BNKRPT-CASE-NO                    ,           
                      :AT-CODE-ACCT-STAT                    ,           
                      :AT-CUSTOMER-NO                       ,           
C28788                :AT-IVR-EXEMPT-CD                                 
                 FROM CSS_ACCOUNT                                       
                WHERE ACCOUNT_NO = :WS-ACCOUNT-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      
              IF WS-BILL-DAY-00-NI < 0                                  
                  MOVE LOW-VALUES           TO AT-DATE-BILL-DAY-00      
              END-IF                                                    
              IF WS-BILL-DAY-30-NI < 0                                  
                  MOVE LOW-VALUES           TO AT-DATE-BILL-DAY-30      
              END-IF                                                    
              IF WS-BILL-DAY-60-NI < 0                                  
                  MOVE LOW-VALUES           TO AT-DATE-BILL-DAY-60      
              END-IF                                                    
              IF WS-BILL-DAY-90-NI < 0                                  
                  MOVE LOW-VALUES           TO AT-DATE-BILL-DAY-90      
              END-IF                                                    
T8534         IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                      
T8534            MOVE ZEROS                 TO AT-CUSTOMER-NO           
T8534         END-IF                                                    
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_ACCOUNT'              TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       5025-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 5030-FETCH-BNKRPT-FILED-DATE                                   *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     GET THE DATE BANKRUPT FILED FROM THE CSS_BANKRUPTCY TABLE  *        
      *     FROM THE BANKRUPT CASE NO FOR THE ACCOUNT.                 *        
      ******************************************************************        
       5030-FETCH-BNKRPT-FILED-DATE.                                    
                                                                        
           MOVE '5030'                          TO ACTIVE-PARAGRAPH.    
           MOVE '5000-FETCH-BNKRPT-FILED-DATE'  TO RS-ACTIVE-PARA.      
           MOVE 'FIND BANKRUPTCY FILED DATE'    TO RS-TABLE-NAME.       
                                                                        
           EXEC SQL                                                     
               SELECT DATE_BNKRPT_FILED,                                
                      FILED_CASE_NO                                     
                 INTO :BQ-DATE-BNKRPT-FILED :WS-BNKRPT-DATE-IND,         
                      :BQ-FILED-CASE-NO                                 
                 FROM CSS_BANKRUPTCY                                    
                WHERE BNKRPT_CASE_NO = :AT-BNKRPT-CASE-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                   
              IF WS-BNKRPT-DATE-IND = 0                                 
                 MOVE BQ-DATE-BNKRPT-FILED    TO RS-DATE-BNKRPT-FL      
                 MOVE BQ-FILED-CASE-NO        TO RS-FILED-CASE-NO       
              ELSE                                                      
                 MOVE LOW-VALUES              TO RS-DATE-BNKRPT-FL      
              END-IF                                                    
           ELSE IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                    
              MOVE LOW-VALUES                 TO RS-DATE-BNKRPT-FL      
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_BANKRUPTCY'           TO TABLE-1                
              MOVE 'BNKRPT_CASE_NO'           TO TABLE-ELEMENT-1        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-2        
              MOVE AT-BNKRPT-CASE-NO          TO HOSTVAR-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF
           END-IF.                                                      
                                                                        
       5030-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 5050-FETCH-SUBDIV-LIGHT.                                       *        
      *     CALLS       7000-FETCH-RATE-ITEM-CODE                      *        
      *                 7100-FETCH-VERSION-NO                          *        
      *                 7200-FETCH-PRICE-PER-SERV                      *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     FETCH PRICE PER SERVICE FOR SUBDIV. LIGHTING               *        
      ******************************************************************        
       5050-FETCH-SUBDIV-LIGHT.                                         
                                                                        
           MOVE '5050'                           TO ACTIVE-PARAGRAPH.   
           MOVE '5050-FETCH-SUBDIV-LIGHT'        TO RS-ACTIVE-PARA.     
           MOVE 'FETCH PRICE FOR SUBDIV. LIGHTS' TO RS-TABLE-NAME.      
                                                                        
           MOVE WS-SUBDIV-PLAN                   TO WS-RATE-PLAN-NO.    
                                                                        
           EXEC SQL                                                     
REARCH         SELECT
              CAST(SYSDATETIMEOFFSET() AS DATE)
            INTO
              :WS-CURRENT-DATE                      
           END-EXEC.                                                    

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

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

                                                                        
CBSI       MOVE SQLCODE                         TO WS-ACTIVE-RETURN-CODE
CBSI                                               RS-RETURN-CODE.      
CBSI                                                                    
CBSI       IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
CBSI          NEXT SENTENCE                                             
CBSI       ELSE                                                         
CBSI          MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
CBSI          MOVE '5050'                       TO ACTIVE-PARAGRAPH     
REARCH        MOVE 'SET'                        TO ABEND-FUNCTION       
REARCH        MOVE 'SET'                        TO TABLE-1              
CBSI          MOVE 'ACCOUNT_NO'                 TO TABLE-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1    
CBSI          MOVE 'N'                          TO SEND-DONE-SW         
CBSI          PERFORM 8100-SEND-RESULT          THRU 8100-EXIT          
CBSI          PERFORM 8900-SEND-DONE            THRU 8900-EXIT          
CBSI          PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          
CBSI       END-IF.                                                      
                                                                        
      *--'64' IS THE RATE PLAN NO FOR SUBDIVISION LIGHTS. TO -->                
      *--FIND PRICE PER SERVICE FIRST FIND RATE ITEM CODE    -->                
      *--AND VERSION NO.                                     -->                
           PERFORM 7000-FETCH-RATE-ITEM-CODE    THRU 7000-EXIT.         
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              PERFORM 7100-FETCH-VERSION-NO        THRU 7100-EXIT       
           ELSE                                                         
              NEXT SENTENCE                                             
           END-IF.                                                      
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              PERFORM 7200-FETCH-PRICE-PER-SERV    THRU 7200-EXIT       
           ELSE                                                         
              NEXT SENTENCE                                             
           END-IF.                                                      
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
P00480        IF WS-PRICE-PER-SERVICE > 0 AND                           
P00480           WS-PRICE-PER-SERVICE < 1                               
P00480               MOVE 1 TO WS-PRICE-PER-SERVICE                     
P00480        END-IF                                                    
              MOVE WS-PRICE-PER-SERVICE TO RS-SUBDIV-LIGHT              
           END-IF.                                                      
                                                                        
       5050-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5100-FETCH-PREM-DIR-IND.                                       *        
      *     CALLS       7300-FETCH-PREMISE                             *        
      *                 7310-FETCH-LANDLORD                            *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     FETCH PREMISE DIRECTIONS/INSTRUCTIONS INDICATOR            *        
      ******************************************************************        
                                                                        
       5100-FETCH-PREM-DIR-IND.                                         
           MOVE '5100'                          TO ACTIVE-PARAGRAPH.    
           MOVE '5100-FETCH-PREM-DIR-IND'       TO RS-ACTIVE-PARA.      
           PERFORM 7300-FETCH-PREMISE           THRU 7300-EXIT.         
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              IF WS-PREMISE-DIRECTIONS IS EQUAL SPACES                  
                 AND WS-SPCL-INSTRUCTIONS IS EQUAL SPACES               
                 AND WS-SPCL-READ-INSTR IS EQUAL SPACES                 
                  MOVE 'N' TO RS-PREM-DIR-IND                           
              ELSE                                                      
                  MOVE 'Y' TO RS-PREM-DIR-IND                           
              END-IF                                                    
           END-IF.                                                      
           PERFORM 7310-FETCH-LANDLORD          THRU 7310-EXIT.         
P00390     PERFORM 7320-GET-ZIP-CODE            THRU 7320-EXIT.         
P00390     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
P00390        PERFORM 7330-GET-SPCL-MSG-ZIP   THRU 7330-EXIT            
P00390        MOVE A4-ERROR-MSG-NO            TO RS-A4-ERROR-MSG-NO-ZIP 
P00390     ELSE                                                         
P00390        MOVE ZERO                       TO RS-RETURN-CODE         
P00390        MOVE SPACES                     TO RS-A4-ERROR-MSG-NO-ZIP 
P00390     END-IF.                                                      
                                                                        
       5100-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5200-PROCESS-FETCH-UT                                          *        
      *     CALLS       7510-FETCH-UTIL-ENVRNMT                        *        
      *                 8100-SEND-RESULT                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     READ EACH RETURNED ROW OF CSS_UTIL_ENVRNMT,  FORMAT IT   *          
      *     AND SEND IT BACK                                           *        
      ******************************************************************        
                                                                        
       5200-PROCESS-FETCH-UT.                                           
           MOVE '5200'                             TO ACTIVE-PARAGRAPH  
           MOVE '5200-PROCESS-FETCH-UT'            TO RS-ACTIVE-PARA.   
           MOVE 'PROCESSING CURSOR FOR UTILITIES'  TO RS-TABLE-NAME.    
                                                                        
           PERFORM 7510-FETCH-UTIL-ENVRNMT        THRU 7510-EXIT.       
                                                                        
      *--IF ROWS ARE FOUND CONTINUE PROCESSING ELSE SEND 1 ROW -->              
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T14862        IF UT-RATE-PLAN-NO = '064'                                
T14862           GO TO 5200-PROCESS-FETCH-UT                            
T14862        END-IF                                                    
              PERFORM 7991-FETCH-RATE-DESC  THRU 7991-EXIT              
              IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                
                 MOVE WS-ACTIVE-RETURN-CODE    TO RS-RETURN-CODE        
                 MOVE 'UT'                     TO RS-TABLE-ID           
                 MOVE UT-CODE-UTIL-TYPE        TO RS-UT-CODE-UTIL-TY    
                 MOVE UT-IC-NO                 TO RS-UT-IC-NO           
                 MOVE UT-CODE-REVENUE-CLASS    TO RS-UT-CODE-REV-CLA    
                 MOVE UT-RATE-PLAN-NO          TO RS-UT-RATE-PLAN-NO    
                 MOVE UT-READ-CYCLE            TO RS-UT-READ-CYCLE      
                 MOVE UT-READ-ROUTE            TO RS-UT-READ-ROUTE      
P00390           IF UT-READ-CYCLE > SPACES AND UT-READ-ROUTE > 0        
P00390              PERFORM 7994-GET-SPCL-MSG-RTE THRU 7994-EXIT        
P00390              IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL          
P00390                 MOVE O2-ERROR-MSG-NO    TO RS-O2-ERROR-MSG-NO-RTE
P00390              ELSE                                                
P00390                 MOVE ZERO               TO RS-RETURN-CODE        
P00390                 MOVE SPACES             TO RS-O2-ERROR-MSG-NO-RTE
P00390              END-IF                                              
P00390           ELSE                                                   
P00390              MOVE SPACES                TO RS-O2-ERROR-MSG-NO-RTE
P00390           END-IF                                                 
                 MOVE UT-CODE-SIC-NO           TO RS-UT-CODE-SIC-NO     
                 MOVE RD-RATE-DESC             TO RS-UT-RATE-DESC       
                                                                        
                 MOVE SPACES     TO   RS-MN-METER-NO,                   
                                      RS-MN-CD-STUS-RS,                 
                                      RS-MN-CODE-USAGE-T,               
                                      RS-MN-CODE-USAGE-I,               
                                      RS-MN-CODE-USAGE-S,               
                                      RS-MN-CODE-METER-S,               
                                      RS-MN-METER-SUPPLY,               
                                      RS-MN-CODE-METER-L,               
                                      RS-MN-METER-LOC-DE,               
                                      RS-MN-METER-IND,                  
                                      RS-RG-CODE-STATUS,                
                                      RS-RG-CODE-USAGE,                 
                                      RS-RG-CD-USG-SRC,                 
                                      RS-RG-CD-USG-TYP,                 
                                      RS-RG-LAST-READD,                 
                                      RS-CP-CODE-PLAN,                  
                                      RS-CP-CD-STATRS,                  
                                      RS-CP-CD-SVC-TYP,                 
                                      RS-CP-POLE-NO,                    
                                      RS-CP-DIST-NO,                    
                                      RS-CP-EQUIP-ID,                   
T20443                                RS-CP-DT-PLN-ST,                  
302442                                RS-MN-CODE-MTR-RD,                
C34652                                RS-MN-MTR-PRESS                   
                                                                        
                 MOVE ZEROS      TO   RS-MN-MTR-REF-NO,                 
                                      RS-MN-CODE-TIME-PE,               
                                      RS-MN-CONSTANT,                   
                                      RS-MN-NO-DIALS,                   
                                      RS-CP-LIGHT-NO,                   
                                      RS-MN-LAST-READ-VA,               
                                      RS-RG-CODE-TIME-P,                
                                      RS-RG-LST-READVL,                 
                                      RS-RG-REG-ID-NO,                  
                                      RS-CP-NO-UNITS,                   
                                      RS-CP-MTLY-AMT-FX,                
                                      RS-CP-RT-ITEM-CD,                 
                                      RS-CP-USAGE-FIXED,                
                                      RS-CP-ITEM-SEQ-NO                 
                 ADD 1 TO RS-ROW-NO                                     
                 PERFORM 8100-SEND-RESULT      THRU 8100-EXIT           
                                                                        
T14862*--AFTER SENDING THE UTILITY ROW, OPEN AND PROCESS        -->             
T14862*--THE ROWS IN CSS_CUST_PLAN (PRIVATE LIGHTS) ,THEN       -->             
      *--OPEN AND PROCESS THE ROWS IN CSS_MTRD_ENVRNMT (METERS) -->             
T14862            PERFORM 7800-OPEN-CP-CURSOR        THRU 7800-EXIT     
T14862            PERFORM 5500-PROCESS-FETCH-CP      THRU 5500-EXIT     
                         UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND        
T14862            PERFORM 7820-CLOSE-CP-CURSOR       THRU 7820-EXIT     
T14862            PERFORM 7600-OPEN-MN-CURSOR        THRU 7600-EXIT     
T14862            PERFORM 5300-PROCESS-FETCH-MN      THRU 5300-EXIT     
                        UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND         
T14862            PERFORM 7620-CLOSE-MN-CURSOR       THRU 7620-EXIT     
              END-IF                                                    
           ELSE                                                         
               IF RS-ROW-NO = 0                                         
                  PERFORM 5700-SEND-RESULT     THRU 5700-EXIT           
           END-IF
           END-IF.                                                      
                                                                        
       5200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5300-PROCESS-FETCH-MN                                          *        
      *     CALLS       7610-FETCH-MTRD-ENVRNMT                        *        
      *                 8100-SEND-RESULT                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     READ EACH RETURNED ROW OF CSS_MTRD_ENVRNMT,  FORMAT IT   *          
      *     AND SEND IT BACK                                           *        
      ******************************************************************        
       5300-PROCESS-FETCH-MN.                                           
           MOVE '5300'                            TO ACTIVE-PARAGRAPH.  
           MOVE '5300-PROCESS-FETCH-MN'           TO RS-ACTIVE-PARA.    
           MOVE 'PROCESSING METER CURSOR'         TO RS-TABLE-NAME.     
                                                                        
           PERFORM 7610-FETCH-MTRD-ENVRNMT THRU 7610-EXIT.              
                                                                        
      *--IF A METER ROW IS FOUND THEN SEND ROW AND LOOK FOR -->                 
      *--REGISTERS AND PROCESS REGISTERS IF THERE ARE ANY.  -->                 
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
                                                                        
              MOVE WS-ACTIVE-RETURN-CODE    TO RS-RETURN-CODE           
              MOVE 'MN'                     TO RS-TABLE-ID              
              MOVE MN-METER-NO              TO RS-MN-METER-NO           
              MOVE MN-MTR-REF-NO            TO RS-MN-MTR-REF-NO         
              MOVE MN-CODE-TIME-PERIOD      TO RS-MN-CODE-TIME-PE       
              MOVE MN-LAST-READ-VALUE       TO RS-MN-LAST-READ-VA       
              MOVE MN-REG-ID-NO             TO RS-RG-REG-ID-NO          
              MOVE MN-LAST-REG-READ-DATE    TO RS-RG-LAST-READD         
              MOVE MN-CODE-STATUS-REAS      TO RS-MN-CD-STUS-RS         
              MOVE MN-CODE-USAGE-TYPE       TO RS-MN-CODE-USAGE-T       
              MOVE MN-CODE-USAGE-ID         TO RS-MN-CODE-USAGE-I       
              MOVE MN-CODE-USAGE-SOURCE     TO RS-MN-CODE-USAGE-S       
              MOVE MN-CODE-METER-STATUS     TO RS-MN-CODE-METER-S       
              MOVE MN-METER-SUPPLYING       TO RS-MN-METER-SUPPLY       
              MOVE MN-CODE-METER-LOC        TO RS-MN-CODE-METER-L       
              MOVE MN-DIST-NODE-POINT       TO RS-MN-DIST-NODE-PO       
      *       MOVE MN-POINT-ID              TO RS-MN-POINT-ID                   
T24056        MOVE MN-GIS-POINT-ID          TO RS-MN-POINT-ID           
              MOVE MN-SEAL-CODE-ID          TO RS-MN-SEAL-CODE-ID       
              MOVE MN-HEXAGRAM-LOCATION     TO RS-MN-HEX-LOCATION       
              MOVE MN-INSULATED-IND         TO RS-MN-INSULATED-IN       
              MOVE MN-LOCK-TYPE-ID          TO RS-MN-LOCK-TYPE-ID       
              MOVE MN-DELIVERY-LEVEL-CD     TO RS-MN-DELIVERY-LEV       
              MOVE MN-UTILITY-SOURCE-CD     TO RS-MN-UTILITY-SOUR       
              MOVE MN-IDR-RECIPIENT-CD      TO RS-MN-IDR-RECIPIEN       
              MOVE MN-PROGRAM-ID            TO RS-MN-PROGRAM-ID         
              MOVE MN-MTR-READ-SOURCE-CD    TO RS-MN-MTR-READ-SO        
A00714        IF WS-NULL-CONSTANT-MLOC < ZEROS                          
A00714           MOVE ' '                   TO RS-MN-METER-LOC-DE       
A00714        ELSE                                                      
A00714           MOVE Q4-METER-LOC-DESC        TO RS-MN-METER-LOC-DE    
A00714        END-IF                                                    
A00714        IF WS-NULL-CONSTANT < ZEROS                               
A00714           MOVE 1                     TO RS-MN-CONSTANT,          
A00714                                         MC-CONSTANT              
A00714        ELSE                                                      
                 MOVE MC-CONSTANT           TO RS-MN-CONSTANT           
A00714        END-IF                                                    
A00714        IF WS-NULL-NO-DIALS < ZEROS                               
A00714           MOVE '5'                   TO RS-MN-NO-DIALS           
A00714        ELSE                                                      
                 MOVE MC-NO-READ-DIALS      TO RS-MN-NO-DIALS           
A00714        END-IF                                                    
A00714        IF WS-NULL-CODE-CAP < ZEROS                               
A00714           MOVE 'A'                   TO MC-CODE-CAP-TYPE         
A00714        END-IF                                                    
302442        MOVE MN-CODE-MTR-RD-INST1     TO RS-MN-CODE-MTR-RD        
C34652        MOVE MN-METER-PRESSURE        TO WS-MN-METER-PRESSURE     
C34652        MOVE WS-MN-METER-PRESSURE     TO RS-MN-MTR-PRESS          
                                                                        
P00447        IF MC-CODE-CAP-TYPE = 'A' AND (MC-CONSTANT > 1 OR         
P00447                                       MC-CONSTANT = 0)           
                 MOVE 'Y' TO RS-MN-METER-IND                            
              ELSE                                                      
                 MOVE 'N' TO RS-MN-METER-IND                            
              END-IF                                                    
                                                                        
              MOVE SPACES       TO    RS-RG-CODE-STATUS,                
                                      RS-RG-CODE-USAGE,                 
                                      RS-RG-CD-USG-SRC,                 
                                      RS-RG-CD-USG-TYP,                 
                                      RS-CP-CD-STATRS,                  
                                      RS-CP-CD-SVC-TYP,                 
                                      RS-CP-POLE-NO,                    
                                      RS-CP-DIST-NO,                    
                                      RS-CP-EQUIP-ID,                   
T20443                                RS-CP-DT-PLN-ST                   
                                                                        
              MOVE ZEROS        TO    RS-RG-CODE-TIME-P,                
                                      RS-RG-LST-READVL,                 
                                      RS-CP-LIGHT-NO,                   
                                      RS-CP-NO-UNITS,                   
                                      RS-CP-MTLY-AMT-FX,                
                                      RS-CP-RT-ITEM-CD,                 
                                      RS-CP-USAGE-FIXED,                
                                      RS-CP-ITEM-SEQ-NO                 
                                                                        
T14716        IF UT-CODE-UTIL-TYPE = 'E'                                
A00714         IF WS-NULL-NO-DIALS < ZEROS                              
A00714          CONTINUE                                                
A00714         ELSE                                                     
T14716          PERFORM 7615-SELECT-ELEC-METER THRU 7615-EXIT           
P00447          IF EM-AMPS <= 10 AND                                    
P00447                (MC-CONSTANT < 1 AND MC-CONSTANT NOT = 0)         
                   MOVE 5000                  TO RS-RETURN-CODE         
                END-IF                                                  
A00714         END-IF                                                   
              END-IF                                                    
                                                                        
              ADD 1                         TO RS-ROW-NO                
              PERFORM 8100-SEND-RESULT      THRU 8100-EXIT              
                                                                        
      *--IF CODE DATA PRESENT IN MTRD_ENVRNMT IS 'A' THEN -->                   
      *--ADDITIONAL REGISTERS ARE PRESENT AND NEED TO BE  -->                   
      *--PROCESSED BY USING THE RG-CURSOR.                -->                   
              IF MN-CODE-DATA-PRESENT = 'A'                             
                  PERFORM 7700-OPEN-RG-CURSOR            THRU 7700-EXIT 
                  PERFORM 5400-PROCESS-FETCH-RG          THRU 5400-EXIT 
                          UNTIL WS-ACTIVE-RETURN-CODE = NOT-FOUND       
                  PERFORM 7720-CLOSE-RG-CURSOR           THRU 7720-EXIT 
              END-IF                                                    
           END-IF.                                                      
                                                                        
       5300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5400-PROCESS-FETCH-RG                                          *        
      *     CALLS       7710-FETCH-REGISTER-READ                       *        
      *                 8100-SEND-RESULT                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     READ EACH RETURNED ROW OF CSS_REGISTER_READ, FORMAT IT   *          
      *     AND SEND IT BACK                                           *        
      ******************************************************************        
                                                                        
       5400-PROCESS-FETCH-RG.                                           
           MOVE '5400'                           TO ACTIVE-PARAGRAPH    
           MOVE '5400-PROCESS-FETCH-RG'          TO RS-ACTIVE-PARA      
           MOVE 'PROCESSING OF REGISTER CURSOR'  TO RS-TABLE-NAME.      
                                                                        
           PERFORM 7710-FETCH-REGISTER-READ       THRU 7710-EXIT.       
                                                                        
      *--IF REGISTERS ARE FOUND THEN PROCESS EACH ROW -->                       
      *--AND SEND BACK REGISTER ROW.                  -->                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
                                                                        
              MOVE WS-ACTIVE-RETURN-CODE    TO RS-RETURN-CODE           
              MOVE 'RG'                     TO RS-TABLE-ID              
              MOVE RG-CODE-REG-STATUS       TO RS-RG-CODE-REG-ST        
              MOVE RG-CODE-STATUS-REAS      TO RS-RG-CODE-STATUS        
              MOVE RG-CODE-TIME-PERIOD      TO RS-RG-CODE-TIME-P        
              MOVE RG-CODE-USAGE-ID         TO RS-RG-CODE-USAGE         
              MOVE RG-CODE-USAGE-SOURCE     TO RS-RG-CD-USG-SRC         
              MOVE RG-CODE-USAGE-TYPE       TO RS-RG-CD-USG-TYP         
              MOVE RG-LAST-REG-READ-DT      TO RS-RG-LAST-READD         
              MOVE RG-LAST-READ-VALUE       TO RS-RG-LST-READVL         
              MOVE RG-REG-ID-NO             TO RS-RG-REG-ID-NO          
A00714        IF WS-NULL-CONSTANT < ZEROS                               
A00714           MOVE 1                     TO RS-MN-CONSTANT           
A00714           MOVE 1                     TO MC-CONSTANT              
A00714        ELSE                                                      
                 MOVE MC-CONSTANT           TO RS-MN-CONSTANT           
A00714        END-IF                                                    
A00714        IF WS-NULL-NO-DIALS < ZEROS                               
A00714           MOVE '5'                   TO RS-MN-NO-DIALS           
A00714        ELSE                                                      
                 MOVE MC-NO-READ-DIALS      TO RS-MN-NO-DIALS           
A00714        END-IF                                                    
A00714        IF WS-NULL-CODE-CAP < ZEROS                               
A00714           MOVE 'A'                   TO MC-CODE-CAP-TYPE         
A00714        END-IF                                                    
                                                                        
P00447        IF MC-CODE-CAP-TYPE = 'A' AND (MC-CONSTANT > 1 OR         
P00447                                       MC-CONSTANT = 0)           
                 MOVE 'Y' TO RS-MN-METER-IND                            
              ELSE                                                      
                 MOVE 'N' TO RS-MN-METER-IND                            
              END-IF                                                    
                                                                        
              MOVE SPACES TO          RS-CP-CD-STATRS,                  
                                      RS-CP-CD-SVC-TYP,                 
                                      RS-CP-POLE-NO,                    
                                      RS-CP-DIST-NO,                    
                                      RS-CP-EQUIP-ID,                   
T20443                                RS-CP-DT-PLN-ST                   
                                                                        
             MOVE ZEROS TO            RS-CP-LIGHT-NO,                   
                                      RS-CP-NO-UNITS,                   
                                      RS-CP-MTLY-AMT-FX,                
                                      RS-CP-RT-ITEM-CD,                 
                                      RS-CP-USAGE-FIXED,                
                                      RS-CP-ITEM-SEQ-NO                 
              ADD  1                        TO RS-ROW-NO                
              PERFORM 8100-SEND-RESULT      THRU 8100-EXIT              
           END-IF.                                                      
                                                                        
       5400-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5500-PROCESS-FETCH-CP                                          *        
      *     CALLS       7810-FETCH-CUST-PLAN                           *        
      *                 8100-SEND-RESULT                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     READ EACH RETURNED ROW OF CSS_CUST_PLAN,     FORMAT IT   *          
      *     AND SEND IT BACK                                           *        
      ******************************************************************        
                                                                        
       5500-PROCESS-FETCH-CP.                                           
           MOVE '5500'                            TO ACTIVE-PARAGRAPH   
           MOVE '5500-PROCESS-FETCH-CP'           TO RS-ACTIVE-PARA     
           MOVE 'PROCESSING CUST PLAN CURSOR'     TO RS-TABLE-NAME.     
                                                                        
           PERFORM 7810-FETCH-CUST-PLAN           THRU 7810-EXIT.       
                                                                        
      *--IF A CUSTOMER PLAN IS FOUND, FIND DESCRIPTION FOR -->                  
      *--FOR THE UNMETERED RATE PLAN AND SEND ROW BACK.    -->                  
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              PERFORM 5600-FETCH-RATE-DESC  THRU 5600-EXIT              
                                                                        
T14862        IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND   
                 MOVE WS-ACTIVE-RETURN-CODE    TO RS-RETURN-CODE        
                 MOVE 'CP'                     TO RS-TABLE-ID           
                 MOVE CP-ITEM-SEQ-NO         TO RS-CP-ITEM-SEQ-NO       
                 MOVE CP-NO-UNITS            TO RS-CP-NO-UNITS          
                 MOVE CP-CODE-PLAN-STATUS    TO RS-CP-CODE-PLAN         
                 MOVE CP-CODE-STAT-REASON    TO RS-CP-CD-STATRS         
                 MOVE CP-CODE-SERVICE-TYPE   TO RS-CP-CD-SVC-TYP        
                 MOVE CP-MTHLY-AMOUNT-FIXED TO RS-CP-MTLY-AMT-FX        
                 MOVE CP-RATE-ITEM-CODE        TO RS-CP-RT-ITEM-CD      
                 MOVE CP-LIGHT-NO              TO RS-CP-LIGHT-NO        
                 MOVE CP-POLE-NO               TO RS-CP-POLE-NO         
                 MOVE CP-DIST-NO               TO RS-CP-DIST-NO         
                 MOVE CP-USAGE-FIXED           TO RS-CP-USAGE-FIXED     
                                                                        
                 MOVE SPACES        TO   RS-MN-METER-NO,                
                                         RS-MN-CD-STUS-RS,              
                                         RS-MN-CODE-USAGE-T,            
                                         RS-MN-CODE-USAGE-I,            
                                         RS-MN-CODE-USAGE-S,            
                                         RS-MN-CODE-METER-S,            
                                         RS-MN-METER-SUPPLY,            
                                         RS-MN-CODE-METER-L,            
                                         RS-MN-METER-LOC-DE,            
                                         RS-MN-METER-IND,               
                                         RS-RG-CODE-USAGE,              
                                         RS-RG-CD-USG-SRC,              
                                         RS-RG-CD-USG-TYP,              
                                         RS-RG-LAST-READD,              
                                         RS-RG-CODE-STATUS,             
302442                                   RS-MN-CODE-MTR-RD,             
C34652                                   RS-MN-MTR-PRESS                
                                                                        
                 MOVE ZEROS         TO   RS-MN-MTR-REF-NO,              
                                         RS-MN-CODE-TIME-PE,            
                                         RS-MN-LAST-READ-VA,            
                                         RS-MN-CONSTANT,                
                                         RS-MN-NO-DIALS,                
                                         RS-RG-CODE-TIME-P,             
                                         RS-RG-LST-READVL,              
                                         RS-RG-REG-ID-NO                
                 ADD 1 TO RS-ROW-NO                                     
                 PERFORM 8100-SEND-RESULT      THRU 8100-EXIT           
              END-IF                                                    
           END-IF.                                                      
                                                                        
       5500-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5600-FETCH-RATE-DESC                                           *        
      *     CALLS       7100-FETCH-VERSION-NO                          *        
      *                 7900-FETCH-UM-DESC                             *        
      *                                                                *        
      *     CALLED FROM 5500-PROCESS-FETCH-CP                          *        
      *                                                                *        
      *     FETCH THE RATE PLAN DESC FOR THE UNMETERED PLAN            *        
      ******************************************************************        
                                                                        
       5600-FETCH-RATE-DESC.                                            
           MOVE '5600'                      TO ACTIVE-PARAGRAPH.        
           MOVE '5600-FETCH-RATE-DESC'      TO RS-ACTIVE-PARA.          
           MOVE 'FETCH UNMETERED RATE DESC' TO RS-TABLE-NAME.           
           MOVE UT-RATE-PLAN-NO             TO WS-RATE-PLAN-NO.         
           MOVE UT-CODE-UTIL-TYPE           TO WS-CODE-UTIL-TYPE.       
           PERFORM 7100-FETCH-VERSION-NO    THRU 7100-EXIT.             
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
              PERFORM 7900-FETCH-UM-DESC     THRU 7900-EXIT
           END-IF.            
                                                                        
       5600-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 5700-SEND-RESULT                                               *        
      *     CALLS       8100-SEND-RESULT                               *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                 5200-PROCESS-FETCH-UT                          *        
      *     SEND ONE ROW BACK WITHOUT ANY UTILITY INFORMATION.         *        
      ******************************************************************        
       5700-SEND-RESULT.                                                
           MOVE '5700'                   TO ACTIVE-PARAGRAPH.           
           MOVE '5700-SEND-RESULT'       TO RS-ACTIVE-PARA.             
           MOVE 'SEND ONE ROW'           TO RS-TABLE-NAME.              
           MOVE 0                        TO RS-RETURN-CODE              
           MOVE 'XX'                     TO RS-TABLE-ID                 
           MOVE SPACES          TO RS-UT-CODE-UTIL-TY,                  
                                   RS-UT-RATE-PLAN-NO,                  
                                   RS-UT-RATE-DESC,                     
                                   RS-UT-CODE-REV-CLA,                  
                                   RS-MN-METER-NO,                      
                                   RS-MN-CD-STUS-RS,                    
                                   RS-MN-CODE-USAGE-T,                  
                                   RS-MN-CODE-USAGE-I,                  
                                   RS-MN-CODE-USAGE-S,                  
                                   RS-MN-CODE-METER-S,                  
                                   RS-MN-METER-SUPPLY,                  
                                   RS-MN-CODE-METER-L,                  
                                   RS-MN-METER-LOC-DE,                  
                                   RS-MN-METER-IND,                     
                                   RS-RG-CODE-STATUS,                   
                                   RS-RG-CODE-USAGE,                    
                                   RS-RG-CD-USG-SRC,                    
                                   RS-RG-CD-USG-TYP,                    
                                   RS-RG-LAST-READD,                    
                                   RS-CP-CODE-PLAN,                     
                                   RS-CP-CD-STATRS,                     
                                   RS-CP-CD-SVC-TYP,                    
                                   RS-CP-POLE-NO,                       
                                   RS-CP-DIST-NO,                       
                                   RS-CP-EQUIP-ID,                      
T20443                             RS-CP-DT-PLN-ST,                     
302442                             RS-MN-CODE-MTR-RD,                   
C34652                             RS-MN-MTR-PRESS,                     
P00390                             RS-O2-ERROR-MSG-NO-RTE               
                                                                        
           MOVE ZEROS         TO   RS-UT-IC-NO,                         
                                   RS-UT-READ-ROUTE,                    
                                   RS-MN-MTR-REF-NO,                    
                                   RS-MN-CODE-TIME-PE,                  
                                   RS-MN-CONSTANT,                      
                                   RS-MN-NO-DIALS,                      
                                   RS-CP-LIGHT-NO,                      
                                   RS-MN-LAST-READ-VA,                  
                                   RS-RG-CODE-TIME-P,                   
                                   RS-RG-LST-READVL,                    
                                   RS-RG-REG-ID-NO,                     
                                   RS-CP-NO-UNITS,                      
                                   RS-CP-MTLY-AMT-FX,                   
                                   RS-CP-RT-ITEM-CD,                    
                                   RS-CP-USAGE-FIXED,                   
                                   RS-CP-ITEM-SEQ-NO                    
            ADD 1 TO RS-ROW-NO                                          
            PERFORM 8100-SEND-RESULT      THRU 8100-EXIT.               
                                                                        
       5700-EXIT.                                                       
            EXIT.                                                       
                                                                        
      ******************************************************************        
      * 7000-FETCH-RATE-ITEM-CODE                                      *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5000-FETCH-SUBDIV-LIGHT                        *        
      *                                                                *        
      *     FETCH RATE ITEM CODE FROM UT AND CP                        *        
      ******************************************************************        
                                                                        
       7000-FETCH-RATE-ITEM-CODE.                                       
           MOVE '7000'                           TO ACTIVE-PARAGRAPH.   
           MOVE '7000-FETCH-RATE-ITEM-CODE'      TO RS-ACTIVE-PARA      
           MOVE 'RETRIEVE FROM CP AND UT TABLES' TO RS-TABLE-NAME.      
                                                                        
           EXEC SQL                                                     
               SELECT CP.RATE_ITEM_CODE,                                
                      UT.CODE_UTIL_TYPE                                 
                    INTO :WS-RATE-ITEM-CODE,                            
                         :WS-CODE-UTIL-TYPE                             
               FROM CSS_CUST_PLAN CP, CSS_UTIL_ENVRNMT UT               
               WHERE CP.ACCOUNT_NO       = :WS-ACCOUNT-NO               
               AND   UT.ACCOUNT_NO       = :WS-ACCOUNT-NO               
               AND   UT.RATE_PLAN_NO     = :WS-RATE-PLAN-NO             
               AND   CP.CODE_UTIL_TYPE   = UT.CODE_UTIL_TYPE            
               AND   CP.IC_NO            = UT.IC_NO                     
T20147         AND   CP.CODE_PLAN_STATUS = 'A'                          
           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          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_UTIL_ENVRNMT'         TO TABLE-1                
              MOVE 'CSS_CUST_PLAN'            TO TABLE-2                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE 'RATE_PLAN_NO'             TO TABLE-ELEMENT-2        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE WS-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7000-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7100-FETCH-VERSION-NO                                          *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5000-FETCH-SUBDIV-LIGHT                        *        
      *                                                                *        
      *     FETCH VERSION NO CNTRL FROM CSS_RATE_CREATOR               *        
      ******************************************************************        
                                                                        
       7100-FETCH-VERSION-NO.                                           
           MOVE '7100'                    TO ACTIVE-PARAGRAPH.          
           MOVE '7100-FETCH-VERSION-NO'   TO RS-ACTIVE-PARA             
           MOVE 'RETRIEVE MAX VERSION NO' TO RS-TABLE-NAME.             
                                                                        
           EXEC SQL                                                     
               SELECT MAX(VERSION_NO_CNTRL)                             
                    INTO :WS-VERSION-NO-CNTRL :WS-NULL-INDICATOR        
               FROM CSS_RATE_CREATOR                                    
               WHERE CODE_UTIL_TYPE    = :WS-CODE-UTIL-TYPE             
               AND   RATE_PLAN_NO      = :WS-RATE-PLAN-NO               
               AND   CODE_STATUS IN ('A','I')                           
               AND   FROM_EFFECTIVE_DT <= IIF(TRY_CONVERT(DATE, 
                                                       :WS-CURRENT-DATE
              ) IS NULL OR (PATINDEX('%.%', :WS-CURRENT-DATE
              ) <> 0) OR (LEN(:WS-CURRENT-DATE) <> 10), CIS.CHAR2DATE(
                                                       :WS-CURRENT-DATE
              ), CONVERT(DATE, :WS-CURRENT-DATE) )              
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT MAX(VERSION_NO_CNTRL)                                     
MFA-TR*             INTO :WS-VERSION-NO-CNTRL :WS-NULL-INDICATOR                
MFA-TR*        FROM CSS_RATE_CREATOR                                            
MFA-TR*        WHERE CODE_UTIL_TYPE    = :WS-CODE-UTIL-TYPE                     
MFA-TR*        AND   RATE_PLAN_NO      = :WS-RATE-PLAN-NO                       
MFA-TR*        AND   CODE_STATUS IN ('A','I')                                   
MFA-TR*        AND   FROM_EFFECTIVE_DT <= :WS-CURRENT-DATE                      
MFA-TR*    END-EXEC.                                                            

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

                                                                        
           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 'SELECT'                   TO ABEND-FUNCTION         
              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 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
CBSI          MOVE 'FROM_EFFECTIVE_DT'        TO TABLE-ELEMENT-4        
              MOVE WS-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
              MOVE WS-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-3      
CBSI          MOVE WS-CURRENT-DATE            TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
      *************************************************************             
      * GET THE CODE STATUS AND CHECK WHETHER THE RATE IS ACTIVE  *             
      *************************************************************             
           MOVE 'INACTIVE RATE PLAN'      TO RS-TABLE-NAME.             
           EXEC SQL                                                     
               SELECT CODE_STATUS                                       
                    INTO :WS-CODE-STATUS                                
               FROM CSS_RATE_CREATOR                                    
               WHERE CODE_UTIL_TYPE   = :WS-CODE-UTIL-TYPE              
               AND   RATE_PLAN_NO     = :WS-RATE-PLAN-NO                
               AND   VERSION_NO_CNTRL = :WS-VERSION-NO-CNTRL            
               AND   CODE_STATUS      = 'A'                             
           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          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_RATE_CREATOR'         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 'CODE_STATUS'              TO TABLE-ELEMENT-4        
              MOVE WS-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
              MOVE WS-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
              MOVE WS-VERSION-NO-CNTRL        TO HOSTVAR-ELEMENT-3      
              MOVE 'A'                        TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7100-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7200-FETCH-PRICE-PER-SERV                                      *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5000-FETCH-SUBDIV-LIGHT                        *        
      *                                                                *        
      *     FETCH PRICE PER SERVICE FROM CSS_UMTR_PLAN                 *        
      ******************************************************************        
       7200-FETCH-PRICE-PER-SERV.                                       
           MOVE '7200'                       TO ACTIVE-PARAGRAPH.       
           MOVE '7200-FETCH-PRICE-PER-SERV'  TO RS-ACTIVE-PARA.         
           MOVE 'RETRIEVE OF UNMETERED PLAN' TO RS-TABLE-NAME.          
                                                                        
           EXEC SQL                                                     
               SELECT PRICE_PER_SERV                                    
                    INTO :WS-PRICE-PER-SERVICE                          
               FROM CSS_UNMTR_PLAN                                      
               WHERE CODE_UTIL_TYPE   = :WS-CODE-UNMETERED              
               AND   RATE_PLAN_NO     = :WS-RATE-PLAN-NO                
               AND   VERSION_NO_CNTRL = :WS-VERSION-NO-CNTRL            
               AND   RATE_ITEM_CODE   = :WS-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 OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
CBSI          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        
CBSI          MOVE 'RATE_ITEM_CODE'           TO TABLE-ELEMENT-4        
              MOVE WS-CODE-UNMETERED          TO HOSTVAR-ELEMENT-1      
              MOVE WS-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
              MOVE WS-VERSION-NO-CNTRL        TO HOSTVAR-ELEMENT-3      
              MOVE WS-RATE-ITEM-CODE          TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7200-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7300-FETCH-PREMISE                                             *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5100-FETCH-PREM-DIR-IND                        *        
      *                                                                *        
      *     FETCH PREMISE DIRECTIONS AND INSTRUCTIONS FROM CSS_PREMISE *        
      ******************************************************************        
                                                                        
       7300-FETCH-PREMISE.                                              
           MOVE '7300'                           TO ACTIVE-PARAGRAPH.   
           MOVE '7300-FETCH-PREMISE'             TO RS-ACTIVE-PARA.     
           MOVE 'RETRIEVE OF PREMISE DIRECTIONS' TO RS-TABLE-NAME.      
                                                                        
           EXEC SQL                                                     
               SELECT PREMISE_DIRECTIONS,                               
                      SPCL_INSTRUCTIONS,                                
                      SPCL_READ_INSTR,                                  
                      CODE_RENTAL_PROP,                                 
                      REV_DISTRICT_CD,                                  
P00390                ADDRESS_ID                                        
                    INTO :WS-PREMISE-DIRECTIONS,                        
                         :WS-SPCL-INSTRUCTIONS,                         
                         :WS-SPCL-READ-INSTR,                           
                         :RS-CD-RNTL-PROP,                              
                         :RS-REV-DIST-CD,                               
P00390                   :PR-ADDRESS-ID                                 
               FROM CSS_PREMISE                                         
               WHERE PREMISE_NO       = :WS-PREMISE-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          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_PREMISE'              TO TABLE-1                
              MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-1        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-2        
              MOVE WS-PREMISE-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7310-FETCH-LANDLORD                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5100-FETCH-PREM-DIR-IND                        *        
      *                                                                *        
      *     FETCH LANDLORD CUSTOMER NO.                                *        
      ******************************************************************        
                                                                        
       7310-FETCH-LANDLORD.                                             
           MOVE '7310'                         TO ACTIVE-PARAGRAPH.     
           MOVE '7310-FETCH-LANDLORD'          TO RS-ACTIVE-PARA.       
           MOVE 'RETRIEVE OF LANDLORD CUST NO' TO RS-TABLE-NAME.        
                                                                        
           EXEC SQL                                                     
               SELECT CUSTOMER_NO                                       
                    INTO :RS-LL-CUSTOMER-NO                             
               FROM CSS_LANDLORD                                        
               WHERE PREMISE_NO       = :WS-PREMISE-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          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_LANDLORD'             TO TABLE-1                
              MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-1        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-2        
              MOVE WS-PREMISE-NO              TO HOSTVAR-ELEMENT-1      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7310-EXIT.                                                       
           EXIT.                                                        
                                                                        
P00390******************************************************************        
P00390* 7320-GET-ZIP-CODE                                              *        
P00390*     CALLS       9000-SEND-ERROR-RESULT                         *        
P00390*                 9900-SQL-ERROR-ROUTINE                         *        
P00390*                                                                *        
P00390*     CALLED FROM 5100-FETCH-PREM-DIR-IND                        *        
P00390*                                                                *        
P00390*     GETS THE ZIP CODE FOR THAT ADDRESS ID                      *        
P00390******************************************************************        
P00390                                                                  
P00390 7320-GET-ZIP-CODE.                                               
P00390     MOVE '7320'                         TO ACTIVE-PARAGRAPH.     
P00390     MOVE '7320-GET-ZIP-CODE'            TO RS-ACTIVE-PARA.       
P00390     MOVE 'CSS_ZIP_CODE'                 TO RS-TABLE-NAME.        
P00390                                                                  
P00390     EXEC SQL                                                     
P00390         SELECT ZIP_CODE,                                         
P00390                ZIP_CODE_TOKEN                                    
P00390           INTO :DY-ZIP-CODE,                                     
P00390                :DY-ZIP-CODE-TOKEN                                
P00390         FROM CSS_ADDR_FORMATTED WITH(READUNCOMMITTED)                    
P00390        WHERE ADDRESS_ID       = :PR-ADDRESS-ID                   
P00390                                                           
P00390                                                      
P00390     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT ZIP_CODE,                                                 
MFA-TR*               ZIP_CODE_TOKEN                                            
MFA-TR*          INTO :DY-ZIP-CODE,                                             
MFA-TR*               :DY-ZIP-CODE-TOKEN                                        
MFA-TR*        FROM CSS_ADDR_FORMATTED                                          
MFA-TR*       WHERE ADDRESS_ID       = :PR-ADDRESS-ID                           
MFA-TR*        WITH UR                                                          
MFA-TR*       QUERYNO 7320                                                      
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

P00390                                                                  
P00390     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE RS-RETURN-CODE.        
P00390                                                                  
P00390     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
P00390        NEXT SENTENCE                                             
P00390     ELSE                                                         
P00390        MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
P00390        MOVE 'SELECT'                   TO ABEND-FUNCTION         
P00390        MOVE 'CSS_ADDR_FORMATTED'       TO TABLE-1                
P00390        MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-1        
P00390        MOVE 'ADDRESS_ID'               TO TABLE-ELEMENT-2        
P00390        MOVE PR-PREMISE-NO              TO HOSTVAR-ELEMENT-1      
P00390        MOVE PR-ADDRESS-ID              TO HOSTVAR-ELEMENT-2      
P00390        MOVE 'N'                        TO SEND-DONE-SW           
P00390        PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
P00390        PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
P00390        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00390     END-IF.                                                      
P00390                                                                  
P00390 7320-EXIT.                                                       
P00390     EXIT.                                                        
P00390                                                                  
P00390******************************************************************        
P00390* 7330-GET-SPCL-MSG-ZIP                                          *        
P00390*     CALLS       9000-SEND-ERROR-RESULT                         *        
P00390*                 9900-SQL-ERROR-ROUTINE                         *        
P00390*                                                                *        
P00390*     CALLED FROM 5100-FETCH-PREM-DIR-IND                        *        
P00390*                                                                *        
P00390*     GETS THE ERROR MESSAGE FOR THAT ZIP CODE                   *        
P00390******************************************************************        
P00390                                                                  
P00390 7330-GET-SPCL-MSG-ZIP.                                           
P00390     MOVE '7330'                         TO ACTIVE-PARAGRAPH.     
P00390     MOVE '7330-GET-SPCL-MSG-ZIP'        TO RS-ACTIVE-PARA.       
P00390     MOVE 'CSS_ZIP_CODE'                 TO RS-TABLE-NAME.        
P00390                                                                  
P00390     EXEC SQL                                                     
P00390         SELECT ERROR_MSG_NO                                      
P00390           INTO :A4-ERROR-MSG-NO                                  
P00390         FROM CSS_ZIP_CODE WITH(READUNCOMMITTED)                          
P00390         WHERE ZIP_CODE         = :DY-ZIP-CODE                    
P00390           AND ZIP_CODE_TOKEN   = :DY-ZIP-CODE-TOKEN              
P00390                                                           
P00390                                                      
P00390     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT ERROR_MSG_NO                                              
MFA-TR*          INTO :A4-ERROR-MSG-NO                                          
MFA-TR*        FROM CSS_ZIP_CODE                                                
MFA-TR*        WHERE ZIP_CODE         = :DY-ZIP-CODE                            
MFA-TR*          AND ZIP_CODE_TOKEN   = :DY-ZIP-CODE-TOKEN                      
MFA-TR*        WITH UR                                                          
MFA-TR*        QUERYNO 7330                                                     
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

P00390                                                                  
P00390     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE RS-RETURN-CODE.        
P00390                                                                  
P00390     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
P00390        NEXT SENTENCE                                             
P00390     ELSE                                                         
P00390        IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                      
P00390           MOVE ZERO                       TO RS-RETURN-CODE      
P00390        ELSE                                                      
P00390           MOVE PROGRAM-NAME               TO ABEND-PROGRAM       
P00390           MOVE 'SELECT'                   TO ABEND-FUNCTION      
P00390           MOVE 'CSS_ZIP_CODE'             TO TABLE-1             
P00390           MOVE 'ZIP_CODE'                 TO TABLE-ELEMENT-1     
P00390           MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-2     
P00390           MOVE DY-ZIP-CODE                TO HOSTVAR-ELEMENT-1   
P00390           MOVE PR-PREMISE-NO              TO HOSTVAR-ELEMENT-2   
P00390           MOVE 'N'                        TO SEND-DONE-SW        
P00390           PERFORM 8100-SEND-RESULT        THRU 8100-EXIT         
P00390           PERFORM 8900-SEND-DONE          THRU 8900-EXIT         
P00390           PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT         
P00390        END-IF                                                    
P00390     END-IF.                                                      
P00390                                                                  
P00390 7330-EXIT.                                                       
P00390     EXIT.                                                        
P00390                                                                  
      ******************************************************************        
      * 7400-FETCH-ACCT-TYPE                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
ACT282*     FETCH PREMISE TYPE FROM CSS_ACCOUNT AND CSS_SO_CODE_DESC   *        
      ******************************************************************        
       7400-FETCH-ACCT-TYPE.                                            
                                                                        
           MOVE '7400'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7400-FETCH-ACCT-TYPE'     TO RS-ACTIVE-PARA.           
           MOVE 'RETRIEVE OF ACCOUNT TYPE' TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
               SELECT AT.CODE_ACCT_STAT,                                
ACT282                SW.CODE_LONG_DESC                                 
                 INTO :RS-ACCT-STATUS,                                  
                      :RS-ACCT-TYPE                                     
                 FROM CSS_ACCOUNT AT,                                   
ACT282                CSS_SO_CODE_DESC SW                               
                WHERE AT.ACCOUNT_NO        = :WS-ACCOUNT-NO             
ACT282            AND AT.ACCOUNT_TYPE_CODE = SW.CODE_VALUE              
ACT282            AND SW.TABLE_NA   = 'CSS_ACCOUNT'                     
ACT282            AND SW.COLUMN_NA  = 'ACCOUNT_TYPE_CODE'               
ACT282            AND SW.PROGRAM_ID = 'ALL'                             
ACT282            AND SW.COMPANY_NO = '01'                              
           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 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_ACCOUNT'              TO TABLE-1                
ACT282        MOVE 'CSS_SO_CODE_DESC'         TO TABLE-2                
ACT282        MOVE 'TABLE_NA'                 TO TABLE-ELEMENT-1        
ACT282        MOVE 'COLUMN_NA'                TO TABLE-ELEMENT-2        
ACT282        MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
ACT282        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-4        
ACT282        MOVE 'CSS_ACCOUNT'              TO HOSTVAR-ELEMENT-1      
ACT282        MOVE 'ACCOUNT_TYPE_CODE'        TO HOSTVAR-ELEMENT-2      
ACT282        MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-3      
ACT282        MOVE '01'                       TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7400-EXIT.                                                       
           EXIT.                                                        
                                                                        
T23507******************************************************************        
T23507* 7410-FETCH-CONTRACT                                            *        
T23507*     CALLS       9000-SEND-ERROR-RESULT                         *        
T23507*                 9900-SQL-ERROR-ROUTINE                         *        
T23507*                                                                *        
T23507*     CALLED FROM 2300-BUILD-RESULT                              *        
T23507*                                                                *        
T23507*     FETCH ACTIVE CONTRACTS FROM CSS_CONTRACT                   *        
T23507******************************************************************        
T23507 7410-FETCH-CONTRACT.                                             
T23507                                                                  
T23507     MOVE '7410'                     TO ACTIVE-PARAGRAPH.         
T23507     MOVE '7410-FETCH-CONTRACT'      TO RS-ACTIVE-PARA.           
T23507     MOVE 'RETRIEVE OF CONTRACT'     TO RS-TABLE-NAME.            
T23507                                                                  
T23507     EXEC SQL                                                     
T23507         SELECT TOP(1) 'Y'                                               
T23507           INTO :RS-ACTIVE-CONTRACT                               
T23507           FROM CSS_CONTRACT                                      
T23507          WHERE ACCOUNT_NO    = :WS-ACCOUNT-NO                    
T23507            AND CNT_STATUS_CD IN ('A', 'B')                       
C30058            AND CODE_CONTRACT_TYPE = 'B'                          
C30058            AND CODE_BILL_TYPE = 'C'                              
C30058            AND CNT_NAME_CD <> 1080                               
C30058                                           
T23507     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ020
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT 'Y'                                                       
MFA-TR*          INTO :RS-ACTIVE-CONTRACT                                       
MFA-TR*          FROM CSS_CONTRACT                                              
MFA-TR*         WHERE ACCOUNT_NO    = :WS-ACCOUNT-NO                            
MFA-TR*           AND CNT_STATUS_CD IN ('A', 'B')                               
MFA-TR*           AND CODE_CONTRACT_TYPE = 'B'                                  
MFA-TR*           AND CODE_BILL_TYPE = 'C'                                      
MFA-TR*           AND CNT_NAME_CD <> 1080                                       
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

T23507                                                                  
T23507     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE                        
T23507                     RS-RETURN-CODE.                              
T23507                                                                  
T23507     EVALUATE WS-ACTIVE-RETURN-CODE                               
T23507         WHEN SUCCESSFUL-CALL                                     
T23507             CONTINUE                                             
T23507         WHEN NOT-FOUND                                           
T23507             MOVE 'N' TO RS-ACTIVE-CONTRACT                       
T23507         WHEN OTHER                                               
T23507             MOVE PROGRAM-NAME          TO ABEND-PROGRAM          
T23507             MOVE 'SELECT'              TO ABEND-FUNCTION         
T23507             MOVE 'CSS_CONTRACT'        TO TABLE-1                
T23507             MOVE 'ACCOUNT_NO'          TO TABLE-ELEMENT-1        
T23507             MOVE WS-ACCOUNT-NO         TO HOSTVAR-ELEMENT-1      
T23507             MOVE 'N'                   TO SEND-DONE-SW           
T23507             PERFORM 8100-SEND-RESULT   THRU 8100-EXIT            
T23507             PERFORM 8900-SEND-DONE     THRU 8900-EXIT            
T23507             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
T23507     END-EVALUATE.                                                
T23507                                                                  
T23507 7410-EXIT.                                                       
T23507     EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7500-OPEN-UT-CURSOR                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     OPENS THE CURSOR                                           *        
      ******************************************************************        
                                                                        
       7500-OPEN-UT-CURSOR.                                             
           MOVE '7500'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7500-UT-CURSOR'           TO RS-ACTIVE-PARA.           
           MOVE 'OPEN OF CURSOR'           TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              OPEN UT-CURSOR                                            
           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          
T16498        MOVE 'OPEN'                     TO ABEND-FUNCTION         
              MOVE 'CSS_UTIL_ENVRNMT'         TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T16498        MOVE PARM-COMPANY-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7500-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7510-FETCH-UTIL-ENVRNMT                                        *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5200-PROCESS-FETCH-UT                          *        
      *                                                                *        
      *     FETCHES ROWS FROM THE TABLE CSS_UTIL_ENVRNMT FOR THE       *        
      *     ACCOUNT NO PASSED AS PARAMTER                              *        
      ******************************************************************        
                                                                        
       7510-FETCH-UTIL-ENVRNMT.                                         
           MOVE '7510'                        TO ACTIVE-PARAGRAPH.      
           MOVE '7510-FETCH-UTIL-ENVRNMT'     TO RS-ACTIVE-PARA.        
           MOVE 'FETCH FROM CSS_UTIL_ENVRNMT' TO RS-TABLE-NAME.         
                                                                        
           EXEC SQL                                                     
              FETCH  UT-CURSOR                                          
              INTO  :UT-ACCOUNT-NO,                                     
                    :UT-CODE-UTIL-TYPE,                                 
                    :UT-IC-NO,                                          
                    :UT-CODE-REVENUE-CLASS,                             
                    :UT-RATE-PLAN-NO,                                   
                    :UT-READ-CYCLE,                                     
                    :UT-READ-ROUTE,                                     
                    :UT-CODE-SIC-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          
T16498        MOVE 'FETCH'                    TO ABEND-FUNCTION         
              MOVE 'CSS_UTIL_ENVRNMT'         TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T16498        MOVE PARM-COMPANY-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7510-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7520-CLOSE-UT-CURSOR                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     CLOSES THE CURSOR                                          *        
      ******************************************************************        
                                                                        
       7520-CLOSE-UT-CURSOR.                                            
           MOVE '7520'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7520-CLOSE-UT-CURSOR'     TO RS-ACTIVE-PARA.           
           MOVE 'CLOSE OF CURSOR'          TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              CLOSE  UT-CURSOR                                          
           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          
T16498        MOVE 'CLOSE'                    TO ABEND-FUNCTION         
              MOVE 'CSS_UTIL_ENVRNMT'         TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T16498        MOVE PARM-COMPANY-NO            TO HOSTVAR-ELEMENT-2      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7520-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7600-OPEN-MN-CURSOR                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     OPENS THE CURSOR                                           *        
      ******************************************************************        
                                                                        
       7600-OPEN-MN-CURSOR.                                             
           MOVE '7600'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7600-OPEN-MN-CURSOR'      TO RS-ACTIVE-PARA.           
           MOVE 'OPEN OF CURSOR'           TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              OPEN MN-CURSOR                                            
           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          
T16498        MOVE 'OPEN'                     TO ABEND-FUNCTION         
              MOVE 'CSS_MTRD_ENVRNMT'         TO TABLE-1                
T16498        MOVE 'CSS_METER_LOC'            TO TABLE-2                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-3                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-4        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7600-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7610-FETCH-MTRD-ENVRNMT                                        *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5300-PROCESS-FETCH-MN                          *        
      *                                                                *        
      *     FETCHES ROWS FROM THE TABLE CSS_MTRD_ENVRNMT FOR THE       *        
      *     ACCOUNT NO PASSED AS PARAMTER                              *        
      ******************************************************************        
       7610-FETCH-MTRD-ENVRNMT.                                         
                                                                        
           MOVE '7610'                        TO ACTIVE-PARAGRAPH.      
           MOVE '7610-FETCH-MTRD-ENVRNMT'     TO RS-ACTIVE-PARA.        
           MOVE 'FETCH FROM CSS_MTRD_ENVRNMT' TO RS-TABLE-NAME.         
                                                                        
           EXEC SQL                                                     
              FETCH MN-CURSOR                                           
               INTO :MN-ACCOUNT-NO        ,                             
                    :MN-CODE-UTIL-TYPE    ,                             
                    :MN-METER-NO          ,                             
                    :MN-IC-NO             ,                             
                    :MN-MTR-REF-NO        ,                             
                    :MN-CODE-TIME-PERIOD  ,                             
                    :MN-LAST-READ-VALUE   ,                             
                    :MN-REG-ID-NO         ,                             
                    :MN-LAST-REG-READ-DATE,                             
                    :MN-CODE-STATUS-REAS  ,                             
                    :MN-CODE-USAGE-TYPE   ,                             
                    :MN-CODE-USAGE-ID     ,                             
                    :MN-CODE-USAGE-SOURCE ,                             
                    :MN-CODE-METER-STATUS ,                             
                    :MN-METER-SUPPLYING   ,                             
                    :MN-CODE-METER-LOC    ,                             
                    :MN-CODE-DATA-PRESENT ,                             
                    :MN-DIST-NODE-POINT   ,                             
                    :MN-POINT-ID          ,                             
                    :MN-SEAL-CODE-ID      ,                             
                    :MN-HEXAGRAM-LOCATION ,                             
                    :MN-INSULATED-IND     ,                             
                    :MN-LOCK-TYPE-ID      ,                             
                    :MN-DELIVERY-LEVEL-CD ,                             
                    :MN-UTILITY-SOURCE-CD ,                             
                    :MN-IDR-RECIPIENT-CD  ,                             
                    :MN-PROGRAM-ID        ,                             
                    :MN-MTR-READ-SOURCE-CD,                             
                    :MN-GIS-POINT-ID      ,                             
A00714              :Q4-METER-LOC-DESC :WS-NULL-CONSTANT-MLOC,           
A00714              :MC-CONSTANT :WS-NULL-CONSTANT,                      
A00714              :MC-NO-READ-DIALS :WS-NULL-NO-DIALS,                 
A00714              :MC-CODE-CAP-TYPE :WS-NULL-CODE-CAP,                 
                    :MN-CODE-MTR-RD-INST1 ,                             
C34652              :MN-METER-PRESSURE                                  
           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          
T16498        MOVE 'FETCH'                    TO ABEND-FUNCTION         
              MOVE 'CSS_MTRD_ENVRNMT'         TO TABLE-1                
T16498        MOVE 'CSS_METER_LOC'            TO TABLE-2                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-3                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-4        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7610-EXIT.                                                       
           EXIT.                                                        
                                                                        
T14716******************************************************************        
T14716* 7615-SELECT-ELEC-METER                                                  
T14716*     CALLS       9000-SEND-ERROR-RESULT                         *        
T14716*                 9900-SQL-ERROR-ROUTINE                         *        
T14716*                                                                *        
T14716*     CALLED FROM 5300-PROCESS-FETCH-MN                          *        
T14716*                                                                *        
T14716*     SELECTS THE ELEC-METER ROW TO PASS AMPS BACK               *        
T14716******************************************************************        
T14716 7615-SELECT-ELEC-METER.                                          
T14716                                                                  
T14716     MOVE '7615'                        TO ACTIVE-PARAGRAPH.      
T14716     MOVE '7615-SELECT-ELEC-METER'      TO RS-ACTIVE-PARA.        
T14716     MOVE 'SELECT FROM CSS_ELEC_METER'  TO RS-TABLE-NAME.         
T14716                                                                  
T14716     EXEC SQL                                                     
T14716        SELECT AMPS                                               
T14716         INTO :EM-AMPS                                            
T14716         FROM CSS_ELEC_METER                                      
T22243         WHERE COMPANY_NO     = :EM-COMPANY-NO                    
T14716         AND   CODE_UTIL_TYPE = :UT-CODE-UTIL-TYPE                
T14716         AND   METER_NO       = :MN-METER-NO                      
T14716     END-EXEC.                                                    

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

T14716                                                                  
T14716     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE RS-RETURN-CODE.        
T14716                                                                  
T14716*    IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND              
T14720     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T14716        NEXT SENTENCE                                             
T14716     ELSE                                                         
T14716        MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
T14716        MOVE 'CSS_ELEC_METER'           TO TABLE-1                
T14716        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-1        
T14716        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'METER_NO'                 TO TABLE-ELEMENT-2        
T16498        MOVE MN-METER-NO                TO HOSTVAR-ELEMENT-2      
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-3      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-4        
T22243        MOVE EM-COMPANY-NO              TO HOSTVAR-ELEMENT-4      
T14716        MOVE 'N'                        TO SEND-DONE-SW           
T14716        PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
T14716        PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
T14716        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
T14716     END-IF.                                                      
T14716                                                                  
T14716 7615-EXIT.                                                       
T14716     EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7620-CLOSE-MN-CURSOR                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     CLOSES THE CURSOR                                          *        
      ******************************************************************        
                                                                        
       7620-CLOSE-MN-CURSOR.                                            
           MOVE '7620'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7620-CLOSE-MN-CURSOR'     TO RS-ACTIVE-PARA.           
           MOVE 'CLOSE OF CURSOR'          TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              CLOSE  MN-CURSOR                                          
           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          
T16498        MOVE 'CLOSE'                    TO ABEND-FUNCTION         
              MOVE 'CSS_MTRD_ENVRNMT'         TO TABLE-1                
T16498        MOVE 'CSS_METER_LOC'            TO TABLE-2                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-3                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-4        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7620-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7700-OPEN-RG-CURSOR                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     OPENS THE CURSOR                                           *        
      ******************************************************************        
                                                                        
       7700-OPEN-RG-CURSOR.                                             
           MOVE '7700'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7700-OPEN-RG-CURSOR'      TO RS-ACTIVE-PARA.           
           MOVE 'OPEN OF CURSOR'           TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              OPEN RG-CURSOR                                            
           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          
T16498        MOVE 'OPEN'                     TO ABEND-FUNCTION         
              MOVE 'CSS_REGISTER_READ'        TO TABLE-1                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-2                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE MN-IC-NO                   TO HOSTVAR-ELEMENT-3      
T16498        MOVE 'METER_NO'                 TO TABLE-ELEMENT-4        
T16498        MOVE MN-METER-NO                TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7700-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7710-FETCH-REGISTER-READ                                       *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5400-PROCESS-FETCH-RG                          *        
      *                                                                *        
      *     FETCHES ROWS FROM THE TABLE CSS_REGISTER_READ FOR THE      *        
      *     ACCOUNT NO PASSED AS PARAMTER                              *        
      ******************************************************************        
                                                                        
       7710-FETCH-REGISTER-READ.                                        
           MOVE '7710'                          TO ACTIVE-PARAGRAPH.    
           MOVE '7710-FETCH-REGISTER-READ'      TO RS-ACTIVE-PARA.      
           MOVE 'RETRIEVE OF CSS_REGISTER_READ' TO RS-TABLE-NAME.       
                                                                        
           EXEC SQL                                                     
              FETCH  RG-CURSOR                                          
              INTO  :RG-ACCOUNT-NO,                                     
                    :RG-CODE-UTIL-TYPE,                                 
                    :RG-IC-NO,                                          
                    :RG-MTR-REF-NO,                                     
                    :RG-CODE-REG-STATUS,                                
                    :RG-CODE-STATUS-REAS,                               
                    :RG-CODE-TIME-PERIOD,                               
                    :RG-CODE-USAGE-ID,                                  
                    :RG-CODE-USAGE-SOURCE,                              
                    :RG-CODE-USAGE-TYPE,                                
                    :RG-LAST-REG-READ-DT,                               
                    :RG-LAST-READ-VALUE,                                
                    :RG-REG-ID-NO,                                      
A00714              :MC-CONSTANT :WS-NULL-CONSTANT,                      
A00714              :MC-NO-READ-DIALS :WS-NULL-NO-DIALS,                 
A00714              :MC-CODE-CAP-TYPE :WS-NULL-CODE-CAP                  
           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          
T16398        MOVE 'FETCH'                    TO ABEND-FUNCTION         
              MOVE 'CSS_REGISTER_READ'        TO TABLE-1                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-2                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE MN-IC-NO                   TO HOSTVAR-ELEMENT-3      
T16498        MOVE 'METER_NO'                 TO TABLE-ELEMENT-4        
T16498        MOVE MN-METER-NO                TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7710-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7720-CLOSE-RG-CURSOR                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     CLOSES THE CURSOR                                          *        
      ******************************************************************        
                                                                        
       7720-CLOSE-RG-CURSOR.                                            
           MOVE '7720'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7720-CLOSE-RG-CURSOR'     TO RS-ACTIVE-PARA.           
           MOVE 'CLOSE OF CURSOR'          TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              CLOSE  RG-CURSOR                                          
           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          
T16498        MOVE 'CLOSE'                    TO ABEND-FUNCTION         
              MOVE 'CSS_REGISTER_READ'        TO TABLE-1                
T16498        MOVE 'CSS_MTR_CAP'              TO TABLE-2                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T22243        MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
T22243        MOVE MC-COMPANY-NO              TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE MN-IC-NO                   TO HOSTVAR-ELEMENT-3      
T16498        MOVE 'METER_NO'                 TO TABLE-ELEMENT-4        
T16498        MOVE MN-METER-NO                TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7720-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7800-OPEN-CP-CURSOR                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     OPENS THE CURSOR                                           *        
      ******************************************************************        
                                                                        
       7800-OPEN-CP-CURSOR.                                             
           MOVE '7800'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7800-OPEN-CP-CURSOR'      TO RS-ACTIVE-PARA.           
           MOVE 'OPEN OF CURSOR'           TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              OPEN CP-CURSOR                                            
           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          
T16498        MOVE 'OPEN'                     TO ABEND-FUNCTION         
              MOVE 'CSS_CUST_PLAN'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7800-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7810-FETCH-CUST-PLAN                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5500-PROCESS-FETCH-CP                          *        
      *                                                                *        
      *     FETCHES ROWS FROM THE TABLE CSS_CUST_PLAN     FOR THE      *        
      *     ACCOUNT NO PASSED AS PARAMTER                              *        
      ******************************************************************        
                                                                        
       7810-FETCH-CUST-PLAN.                                            
           MOVE '7810'                      TO ACTIVE-PARAGRAPH.        
           MOVE '7810-FETCH-CUST-PLAN'      TO RS-ACTIVE-PARA.          
           MOVE 'RETRIEVE OF CSS_CUST_PLAN' TO RS-TABLE-NAME.           
                                                                        
A00759*    PERFORM 7874-GET-DATE-UTIL-SVC-STRT THRU 7874-EXIT.                  
                                                                        
           EXEC SQL                                                     
              FETCH  CP-CURSOR                                          
              INTO  :CP-ACCOUNT-NO,                                     
                    :CP-CODE-UTIL-TYPE,                                 
                    :CP-IC-NO,                                          
                    :CP-NO-UNITS,                                       
                    :CP-ITEM-SEQ-NO,                                    
                    :CP-CODE-PLAN-STATUS,                               
                    :CP-CODE-STAT-REASON,                               
                    :CP-CODE-SERVICE-TYPE,                              
                    :CP-MTHLY-AMOUNT-FIXED,                             
                    :CP-RATE-ITEM-CODE,                                 
                    :CP-LIGHT-NO,                                       
                    :CP-POLE-NO,                                        
                    :CP-DIST-NO,                                        
                    :CP-USAGE-FIXED,                                    
T20443              :CP-DATE-PLAN-START :WS-NULL-INDICATOR,              
T20443              :CP-REMOVE-DATE :WS-NULL-DATE                        
           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      
T20443        IF WS-NULL-INDICATOR = WS-NULL-VALUE                      
T20443            MOVE LOW-VALUES TO CP-DATE-PLAN-START                 
T20443        END-IF                                                    
T20443*       IF WS-NULL-DATE = WS-NULL-VALUE                                   
T20443*           MOVE LOW-VALUES TO CP-REMOVE-DATE                             
T20443*           IF CP-DATE-PLAN-START >= WS-MAX-DT-UTL-SVC-STRT               
A00759            IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND        
A00759               CP-CODE-PLAN-STATUS NOT EQUAL 'R'                  
T20443               MOVE CP-DATE-PLAN-START TO RS-CP-DT-PLN-ST         
T20443            END-IF                                                
T20443*       END-IF                                                            
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'FETCH'                    TO ABEND-FUNCTION         
              MOVE 'CSS_CUST_PLAN'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7810-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7820-CLOSE-CP-CURSOR                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     CLOSES THE CURSOR                                          *        
      ******************************************************************        
                                                                        
       7820-CLOSE-CP-CURSOR.                                            
           MOVE '7820'                     TO ACTIVE-PARAGRAPH.         
           MOVE '7820-CLOSE-CP-CURSOR'     TO RS-ACTIVE-PARA.           
           MOVE 'CLOSE OF CURSOR'          TO RS-TABLE-NAME.            
                                                                        
           EXEC SQL                                                     
              CLOSE  CP-CURSOR                                          
           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          
T16498        MOVE 'CLOSE'                    TO ABEND-FUNCTION         
              MOVE 'CSS_CUST_PLAN'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
T16498        MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-2        
T16498        MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-2      
T16498        MOVE 'IC_NO'                    TO TABLE-ELEMENT-3        
T16498        MOVE UT-IC-NO                   TO HOSTVAR-ELEMENT-3      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7820-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
T18326* 7850-NULL-END-DATE                                             *        
T18326*     CALLS       9000-SEND-ERROR-RESULT                         *        
T18326*                 9900-SQL-ERROR-ROUTINE                         *        
T18326*                                                                *        
T18326*     CALLED FROM 5000-FETCH-CUR-ACCOUNT                         *        
T18326*                                                                *        
T18326*     1.  LOOK FOR A NULL IN DATE_UTIL_SVC_END (THERE SHOULD BE  *        
T18326*         ONLY ONE).  IF EXISTS, USE THIS ACCOUNT.               *        
T18326*     2.  IF NONE EXISTS, LOOK FOR MAX (DATE_UTIL_SVC_END).  IF  *        
T18326*         ONLY ONE EXISTS, USE THIS ACCOUNT.                     *        
T18326*     3.  IF MULTIPLE ROWS WITH SAME MAX END DATE, LOOK AT       *        
T18326*         ACCOUNT TABLE FOR MAX (ACCT_FINALED_DT) FOR THE        *        
T18326*         PREMISE.  USE THIS ACCOUNT.                            *        
T18721*     4.  IF MULTIPLE ROWS WITH SAME MAX ACCT_FINALED_DT, LOOK   *        
T18721*         FOR MAX ACCT_CREATE_DT.  USE THIS ACCOUNT.             *        
T18326******************************************************************        
T18326                                                                  
T18326 7850-NULL-END-DATE.                                              
T18326                                                                  
T18326     MOVE '7850'                         TO ACTIVE-PARAGRAPH.     
T18326     MOVE '7850-NULL-END-DATE'           TO RS-ACTIVE-PARA.       
T18326     MOVE 'FETCH CURRENT ACTIVE ACCOUNT' TO RS-TABLE-NAME.        
T18326                                                                  
T18326     EXEC SQL                                                     
T18326        SELECT CH.ACCOUNT_NO, AT.CREDIT_GROUP                     
T18326          INTO :RS-ACCOUNT-NO,                                    
T18326               :RS-CREDIT-GROUP                                   
T18326          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT        AT                              
T18326         WHERE CH.PREMISE_NO = :WS-PREMISE-NO                     
T18326           AND AT.COMPANY_NO = :PARM-COMPANY-NO                   
T18326           AND CH.ACCOUNT_NO = AT.ACCOUNT_NO                      
T18326           AND CH.DATE_UTIL_SVC_END IS NULL                       
T18326     END-EXEC.                                                    

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

T18326                                                                  
T18326     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE  
T18326                                           RS-RETURN-CODE.        
T18326                                                                  
T18326     EVALUATE WS-ACTIVE-RETURN-CODE                               
T18326         WHEN SUCCESSFUL-CALL                                     
T18326             CONTINUE                                             
T18326         WHEN NOT-FOUND                                           
T18326             PERFORM 7860-MAX-END-DATE THRU 7860-EXIT             
T18326         WHEN OTHER                                               
T18326             MOVE PROGRAM-NAME          TO ABEND-PROGRAM          
T18326             MOVE 'SELECT'              TO ABEND-FUNCTION         
T18326             MOVE 'CSS_ACCOUNT'         TO TABLE-1                
T18326             MOVE 'CSS_CUST_PREM_HIST'  TO TABLE-2                
T18326             MOVE 'PREMISE_NO'          TO TABLE-ELEMENT-1        
T18326             MOVE 'COMPANY_NO'          TO TABLE-ELEMENT-2        
T18326             MOVE 'DATE_UTIL_SVC_END'   TO TABLE-ELEMENT-3        
CBSI               MOVE 'ACCOUNT_NO'          TO TABLE-ELEMENT-4        
T18326             MOVE WS-PREMISE-NO         TO HOSTVAR-ELEMENT-1      
T18326             MOVE PARM-COMPANY-NO       TO HOSTVAR-ELEMENT-2      
T18326             MOVE 'NULL'                TO HOSTVAR-ELEMENT-3      
CBSI               MOVE PARM-ACCOUNT-NO       TO HOSTVAR-ELEMENT-4      
T18326             MOVE 'N'                   TO SEND-DONE-SW           
T18326             PERFORM 8100-SEND-RESULT   THRU 8100-EXIT            
T18326             PERFORM 8900-SEND-DONE     THRU 8900-EXIT            
T18326             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
T18326     END-EVALUATE.                                                
T18326                                                                  
T18326 7850-EXIT.                                                       
T18326     EXIT.                                                        
T18326                                                                  
T18326******************************************************************        
T18326* 7860-MAX-END-DATE                                              *        
T18326*     CALLS       9000-SEND-ERROR-RESULT                         *        
T18326*                 9900-SQL-ERROR-ROUTINE                         *        
T18326*                                                                *        
T18326*     CALLED FROM 7850-NULL-END-DATE                             *        
T18326*                                                                *        
T18326*     MAX DATE_UTIL_SVC_END AT PREMISE                           *        
T18326******************************************************************        
T18326                                                                  
T18326 7860-MAX-END-DATE.                                               
T18326                                                                  
T18326     MOVE '7860'                         TO ACTIVE-PARAGRAPH.     
T18326     MOVE '7860-MAX-END-DATE'            TO RS-ACTIVE-PARA.       
T18326     MOVE 'FETCH CURRENT ACTIVE ACCOUNT' TO RS-TABLE-NAME.        
T18326                                                                  
T18326     EXEC SQL                                                     
T18326        SELECT MAX(DATE_UTIL_SVC_END)                             
T18326          INTO :WS-DATE-UTIL-SVC-END :WS-NULL-INDICATOR            
T18326          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT        AT                              
T18326         WHERE CH.PREMISE_NO = :WS-PREMISE-NO                     
T18326           AND AT.COMPANY_NO = :PARM-COMPANY-NO                   
T18326           AND CH.ACCOUNT_NO = AT.ACCOUNT_NO                      
T18326     END-EXEC.                                                    

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

T18326                                                                  
T18326     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE  
T18326                                           RS-RETURN-CODE.        
T18326                                                                  
T18326     EVALUATE WS-ACTIVE-RETURN-CODE                               
T18326         WHEN SUCCESSFUL-CALL                                     
T18326             CONTINUE                                             
T18326         WHEN NOT-FOUND                                           
T18326             MOVE LOW-VALUES            TO WS-DATE-UTIL-SVC-END   
T18326         WHEN OTHER                                               
T18326             MOVE PROGRAM-NAME          TO ABEND-PROGRAM          
CBSI               MOVE 'SELECT'              TO ABEND-FUNCTION         
T18326             MOVE 'CSS_ACCOUNT'         TO TABLE-1                
T18326             MOVE 'CSS_CUST_PREM_HIST'  TO TABLE-2                
T18326             MOVE 'PREMISE_NO'          TO TABLE-ELEMENT-1        
T18326             MOVE 'COMPANY_NO'          TO TABLE-ELEMENT-2        
CBSI               MOVE 'ACCOUNT_NO'          TO TABLE-ELEMENT-3        
T18326             MOVE WS-PREMISE-NO         TO HOSTVAR-ELEMENT-1      
T18326             MOVE PARM-COMPANY-NO       TO HOSTVAR-ELEMENT-2      
CBSI               MOVE PARM-ACCOUNT-NO       TO HOSTVAR-ELEMENT-3      
T18326             MOVE 'N'                   TO SEND-DONE-SW           
T18326             PERFORM 8100-SEND-RESULT   THRU 8100-EXIT            
T18326             PERFORM 8900-SEND-DONE     THRU 8900-EXIT            
T18326             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
T18326     END-EVALUATE.                                                
T18326                                                                  
T18326     IF (WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND              
T18326        WS-NULL-INDICATOR NOT EQUAL -1)                           
T18326        EXEC SQL                                                  
T18326            SELECT CH.ACCOUNT_NO,                                 
T18326                   AT.CREDIT_GROUP                                
T18326              INTO :RS-ACCOUNT-NO,                                
T18326                   :RS-CREDIT-GROUP                               
T18326              FROM CSS_CUST_PREM_HIST CH,                         
T18326                   CSS_ACCOUNT        AT                          
T18326             WHERE CH.PREMISE_NO         = :WS-PREMISE-NO         
T18326               AND AT.PREMISE_NO         = :WS-PREMISE-NO         
T18326               AND AT.COMPANY_NO         = :PARM-COMPANY-NO       
T18326               AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO          
T18326               AND CH.DATE_UTIL_SVC_END  = IIF(TRY_CONVERT(DATE, 
                                                  :WS-DATE-UTIL-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-END
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-END
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-END
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-END) )  
T18326        END-EXEC                                                  

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                          
MFA-TR*           SELECT CH.ACCOUNT_NO,                                         
MFA-TR*                  AT.CREDIT_GROUP                                        
MFA-TR*             INTO :RS-ACCOUNT-NO,                                        
MFA-TR*                  :RS-CREDIT-GROUP                                       
MFA-TR*             FROM CSS_CUST_PREM_HIST CH,                                 
MFA-TR*                  CSS_ACCOUNT        AT                                  
MFA-TR*            WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.COMPANY_NO         = :PARM-COMPANY-NO               
MFA-TR*              AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                  
MFA-TR*              AND CH.DATE_UTIL_SVC_END  = :WS-DATE-UTIL-SVC-END          
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

T18326                                                                  
T18326        MOVE SQLCODE                      TO WS-ACTIVE-RETURN-CODE
T18326                                             RS-RETURN-CODE       
T18326                                                                  
T18326        EVALUATE WS-ACTIVE-RETURN-CODE                            
T18326            WHEN SUCCESSFUL-CALL                                  
T18326            WHEN NOT-FOUND                                        
T18326                CONTINUE                                          
T18326            WHEN WS-DUPLICATE-ROWS                                
T18326                PERFORM 7870-GET-MAX-FINAL-DATE THRU 7870-EXIT    
T18326            WHEN OTHER                                            
T18326                MOVE PROGRAM-NAME          TO ABEND-PROGRAM       
T18326                MOVE 'SELECT'              TO ABEND-FUNCTION      
T18326                MOVE 'CSS_ACCOUNT'         TO TABLE-1             
T18326                MOVE 'CSS_CUST_PREM_HIST'  TO TABLE-2             
T18326                MOVE 'PREMISE_NO'          TO TABLE-ELEMENT-1     
T18326                MOVE 'COMPANY_NO'          TO TABLE-ELEMENT-2     
T18326                MOVE 'DATE_UTIL_SVC_END'   TO TABLE-ELEMENT-3     
CBSI                  MOVE 'ACCOUNT_NO'          TO TABLE-ELEMENT-4     
T18326                MOVE WS-PREMISE-NO         TO HOSTVAR-ELEMENT-1   
T18326                MOVE PARM-COMPANY-NO       TO HOSTVAR-ELEMENT-2   
T18326                MOVE WS-DATE-UTIL-SVC-END  TO HOSTVAR-ELEMENT-3   
CBSI                  MOVE PARM-ACCOUNT-NO       TO HOSTVAR-ELEMENT-4   
T18326                MOVE 'N'                   TO SEND-DONE-SW        
T18326                PERFORM 8100-SEND-RESULT   THRU 8100-EXIT         
T18326                PERFORM 8900-SEND-DONE     THRU 8900-EXIT         
T18326                PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT     
T18326         END-EVALUATE
           END-IF.                                            
T18326                                                                  
T18326 7860-EXIT.                                                       
T18326     EXIT.                                                        
T18326                                                                  
T18326******************************************************************        
T18326* 7870-GET-MAX-FINAL-DATE                                        *        
T18326*     CALLS       9000-SEND-ERROR-RESULT                         *        
T18326*                 9900-SQL-ERROR-ROUTINE                         *        
T18326*                                                                *        
T18326*     CALLED FROM 7860-MAX-END-DATE                              *        
T18326*                                                                *        
T18326*     MAX ACCT_FINALED_DT AT PREMISE                             *        
T18326******************************************************************        
T18326                                                                  
T18326 7870-GET-MAX-FINAL-DATE.                                         
T18326                                                                  
T18326     MOVE '7870'                        TO ACTIVE-PARAGRAPH.      
T18326     MOVE '7870-GET-MAX-FINAL-DATE'     TO RS-ACTIVE-PARA.        
T18326     MOVE 'GET MAX FINAL DATE'          TO RS-TABLE-NAME.         
T18326                                                                  
T18326     EXEC SQL                                                     
T18326        SELECT REPLACE(REPLACE(CONVERT(CHAR(26), MAX(
           AT.ACCT_FINALED_DT), 121), ' ', '-'), ':', '.')                     
T18326          INTO :WS-MAX-AT-FINAL-DT                                
T18326          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT        AT                              
T18326         WHERE CH.PREMISE_NO         = :WS-PREMISE-NO             
T18326           AND AT.COMPANY_NO         = :PARM-COMPANY-NO           
T18326           AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO              
T18326           AND CH.DATE_UTIL_SVC_END  = IIF(TRY_CONVERT(DATE, 
                                                  :WS-DATE-UTIL-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-END
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-END
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-END
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-END) )      
T18326     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT MAX(AT.ACCT_FINALED_DT)                                    
MFA-TR*         INTO :WS-MAX-AT-FINAL-DT                                        
MFA-TR*         FROM CSS_CUST_PREM_HIST CH,                                     
MFA-TR*              CSS_ACCOUNT        AT                                      
MFA-TR*        WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                     
MFA-TR*          AND AT.COMPANY_NO         = :PARM-COMPANY-NO                   
MFA-TR*          AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                      
MFA-TR*          AND CH.DATE_UTIL_SVC_END  = :WS-DATE-UTIL-SVC-END              
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

T18326                                                                  
T18326     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE. 
T18326                                                                  
T18326     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T18326         NEXT SENTENCE                                            
T18326     ELSE                                                         
T18326         MOVE SQLCODE                   TO RS-RETURN-CODE         
T18326         MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
T18326         MOVE 'SELECT'                  TO ABEND-FUNCTION         
T18326         MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
T18326         MOVE 'CSS_ACCOUNT'             TO TABLE-2                
T18326         MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
T18326         MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
T18326         MOVE 'DATE_UTIL_SVC_END'       TO TABLE-ELEMENT-2        
T18326         MOVE WS-DATE-UTIL-SVC-END      TO HOSTVAR-ELEMENT-2      
CBSI           MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-3        
CBSI           MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-3      
CBSI           MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-4        
CBSI           MOVE PARM-ACCOUNT-NO           TO HOSTVAR-ELEMENT-4      
T18326         MOVE 'N'                       TO SEND-DONE-SW           
T18326         PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
T18326         PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
T18326         PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
T18326     END-IF.                                                      
T18326                                                                  
T18326     EXEC SQL                                                     
T18326        SELECT CH.ACCOUNT_NO,                                     
T18326               AT.CREDIT_GROUP                                    
T18326          INTO :RS-ACCOUNT-NO,                                    
T18326               :RS-CREDIT-GROUP                                   
T18326          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT        AT                              
T18326         WHERE CH.PREMISE_NO             = :WS-PREMISE-NO         
T18326           AND AT.PREMISE_NO             = :WS-PREMISE-NO         
T18326           AND AT.COMPANY_NO             = :PARM-COMPANY-NO       
T18326           AND CH.ACCOUNT_NO             = AT.ACCOUNT_NO          
T18326           AND CH.DATE_UTIL_SVC_END      = IIF(TRY_CONVERT(DATE, 
                                                  :WS-DATE-UTIL-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-END
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-END
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-END
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-END) )  
T18326           AND AT.ACCT_FINALED_DT        = CIS.CHAR2TIMESTAMP(
                                                    :WS-MAX-AT-FINAL-DT
              )    
T18326     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT CH.ACCOUNT_NO,                                             
MFA-TR*              AT.CREDIT_GROUP                                            
MFA-TR*         INTO :RS-ACCOUNT-NO,                                            
MFA-TR*              :RS-CREDIT-GROUP                                           
MFA-TR*         FROM CSS_CUST_PREM_HIST CH,                                     
MFA-TR*              CSS_ACCOUNT        AT                                      
MFA-TR*        WHERE CH.PREMISE_NO             = :WS-PREMISE-NO                 
MFA-TR*          AND AT.PREMISE_NO             = :WS-PREMISE-NO                 
MFA-TR*          AND AT.COMPANY_NO             = :PARM-COMPANY-NO               
MFA-TR*          AND CH.ACCOUNT_NO             = AT.ACCOUNT_NO                  
MFA-TR*          AND CH.DATE_UTIL_SVC_END      = :WS-DATE-UTIL-SVC-END          
MFA-TR*          AND AT.ACCT_FINALED_DT        = :WS-MAX-AT-FINAL-DT            
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

T18326                                                                  
T18326     MOVE SQLCODE                        TO WS-ACTIVE-RETURN-CODE 
T18326                                         RS-RETURN-CODE.          
T18326                                                                  
T18721     EVALUATE WS-ACTIVE-RETURN-CODE                               
T18721         WHEN SUCCESSFUL-CALL                                     
T18326             CONTINUE                                             
T18721         WHEN WS-DUPLICATE-ROWS                                   
T18721             PERFORM 7875-GET-MAX-CREATE-DATE THRU 7875-EXIT      
T18721         WHEN OTHER                                               
T18326             MOVE PROGRAM-NAME            TO ABEND-PROGRAM        
T18326             MOVE 'SELECT'                TO ABEND-FUNCTION       
T18326             MOVE 'CSS_CUST_PREM_HIST'    TO TABLE-1              
T18326             MOVE 'CSS_ACCOUNT'           TO TABLE-2              
T18326             MOVE 'PREMISE_NO'            TO TABLE-ELEMENT-1      
T18326             MOVE WS-PREMISE-NO           TO HOSTVAR-ELEMENT-1    
T18326             MOVE 'COMPANY_NO'            TO TABLE-ELEMENT-2      
T18326             MOVE PARM-COMPANY-NO         TO HOSTVAR-ELEMENT-2    
CBSI               MOVE 'DATE_UTIL_SVC_END '    TO TABLE-ELEMENT-3      
CBSI               MOVE WS-DATE-UTIL-SVC-END    TO HOSTVAR-ELEMENT-3    
CBSI               MOVE 'ACCT_FINALED_DT'       TO TABLE-ELEMENT-4      
CBSI               MOVE WS-MAX-AT-FINAL-DT      TO HOSTVAR-ELEMENT-4    
T18326             MOVE 'N'                     TO SEND-DONE-SW         
T18326             PERFORM 8100-SEND-RESULT     THRU 8100-EXIT          
T18326             PERFORM 8900-SEND-DONE       THRU 8900-EXIT          
T18326             PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT        
T18721     END-EVALUATE.                                                
T18326                                                                  
T18326 7870-EXIT.                                                       
T18326     EXIT.                                                        
                                                                        
T18721******************************************************************        
T20443* 7874-GET-DATE-UTIL-SVC-STRT                                    *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM                                                *        
      *                                                                *        
      *     MAX ACCT_CREATE_DT AT PREMISE                              *        
      ******************************************************************        
                                                                        
       7874-GET-DATE-UTIL-SVC-STRT.                                     
                                                                        
           MOVE '7874'                         TO ACTIVE-PARAGRAPH.     
           MOVE '7874-GET-DATE-UTIL-SVC-STRT'  TO RS-ACTIVE-PARA.       
           MOVE 'GET DATE UTIL SVC STRT'       TO RS-TABLE-NAME.        
                                                                        
           EXEC SQL                                                     
              SELECT MAX(DISTINCT(DATE_UTIL_SVC_STRT))                  
                INTO :WS-MAX-DT-UTL-SVC-STRT :WS-NULL-INDICATOR          
                FROM CSS_CUST_PREM_HIST                                 
               WHERE PREMISE_NO         = :WS-PREMISE-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. 
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                    
               MOVE LOW-VALUES                TO WS-MAX-DT-UTL-SVC-STRT 
           ELSE                                                         
               MOVE SQLCODE                   TO RS-RETURN-CODE         
               MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
               MOVE 'SELECT'                  TO ABEND-FUNCTION         
               MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
               MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
               MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
               PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
               PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
               PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
           END-IF
           END-IF.                                                      
                                                                        
       7874-EXIT.                                                       
           EXIT.                                                        
                                                                        
T18721******************************************************************        
T18721* 7875-GET-MAX-CREATE-DATE                                       *        
T18721*     CALLS       9000-SEND-ERROR-RESULT                         *        
T18721*                 9900-SQL-ERROR-ROUTINE                         *        
T18721*                                                                *        
T18721*     CALLED FROM 7870-GET-MAX-END-DATE                          *        
T18721*                                                                *        
T18721*     MAX ACCT_CREATE_DT AT PREMISE                              *        
T18721******************************************************************        
T18721                                                                  
T18721 7875-GET-MAX-CREATE-DATE.                                        
T18721                                                                  
T18721     MOVE '7875'                        TO ACTIVE-PARAGRAPH.      
T18721     MOVE '7875-GET-MAX-CREATE-DATE'    TO RS-ACTIVE-PARA.        
T18721     MOVE 'GET MAX CREATE DATE'          TO RS-TABLE-NAME.        
T18721                                                                  
T18721     EXEC SQL                                                     
T18721        SELECT REPLACE(REPLACE(CONVERT(CHAR(26), MAX(
           AT.ACCT_CREATE_DT), 121), ' ', '-'), ':', '.')                      
T18721          INTO :WS-MAX-AT-CREATE-DT                               
T18721          FROM CSS_CUST_PREM_HIST CH,                             
T18721               CSS_ACCOUNT        AT                              
T18721         WHERE CH.PREMISE_NO         = :WS-PREMISE-NO             
T18721           AND AT.COMPANY_NO         = :PARM-COMPANY-NO           
T18721           AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO              
T18721           AND CH.DATE_UTIL_SVC_END  = IIF(TRY_CONVERT(DATE, 
                                                  :WS-DATE-UTIL-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-END
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-END
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-END
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-END) )      
T18721           AND AT.ACCT_FINALED_DT    = CIS.CHAR2TIMESTAMP(
                                                    :WS-MAX-AT-FINAL-DT
              )        
T18721     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT MAX(AT.ACCT_CREATE_DT)                                     
MFA-TR*         INTO :WS-MAX-AT-CREATE-DT                                       
MFA-TR*         FROM CSS_CUST_PREM_HIST CH,                                     
MFA-TR*              CSS_ACCOUNT        AT                                      
MFA-TR*        WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                     
MFA-TR*          AND AT.COMPANY_NO         = :PARM-COMPANY-NO                   
MFA-TR*          AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                      
MFA-TR*          AND CH.DATE_UTIL_SVC_END  = :WS-DATE-UTIL-SVC-END              
MFA-TR*          AND AT.ACCT_FINALED_DT    = :WS-MAX-AT-FINAL-DT                
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

T18721                                                                  
T18721     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE. 
T18721                                                                  
T18721     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T18721         NEXT SENTENCE                                            
T18721     ELSE                                                         
T18721         MOVE SQLCODE                   TO RS-RETURN-CODE         
T18721         MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
T18721         MOVE 'SELECT'                  TO ABEND-FUNCTION         
T18721         MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
T18721         MOVE 'CSS_ACCOUNT'             TO TABLE-2                
T18721         MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
T18721         MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
T18721         MOVE 'DATE_UTIL_SVC_END'       TO TABLE-ELEMENT-2        
T18721         MOVE WS-DATE-UTIL-SVC-END      TO HOSTVAR-ELEMENT-2      
CBSI           MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-3        
CBSI           MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-3      
CBSI           MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-4        
CBSI           MOVE PARM-ACCOUNT-NO           TO HOSTVAR-ELEMENT-4      
T18721         MOVE 'N'                       TO SEND-DONE-SW           
T18721         PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
T18721         PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
T18721         PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
T18721     END-IF.                                                      
T18721                                                                  
T18721     EXEC SQL                                                     
T18721        SELECT CH.ACCOUNT_NO,                                     
T18721               AT.CREDIT_GROUP                                    
T18721          INTO :RS-ACCOUNT-NO,                                    
T18721               :RS-CREDIT-GROUP                                   
T18721          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT            AT                          
T18326         WHERE CH.PREMISE_NO             = :WS-PREMISE-NO         
T18326           AND AT.PREMISE_NO             = :WS-PREMISE-NO         
T18326           AND AT.COMPANY_NO             = :PARM-COMPANY-NO       
T18326           AND CH.ACCOUNT_NO             = AT.ACCOUNT_NO          
T18326           AND CH.DATE_UTIL_SVC_END      = IIF(TRY_CONVERT(DATE, 
                                                  :WS-DATE-UTIL-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-END
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-END
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-END
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-END) )  
T18721           AND AT.ACCT_CREATE_DT         = CIS.CHAR2TIMESTAMP(
                                                   :WS-MAX-AT-CREATE-DT
              )   
T18326     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT CH.ACCOUNT_NO,                                             
MFA-TR*              AT.CREDIT_GROUP                                            
MFA-TR*         INTO :RS-ACCOUNT-NO,                                            
MFA-TR*              :RS-CREDIT-GROUP                                           
MFA-TR*         FROM CSS_CUST_PREM_HIST CH,                                     
MFA-TR*              CSS_ACCOUNT            AT                                  
MFA-TR*        WHERE CH.PREMISE_NO             = :WS-PREMISE-NO                 
MFA-TR*          AND AT.PREMISE_NO             = :WS-PREMISE-NO                 
MFA-TR*          AND AT.COMPANY_NO             = :PARM-COMPANY-NO               
MFA-TR*          AND CH.ACCOUNT_NO             = AT.ACCOUNT_NO                  
MFA-TR*          AND CH.DATE_UTIL_SVC_END      = :WS-DATE-UTIL-SVC-END          
MFA-TR*          AND AT.ACCT_CREATE_DT         = :WS-MAX-AT-CREATE-DT           
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

T18326                                                                  
T18326     MOVE SQLCODE                        TO WS-ACTIVE-RETURN-CODE 
T18326                                         RS-RETURN-CODE.          
T18326                                                                  
T18326     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T18326        NEXT SENTENCE                                             
T18326     ELSE                                                         
T18326        MOVE PROGRAM-NAME                 TO ABEND-PROGRAM        
T18326        MOVE 'SELECT'                     TO ABEND-FUNCTION       
T18326        MOVE 'CSS_CUST_PREM_HIST'         TO TABLE-1              
T18326        MOVE 'CSS_ACCOUNT'                TO TABLE-2              
T18326        MOVE 'PREMISE_NO'                 TO TABLE-ELEMENT-1      
T18326        MOVE WS-PREMISE-NO                TO HOSTVAR-ELEMENT-1    
T18326        MOVE 'COMPANY_NO'                 TO TABLE-ELEMENT-2      
T18326        MOVE PARM-COMPANY-NO              TO HOSTVAR-ELEMENT-2    
CBSI          MOVE 'DATE_UTIL_SVC_END '         TO TABLE-ELEMENT-3      
CBSI          MOVE WS-DATE-UTIL-SVC-END         TO HOSTVAR-ELEMENT-3    
CBSI          MOVE 'ACCT_FINALED_DT'            TO TABLE-ELEMENT-4      
CBSI          MOVE WS-MAX-AT-FINAL-DT           TO HOSTVAR-ELEMENT-4    
T18326        MOVE 'N'                          TO SEND-DONE-SW         
T18326        PERFORM 8100-SEND-RESULT          THRU 8100-EXIT          
T18326        PERFORM 8900-SEND-DONE            THRU 8900-EXIT          
T18326        PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT
           END-IF.            
T18326                                                                  
T18721 7875-EXIT.                                                       
T18326     EXIT.                                                        
                                                                        
T18326 7880-VALIDATE-ACCOUNT.                                           
T18326                                                                  
T18326     MOVE '7880'                        TO ACTIVE-PARAGRAPH.      
T18326     MOVE '7880-VALIDATE-ACCOUNT'       TO RS-ACTIVE-PARA.        
T18326     MOVE 'VALIDATE ACCOUNT'            TO RS-TABLE-NAME.         
T18326                                                                  
T18326     EXEC SQL                                                     
T18326        SELECT DATE_UTIL_SVC_END                                  
T18326          INTO :WS-ACCT-SVC-END :WS-NULL-DATE                      
T18326          FROM CSS_CUST_PREM_HIST CH,                             
T18326               CSS_ACCOUNT        AT                              
T18326         WHERE CH.PREMISE_NO = :WS-PREMISE-NO                     
T18326           AND CH.ACCOUNT_NO = :WS-TEMP-ACCOUNT-NO                
T18326           AND CH.ACCOUNT_NO = AT.ACCOUNT_NO                      
T18326           AND AT.COMPANY_NO = :PARM-COMPANY-NO                   
T18326     END-EXEC.                                                    

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

T18326                                                                  
T18326     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE  
T18326                                        RS-RETURN-CODE.           
T18326                                                                  
T18326     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T18326         NEXT SENTENCE                                            
T18326     ELSE                                                         
T18326         MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
T18326         MOVE 'SELECT'                  TO ABEND-FUNCTION         
T18326         MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
T18326         MOVE 'CSS_ACCOUNT'             TO TABLE-2                
T18326         MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
T18326         MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
T18326         MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-2        
T18326         MOVE WS-TEMP-ACCOUNT-NO        TO HOSTVAR-ELEMENT-2      
T18326         MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-3        
T18326         MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-3      
T18326         MOVE 'N'                       TO SEND-DONE-SW           
T18326         PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
T18326         PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
T18326         PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
T18326     END-IF.                                                      
T18326                                                                  
T18326     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND               
T18326             WS-NULL-DATE NOT = WS-NULL-VALUE                     
T18326        EXEC SQL                                                  
T18326            SELECT 'N'                                            
T18326              INTO :RS-CURRENT-ACCOUNT                            
T18326              FROM CSS_CUST_PREM_HIST A,                          
T18326                   CSS_ACCOUNT        B                           
T18326             WHERE A.PREMISE_NO         = :WS-PREMISE-NO          
T18326               AND A.ACCOUNT_NO         = B.ACCOUNT_NO            
T18326               AND A.PREMISE_NO         = B.PREMISE_NO            
T18326               AND (A.DATE_UTIL_SVC_END  > IIF(TRY_CONVERT(DATE, 
                                                       :WS-ACCT-SVC-END
              ) IS NULL OR (PATINDEX('%.%', :WS-ACCT-SVC-END
              ) <> 0) OR (LEN(:WS-ACCT-SVC-END) <> 10), CIS.CHAR2DATE(
                                                       :WS-ACCT-SVC-END
              ), CONVERT(DATE, :WS-ACCT-SVC-END) )       
T18326                OR  A.DATE_UTIL_SVC_END  IS NULL)                 
T18326               AND B.CODE_ACCT_STAT     = 'A'                     
T18326        END-EXEC                                                  

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                          
MFA-TR*           SELECT 'N'                                                    
MFA-TR*             INTO :RS-CURRENT-ACCOUNT                                    
MFA-TR*             FROM CSS_CUST_PREM_HIST A,                                  
MFA-TR*                  CSS_ACCOUNT        B                                   
MFA-TR*            WHERE A.PREMISE_NO         = :WS-PREMISE-NO                  
MFA-TR*              AND A.ACCOUNT_NO         = B.ACCOUNT_NO                    
MFA-TR*              AND A.PREMISE_NO         = B.PREMISE_NO                    
MFA-TR*              AND (A.DATE_UTIL_SVC_END  > :WS-ACCT-SVC-END               
MFA-TR*               OR  A.DATE_UTIL_SVC_END  IS NULL)                         
MFA-TR*              AND B.CODE_ACCT_STAT     = 'A'                             
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

T18326                                                                  
T18326        MOVE SQLCODE                    TO WS-ACTIVE-RETURN-CODE  
T18326                                           RS-RETURN-CODE         
T18326                                                                  
T18326        IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND   
T18326            NEXT SENTENCE                                         
T18326        ELSE                                                      
T18326            MOVE PROGRAM-NAME              TO ABEND-PROGRAM       
T18326            MOVE 'SELECT'                  TO ABEND-FUNCTION      
T18326            MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1             
T18326            MOVE 'CSS_ACCOUNT'             TO TABLE-2             
T18326            MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1     
T18326            MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1   
CBSI              MOVE 'DATE_UTIL_SVC_END '      TO TABLE-ELEMENT-2     
CBSI              MOVE  WS-ACCT-SVC-END          TO HOSTVAR-ELEMENT-2   
CBSI              MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-3     
CBSI              MOVE  PARM-ACCOUNT-NO          TO HOSTVAR-ELEMENT-3   
T18326            MOVE 'N'                       TO SEND-DONE-SW        
T18326            PERFORM 8100-SEND-RESULT       THRU 8100-EXIT         
T18326            PERFORM 8900-SEND-DONE         THRU 8900-EXIT         
T18326            PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT         
T18326        END-IF                                                    
T18326     END-IF.                                                      
T18326                                                                  
T18326 7880-EXIT.                                                       
T18326     EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7900-FETCH-UM-DESC                                             *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5600-FETCH-RATE-DESC                           *        
      *                                                                *        
      *     FETCH DESCRIPTION FOR UNMETERED RATE PLAN                  *        
      ******************************************************************        
                                                                        
       7900-FETCH-UM-DESC.                                              
           MOVE '7900'                      TO ACTIVE-PARAGRAPH.        
           MOVE '7900-FETCH-UM-DESC'        TO RS-ACTIVE-PARA.          
           MOVE 'FETCH UNMETERED PLAN DESC' TO RS-TABLE-NAME.           
                                                                        
            EXEC SQL                                                    
              SELECT L9.UM_EQUIP_ID, L9.UM_EQUIP_SHRT_DESC              
                  INTO :RS-CP-EQUIP-ID, :RS-UT-RATE-DESC                
              FROM CSS_UNMTR_PLAN   UP,                                 
                   CSS_UM_EQUIPMENT L9                                  
              WHERE UP.CODE_UTIL_TYPE   = :UT-CODE-UTIL-TYPE            
              AND   UP.RATE_PLAN_NO     = :WS-RATE-PLAN-NO              
              AND   UP.VERSION_NO_CNTRL = :WS-VERSION-NO-CNTRL          
              AND   UP.RATE_ITEM_CODE   = :CP-RATE-ITEM-CODE            
              AND   UP.UM_EQUIP_ID      =  L9.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.        
                                                                        
T14862     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_UNMTR_PLAN'           TO TABLE-1                
T16498        MOVE 'CSS_UM_EQUIPMENT'         TO TABLE-2                
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-1        
              MOVE 'RATE_PLAN_NO'             TO TABLE-ELEMENT-2        
              MOVE 'RATE_ITEM_CODE'           TO TABLE-ELEMENT-3        
              MOVE 'VERSION_NO_CNTRL'         TO TABLE-ELEMENT-4        
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-1      
              MOVE WS-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
T16498        MOVE CP-RATE-ITEM-CODE          TO HOSTVAR-ELEMENT-3      
              MOVE WS-VERSION-NO-CNTRL        TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7900-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7950-FETCH-CUR-ACCT                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5000-FETCH-CUR-ACCOUNT                         *        
      *                                                                *        
      *     FETCH CURRENT ACTIVE ACCOUNT AT THE PREMISE.               *        
      ******************************************************************        
                                                                        
       7950-FETCH-CUR-ACCT.                                             
                                                                        
           MOVE '7950'                         TO ACTIVE-PARAGRAPH.     
           MOVE '7950-FETCH-CUR-ACCT'          TO RS-ACTIVE-PARA.       
           MOVE 'FETCH CURRENT ACTIVE ACCOUNT' TO RS-TABLE-NAME.        
                                                                        
           EXEC SQL                                                     
              SELECT MAX(DATE_UTIL_SVC_STRT)                            
                INTO :WS-DATE-UTIL-SVC-STRT :WS-NULL-INDICATOR           
                FROM CSS_CUST_PREM_HIST CH,                             
                     CSS_ACCOUNT        AT                              
               WHERE CH.PREMISE_NO = :WS-PREMISE-NO                     
                 AND AT.COMPANY_NO = :PARM-COMPANY-NO                   
                 AND CH.ACCOUNT_NO = AT.ACCOUNT_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 IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                    
              MOVE LOW-VALUES                 TO WS-DATE-UTIL-SVC-STRT  
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_ACCOUNT'              TO TABLE-1                
              MOVE 'CSS_CUST_PREM_HIST'       TO TABLE-2                
              MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-1        
              MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-2        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-3        
              MOVE WS-PREMISE-NO              TO HOSTVAR-ELEMENT-1      
              MOVE PARM-COMPANY-NO            TO HOSTVAR-ELEMENT-2      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-3      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF
           END-IF.                                                      
                                                                        
           IF (WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND              
              WS-NULL-INDICATOR NOT EQUAL -1)                           
              EXEC SQL                                                  
                  SELECT CH.ACCOUNT_NO,                                 
                         AT.CREDIT_GROUP                                
                    INTO :RS-ACCOUNT-NO,                                
                         :RS-CREDIT-GROUP                               
                    FROM CSS_CUST_PREM_HIST CH,                         
                         CSS_ACCOUNT        AT                          
                   WHERE CH.PREMISE_NO         = :WS-PREMISE-NO         
                     AND AT.PREMISE_NO         = :WS-PREMISE-NO         
                     AND AT.COMPANY_NO         = :PARM-COMPANY-NO       
                     AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO          
                     AND CH.DATE_UTIL_SVC_STRT = IIF(TRY_CONVERT(DATE, 
                                                 :WS-DATE-UTIL-SVC-STRT
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-STRT
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-STRT
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-STRT
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-STRT) ) 
              END-EXEC                                                  

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                          
MFA-TR*           SELECT CH.ACCOUNT_NO,                                         
MFA-TR*                  AT.CREDIT_GROUP                                        
MFA-TR*             INTO :RS-ACCOUNT-NO,                                        
MFA-TR*                  :RS-CREDIT-GROUP                                       
MFA-TR*             FROM CSS_CUST_PREM_HIST CH,                                 
MFA-TR*                  CSS_ACCOUNT        AT                                  
MFA-TR*            WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.COMPANY_NO         = :PARM-COMPANY-NO               
MFA-TR*              AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                  
MFA-TR*              AND CH.DATE_UTIL_SVC_STRT = :WS-DATE-UTIL-SVC-STRT         
MFA-TR*       END-EXEC                                                          

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

                                                                        
              MOVE SQLCODE                      TO WS-ACTIVE-RETURN-CODE
                                                   RS-RETURN-CODE       
              IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND   
                  NEXT SENTENCE                                         
              ELSE IF WS-ACTIVE-RETURN-CODE = WS-DUPLICATE-ROWS         
                  PERFORM 7952-GET-CUR-ACCT      THRU 7952-EXIT         
                  GO TO 7950-EXIT                                       
              ELSE                                                      
                  MOVE PROGRAM-NAME              TO ABEND-PROGRAM       
T16498            MOVE 'SELECT'                  TO ABEND-FUNCTION      
                  MOVE 'CSS_ACCOUNT'             TO TABLE-1             
                  MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-2             
                  MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1     
                  MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-2     
                  MOVE 'DATE_UTIL_SVC_STRT'      TO TABLE-ELEMENT-3     
CBSI              MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-4     
                  MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1   
                  MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-2   
                  MOVE WS-DATE-UTIL-SVC-STRT     TO HOSTVAR-ELEMENT-3   
CBSI              MOVE PARM-ACCOUNT-NO           TO HOSTVAR-ELEMENT-4   
                  MOVE 'N'                       TO SEND-DONE-SW        
                  PERFORM 8100-SEND-RESULT       THRU 8100-EXIT         
                  PERFORM 8900-SEND-DONE         THRU 8900-EXIT         
                  PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT         
               END-IF
              END-IF                                                   
            ELSE                                                        
               NEXT SENTENCE                                            
            END-IF.                                                     
                                                                        
       7950-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7951-VALIDATE-ACCOUNT                                          *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5000-FETCH-CUR-ACCOUNT                         *        
      *                                                                *        
      *     CHECKS TO SEE IF THE ACCOUNT IS THE MOST CURRENT ACCOUNT   *        
      *     AT THIS PREMISE.                                           *        
      ******************************************************************        
       7951-VALIDATE-ACCOUNT.                                           
                                                                        
           MOVE '7951'                        TO ACTIVE-PARAGRAPH.      
           MOVE '7951-VALIDATE-ACCOUNT'       TO RS-ACTIVE-PARA.        
           MOVE 'VALIDATE ACCOUNT'            TO RS-TABLE-NAME.         
                                                                        
           EXEC SQL                                                     
              SELECT DATE_UTIL_SVC_STRT                                 
                INTO :WS-ACCT-SVC-STRT :WS-NULL-DATE                     
                FROM CSS_CUST_PREM_HIST CH,                             
                     CSS_ACCOUNT        AT                              
               WHERE CH.PREMISE_NO = :WS-PREMISE-NO                     
                 AND CH.ACCOUNT_NO = :WS-TEMP-ACCOUNT-NO                
                 AND CH.ACCOUNT_NO = AT.ACCOUNT_NO                      
                 AND AT.COMPANY_NO = :PARM-COMPANY-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          
T16498         MOVE 'SELECT'                  TO ABEND-FUNCTION         
               MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
               MOVE 'CSS_ACCOUNT'             TO TABLE-2                
               MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
               MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
               MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-2        
T16498         MOVE WS-TEMP-ACCOUNT-NO        TO HOSTVAR-ELEMENT-2      
               MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-3        
               MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-3      
               MOVE 'N'                       TO SEND-DONE-SW           
               PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
               PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
               PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL AND               
                   WS-NULL-DATE NOT = WS-NULL-VALUE                     
              EXEC SQL                                                  
                  SELECT 'N'                                            
                    INTO :RS-CURRENT-ACCOUNT                            
                    FROM CSS_CUST_PREM_HIST A,                          
                         CSS_ACCOUNT        B                           
                   WHERE A.PREMISE_NO         = :WS-PREMISE-NO          
                     AND A.ACCOUNT_NO         = B.ACCOUNT_NO            
                     AND A.PREMISE_NO         = B.PREMISE_NO            
                     AND A.DATE_UTIL_SVC_STRT > IIF(TRY_CONVERT(DATE, 
                                                      :WS-ACCT-SVC-STRT
              ) IS NULL OR (PATINDEX('%.%', :WS-ACCT-SVC-STRT
              ) <> 0) OR (LEN(:WS-ACCT-SVC-STRT) <> 10), CIS.CHAR2DATE(
                                                      :WS-ACCT-SVC-STRT
              ), CONVERT(DATE, :WS-ACCT-SVC-STRT) )       
                     AND B.CODE_ACCT_STAT     = 'A'                     
              END-EXEC                                                  

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                          
MFA-TR*           SELECT 'N'                                                    
MFA-TR*             INTO :RS-CURRENT-ACCOUNT                                    
MFA-TR*             FROM CSS_CUST_PREM_HIST A,                                  
MFA-TR*                  CSS_ACCOUNT        B                                   
MFA-TR*            WHERE A.PREMISE_NO         = :WS-PREMISE-NO                  
MFA-TR*              AND A.ACCOUNT_NO         = B.ACCOUNT_NO                    
MFA-TR*              AND A.PREMISE_NO         = B.PREMISE_NO                    
MFA-TR*              AND A.DATE_UTIL_SVC_STRT > :WS-ACCT-SVC-STRT               
MFA-TR*              AND B.CODE_ACCT_STAT     = 'A'                             
MFA-TR*       END-EXEC                                                          

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

                                                                        
              MOVE SQLCODE                    TO WS-ACTIVE-RETURN-CODE  
                                                 RS-RETURN-CODE         
                                                                        
              IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND   
                  NEXT SENTENCE                                         
              ELSE                                                      
                  MOVE PROGRAM-NAME              TO ABEND-PROGRAM       
T16498            MOVE 'SELECT'                  TO ABEND-FUNCTION      
                  MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1             
T16498            MOVE 'CSS_ACCOUNT'             TO TABLE-2             
                  MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1     
                  MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1   
T16498            MOVE 'DATE_UTIL_SVC_STRT'      TO TABLE-ELEMENT-2     
T16498            MOVE WS-ACCT-SVC-STRT          TO HOSTVAR-ELEMENT-2   
CBSI              MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-3     
CBSI              MOVE PARM-ACCOUNT-NO           TO HOSTVAR-ELEMENT-3   
                  MOVE 'N'                       TO SEND-DONE-SW        
                  PERFORM 8100-SEND-RESULT       THRU 8100-EXIT         
                  PERFORM 8900-SEND-DONE         THRU 8900-EXIT         
                  PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT         
              END-IF                                                    
           END-IF.                                                      
                                                                        
       7951-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7952-GET-CUR-ACCT                                              *        
      *     IN THE CASE THAT TWO ACCOUNTS HAVE BEEN PROCESSED ON THE   *        
      *     SAME DAY, DETERMINE WHICH ACCOUNT IS THE MOST CURRENT.     *        
      ******************************************************************        
       7952-GET-CUR-ACCT.                                               
                                                                        
           MOVE '7952'                        TO ACTIVE-PARAGRAPH.      
           MOVE '7952-GET-CUR-ACCT'           TO RS-ACTIVE-PARA.        
           MOVE 'DETERMINE CURRENT ACCT'      TO RS-TABLE-NAME.         
                                                                        
           EXEC SQL                                                     
               SELECT CH.ACCOUNT_NO,                                    
                      AT.CREDIT_GROUP                                   
                 INTO :RS-ACCOUNT-NO,                                   
                      :RS-CREDIT-GROUP                                  
                 FROM CSS_CUST_PREM_HIST CH,                            
                      CSS_ACCOUNT        AT                             
                WHERE CH.PREMISE_NO         = :WS-PREMISE-NO            
                  AND AT.PREMISE_NO         = :WS-PREMISE-NO            
                  AND AT.COMPANY_NO         = :PARM-COMPANY-NO          
                  AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO             
                  AND CH.DATE_UTIL_SVC_STRT = IIF(TRY_CONVERT(DATE, 
                                                 :WS-DATE-UTIL-SVC-STRT
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-STRT
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-STRT
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-STRT
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-STRT) )    
                  AND CH.DATE_UTIL_SVC_END IS NULL                      
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT CH.ACCOUNT_NO,                                            
MFA-TR*               AT.CREDIT_GROUP                                           
MFA-TR*          INTO :RS-ACCOUNT-NO,                                           
MFA-TR*               :RS-CREDIT-GROUP                                          
MFA-TR*          FROM CSS_CUST_PREM_HIST CH,                                    
MFA-TR*               CSS_ACCOUNT        AT                                     
MFA-TR*         WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                    
MFA-TR*           AND AT.PREMISE_NO         = :WS-PREMISE-NO                    
MFA-TR*           AND AT.COMPANY_NO         = :PARM-COMPANY-NO                  
MFA-TR*           AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                     
MFA-TR*           AND CH.DATE_UTIL_SVC_STRT = :WS-DATE-UTIL-SVC-STRT            
MFA-TR*           AND CH.DATE_UTIL_SVC_END IS NULL                              
MFA-TR*    END-EXEC.                                                            

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

                                                                        
           MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE  
                                                 RS-RETURN-CODE.        
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
               NEXT SENTENCE                                            
           ELSE                                                         
               MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
T16498         MOVE 'SELECT'                  TO ABEND-FUNCTION         
               MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
               MOVE 'CSS_ACCOUNT'             TO TABLE-2                
               MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
               MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
               MOVE 'DATE_UTIL_SVC_STRT'      TO TABLE-ELEMENT-2        
               MOVE WS-DATE-UTIL-SVC-STRT     TO HOSTVAR-ELEMENT-2      
               MOVE 'DATE_UTIL_SVC_END'       TO TABLE-ELEMENT-3        
               MOVE 'NULL'                    TO HOSTVAR-ELEMENT-3      
CBSI           MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-4        
CBSI           MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-4      
               MOVE 'N'                       TO SEND-DONE-SW           
               PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
               PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
               PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
           IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
              PERFORM 7953-GET-MAX-AT-CREATE-DT THRU 7953-EXIT          
                                                                        
              EXEC SQL                                                  
                  SELECT CH.ACCOUNT_NO,                                 
                         AT.CREDIT_GROUP                                
                    INTO :RS-ACCOUNT-NO,                                
                         :RS-CREDIT-GROUP                               
                    FROM CSS_CUST_PREM_HIST CH,                         
                         CSS_ACCOUNT        AT                          
                   WHERE CH.PREMISE_NO         = :WS-PREMISE-NO         
                     AND AT.PREMISE_NO         = :WS-PREMISE-NO         
                     AND AT.COMPANY_NO         = :PARM-COMPANY-NO       
                     AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO          
                     AND CH.DATE_UTIL_SVC_STRT = IIF(TRY_CONVERT(DATE, 
                                                 :WS-DATE-UTIL-SVC-STRT
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-STRT
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-STRT
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-STRT
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-STRT) ) 
                     AND AT.ACCT_CREATE_DT     = CIS.CHAR2TIMESTAMP(
                                                   :WS-MAX-AT-CREATE-DT
              )   
              END-EXEC                                                  

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*       EXEC SQL                                                          
MFA-TR*           SELECT CH.ACCOUNT_NO,                                         
MFA-TR*                  AT.CREDIT_GROUP                                        
MFA-TR*             INTO :RS-ACCOUNT-NO,                                        
MFA-TR*                  :RS-CREDIT-GROUP                                       
MFA-TR*             FROM CSS_CUST_PREM_HIST CH,                                 
MFA-TR*                  CSS_ACCOUNT        AT                                  
MFA-TR*            WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.PREMISE_NO         = :WS-PREMISE-NO                 
MFA-TR*              AND AT.COMPANY_NO         = :PARM-COMPANY-NO               
MFA-TR*              AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                  
MFA-TR*              AND CH.DATE_UTIL_SVC_STRT = :WS-DATE-UTIL-SVC-STRT         
MFA-TR*              AND AT.ACCT_CREATE_DT     = :WS-MAX-AT-CREATE-DT           
MFA-TR*       END-EXEC                                                          

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

                                                                        
              MOVE SQLCODE                      TO WS-ACTIVE-RETURN-CODE
                                                   RS-RETURN-CODE       
                                                                        
              IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                
                 NEXT SENTENCE                                          
              ELSE                                                      
                 MOVE PROGRAM-NAME              TO ABEND-PROGRAM        
T16498           MOVE 'SELECT'                  TO ABEND-FUNCTION       
                 MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1              
                 MOVE 'CSS_ACCOUNT'             TO TABLE-2              
                 MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1      
                 MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1    
                 MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-2      
                 MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-2    
                 MOVE 'DATE_UTIL_SVC_STRT'      TO TABLE-ELEMENT-3      
                 MOVE WS-DATE-UTIL-SVC-STRT     TO HOSTVAR-ELEMENT-3    
                 MOVE 'ACCT_CREATE_DT'          TO TABLE-ELEMENT-4      
                 MOVE WS-MAX-AT-CREATE-DT       TO HOSTVAR-ELEMENT-4    
                 MOVE 'N'                       TO SEND-DONE-SW         
                 PERFORM 8100-SEND-RESULT       THRU 8100-EXIT          
                 PERFORM 8900-SEND-DONE         THRU 8900-EXIT          
                 PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT          
              END-IF                                                    
           END-IF.                                                      
                                                                        
       7952-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7953-GET-MAX-AT-CREATE-DT.                                     *        
      *     OBTAIN THE LATEST TIMESTAMP OF THE ACCOUNT ON THE PREMISE  *        
      *     THAT WAS LAST CREATED.                                     *        
      ******************************************************************        
       7953-GET-MAX-AT-CREATE-DT.                                       
                                                                        
           MOVE '7953'                        TO ACTIVE-PARAGRAPH.      
           MOVE '7953-GET-MAX-AT-CREATE-DT'   TO RS-ACTIVE-PARA.        
           MOVE 'GET MAX CREATE DT AT PREM'   TO RS-TABLE-NAME.         
                                                                        
           EXEC SQL                                                     
              SELECT REPLACE(REPLACE(CONVERT(CHAR(26), MAX(
           AT.ACCT_CREATE_DT), 121), ' ', '-'), ':', '.')                      
                INTO :WS-MAX-AT-CREATE-DT                               
                FROM CSS_CUST_PREM_HIST CH,                             
                     CSS_ACCOUNT        AT                              
               WHERE CH.PREMISE_NO         = :WS-PREMISE-NO             
                 AND AT.COMPANY_NO         = :PARM-COMPANY-NO           
                 AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO              
                 AND CH.DATE_UTIL_SVC_STRT = IIF(TRY_CONVERT(DATE, 
                                                 :WS-DATE-UTIL-SVC-STRT
              ) IS NULL OR (PATINDEX('%.%', :WS-DATE-UTIL-SVC-STRT
              ) <> 0) OR (LEN(:WS-DATE-UTIL-SVC-STRT
              ) <> 10), CIS.CHAR2DATE(:WS-DATE-UTIL-SVC-STRT
              ), CONVERT(DATE, :WS-DATE-UTIL-SVC-STRT) )     
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT MAX(AT.ACCT_CREATE_DT)                                     
MFA-TR*         INTO :WS-MAX-AT-CREATE-DT                                       
MFA-TR*         FROM CSS_CUST_PREM_HIST CH,                                     
MFA-TR*              CSS_ACCOUNT        AT                                      
MFA-TR*        WHERE CH.PREMISE_NO         = :WS-PREMISE-NO                     
MFA-TR*          AND AT.COMPANY_NO         = :PARM-COMPANY-NO                   
MFA-TR*          AND CH.ACCOUNT_NO         = AT.ACCOUNT_NO                      
MFA-TR*          AND CH.DATE_UTIL_SVC_STRT = :WS-DATE-UTIL-SVC-STRT             
MFA-TR*    END-EXEC.                                                            

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

                                                                        
           MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE. 
                                                                        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
               NEXT SENTENCE                                            
           ELSE                                                         
               MOVE SQLCODE                   TO RS-RETURN-CODE         
               MOVE PROGRAM-NAME              TO ABEND-PROGRAM          
T16498         MOVE 'SELECT'                  TO ABEND-FUNCTION         
               MOVE 'CSS_CUST_PREM_HIST'      TO TABLE-1                
               MOVE 'CSS_ACCOUNT'             TO TABLE-2                
               MOVE 'PREMISE_NO'              TO TABLE-ELEMENT-1        
               MOVE WS-PREMISE-NO             TO HOSTVAR-ELEMENT-1      
               MOVE 'DATE_UTIL_SVC_STRT'      TO TABLE-ELEMENT-2        
               MOVE WS-DATE-UTIL-SVC-STRT     TO HOSTVAR-ELEMENT-2      
CBSI           MOVE 'COMPANY_NO'              TO TABLE-ELEMENT-3        
CBSI           MOVE PARM-COMPANY-NO           TO HOSTVAR-ELEMENT-3      
CBSI           MOVE 'ACCOUNT_NO'              TO TABLE-ELEMENT-4        
CBSI           MOVE PARM-ACCOUNT-NO           TO HOSTVAR-ELEMENT-4      
               MOVE 'N'                       TO SEND-DONE-SW           
               PERFORM 8100-SEND-RESULT       THRU 8100-EXIT            
               PERFORM 8900-SEND-DONE         THRU 8900-EXIT            
               PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7953-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************        
      * 7990-SELECT-DEPOSIT                                            *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     SELECT DEPOSIT FOR NEW ACCOUNT IF IT EXISTS                *        
      ******************************************************************        
                                                                        
       7990-SELECT-DEPOSIT.                                             
           MOVE '7990'                      TO ACTIVE-PARAGRAPH.        
           MOVE '7990-SELECT-DEPOSIT'       TO RS-ACTIVE-PARA.          
           MOVE 'FETCH DEPOSIT FOR ACCOUNT' TO RS-TABLE-NAME.           
                                                                        
           EXEC SQL                                                     
               SELECT SUM(AMT_DEPOSIT)                                  
                    INTO :RS-DEPOSIT-AMT :WS-AMT-DEPOSIT-IND            
               FROM CSS_DEP_ON_HAND                                     
               WHERE ACCOUNT_NO        = :WS-ACCOUNT-NO                 
               AND   (DEPOSIT_STATUS_CD = 'A'                           
PCR482          OR    DEPOSIT_STATUS_CD = 'P')                          
           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      
              IF WS-AMT-DEPOSIT-IND = -1                                
                 MOVE 0                       TO RS-DEPOSIT-AMT         
              END-IF                                                    
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
              MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_DEP_ON_HAND'          TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7990-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7991-FETCH-RATE-DESC                                           *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 5200-PROCESS-FETCH-UT                          *        
      *                                                                *        
      *     SELECT RATE DESCRIPTION FOR THE UTILITY                    *        
      ******************************************************************        
                                                                        
       7991-FETCH-RATE-DESC.                                            
           MOVE '7991'                   TO ACTIVE-PARAGRAPH.           
           MOVE '7991-FETCH-RATE-DESC'   TO RS-ACTIVE-PARA.             
           MOVE 'FETCH RATE DESCRIPTION' TO RS-TABLE-NAME.              
                                                                        
           EXEC SQL                                                     
              SELECT RATE_DESC,                                         
T22131               SECURED_RATE_FL                                    
                INTO :RD-RATE-DESC,                                     
T22131               :RD-SECURED-RATE-FL                                
               FROM  CSS_RATE_PLAN_DESC                                 
               WHERE COMPANY_NO        = :PARM-COMPANY-NO               
               AND   RATE_PLAN_NO      = :UT-RATE-PLAN-NO               
               AND   CODE_UTIL_TYPE    = :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                   
T22131        IF RD-SECURED-RATE-FL = 'Y'                               
T22131           MOVE 'Y' TO RS-SECURED-RATE-FL                         
              ELSE                                                      
                 MOVE 'N' TO RS-SECURED-RATE-FL                         
T22131        END-IF                                                    
T22131*       NEXT SENTENCE                                                     
           ELSE                                                         
              MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
T16498        MOVE 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_RATE_PLAN_DESC'       TO TABLE-1                
              MOVE 'COMPANY_NO'               TO TABLE-ELEMENT-1        
              MOVE 'RATE_PLAN_NO'             TO TABLE-ELEMENT-2        
              MOVE 'CODE_UTIL_TYPE'           TO TABLE-ELEMENT-3        
CBSI          MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-4        
              MOVE PARM-COMPANY-NO            TO HOSTVAR-ELEMENT-1      
              MOVE UT-RATE-PLAN-NO            TO HOSTVAR-ELEMENT-2      
              MOVE UT-CODE-UTIL-TYPE          TO HOSTVAR-ELEMENT-3      
CBSI          MOVE PARM-ACCOUNT-NO            TO HOSTVAR-ELEMENT-4      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
       7991-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7992-FETCH-SECURITIES-AMT                                      *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     COMPUTE TOTAL SECURITIES AMOUNT FOR THE ACCOUNT            *        
      ******************************************************************        
                                                                        
       7992-FETCH-SECURITIES-AMT.                                       
           MOVE '7992'                      TO ACTIVE-PARAGRAPH.        
           MOVE '7992-FETCH-SECURITIES-AMT' TO RS-ACTIVE-PARA.          
           MOVE 'FETCH SURETY BOND AMOUNT'  TO RS-TABLE-NAME.           
                                                                        
           EXEC SQL                                                     
               SELECT SUM(AMT_BOND)                                     
                    INTO :WS-SUM-AMT-BOND :WS-NULL-INDICATOR            
               FROM CSS_SURETY_BOND                                     
               WHERE ACCOUNT_NO        = :WS-ACCOUNT-NO                 
               AND   CODE_STATUS       = :WS-ACTIVE-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 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_SURETY_BOND'          TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
      *--FETCH AMOUNT GUARANTEED FROM CSS_GUARANTOR    -->                      
           MOVE 'FETCH AMOUNT GUARANTEED'   TO RS-TABLE-NAME.           
           EXEC SQL                                                     
               SELECT SUM(AMOUNT_GUARANTEED)                            
                    INTO :WS-SUM-AMT-GRNTD :WS-NULL-INDICATOR           
               FROM CSS_GUARANTOR                                       
               WHERE ACCOUNT_NO        = :WS-ACCOUNT-NO                 
               AND GUAR_STATUS_CD      = :WS-ACTIVE-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 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_GUARANTOR'            TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
      *--FETCH AMT_DEPOSIT FROM CSS_DEP_ON_HAND      -->                        
           MOVE 'FETCH AMOUNT DEPOSITED'   TO RS-TABLE-NAME.            
           EXEC SQL                                                     
               SELECT SUM(AMT_DEPOSIT)                                  
                    INTO :WS-SUM-AMT-DEPOSIT :WS-NULL-INDICATOR         
               FROM CSS_DEP_ON_HAND                                     
               WHERE ACCOUNT_NO        = :WS-ACCOUNT-NO                 
               AND   (DEPOSIT_STATUS_CD = 'A'                           
PCR482          OR    DEPOSIT_STATUS_CD = 'P')                          
           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 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_DEP_ON_HAND'          TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
                                                                        
           COMPUTE WS-TOTAL-AMOUNT = WS-SUM-AMT-BOND +                  
                    + WS-SUM-AMT-GRNTD + WS-SUM-AMT-DEPOSIT             
           MOVE WS-TOTAL-AMOUNT TO RS-SEC-TOT-AMT.                      
                                                                        
       7992-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ******************************************************************        
      * 7993-FETCH-ARREARS-CD                                          *        
      *     CALLS       9000-SEND-ERROR-RESULT                         *        
      *                 9900-SQL-ERROR-ROUTINE                         *        
      *                                                                *        
      *     CALLED FROM 2300-BUILD-RESULT                              *        
      *                                                                *        
      *     SELECT CURRENT MONTH ARREARS CODE FROM CSS_CREDIT_PROFILE  *        
      ******************************************************************        
                                                                        
       7993-FETCH-ARREARS-CD.                                           
           MOVE '7993'                           TO ACTIVE-PARAGRAPH.   
           MOVE '7993-FETCH-ARREARS-CD'          TO RS-ACTIVE-PARA.     
           MOVE 'FETCH CURRENT MONTH ARREARS CD' TO RS-TABLE-NAME.      
                                                                        
           EXEC SQL                                                     
               SELECT ARREARS_HIST                                      
                    INTO :WS-ARREARS-HIST                               
               FROM CSS_CREDIT_PROFILE                                  
               WHERE ACCOUNT_NO        = :WS-ACCOUNT-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 'SELECT'                   TO ABEND-FUNCTION         
              MOVE 'CSS_CREDIT_PROFILE'       TO TABLE-1                
              MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
              MOVE WS-ACCOUNT-NO              TO HOSTVAR-ELEMENT-1      
              MOVE 'N'                        TO SEND-DONE-SW           
              PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
              PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
              PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
           END-IF.                                                      
           MOVE WS-ARREARS-HIST(1:1) TO RS-CUR-MTH-ARR-CD.              
                                                                        
       7993-EXIT.                                                       
           EXIT.                                                        
                                                                        
P00390******************************************************************        
P00390* 7994-GET-SPCL-MSG-RTE                                          *        
P00390*     CALLS       9000-SEND-ERROR-RESULT                         *        
P00390*                 9900-SQL-ERROR-ROUTINE                         *        
P00390*                                                                *        
P00390*     CALLED FROM 2300-BUILD-RESULT                              *        
P00390*                                                                *        
P00390*     SELECTS THE ERROR MESSAGE FOR THE READ CYCLE/READ ROUTE    *        
P00390******************************************************************        
P00390                                                                  
P00390 7994-GET-SPCL-MSG-RTE.                                           
P00390     MOVE '7994'                           TO ACTIVE-PARAGRAPH.   
P00390     MOVE '7994-GET-SPCL-MSG-RTE'          TO RS-ACTIVE-PARA.     
P00390     MOVE 'CSS_LOC_OFF_CYC_RT'             TO RS-TABLE-NAME.      
P00390                                                                  
P00390     EXEC SQL                                                     
P00390         SELECT ERROR_MSG_NO                                      
P00390           INTO :O2-ERROR-MSG-NO                                  
P00390         FROM CSS_LOC_OFF_CYC_RT WITH(READUNCOMMITTED)                    
P00390         WHERE COMPANY_NO        = :UT-COMPANY-NO                 
P00390           AND READ_ROUTE        = :UT-READ-ROUTE                 
P00390           AND READ_CYCLE        = :UT-READ-CYCLE                 
P00390                                                           
P00390                                                      
P00390     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT ERROR_MSG_NO                                              
MFA-TR*          INTO :O2-ERROR-MSG-NO                                          
MFA-TR*        FROM CSS_LOC_OFF_CYC_RT                                          
MFA-TR*        WHERE COMPANY_NO        = :UT-COMPANY-NO                         
MFA-TR*          AND READ_ROUTE        = :UT-READ-ROUTE                         
MFA-TR*          AND READ_CYCLE        = :UT-READ-CYCLE                         
MFA-TR*         WITH UR                                                         
MFA-TR*        QUERYNO 7994                                                     
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

P00390                                                                  
P00390     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE RS-RETURN-CODE.        
P00390                                                                  
P00390     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
P00390        NEXT SENTENCE                                             
P00390     ELSE                                                         
P00390        MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
P00390        MOVE 'SELECT'                   TO ABEND-FUNCTION         
P00390        MOVE 'CSS_LOC_OFF_CYC_RT'       TO TABLE-1                
P00390        MOVE 'READ_ROUTE'               TO TABLE-ELEMENT-1        
P00390        MOVE UT-READ-ROUTE              TO HOSTVAR-ELEMENT-1      
P00390        MOVE 'N'                        TO SEND-DONE-SW           
P00390        PERFORM 8100-SEND-RESULT        THRU 8100-EXIT            
P00390        PERFORM 8900-SEND-DONE          THRU 8900-EXIT            
P00390        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
P00390     END-IF.                                                      
P00390                                                                  
P00390 7994-EXIT.                                                       
P00390     EXIT.                                                        
                                                                        
T19557 9500-CALL-CPD00068.                                              
                                                                        
CVT999*    EXEC CICS LINK                                                       
CVT000         CALL WS-MCSCB068                                         
CVT000                         USING CWS00068-FIELDS,                   
CVT000                               WS-CODES-DATA-PRESENT,             
CVT000                               DCLCSS-ACCOUNT,                    
CVT000                               ABEND-FILE,                        
CVT000                               RS-RETURN-CODE.                    
CVT999*              PROGRAM ('SCSCO068')                                       
CVT999*              COMMAREA (WS-CPD68-LINK-RECORD)                            
CVT999*              LENGTH (LENGTH OF WS-CPD68-LINK-RECORD)                    
CVT999*              RESP (WS-EIBRESP)                                          
CVT999*    END-EXEC                                                             
CVT999*                                                                         
CVT999*    IF WS-EIBRESP = DFHRESP(NORMAL)                                      
CVT999*       CONTINUE                                                          
CVT999*    ELSE                                                                 
CVT999*       MOVE -1                         TO RS-RETURN-CODE                 
CVT999*       MOVE RS-RETURN-CODE             TO WS-ACTIVE-RETURN-CODE,         
CVT999*                                          SQLCODE                        
CVT999*       MOVE PROGRAM-NAME               TO ABEND-PROGRAM                  
CVT999*       MOVE '9500'                     TO ACTIVE-PARAGRAPH               
CVT999*       MOVE 'LINKFAIL'                 TO ABEND-FUNCTION                 
CVT999*       PERFORM 9700-PROCESS-ABEND      THRU 9700-EXIT                    
CVT999*    END-IF.                                                              
T19557                                                                  
T19557 9500-EXIT.                                                       
T19557     EXIT.                                                        
                                                                        
      ******************************************************************        
      * INCLUDE CPD0023C                                               *        
      ******************************************************************        
           EXEC SQL                                                             
              INCLUDE CPD0023C                                                  
           END-EXEC.                                                            
                                                                        
                                                                        
      ******************************************************************        
      * 9900- JOURNALING / ERROR HANDLING INCLUDE                      *        
      ******************************************************************        
           EXEC SQL                                                             
              INCLUDE CPDSP300                                                  
           END-EXEC.                                                            
                                                                        
      ******************************************************************        
      *       END PROGRAM COPYLIB                                      *        
      ******************************************************************        
CVT999*    COPY CPD00302.                                                       
                                                                        
CVT000 8100-SEND-RESULT.                                                
CVT000     EXEC SQL                                                     
CVT000       INSERT INTO #CSR02210_R1                            
CVT000       (                                                          
CVT000        RETURN_CODE                                               
CVT000       ,ACTIVE_PARA                                               
CVT000       ,TABLE_NAME                                                
CVT000       ,TABLE_ID                                                  
CVT000       ,UT_CODE_UTIL_TY                                           
CVT000       ,UT_IC_NO                                                  
CVT000       ,UT_READ_ROUTE                                             
CVT000       ,UT_RATE_PLAN_NO                                           
CVT000       ,UT_RATE_DESC                                              
CVT000       ,UT_CODE_REV_CLA                                           
CVT000       ,UT_READ_CYCLE                                             
CVT000       ,UT_CODE_SIC_NO                                            
CVT000       ,MN_METER_NO                                               
CVT000       ,MN_MTR_REF_NO                                             
CVT000       ,MN_CODE_TIME_PE                                           
CVT000       ,MN_LAST_READ_VA                                           
CVT000       ,MN_CD_STUS_RS                                             
CVT000       ,MN_CODE_USAGE_T                                           
CVT000       ,MN_CODE_USAGE_I                                           
CVT000       ,MN_CODE_USAGE_S                                           
CVT000       ,MN_CODE_METER_S                                           
CVT000       ,MN_METER_SUPPLY                                           
CVT000       ,MN_CODE_METER_L                                           
CVT000       ,MN_METER_LOC_DE                                           
CVT000       ,MN_METER_IND                                              
CVT000       ,MN_CONSTANT                                               
CVT000       ,MN_NO_DIALS                                               
CVT000       ,MN_DIST_NODE_PO                                           
CVT000       ,MN_POINT_ID                                               
CVT000       ,MN_SEAL_CODE_ID                                           
CVT000       ,MN_HEX_LOCATION                                           
CVT000       ,MN_INSULATED_IN                                           
CVT000       ,MN_LOCK_TYPE_ID                                           
CVT000       ,MN_DELIVERY_LEV                                           
CVT000       ,MN_UTILITY_SOUR                                           
CVT000       ,MN_IDR_RECIPIEN                                           
CVT000       ,MN_PROGRAM_ID                                             
CVT000       ,MN_MTR_READ_SO                                            
CVT000       ,RG_CODE_REG_ST                                            
CVT000       ,RG_CODE_STATUS                                            
CVT000       ,RG_CODE_TIME_P                                            
CVT000       ,RG_CODE_USAGE                                             
CVT000       ,RG_CD_USG_SRC                                             
CVT000       ,RG_CD_USG_TYP                                             
CVT000       ,RG_LAST_READD                                             
CVT000       ,RG_LST_READVL                                             
CVT000       ,RG_REG_ID_NO                                              
CVT000       ,CP_NO_UNITS                                               
CVT000       ,CP_CODE_PLAN                                              
CVT000       ,CP_CD_STATRS                                              
CVT000       ,CP_CD_SVC_TYP                                             
CVT000       ,CP_MTLY_AMT_FX                                            
CVT000       ,CP_RT_ITEM_CD                                             
CVT000       ,CP_LIGHT_NO                                               
CVT000       ,CP_POLE_NO                                                
CVT000       ,CP_DIST_NO                                                
CVT000       ,CP_USAGE_FIXED                                            
CVT000       ,CP_ITEM_SEQ_NO                                            
CVT000       ,CP_EQUIP_ID                                               
CVT000       ,PREM_DIR_IND                                              
CVT000       ,SUBDIV_LIGHT                                              
CVT000       ,ACCT_TYPE                                                 
CVT000       ,CD_RNTL_PROP                                              
CVT000       ,LL_CUSTOMER_NO                                            
CVT000       ,REV_DIST_CD                                               
CVT000       ,MN_CODE_MTR_RD                                            
CVT000       ,MN_MTR_PRESS                                              
CVT000       ,DISC_BAL                                                  
CVT000       ,ACCOUNT_NO                                                
CVT000       ,ACCT_STATUS                                               
CVT000       ,ROW_NO                                                    
CVT000       ,DEPOSIT_AMT                                               
CVT000       ,SEC_TOT_AMT                                               
CVT000       ,CUR_MTH_ARR_CD                                            
CVT000       ,CREDIT_GROUP                                              
CVT000       ,CURRENT_ACCOUNT                                           
CVT000       ,PRIOR_ACCT_STAT                                           
CVT000       ,READ_CYCLE                                                
CVT000       ,SERV_STRT_DT                                              
CVT000       ,DEP_INTST_RT                                              
CVT000       ,CP_DT_PLN_ST                                              
CVT000       ,ACTIVE_CONTRACT                                           
CVT000       ,SECURED_RATE_FL                                           
CVT000       ,DATE_BNKRPT_FL                                            
CVT000       ,FILED_CASE_NO                                             
CVT000       ,DL_NO                                                     
CVT000       ,DL_STATE                                                  
CVT000       ,SSN                                                       
P00390       ,O2_ERROR_MSG_NO                                           
P00390       ,A4_ERROR_MSG_NO                                           
CVT000       )                                                          
CVT000       VALUES                                                     
CVT000       (                                                          
CVT000        :RS-RETURN-CODE                                           
CVT000       ,:RS-ACTIVE-PARA                                           
CVT000       ,:RS-TABLE-NAME                                            
CVT000       ,:RS-TABLE-ID                                              
CVT000       ,:RS-UT-CODE-UTIL-TY                                       
CVT000       ,:RS-UT-IC-NO                                              
CVT000       ,:RS-UT-READ-ROUTE                                         
CVT000       ,:RS-UT-RATE-PLAN-NO                                       
CVT000       ,:RS-UT-RATE-DESC                                          
CVT000       ,:RS-UT-CODE-REV-CLA                                       
CVT000       ,:RS-UT-READ-CYCLE                                         
CVT000       ,:RS-UT-CODE-SIC-NO                                        
CVT000       ,:RS-MN-METER-NO                                           
CVT000       ,:RS-MN-MTR-REF-NO                                         
CVT000       ,:RS-MN-CODE-TIME-PE                                       
CVT000       ,:RS-MN-LAST-READ-VA                                       
CVT000       ,:RS-MN-CD-STUS-RS                                         
CVT000       ,:RS-MN-CODE-USAGE-T                                       
CVT000       ,:RS-MN-CODE-USAGE-I                                       
CVT000       ,:RS-MN-CODE-USAGE-S                                       
CVT000       ,:RS-MN-CODE-METER-S                                       
CVT000       ,:RS-MN-METER-SUPPLY                                       
CVT000       ,:RS-MN-CODE-METER-L                                       
CVT000       ,:RS-MN-METER-LOC-DE                                       
CVT000       ,:RS-MN-METER-IND                                          
CVT000       ,:RS-MN-CONSTANT                                           
CVT000       ,:RS-MN-NO-DIALS                                           
CVT000       ,:RS-MN-DIST-NODE-PO                                       
CVT000       ,:RS-MN-POINT-ID                                           
CVT000       ,:RS-MN-SEAL-CODE-ID                                       
CVT000       ,:RS-MN-HEX-LOCATION                                       
CVT000       ,:RS-MN-INSULATED-IN                                       
CVT000       ,:RS-MN-LOCK-TYPE-ID                                       
CVT000       ,:RS-MN-DELIVERY-LEV                                       
CVT000       ,:RS-MN-UTILITY-SOUR                                       
CVT000       ,:RS-MN-IDR-RECIPIEN                                       
CVT000       ,:RS-MN-PROGRAM-ID                                         
CVT000       ,:RS-MN-MTR-READ-SO                                        
CVT000       ,:RS-RG-CODE-REG-ST                                        
CVT000       ,:RS-RG-CODE-STATUS                                        
CVT000       ,:RS-RG-CODE-TIME-P                                        
CVT000       ,:RS-RG-CODE-USAGE                                         
CVT000       ,:RS-RG-CD-USG-SRC                                         
CVT000       ,:RS-RG-CD-USG-TYP                                         
CVT000       ,:RS-RG-LAST-READD                                         
CVT000       ,:RS-RG-LST-READVL                                         
CVT000       ,:RS-RG-REG-ID-NO                                          
CVT000       ,:RS-CP-NO-UNITS                                           
CVT000       ,:RS-CP-CODE-PLAN                                          
CVT000       ,:RS-CP-CD-STATRS                                          
CVT000       ,:RS-CP-CD-SVC-TYP                                         
CVT000       ,:RS-CP-MTLY-AMT-FX                                        
CVT000       ,:RS-CP-RT-ITEM-CD                                         
CVT000       ,:RS-CP-LIGHT-NO                                           
CVT000       ,:RS-CP-POLE-NO                                            
CVT000       ,:RS-CP-DIST-NO                                            
CVT000       ,:RS-CP-USAGE-FIXED                                        
CVT000       ,:RS-CP-ITEM-SEQ-NO                                        
CVT000       ,:RS-CP-EQUIP-ID                                           
CVT000       ,:RS-PREM-DIR-IND                                          
CVT000       ,:RS-SUBDIV-LIGHT                                          
CVT000       ,:RS-ACCT-TYPE                                             
CVT000       ,:RS-CD-RNTL-PROP                                          
CVT000       ,:RS-LL-CUSTOMER-NO                                        
CVT000       ,:RS-REV-DIST-CD                                           
CVT000       ,:RS-MN-CODE-MTR-RD                                        
CVT000       ,:RS-MN-MTR-PRESS                                          
CVT000       ,:RS-DISC-BAL                                              
CVT000       ,:RS-ACCOUNT-NO                                            
CVT000       ,:RS-ACCT-STATUS                                           
CVT000       ,:RS-ROW-NO                                                
CVT000       ,:RS-DEPOSIT-AMT                                           
CVT000       ,:RS-SEC-TOT-AMT                                           
CVT000       ,:RS-CUR-MTH-ARR-CD                                        
CVT000       ,:RS-CREDIT-GROUP                                          
CVT000       ,:RS-CURRENT-ACCOUNT                                       
CVT000       ,:RS-PRIOR-ACCT-STAT                                       
CVT000       ,:RS-READ-CYCLE                                            
CVT000       ,:RS-SERV-STRT-DT                                          
CVT000       ,:RS-DEP-INTST-RT                                          
CVT000       ,:RS-CP-DT-PLN-ST                                          
CVT000       ,:RS-ACTIVE-CONTRACT                                       
CVT000       ,:RS-SECURED-RATE-FL                                       
CVT000       ,:RS-DATE-BNKRPT-FL                                        
CVT000       ,:RS-FILED-CASE-NO                                         
CVT000       ,:RS-DL-NO                                                 
CVT000       ,:RS-DL-STATE                                              
CVT000       ,:RS-SSN                                                   
P00390       ,:RS-O2-ERROR-MSG-NO-RTE                                   
P00390       ,:RS-A4-ERROR-MSG-NO-ZIP                                   
CVT000       )                                                          
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*    EXEC SQL                                                             
MFA-TR*      INSERT INTO SESSION.CSR02210_R1                                    
MFA-TR*      (                                                                  
MFA-TR*       RETURN_CODE                                                       
MFA-TR*      ,ACTIVE_PARA                                                       
MFA-TR*      ,TABLE_NAME                                                        
MFA-TR*      ,TABLE_ID                                                          
MFA-TR*      ,UT_CODE_UTIL_TY                                                   
MFA-TR*      ,UT_IC_NO                                                          
MFA-TR*      ,UT_READ_ROUTE                                                     
MFA-TR*      ,UT_RATE_PLAN_NO                                                   
MFA-TR*      ,UT_RATE_DESC                                                      
MFA-TR*      ,UT_CODE_REV_CLA                                                   
MFA-TR*      ,UT_READ_CYCLE                                                     
MFA-TR*      ,UT_CODE_SIC_NO                                                    
MFA-TR*      ,MN_METER_NO                                                       
MFA-TR*      ,MN_MTR_REF_NO                                                     
MFA-TR*      ,MN_CODE_TIME_PE                                                   
MFA-TR*      ,MN_LAST_READ_VA                                                   
MFA-TR*      ,MN_CD_STUS_RS                                                     
MFA-TR*      ,MN_CODE_USAGE_T                                                   
MFA-TR*      ,MN_CODE_USAGE_I                                                   
MFA-TR*      ,MN_CODE_USAGE_S                                                   
MFA-TR*      ,MN_CODE_METER_S                                                   
MFA-TR*      ,MN_METER_SUPPLY                                                   
MFA-TR*      ,MN_CODE_METER_L                                                   
MFA-TR*      ,MN_METER_LOC_DE                                                   
MFA-TR*      ,MN_METER_IND                                                      
MFA-TR*      ,MN_CONSTANT                                                       
MFA-TR*      ,MN_NO_DIALS                                                       
MFA-TR*      ,MN_DIST_NODE_PO                                                   
MFA-TR*      ,MN_POINT_ID                                                       
MFA-TR*      ,MN_SEAL_CODE_ID                                                   
MFA-TR*      ,MN_HEX_LOCATION                                                   
MFA-TR*      ,MN_INSULATED_IN                                                   
MFA-TR*      ,MN_LOCK_TYPE_ID                                                   
MFA-TR*      ,MN_DELIVERY_LEV                                                   
MFA-TR*      ,MN_UTILITY_SOUR                                                   
MFA-TR*      ,MN_IDR_RECIPIEN                                                   
MFA-TR*      ,MN_PROGRAM_ID                                                     
MFA-TR*      ,MN_MTR_READ_SO                                                    
MFA-TR*      ,RG_CODE_REG_ST                                                    
MFA-TR*      ,RG_CODE_STATUS                                                    
MFA-TR*      ,RG_CODE_TIME_P                                                    
MFA-TR*      ,RG_CODE_USAGE                                                     
MFA-TR*      ,RG_CD_USG_SRC                                                     
MFA-TR*      ,RG_CD_USG_TYP                                                     
MFA-TR*      ,RG_LAST_READD                                                     
MFA-TR*      ,RG_LST_READVL                                                     
MFA-TR*      ,RG_REG_ID_NO                                                      
MFA-TR*      ,CP_NO_UNITS                                                       
MFA-TR*      ,CP_CODE_PLAN                                                      
MFA-TR*      ,CP_CD_STATRS                                                      
MFA-TR*      ,CP_CD_SVC_TYP                                                     
MFA-TR*      ,CP_MTLY_AMT_FX                                                    
MFA-TR*      ,CP_RT_ITEM_CD                                                     
MFA-TR*      ,CP_LIGHT_NO                                                       
MFA-TR*      ,CP_POLE_NO                                                        
MFA-TR*      ,CP_DIST_NO                                                        
MFA-TR*      ,CP_USAGE_FIXED                                                    
MFA-TR*      ,CP_ITEM_SEQ_NO                                                    
MFA-TR*      ,CP_EQUIP_ID                                                       
MFA-TR*      ,PREM_DIR_IND                                                      
MFA-TR*      ,SUBDIV_LIGHT                                                      
MFA-TR*      ,ACCT_TYPE                                                         
MFA-TR*      ,CD_RNTL_PROP                                                      
MFA-TR*      ,LL_CUSTOMER_NO                                                    
MFA-TR*      ,REV_DIST_CD                                                       
MFA-TR*      ,MN_CODE_MTR_RD                                                    
MFA-TR*      ,MN_MTR_PRESS                                                      
MFA-TR*      ,DISC_BAL                                                          
MFA-TR*      ,ACCOUNT_NO                                                        
MFA-TR*      ,ACCT_STATUS                                                       
MFA-TR*      ,ROW_NO                                                            
MFA-TR*      ,DEPOSIT_AMT                                                       
MFA-TR*      ,SEC_TOT_AMT                                                       
MFA-TR*      ,CUR_MTH_ARR_CD                                                    
MFA-TR*      ,CREDIT_GROUP                                                      
MFA-TR*      ,CURRENT_ACCOUNT                                                   
MFA-TR*      ,PRIOR_ACCT_STAT                                                   
MFA-TR*      ,READ_CYCLE                                                        
MFA-TR*      ,SERV_STRT_DT                                                      
MFA-TR*      ,DEP_INTST_RT                                                      
MFA-TR*      ,CP_DT_PLN_ST                                                      
MFA-TR*      ,ACTIVE_CONTRACT                                                   
MFA-TR*      ,SECURED_RATE_FL                                                   
MFA-TR*      ,DATE_BNKRPT_FL                                                    
MFA-TR*      ,FILED_CASE_NO                                                     
MFA-TR*      ,DL_NO                                                             
MFA-TR*      ,DL_STATE                                                          
MFA-TR*      ,SSN                                                               
MFA-TR*      ,O2_ERROR_MSG_NO                                                   
MFA-TR*      ,A4_ERROR_MSG_NO                                                   
MFA-TR*      )                                                                  
MFA-TR*      VALUES                                                             
MFA-TR*      (                                                                  
MFA-TR*       :RS-RETURN-CODE                                                   
MFA-TR*      ,:RS-ACTIVE-PARA                                                   
MFA-TR*      ,:RS-TABLE-NAME                                                    
MFA-TR*      ,:RS-TABLE-ID                                                      
MFA-TR*      ,:RS-UT-CODE-UTIL-TY                                               
MFA-TR*      ,:RS-UT-IC-NO                                                      
MFA-TR*      ,:RS-UT-READ-ROUTE                                                 
MFA-TR*      ,:RS-UT-RATE-PLAN-NO                                               
MFA-TR*      ,:RS-UT-RATE-DESC                                                  
MFA-TR*      ,:RS-UT-CODE-REV-CLA                                               
MFA-TR*      ,:RS-UT-READ-CYCLE                                                 
MFA-TR*      ,:RS-UT-CODE-SIC-NO                                                
MFA-TR*      ,:RS-MN-METER-NO                                                   
MFA-TR*      ,:RS-MN-MTR-REF-NO                                                 
MFA-TR*      ,:RS-MN-CODE-TIME-PE                                               
MFA-TR*      ,:RS-MN-LAST-READ-VA                                               
MFA-TR*      ,:RS-MN-CD-STUS-RS                                                 
MFA-TR*      ,:RS-MN-CODE-USAGE-T                                               
MFA-TR*      ,:RS-MN-CODE-USAGE-I                                               
MFA-TR*      ,:RS-MN-CODE-USAGE-S                                               
MFA-TR*      ,:RS-MN-CODE-METER-S                                               
MFA-TR*      ,:RS-MN-METER-SUPPLY                                               
MFA-TR*      ,:RS-MN-CODE-METER-L                                               
MFA-TR*      ,:RS-MN-METER-LOC-DE                                               
MFA-TR*      ,:RS-MN-METER-IND                                                  
MFA-TR*      ,:RS-MN-CONSTANT                                                   
MFA-TR*      ,:RS-MN-NO-DIALS                                                   
MFA-TR*      ,:RS-MN-DIST-NODE-PO                                               
MFA-TR*      ,:RS-MN-POINT-ID                                                   
MFA-TR*      ,:RS-MN-SEAL-CODE-ID                                               
MFA-TR*      ,:RS-MN-HEX-LOCATION                                               
MFA-TR*      ,:RS-MN-INSULATED-IN                                               
MFA-TR*      ,:RS-MN-LOCK-TYPE-ID                                               
MFA-TR*      ,:RS-MN-DELIVERY-LEV                                               
MFA-TR*      ,:RS-MN-UTILITY-SOUR                                               
MFA-TR*      ,:RS-MN-IDR-RECIPIEN                                               
MFA-TR*      ,:RS-MN-PROGRAM-ID                                                 
MFA-TR*      ,:RS-MN-MTR-READ-SO                                                
MFA-TR*      ,:RS-RG-CODE-REG-ST                                                
MFA-TR*      ,:RS-RG-CODE-STATUS                                                
MFA-TR*      ,:RS-RG-CODE-TIME-P                                                
MFA-TR*      ,:RS-RG-CODE-USAGE                                                 
MFA-TR*      ,:RS-RG-CD-USG-SRC                                                 
MFA-TR*      ,:RS-RG-CD-USG-TYP                                                 
MFA-TR*      ,:RS-RG-LAST-READD                                                 
MFA-TR*      ,:RS-RG-LST-READVL                                                 
MFA-TR*      ,:RS-RG-REG-ID-NO                                                  
MFA-TR*      ,:RS-CP-NO-UNITS                                                   
MFA-TR*      ,:RS-CP-CODE-PLAN                                                  
MFA-TR*      ,:RS-CP-CD-STATRS                                                  
MFA-TR*      ,:RS-CP-CD-SVC-TYP                                                 
MFA-TR*      ,:RS-CP-MTLY-AMT-FX                                                
MFA-TR*      ,:RS-CP-RT-ITEM-CD                                                 
MFA-TR*      ,:RS-CP-LIGHT-NO                                                   
MFA-TR*      ,:RS-CP-POLE-NO                                                    
MFA-TR*      ,:RS-CP-DIST-NO                                                    
MFA-TR*      ,:RS-CP-USAGE-FIXED                                                
MFA-TR*      ,:RS-CP-ITEM-SEQ-NO                                                
MFA-TR*      ,:RS-CP-EQUIP-ID                                                   
MFA-TR*      ,:RS-PREM-DIR-IND                                                  
MFA-TR*      ,:RS-SUBDIV-LIGHT                                                  
MFA-TR*      ,:RS-ACCT-TYPE                                                     
MFA-TR*      ,:RS-CD-RNTL-PROP                                                  
MFA-TR*      ,:RS-LL-CUSTOMER-NO                                                
MFA-TR*      ,:RS-REV-DIST-CD                                                   
MFA-TR*      ,:RS-MN-CODE-MTR-RD                                                
MFA-TR*      ,:RS-MN-MTR-PRESS                                                  
MFA-TR*      ,:RS-DISC-BAL                                                      
MFA-TR*      ,:RS-ACCOUNT-NO                                                    
MFA-TR*      ,:RS-ACCT-STATUS                                                   
MFA-TR*      ,:RS-ROW-NO                                                        
MFA-TR*      ,:RS-DEPOSIT-AMT                                                   
MFA-TR*      ,:RS-SEC-TOT-AMT                                                   
MFA-TR*      ,:RS-CUR-MTH-ARR-CD                                                
MFA-TR*      ,:RS-CREDIT-GROUP                                                  
MFA-TR*      ,:RS-CURRENT-ACCOUNT                                               
MFA-TR*      ,:RS-PRIOR-ACCT-STAT                                               
MFA-TR*      ,:RS-READ-CYCLE                                                    
MFA-TR*      ,:RS-SERV-STRT-DT                                                  
MFA-TR*      ,:RS-DEP-INTST-RT                                                  
MFA-TR*      ,:RS-CP-DT-PLN-ST                                                  
MFA-TR*      ,:RS-ACTIVE-CONTRACT                                               
MFA-TR*      ,:RS-SECURED-RATE-FL                                               
MFA-TR*      ,:RS-DATE-BNKRPT-FL                                                
MFA-TR*      ,:RS-FILED-CASE-NO                                                 
MFA-TR*      ,:RS-DL-NO                                                         
MFA-TR*      ,:RS-DL-STATE                                                      
MFA-TR*      ,:RS-SSN                                                           
MFA-TR*      ,:RS-O2-ERROR-MSG-NO-RTE                                           
MFA-TR*      ,:RS-A4-ERROR-MSG-NO-ZIP                                           
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 '8900'               TO ACTIVE-PARAGRAPH             
CVT000        MOVE 'INSERT'             TO ABEND-FUNCTION               
CVT000        MOVE 'CSR0TEST_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.                                        
CVT000*                                                                         
CVT000 8100-EXIT.                                                       
CVT000      EXIT.                                                       
CVT000******************************************************************        
CVT000* 8000A-DELETE-GTT-ROWS.                                         *        
CVT000******************************************************************        
CVT000 8000A-DELETE-GTT-ROWS.                                           
CVT000*                                                                         
CVT000     MOVE                                                         
CVT000     'DELETE ROWS'                                                
CVT000         TO S-SQL-STATEMENT-V.                                    
CVT000*                                                                         
CVT000      EXEC SQL                                                    
CVT000          DELETE FROM #CSR02210_R1                         
CVT000      END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ049
MFA-TR*     EXEC SQL                                                            
MFA-TR*         DELETE FROM SESSION.CSR02210_R1                                 
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*                                                                         
CVT000      MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                      
CVT000*                                                                         
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 'CSR02210_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*                                                                         
CVT000 8000A-EXIT.                                                      
CVT000     EXIT.                                                        
CVT000*                                                                         
CVT000     EXEC SQL                                                             
CVT000         INCLUDE CPD00320                                                 
CVT000     END-EXEC.                                                            
