       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.     PCSCA524.                                        
       DATE-WRITTEN.   APR, 1995.                                       
           DATE-COMPILED.                                               
      ***************************************************************** 00050000
      **              COPYRIGHT/CONFIDENTIAL  MATERIAL               ** 00060000
      **                     PRICE WATERHOUSE                        ** 00070000
      **                1410 NORTH WESTSHORE BLVD                    ** 00080000
      **                   TAMPA, FLORIDA  33607                     ** 00090000
      **                      (813) 287-9200                         ** 00100000
      **                                                             ** 00110000
      ********            CUSTOMER SERVICE SYSTEM             ********* 00120000
      ********                      DB2                       ********* 00130000
      ***************************************************************** 00140000
      **                                                             ** 00150000
      **              PROGRAM  MODIFICATION  LOG                     ** 00160000
      **    DATE    INITIALS     REASON                              ** 00170000
      **    ____    ________     ______                              ** 00180000
      ** 04/06/95    JTH         SCE&G INITIAL REQUEST FOR PROGRAM   ** 00190000
      **                         TO BE CONVERTED FROM CUS166         ** 00191000
      ** 08/04/95    LMB         TPR 6046                            ** 00192000
      ** 10/19/95    KMG (T1539) TPR 1539 - FIX CURSOR FOR ONLY      ** 00193000
      **                         GAS SELECTION AND FIX CALC LOGIC    ** 00194000
TP2332** 12/13/95    LMB         BASE USE AMOUNT NEEDS TO BE ROUNDED ** 00195000
TP2332**                         UT-RATE-PLAN-NO IS NOT NUMERIC      ** 00196000
T13124** 09/22/97    PD          CHANGED BG CURSOR TO BYPASS BACKOUT ** 00197000
T13124**                         AND CANCELLED BILLS AND TAKE THE    ** 00198000
T13124**                         REBILL.                             ** 00199000
T18137** 10/08/98    RAQ         FOR SAME REVENUE MONTH INCLUDE ONLY ** 00199106
T18137**                         MOST CURRENT BILL_ITEM_TIMESTMP ROW ** 00199206
C23301** 02/13/01    VIJAY       CHANGES FOR PSNC                    ** 00199206
      **                                                             ** 00199206
T26136** 03/13/02    GAUSE       CORRECTED UT-CURSOR TO CHECK FOR    ** 00199206
      **                         NULL DATE                           ** 00199206
      **                                                             ** 00199206
C26287** 06/17/02    GSR         CHANGED LOGIC TO LOOK AT PRIOR      ** 00199206
      **                         CUSTOMER'S USE, IF THE CURRENT CUST ** 00199206
      **                         IS TURNED ON AFTER THE BASE USE PERIOD 00199206
      ** 10/18/02    WBM         BACK OUT CHANGES FOR THIS CML.      ** 00199206
      ** TPR26287                CUSTOMER'S USE, IF THE CURRENT CUST ** 00199206
CIG   ** 12/27/02    GSR         CHANGES MADE TO HANDLE CIG CUSTOMERS** 00199206
      **                                                             ** 00199206
T27909** 01/29/03  COVANSYS      TOTAL THERMS CALCULATED USING THE   **         
T27909**                         ACTUAL DAYS IN BILL PERIODS BY PICK **         
T27909**                         ING THE NO-OF-CONS-DAYS FROM        **         
T27909**                         CSS_BILLING_DET TABLE.              **         
T29922** 12/03       SV          UPDATE BASE USE IN CSS_BILLING_DET  **         
T29922**                         WHILE UPDATING CSS_UTIL_ENVRNMT.    **         
C21122** 12/30/04    GSR         CHANGES MADE TO IMPROVE PERFORMANCE ** 00199206
      **                                                             ** 00199206
T32676** 07/27/05   GOKUL        TO ADD EFFECTIVE_DT AS A KEY TO     **         
T32676**                         CSS_BTU_WNA_RANGE.                  **         
C32676** 08/30/05   GSR          CHANGES MADE TO HANDLE FINALED ACCTS**         
C32676**                         IF THAT IS THE MOST CURRENT AT THE  **         
C32676**                         PREMISE                             **         
T34287** 06/08/06   SP94986      CREATE A WORK QUEUE FOR D31 RATE PLAN          
T34287**                         IF BASE USE IS > SET VALUE TO CHANGE           
T34287**                         TO HIGHER RATE.                                
T34287** 07/08/06   DB41297      OPTIMIZE SELECT STATEMENTS                     
T33924** 08/15/06   VIJAY        PSNC RATE CASE CHANGES :                       
T33924**                     1.  CODE TO WORK EITHER FOR SCEG OR PSNC OR        
T33924**                         BOTH THE COMPANIES BY USING                    
T33924**                         CALC_WNA_METHOD_CD FROM CSS_COMPANY            
T33924**                     2.  NEW DELINQUENCY CODE                           
T33924**                         ANNUAL-REVIEW-SVC-ST  ADDED.                   
T33924**                     3.  REMOVED CSS_CUST_PREM_HIST CHECK IN            
T33924**                         UT-CURSOR.                                     
T33924**                     4.  PROCESS FOR ALL ACCOUNTS TO CHECK MOST         
T33924**                         RECENT ACCOUNT AT PREMISE.                     
T35434** 05/21/07   MC95456      REPLACED CSS_MODEL_SQL WITH SET                
T35434**                         STATEMENTS                                     
A00765** 02/16/09   CVNS         ADDED 9000-SEND-ERROR-RESULT PARA.  **         
A00765**            CHENNAI                                          **         
A37741** 14/11/09   MC95456      DECLARED  S-RETURN-CODE             **         
      **                         RESPECTIVE TO CPD00067 CHANGES      **         
A04527** 06/06/13   AS7C117      REMOVE UNUSED COPYBOOK CWS00056     **         
ACT007** 12/30/13   AS7C117      REPLACE CSS_WQ_ITEMS_MF WITH        **         
ACT007** A04860                  CSS_WQ_ITEMS.                       **         
      ***************************************************************** 00200000
                                                                        
      *================================================================*00220000
      *================================================================*00230000
      *                                                                *00240000
      *   PCSCA524 WILL CALCULATE THE SUMMER BASE USE FOR ACTIVE       *00250000
      *   GAS ACCOUNTS.                                                *00270000
      *                                                                *00271000
      *================================================================*00280000
      *================================================================*00290000
                                                                        
       ENVIRONMENT DIVISION.                                            
       CONFIGURATION SECTION.                                           
       SOURCE-COMPUTER.    IBM-370.                                     
       OBJECT-COMPUTER.    IBM-370.                                     
       INPUT-OUTPUT SECTION.                                            
       FILE-CONTROL.                                                    
                                                                        
       DATA DIVISION.                                                   
                                                                        
       FILE SECTION.                                                    
                                                                        
       WORKING-STORAGE SECTION.                                         

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'PCSCA524'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-MISCELLANEOUS.                                            
           05 WS-START                 PIC X(40)                        
           VALUE 'WORKING STORAGE FOR PCSCA524 STARTS HERE'.            
                                                                        
       COPY CWS09900.                                                   00650000
                                                                        
       COPY CWS00010.                                                   00661000
                                                                        
       COPY CWS00039.                                                   00670000
                                                                        
       COPY CWS00038.                                                   00690000
                                                                        
                                                                        
       COPY CWS00303.                                                   00712000
                                                                        
      *                                                                 00730000
       01  WS-INPUT-DATE-BREAKDOWN     PIC 9(10)  VALUE ZEROS.          
       01  FILLER REDEFINES WS-INPUT-DATE-BREAKDOWN.                    
           05  WS-INPUT-CC-B           PIC 9(02).                       
           05  WS-INPUT-YY-B           PIC 9(02).                       
           05  FILLER                  PIC X(01).                       
           05  WS-INPUT-MM-B           PIC 9(02).                       
           05  FILLER                  PIC X(01).                       
           05  WS-INPUT-DD-B           PIC 9(02).                       
      *                                                                 00980000
       01  WS-CURRENT-DATE             PIC X(10).                       
      *                                                                         
       01  WS-PROGRAM-DATE             PIC X(10).                       
       01  FILLER REDEFINES WS-PROGRAM-DATE.                            
           05  WS-PROGRAM-DT-CCYY      PIC 9(04).                       
           05  FILLER                  PIC X(01).                       
T1539      05  WS-PROGRAM-DT-MM        PIC X(02).                       
           05  FILLER                  PIC X(03).                       
      *                                                                 01020000
       01  WS-LITERALS.                                                 
           05  WS-D                    PIC X(01)     VALUE 'D'.         
           05  WS-E                    PIC X(01)     VALUE 'E'.         
           05  WS-F                    PIC X(01)     VALUE 'F'.         
           05  WS-G                    PIC X(01)     VALUE 'G'.         
           05  WS-H                    PIC X(01)     VALUE 'H'.         
           05  WS-I                    PIC X(01)     VALUE 'I'.         
           05  WS-J                    PIC X(01)     VALUE 'J'.         
           05  WS-K                    PIC X(01)     VALUE 'K'.         
           05  WS-N                    PIC X(01)     VALUE 'N'.         
           05  WS-S                    PIC X(01)     VALUE 'S'.         
           05  WS-Y                    PIC X(01)     VALUE 'Y'.         
           05  WS-PGRMNAME             PIC X(08)     VALUE 'PCSCA524'.  
           05  WS-HUNDRED              PIC S9(04) VALUE +100 COMP-3.    
ACT007     05  SCSCB077                PIC X(8)   VALUE 'SCSCB077'.     
ACT007     05  RS-RETURN-CODE          PIC S9(09) COMP   VALUE +0.      
      *                                                                 01330000
       01  WS-WORK-FIELDS.                                              
           05  WS-BASE-USE             PIC S9(07)  VALUE +0 COMP-3.     
           05  WS-THERMS-USE           PIC S9(08)  VALUE +0 COMP-3.     
           05  WS-ACCUMULATE-USE       PIC S9(07)V99 VALUE +0 COMP-3.   
           05  WS-ACCUMULATE-DAYS      PIC S9(07)V99 VALUE +0 COMP-3.   
           05  WS-THERMS               PIC S9(09)V VALUE +0 COMP-3.     
           05  WS-SUM-BEG-MTH          PIC S9(06)  VALUE +0 COMP-3.     
           05  WS-SUM-END-MTH          PIC S9(06)  VALUE +0 COMP-3.     
T26136     05  WS-UTIL-COUNT           PIC  9(07)  VALUE 0.             
           05  WS-DISPLAY-CNT          PIC S9(07)  VALUE +0.            
           05  WS-REMAINDER            PIC S9(07)  VALUE +0.            
TP2332     05  WS-BASE-USE-WORK        PIC S9(07)V99 VALUE +0 COMP-3.   
T18137     05  WS-COMP-REVENUE-MONTH.                                   
T18137         10 WS-COMP-REVENUE-YYYY PIC 9(04).                       
T18137         10 WS-COMP-REVENUE-MM   PIC 9(02).                       
T18137     05  WS-NULL-IND             PIC S9(04)  VALUE +0 COMP.       
T29922     05  WS-NULL-GAS-BASE-USE    PIC S9(04)  VALUE +0 COMP.       
T29922     05  WS-CALC-GAS-BASE-NULL   PIC S9(04)  VALUE +0 COMP.       
CIG        05  WS-NULL-IND-1           PIC S9(04)  VALUE +0 COMP.       
CIG        05  WS-NO-DAYS              PIC S9(04)  VALUE +0 COMP.       
C32676     05  WS-CURRENT-TS           PIC X(26)   VALUE SPACES.        
C32676     05  WS-RATE-TEXT-LEN        PIC S9(4) COMP VALUE +45.        
A37741     05  S-RETURN-CODE           PIC S9(9) COMP VALUE 0.          
C32676     05  WS-RATE-TEXT            PIC X(54) VALUE                  
C32676         'RATE CHANGE PER RECALCULATED BASE USE'.                 
      *                                                                 01365000
T34287     05  WS-WQ-COMMENT.                                           
T34287         10 WS-ACCT-QUALIFIES    PIC X(23) VALUE                  
T34287         'ACCOUNT QUALIFIES FOR '.                                
T34287         10 WS-D31-HIGH-RATE     PIC X(03) VALUE SPACES.          
T34287         10 WS-D31-COMMENTS      PIC X(60) VALUE                  
T34287         '. NOTIFY ACCOUNT MANAGER AND CHANGE RATE'.              
      *                                                                         
T33924 01  WS-ANNUAL-REVIEW-SVC-ST.                                     
T33924     05 WS-ANNUAL-REVIEW-SVC-ST-YY PIC 9(04).                     
T33924     05 FILLER                     PIC X(01).                     
T33924     05 WS-ANNUAL-REVIEW-SVC-ST-MM PIC 9(02).                     
T33924     05 FILLER                     PIC X(01).                     
T33924     05 WS-ANNUAL-REVIEW-SVC-ST-DD PIC 9(02).                     
      *                                                                         
      **** DELINQ VALUE LOADED HERE ****                                        
T33924 01  WS-ANNUAL-REVIEW-SVC-ST-DEL PIC 9(4)V9(5).                   
T33924 01  FILLER REDEFINES WS-ANNUAL-REVIEW-SVC-ST-DEL.                
T33924     05 WS-ANNUAL-REVIEW-MM-DEL  PIC 9(02).                       
T33924     05 WS-ANNUAL-REVIEW-DD-DEL  PIC 9(02).                       
T33924     05 WS-ANNUAL-REVIEW-YR-DEL  PIC X(05).                       
      *                                                                         
T26136 01  WS-CNT-UT-READ              PIC 9(07) VALUE 0.               
T26136 01  WS-CNT-UT-UPDATE            PIC 9(07) VALUE 0.               
T26136 01  WS-EDIT-PREV-BASE-USE       PIC 9(9).9.                      
T26136 01  WS-EDIT-GAS-BASE-USE        PIC 9(9).9.                      
T26136 01  WS-EDIT-ACCUMULATE-USE      PIC 9(07).99.                    
T26136 01  WS-EDIT-ACCUMULATE-DAYS     PIC 9(07).99.                    
T26136                                                                  
T26136 01  WS-EDIT-PREV-BASE-ORIG      PIC 9(9).9.                      
T26136 01  WS-EDIT-GAS-BASE-ORIG       PIC 9(9).9.                      
T26136                                                                  
       01  WS-SWITCHES.                                                 
           05  WS-NO-MORE-UT-SW        PIC X(01) VALUE 'N'.             
               88  WS-NO-MORE-UTS                VALUE 'Y'.             
               88  WS-MORE-UTS                   VALUE 'N'.             
           05  WS-NO-MORE-BG-SW        PIC X(01) VALUE 'N'.             
               88  WS-NO-MORE-BGS                VALUE 'Y'.             
               88  WS-MORE-BGS                   VALUE 'N'.             
T18137     05  WS-FOUND-BGC-SW         PIC X(01) VALUE 'N'.             
T18137         88  WS-FOUND-BGCANCELS            VALUE 'Y'.             
T18137         88  WS-NOT-FOUND-BGCANCELS        VALUE 'N'.             
           05  WS-NO-MORE-CX-SW        PIC X(01) VALUE 'N'.             
               88  WS-NO-MORE-CXS                VALUE 'Y'.             
               88  WS-MORE-CXS                   VALUE 'N'.             
           05  WS-PROCESS-ACCT-SW      PIC X(01) VALUE 'Y'.             
               88  WS-BYPASS-ACCOUNT             VALUE 'N'.             
               88  WS-PROCESS-ACCOUNT            VALUE 'Y'.             
           05  WS-PROC-DEFAULT-SW      PIC X(01) VALUE 'N'.             
               88  WS-BYPASS-DEFAULT             VALUE 'N'.             
               88  WS-PROCESS-DEFAULT            VALUE 'Y'.             
           05  WS-OVERRIDE-REV-SW      PIC X(01) VALUE 'N'.             
CIG        05  WS-CIG-RATE-FL              PIC X(01) VALUE 'N'.         
CIG            88 IT-IS-CIG-RATE                     VALUE 'Y'.         
T33924     05  WS-PARM-COMPANY-FL          PIC X(01) VALUE SPACES.      
T33924     05  WS-PARM-COMPANY             PIC X(02) VALUE SPACES.      
T33924**** BOTH COMPANIES SCEG AND PSNC ***                             01370100
                                                                        
      *                                                                 04610000
       COPY FIOCA00.                                                    01371000
      *                                                                 01371100
       COPY FIOJC01.                                                    01372000
      *                                                                 01380000
           EXEC SQL                                                     01450000
               INCLUDE SQLCA                                            01460000
           END-EXEC.                                                    01470000
                                                                        
      ******************************************************************01512000
      *    ACCOUNT TABLE - CSS_ACCOUNT                                  01513000
      ******************************************************************01514000
                                                                        
           EXEC SQL                                                     01521000
               INCLUDE TBACCT                                           01522000
           END-EXEC.                                                    01523000
                                                                        
      ******************************************************************01524100
      *    BILLING DETAILS TABLE - CSS_BILLING_DET                      01524200
      ******************************************************************01524300
                                                                        
           EXEC SQL                                                     01524500
               INCLUDE TBBLLDET                                         01524600
           END-EXEC.                                                    01524700
                                                                        
T29922******************************************************************01524100
T29922*    BILLING HEADER TABLE - CSS_BILLING_HDR                       01524200
T29922******************************************************************01524300
T29922                                                                  
T29922     EXEC SQL                                                     01524500
T29922         INCLUDE TBBLLHDR                                         01524600
T29922     END-EXEC.                                                    01524700
T29922                                                                  
      ******************************************************************01525000
      *    CONSUMPTION HISTORY TABLE - CSS_CNSMPTN_HIST                 01526000
      ******************************************************************01527000
                                                                        
           EXEC SQL                                                     01530000
               INCLUDE TBCNSMP                                          01540000
           END-EXEC.                                                    01550000
                                                                        
      ******************************************************************01560100
      *    JOB PARM TABLE - CSS_JOB_PARM                                01560200
      ******************************************************************01560300
                                                                        
           EXEC SQL                                                     01560500
               INCLUDE TBJBPARM                                         01560600
           END-EXEC.                                                    01560700
                                                                        
      ******************************************************************01565000
      *    UTILITY ENVIRONMENT TABLE - CSS_UTIL_ENVRNMT                 01566000
      ******************************************************************01567000
                                                                        
           EXEC SQL                                                     01570000
               INCLUDE TBUTLENV                                         01580000
           END-EXEC.                                                    01590000
                                                                        
CIG   **********************************                                        
CIG   **  CSS_RATE_COMP_DEF           **                                        
CIG   **********************************                                        
CIG        EXEC SQL                                                             
CIG          INCLUDE TBRTCDEF                                                   
CIG        END-EXEC.                                                            
CIG   *                                                                         
CIG   **********************************                                        
CIG   **  CSS_VOL_DAILY               **                                        
CIG   **********************************                                        
CIG        EXEC SQL                                                             
CIG          INCLUDE TBVOLDLY                                                   
CIG        END-EXEC.                                                            
CIG   *                                                                         
T32676**********************************                                        
T32676**  CSS_BTU_WNA_RANGE           **                                        
T32676**********************************                                        
T32676     EXEC SQL                                                             
T32676       INCLUDE TBBTUWNA                                                   
T32676     END-EXEC.                                                            
T32676*                                                                         
C32676*****************************************************************         
C32676*   CSS_MNT_TRANS_HIST                                          *         
C32676*****************************************************************         
C32676     EXEC SQL                                                             
C32676          INCLUDE TBMNHIST                                                
C32676     END-EXEC.                                                            
C32676*****************************************************************         
C32676*   CSS_MT_TRN_HST_DET                                          *         
C32676*****************************************************************         
C32676     EXEC SQL                                                             
C32676          INCLUDE TBMNHDT                                                 
C32676     END-EXEC.                                                            
      *                                                                         
T33924************************************************************              
T33924*   CSS_DELINQUENCY                                                       
T33924************************************************************              
T33924     EXEC SQL                                                             
T33924        INCLUDE TBDELQ                                                    
T33924     END-EXEC.                                                            
      *                                                                         
T33924************************************************************              
T33924*   CSS_CUST_PREM_HIST                                                    
T33924************************************************************              
T33924     EXEC SQL                                                             
T33924        INCLUDE TBCSTPRM                                                  
T33924     END-EXEC.                                                            
      *                                                                         
C32676* WS FOR CPD00099                                                         
C32676     EXEC SQL                                                             
C32676          INCLUDE CWS00099                                                
C32676     END-EXEC.                                                            
ACT007/****** FOR WQ INSERT - WORKING STORAGE COPYBOOK FOR SCSCB077             
ACT007      EXEC SQL                                                            
ACT007           INCLUDE CWS00077                                               
ACT007      END-EXEC.                                                           
ACT007*                                                                         
      ******************************************************************01601000
      *    ACCOUNT TABLE                                                01602000
      ******************************************************************01603000
                                                                        
      ******************************************************************01603000
                                                                        
           EXEC SQL                                                     
C21122        DECLARE UT-CURSOR CURSOR WITH HOLD FOR                    
              SELECT  U.ACCOUNT_NO                                      
                     ,IC_NO                                             
CIG                  ,U.RATE_PLAN_NO                                    
                     ,GAS_BASE_USE                                      
C32676               ,GAS_BASE_USE_DFLT                                 
C32676               ,GAS_BASE_HIGH_RATE                                
C32676               ,GAS_BASE_LOW_RATE                                 
C32676               ,GAS_BASE_USE_MIN                                  
C32676               ,A.CODE_ACCT_STAT                                  
C32676               ,A.PREMISE_NO                                      
C32676               ,A.CUSTOMER_NO                                     
T33924               ,A.COMPANY_NO                                      
T33924               ,U.AUTO_RATE_SW_FL                                 
              FROM    CSS_UTIL_ENVRNMT U WITH(READUNCOMMITTED)                  
                     ,CSS_ACCOUNT A WITH(READUNCOMMITTED)                       
CIG                  ,CSS_BTU_WNA_RANGE BR WITH(READUNCOMMITTED)                
              WHERE   A.ACCOUNT_NO     = U.ACCOUNT_NO                   
T33924          AND   A.COMPANY_NO     = :WS-PARM-COMPANY               
CIG             AND   U.CODE_UTIL_TYPE   = 'G'                          
CIG             AND   BR.CODE_UTIL_TYPE  = U.CODE_UTIL_TYPE             
CIG             AND   BR.RATE_PLAN_NO    = U.RATE_PLAN_NO               
CIG             AND  (BR.WNA_UPPER_LIMIT <> 0                           
CIG              OR   BR.WNA_LOWER_LIMIT <> 0)                          
T32676          AND   BR.EFFECTIVE_DT    = (SELECT MAX(B1.EFFECTIVE_DT) 
T32676                      FROM CSS_BTU_WNA_RANGE B1
                           WITH(READUNCOMMITTED)                   
T32676                      WHERE B1.RATE_PLAN_NO = BR.RATE_PLAN_NO     
T32676                        AND B1.CODE_UTIL_TYPE = BR.CODE_UTIL_TYPE)
T26136          AND  ((GAS_BASE_LAST_UPDT <> IIF(TRY_CONVERT(DATE, 
                                                 :UT-GAS-BASE-LAST-UPDT
              ) IS NULL OR (PATINDEX('%.%', :UT-GAS-BASE-LAST-UPDT
              ) <> 0) OR (LEN(:UT-GAS-BASE-LAST-UPDT
              ) <> 10), CIS.CHAR2DATE(:UT-GAS-BASE-LAST-UPDT
              ), CONVERT(DATE, :UT-GAS-BASE-LAST-UPDT) ))    
T26136                OR (GAS_BASE_LAST_UPDT IS NULL))                  
C34287                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     01610000
MFA-TR*       DECLARE UT-CURSOR CURSOR WITH HOLD FOR                    01990000
MFA-TR*       SELECT  U.ACCOUNT_NO                                      01991000
MFA-TR*              ,IC_NO                                             01991100
MFA-TR*              ,U.RATE_PLAN_NO                                    01991200
MFA-TR*              ,GAS_BASE_USE                                      01991300
MFA-TR*              ,GAS_BASE_USE_DFLT                                         
MFA-TR*              ,GAS_BASE_HIGH_RATE                                04050000
MFA-TR*              ,GAS_BASE_LOW_RATE                                 04050000
MFA-TR*              ,GAS_BASE_USE_MIN                                  04050000
MFA-TR*              ,A.CODE_ACCT_STAT                                  04050000
MFA-TR*              ,A.PREMISE_NO                                      04050000
MFA-TR*              ,A.CUSTOMER_NO                                     04050000
MFA-TR*              ,A.COMPANY_NO                                      04050000
MFA-TR*              ,U.AUTO_RATE_SW_FL                                 04050000
MFA-TR*       FROM    CSS_UTIL_ENVRNMT U                                01991500
MFA-TR*              ,CSS_ACCOUNT A                                     01991500
MFA-TR*              ,CSS_BTU_WNA_RANGE BR                              01991400
MFA-TR*       WHERE   A.ACCOUNT_NO     = U.ACCOUNT_NO                           
MFA-TR*         AND   A.COMPANY_NO     = :WS-PARM-COMPANY                       
MFA-TR*         AND   U.CODE_UTIL_TYPE   = 'G'                          01992300
MFA-TR*         AND   BR.CODE_UTIL_TYPE  = U.CODE_UTIL_TYPE             01992300
MFA-TR*         AND   BR.RATE_PLAN_NO    = U.RATE_PLAN_NO               01992300
MFA-TR*         AND  (BR.WNA_UPPER_LIMIT <> 0                           01992300
MFA-TR*          OR   BR.WNA_LOWER_LIMIT <> 0)                                  
MFA-TR*         AND   BR.EFFECTIVE_DT    = (SELECT MAX(B1.EFFECTIVE_DT)         
MFA-TR*                     FROM CSS_BTU_WNA_RANGE B1                           
MFA-TR*                     WHERE B1.RATE_PLAN_NO = BR.RATE_PLAN_NO             
MFA-TR*                       AND B1.CODE_UTIL_TYPE = BR.CODE_UTIL_TYPE)        
MFA-TR*         AND  ((GAS_BASE_LAST_UPDT <> :UT-GAS-BASE-LAST-UPDT)            
MFA-TR*               OR (GAS_BASE_LAST_UPDT IS NULL))                          
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    01993000
                                                                        
      ******************************************************************01993200
      *    BILLING_DET TABLE                                            01993300
      ******************************************************************01993400
                                                                        
           EXEC SQL                                                     
              DECLARE BG-CURSOR CURSOR FOR                              
              SELECT  BTU_FACTOR,                                       
                      BILL_NO,                                          
                      REPLACE(REPLACE(CONVERT(CHAR(26), 
           BILL_ITEM_TIMESTMP, 121), ' ', '-'), ':', '.') 
           BILL_ITEM_TIMESTMP,                               
C21122                CASE                                              
C21122                  WHEN REV_MTH_ORIG_BILL > 0                      
C21122                     THEN REV_MTH_ORIG_BILL                       
C21122                     ELSE REVENUE_MONTH                           
C21122                END AS REVENUE_MONTH                              
T18137               ,CODE_BILL_ITM_IND                                 
CMLWNA               ,ACCOUNT_NO                                        
CIG                  ,IC_NO                                             
CIG                  ,RATE_PLAN_NO                                      
T27909               ,NO_OF_CONS_DAYS                                   
C21122               ,CODE_DR_CR_CNSMPTN                                
              FROM    CSS_BILLING_DET WITH(READUNCOMMITTED)                     
C32676        WHERE   PREMISE_NO     = :BG-PREMISE-NO                   
               AND    CODE_UTIL_TYPE = 'G'                              
               AND    IC_NO          = :UT-IC-NO                        
C21122         AND ((REV_MTH_ORIG_BILL = 0                              
C21122             AND REVENUE_MONTH                                    
C21122                   BETWEEN :WS-SUM-BEG-MTH                        
C21122                       AND :WS-SUM-END-MTH)                       
C21122           OR REV_MTH_ORIG_BILL                                   
C21122                   BETWEEN :WS-SUM-BEG-MTH                        
C21122                       AND :WS-SUM-END-MTH)                       
C21122         AND    CODE_BILL_ITM_TYPE =  'C'                         
C21122         AND    CODE_BILL_ITM_IND  =  'A'                         
C32656         AND    REVENUE_MONTH > 0                                 
C34287                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ061
MFA-TR*    EXEC SQL                                                     01993600
MFA-TR*       DECLARE BG-CURSOR CURSOR FOR                              01993700
MFA-TR*       SELECT  BTU_FACTOR,                                       01993800
MFA-TR*               BILL_NO,                                          01993900
MFA-TR*               BILL_ITEM_TIMESTMP,                               01994100
MFA-TR*               CASE                                                      
MFA-TR*                 WHEN REV_MTH_ORIG_BILL > 0                              
MFA-TR*                    THEN REV_MTH_ORIG_BILL                               
MFA-TR*                    ELSE REVENUE_MONTH                                   
MFA-TR*               END AS REVENUE_MONTH                                      
MFA-TR*              ,CODE_BILL_ITM_IND                                         
MFA-TR*              ,ACCOUNT_NO                                                
MFA-TR*              ,IC_NO                                                     
MFA-TR*              ,RATE_PLAN_NO                                              
MFA-TR*              ,NO_OF_CONS_DAYS                                           
MFA-TR*              ,CODE_DR_CR_CNSMPTN                                        
MFA-TR*       FROM    CSS_BILLING_DET                                   01994300
MFA-TR*       WHERE   PREMISE_NO     = :BG-PREMISE-NO                           
MFA-TR*        AND    CODE_UTIL_TYPE = 'G'                              01995400
MFA-TR*        AND    IC_NO          = :UT-IC-NO                        01995500
MFA-TR*        AND ((REV_MTH_ORIG_BILL = 0                                      
MFA-TR*            AND REVENUE_MONTH                                            
MFA-TR*                  BETWEEN :WS-SUM-BEG-MTH                                
MFA-TR*                      AND :WS-SUM-END-MTH)                               
MFA-TR*          OR REV_MTH_ORIG_BILL                                           
MFA-TR*                  BETWEEN :WS-SUM-BEG-MTH                                
MFA-TR*                      AND :WS-SUM-END-MTH)                               
MFA-TR*        AND    CODE_BILL_ITM_TYPE =  'C'                                 
MFA-TR*        AND    CODE_BILL_ITM_IND  =  'A'                                 
MFA-TR*        AND    REVENUE_MONTH > 0                                         
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    01996000
                                                                        
       01  WS-END                    PIC X(40)                          
           VALUE 'WORKING STORAGE FOR PCSCA524 ENDS HERE '.             
                                                                        
T33924 LINKAGE SECTION.                                                 
T33924 01  PARMIN.                                                      
T33924     05  PARMLENGTH                        PIC S9(04) COMP.       
T33924     05  PARMDATA.                                                
T33924         10 PARM-COMPANY-FL                PIC X(01).             
                                                                        
       PROCEDURE DIVISION USING PARMIN.                                 
                                                                        
       0000-MAINLINE.                                                   
                                                                        
           DISPLAY '<<<< PCSCA524 STARTED >>>>'.                        
                                                                        
           PERFORM 0100-INITIALIZE      THRU 0100-EXIT.                 
                                                                        
T33924     IF PARMLENGTH > 0                                            
T33924        MOVE PARM-COMPANY-FL TO WS-PARM-COMPANY-FL                
T33924        IF WS-PARM-COMPANY-FL = 'S'                               
T33924           MOVE '01' TO WS-PARM-COMPANY                           
T33924        ELSE                                                      
T33924           IF WS-PARM-COMPANY-FL = 'P'                            
T33924              MOVE '26' TO WS-PARM-COMPANY                        
T33924           END-IF                                                 
T33924        END-IF                                                    
T33924     END-IF.                                                      
                                                                        
T33924***  GET PSNC SERVICE START DATE FROM DELINQUENCY ****            02060000
T33924     IF WS-PARM-COMPANY-FL = 'P'                                  
T33924        MOVE 'ANNUAL-REVIEW-SVC-ST'     TO C8-DELINQ-CD           
T33924        MOVE '26'                       TO C8-COMPANY-NO          
T33924        PERFORM 7800-GET-PSNC-DELINQ THRU 7800-EXIT               
T33924        MOVE C8-DELINQ-VALUE      TO WS-ANNUAL-REVIEW-SVC-ST-DEL  
T33924        MOVE WS-INPUT-DATE           TO WS-ANNUAL-REVIEW-SVC-ST   
T33924        MOVE WS-ANNUAL-REVIEW-MM-DEL TO WS-ANNUAL-REVIEW-SVC-ST-MM
T33924        MOVE WS-ANNUAL-REVIEW-DD-DEL TO WS-ANNUAL-REVIEW-SVC-ST-DD
T33924     END-IF.                                                      
                                                                        
T26136     DISPLAY '               '                                    
T26135         'RT' '  '                                                
T26136         'PREV BASE' '   '                                        
T26136         'ACCUM USE' '  '                                         
T26136         'ACCUM DAYS' ' '                                         
T26136         'CUR BASE'.                                              
                                                                        
                                                                        
T18137     MOVE WS-CURRENT-DATE TO UT-GAS-BASE-LAST-UPDT                
           PERFORM 7000-OPEN-UTIL       THRU 7000-EXIT.                 
           PERFORM 7050-FETCH-UTIL      THRU 7050-EXIT.                 
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              NEXT SENTENCE                                             
           ELSE                                                         
             PERFORM 1000-PROCESS-UTIL    THRU 1000-EXIT                
               UNTIL WS-NO-MORE-UTS                                     
           END-IF.                                                      
                                                                        
           PERFORM 7100-CLOSE-UT-CURSOR THRU 7100-EXIT.                 
                                                                        
T26136     DISPLAY 'UT CURSOR READS            '                        
T26136                                   WS-CNT-UT-READ.                
T26136     DISPLAY 'UT CURSOR UPDATES          '                        
T26136                                   WS-CNT-UT-UPDATE.              
                                                                        
                                                                        
                                                                        
                                                                        
           STOP RUN.                                                    
                                                                        
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       0100-INITIALIZE.                                                 
                                                                        
           PERFORM 6251-GET-FJC01-DATE THRU 6251-EXIT.                  
T1539      PERFORM 6252-GET-REV-MONTH THRU 6252-EXIT.                   
                                                                        
           IF COMMON-DATE-NEEDED                                        
              DISPLAY 'WILL ATTEMPT TO GET COMMON DATE '                
              PERFORM 6240-GET-FCA00-COMMON-DATE THRU 6240-EXIT         
              DISPLAY 'FCA00-COMMON-DATE = ' WS-FCA00-COMMON-DATE       
              MOVE WS-FCA00-COMMON-DATE TO WS-INPUT-DATE                
           END-IF.                                                      
                                                                        
T1539      IF WS-OVERRIDE-REV-SW = 'Y'                                  
T18137*T1539          MOVE WS-REVENUE-MONTH-PARM TO WS-PROGRAM-DATE     02291200
T18137         MOVE WS-REVENUE-MONTH-PARM TO WS-COMP-REVENUE-MONTH      
T18137         MOVE WS-COMP-REVENUE-YYYY  TO WS-PROGRAM-DT-CCYY         
T18137         MOVE WS-COMP-REVENUE-MM    TO WS-PROGRAM-DT-MM           
T1539          MOVE WS-INPUT-DATE         TO WS-CURRENT-DATE            
           ELSE                                                         
               MOVE WS-INPUT-DATE         TO WS-PROGRAM-DATE            
                                             WS-CURRENT-DATE            
           END-IF.                                                      
      ***************************************************************** 02294000
      * CALCULATE THE CURRENT YEAR AND ADD THE MONTHS 6 AND 8 TO DO   * 02295000
      * AN EDIT FOR REVENUE-MONTH BETWEEN 6 AND 8.  JTH 4/95.         * 02296000
      * IF DATE BEING RUN IS LESS THAN JUNE USE SUBTRACT 1 FROM YEAR  * 02296100
      * SO THAT YOU WILL LOOK AT BILL HISTORY FOR JUNE/JULY/AUG       * 02296200
      * PREV YEAR.                                                    * 02296300
      ***************************************************************** 02297000
T1539      IF WS-PROGRAM-DT-MM < '06'                                   
T1539         SUBTRACT 1 FROM WS-PROGRAM-DT-CCYY
           END-IF.                       
                                                                        
           MULTIPLY WS-PROGRAM-DT-CCYY BY WS-HUNDRED                    
                     GIVING WS-SUM-BEG-MTH.                             
           ADD +6   TO WS-SUM-BEG-MTH.                                  
           MULTIPLY WS-PROGRAM-DT-CCYY BY WS-HUNDRED                    
                     GIVING WS-SUM-END-MTH.                             
           ADD +8   TO WS-SUM-END-MTH.                                  
           MOVE WS-PGRMNAME TO ABEND-PROGRAM.                           
                                                                        
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
       1000-PROCESS-UTIL.                                               
           ADD +1 TO WS-UTIL-COUNT.                                     
                                                                        
           MOVE ZEROES TO WS-ACCUMULATE-USE.                            
           MOVE ZEROES TO WS-ACCUMULATE-DAYS.                           
           MOVE 'N'    TO WS-NO-MORE-BG-SW.                             
           MOVE 'N'    TO WS-NO-MORE-CX-SW.                             
C32676     MOVE AT-PREMISE-NO          TO BG-PREMISE-NO                 
C32676                                    WS-CPD99-PREMISE-NO.          
      *                                                                 02890000
C32676     PERFORM 6990-FETCH-CUR-ACCOUNT  THRU  6990-EXIT              
C32676     IF  WS-CPD99-ACCOUNT-NO NOT EQUAL UT-ACCOUNT-NO              
C32676         PERFORM 7050-FETCH-UTIL    THRU 7050-EXIT                
C32676         IF  WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                
C32676             MOVE 'Y'        TO WS-NO-MORE-UT-SW                  
C32676         END-IF                                                   
C32676         GO TO 1000-EXIT                                          
C32676     END-IF.                                                      
                                                                        
           PERFORM 7150-OPEN-BG-CURSOR THRU 7150-EXIT.                  
           PERFORM 7200-FETCH-BG-CURSOR THRU 7200-EXIT.                 
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              NEXT SENTENCE                                             
           ELSE                                                         
              PERFORM 2000-OBTAIN-ALL-BG  THRU 2000-EXIT                
               UNTIL WS-NO-MORE-BGS                                     
           END-IF.                                                      
                                                                        
T33924     IF AT-COMPANY-NO = '26'                                      
T33924        IF UT-RATE-PLAN-NO = BR-GAS-BASE-HIGH-RATE                
T33924           PERFORM 7275-GET-SVC-STRT-DATE THRU 7275-EXIT          
T33924        END-IF                                                    
T33924        IF CH-DATE-UTIL-SVC-STRT >= WS-ANNUAL-REVIEW-SVC-ST AND   
T33924           UT-RATE-PLAN-NO = BR-GAS-BASE-HIGH-RATE                
T33924            MOVE 'N' TO UT-AUTO-RATE-SW-FL                        
T33924            MOVE BR-GAS-BASE-USE-DFLT TO WS-BASE-USE              
T33924        ELSE                                                      
T33924            COMPUTE WS-BASE-USE ROUNDED = WS-ACCUMULATE-USE       
T33924        END-IF                                                    
           ELSE                                                         
T33924        IF AT-COMPANY-NO = '01'                                   
T33924           IF WS-ACCUMULATE-DAYS < 30                             
C32676              MOVE BR-GAS-BASE-USE-DFLT TO WS-BASE-USE            
T33924           ELSE                                                   
TP2332              COMPUTE WS-BASE-USE-WORK ROUNDED =                  
TP2332                      ( WS-ACCUMULATE-USE / WS-ACCUMULATE-DAYS)   
TP2332              COMPUTE WS-BASE-USE ROUNDED = WS-BASE-USE-WORK * 30 
T33924           END-IF                                                 
T33924        END-IF                                                    
           END-IF.                                                      
                                                                        
           PERFORM 2300-UPDATE-BASE-USE THRU 2300-EXIT.                 
                                                                        
           PERFORM 7250-CLOSE-BG-CURSOR THRU 7250-EXIT.                 
           MOVE 'N'    TO WS-NO-MORE-BG-SW.                             
C32676     IF  AT-CODE-ACCT-STAT EQUAL 'A'                              
C32676         PERFORM 2400-UPDATE-BG-BASE-USE THRU 2400-EXIT           
C32676     ELSE                                                         
C32676* UPDATE RATE ON UT FOR NON-ACTIVE ACCOUNTS                               
C32676         IF BR-GAS-BASE-USE-MIN >  0                              
C32676            PERFORM 2500-UPDATE-UT-RATE THRU 2500-EXIT            
C32676         END-IF                                                   
C32676     END-IF.                                                      
                                                                        
T26136*    DIVIDE WS-UTIL-COUNT BY +100  GIVING WS-DISPLAY-CNT          02922400
T26136     DIVIDE WS-UTIL-COUNT BY +1000 GIVING WS-DISPLAY-CNT          
                  REMAINDER WS-REMAINDER.                               
           IF WS-REMAINDER = 0                                          
T18137        EXEC SQL                                                  
T18137             COMMIT                                               
T18137        END-EXEC                                                  

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

              DISPLAY 'UT COUNT = ' WS-UTIL-COUNT
           END-IF.                      
                                                                        
           PERFORM 7050-FETCH-UTIL    THRU 7050-EXIT.                   
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE 'Y'    TO WS-NO-MORE-UT-SW
           END-IF.                          
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       2000-OBTAIN-ALL-BG.                                              
CIG   *                                                                         
CIG        MOVE SPACES                     TO WS-CIG-RATE-FL.           
CIG        MOVE 'G'                        TO J1-CODE-UTIL-TYPE         
CIG                                           BG-CODE-UTIL-TYPE         
CIG        MOVE BG-RATE-PLAN-NO            TO J1-RATE-PLAN-NO           
CIG        PERFORM 7450-CHECK-FOR-CIG-RATE THRU 7450-EXIT.              
CIG        IF  IT-IS-CIG-RATE                                           
CIG            PERFORM 2200-OBTAIN-VOL-DAILY THRU 2200-EXIT             
CIG            PERFORM 7200-FETCH-BG-CURSOR THRU 7200-EXIT              
CIG            IF  WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                
CIG                MOVE 'Y'                TO WS-NO-MORE-BG-SW          
CIG            END-IF                                                   
CIG            GO TO 2000-EXIT                                          
CIG        END-IF.                                                      
CIG   *                                                                         
T27909     ADD BG-NO-OF-CONS-DAYS      TO WS-ACCUMULATE-DAYS            
C21122     MOVE ZEROS                  TO WS-NULL-IND                   
C21122                                    CX-NO-UNITS                   
C21122     PERFORM 7300-SELECT-CX-UNITS THRU 7300-EXIT.                 
C21122     COMPUTE WS-THERMS ROUNDED =                                  
C21122           (CX-NO-UNITS * BG-BTU-FACTOR)                          
C21122     ADD WS-THERMS  TO WS-ACCUMULATE-USE.                         
           PERFORM 7200-FETCH-BG-CURSOR THRU 7200-EXIT.                 
                                                                        
           IF WS-ACTIVE-RETURN-CODE EQUAL NOT-FOUND                     
              MOVE 'Y'   TO WS-NO-MORE-BG-SW
           END-IF.                           
                                                                        
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
CIG   *****************************************************************         
CIG   ** PROCESS VOLUMES FROM CSS_VOL_DAILY FOR CIG  CUSTOMERS       **         
CIG   *****************************************************************         
CIG    2200-OBTAIN-VOL-DAILY.                                           
CIG        MOVE BG-ACCOUNT-NO              TO ND-ACCOUNT-NO             
CIG        MOVE BG-BILL-NO                 TO ND-BILL-NO                
CIG        MOVE 'G'                        TO ND-CODE-UTIL-TYPE         
CIG        MOVE BG-IC-NO                   TO ND-IC-NO                  
CIG        MOVE BG-BILL-ITEM-TIMESTMP      TO ND-BILL-ITEM-TIMESTMP     
CIG        MOVE ZEROS                      TO WS-NULL-IND               
CIG                                           WS-NULL-IND-1             
CIG                                           ND-NO-UNITS               
CIG                                           WS-NO-DAYS.               
CIG        PERFORM 7500-GET-NO-UNITS THRU 7500-EXIT.                    
CIG        ADD ND-NO-UNITS                 TO WS-ACCUMULATE-USE.        
CIG        ADD WS-NO-DAYS                  TO WS-ACCUMULATE-DAYS.       
CIG    2200-EXIT.                                                       
CIG        EXIT.                                                        
CIG   *                                                                 03232700
       2300-UPDATE-BASE-USE.                                            
                                                                        
           MOVE UT-GAS-BASE-USE TO UT-GAS-PREV-BASE-USE.                
           MOVE WS-CURRENT-DATE TO UT-GAS-BASE-LAST-UPDT.               
           MOVE WS-BASE-USE     TO UT-GAS-BASE-USE.                     
T34287     IF UT-RATE-PLAN-NO = 'D31'                                   
T34287        AND UT-GAS-BASE-USE >= BR-GAS-BASE-USE-MIN                
T34287        PERFORM 2350-WQ-FOR-D31-RATE    THRU 2350-EXIT            
T34287     END-IF.                                                      
           PERFORM 8000-UPDATE-UTIL-ENV THRU 8000-EXIT.                 
                                                                        
       2300-EXIT.                                                       
           EXIT.                                                        
                                                                        
T34287*****************************************************************         
T34287** MOVE VALUES OF D31 RATE PLAN TO THE WORK WORK FIELDS.       **         
T34287*****************************************************************         
T34287 2350-WQ-FOR-D31-RATE.                                            
T34287*                                                                 03233000
ACT007     INITIALIZE CWS00077-FIELDS                                   
ACT007     MOVE ZERO                        TO WS-77-SERV-ORDER-NO.     
ACT007     MOVE SPACES                      TO WS-77-ROUTE-CATEGORY.    
ACT007     MOVE WS-INPUT-DATE               TO WS-77-DATE-REQUIRED.     
ACT007     MOVE AT-PREMISE-NO               TO WS-77-PREMISE-NO.        
ACT007     MOVE AT-CUSTOMER-NO              TO WS-77-CUSTOMER-NO.       
ACT007     MOVE SPACES                      TO WS-77-LOCAL-OFFICE.      
ACT007     MOVE SPACES                      TO WS-77-RESP-AREA-ID.      
ACT007     MOVE ZERO                        TO WS-77-FREE-FORM-LEN.     
ACT007     MOVE LOW-VALUES                  TO WS-77-FREE-FORM-TXT.     
ACT007     MOVE UT-ACCOUNT-NO               TO WS-77-ACCOUNT-NO.        
ACT007     MOVE 138                         TO WS-77-CATEGORY-ID.       
ACT007     MOVE 'H'                         TO WS-77-PRIORITY.          
ACT007     MOVE +86                         TO WS-77-COMMENTS-LEN.      
ACT007     MOVE BR-GAS-BASE-HIGH-RATE       TO WS-D31-HIGH-RATE.        
ACT007     MOVE WS-WQ-COMMENT               TO WS-77-COMMENTS-TEXT.     
ACT007     MOVE WS-PGRMNAME                 TO WS-77-CREATED-BY.        
T34287     PERFORM 8890-INSERT-WORK-QUEUE   THRU 8890-EXIT.             
T34287*                                                                 03233000
T34287*                                                                 03241000
T34287 2350-EXIT.                                                       
T34287     EXIT.                                                        
T29922*                                                                 03232700
T29922 2400-UPDATE-BG-BASE-USE.                                         
T29922*                                                                 03232700
T29922     MOVE UT-ACCOUNT-NO             TO BG-ACCOUNT-NO              
T29922                                       BI-ACCOUNT-NO.             
T29922     MOVE UT-IC-NO                  TO BG-IC-NO.                  
T29922     MOVE UT-RATE-PLAN-NO           TO BG-RATE-PLAN-NO.           
T29922     PERFORM 7700-SELECT-FUTURE-BILL-NO    THRU 7700-EXIT.        
T29922     IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
T29922        GO TO 2400-EXIT                                           
T29922     END-IF.                                                      
T29922     MOVE UT-GAS-BASE-USE       TO BG-GAS-BASE-USE                
T29922     MOVE WS-CALC-GAS-BASE-NULL TO WS-NULL-GAS-BASE-USE           
T29922     PERFORM 8100-UPDATE-BG-BASE-USE THRU 8100-EXIT.              
T29922*                                                                 03232700
T29922 2400-EXIT.                                                       
T29922     EXIT.                                                        
C32676*                                                                 03232700
C32676*****************************************************************         
C32676** PROCESS TO UPDATE RATE ON NON-ACTIVE ACCOUNTS               **         
C32676*****************************************************************         
C32676 2500-UPDATE-UT-RATE.                                             
C32676*                                                                 03232700
C32676     IF  UT-GAS-BASE-USE >= BR-GAS-BASE-USE-MIN                   
C32676         IF  BR-GAS-BASE-HIGH-RATE EQUAL UT-RATE-PLAN-NO          
C32676             GO TO 2500-EXIT                                      
C32676         END-IF                                                   
C32676         MOVE UT-RATE-PLAN-NO        TO UT-PRV-RATE-PLAN-NO       
C32676         MOVE BR-GAS-BASE-HIGH-RATE  TO UT-RATE-PLAN-NO           
C32676     ELSE                                                         
C32676         IF  BR-GAS-BASE-LOW-RATE EQUAL UT-RATE-PLAN-NO           
C32676             GO TO 2500-EXIT                                      
C32676         END-IF                                                   
C32676         MOVE UT-RATE-PLAN-NO        TO UT-PRV-RATE-PLAN-NO       
C32676         MOVE BR-GAS-BASE-LOW-RATE   TO UT-RATE-PLAN-NO           
C32676     END-IF.                                                      
C32676*                                                                 03232700
C32676     PERFORM 8200-UPDATE-RATE THRU 8200-EXIT.                     
C32676*                                                                 03232700
C32676     PERFORM 7750-SELECT-CURRENT-TS THRU 7750-EXIT.               
C32676*                                                                 03232700
C32676     MOVE WS-CURRENT-TS                 TO MH-TRANS-HIST-SEQ-NO   
C32676                                           MI-TRANS-HIST-SEQ-NO.  
C32676     MOVE WS-CURRENT-DATE               TO MH-DATE-TRANS.         
C32676     MOVE 'F'                           TO MH-CODE-TRAN-TYPE.     
C32676     MOVE SPACES                        TO MH-RESP-AREA-ID.       
C32676     MOVE UT-ACCOUNT-NO                 TO MH-ACCOUNT-NO.         
C32676     MOVE AT-CUSTOMER-NO                TO MH-CUSTOMER-NO.        
C32676     MOVE AT-PREMISE-NO                 TO MH-PREMISE-NO.         
C32676     MOVE 'SYSTEM'                      TO MH-USER-ID.            
C32676     MOVE WS-PGRMNAME                   TO MH-APPL-PROGRAM-ID.    
C32676     MOVE WS-RATE-TEXT-LEN              TO MH-TRAN-COMMENT-LEN.   
C32676     MOVE WS-RATE-TEXT                  TO MH-TRAN-COMMENT-TEXT.  
C32676*                                                                 03232700
C32676     MOVE SPACES                  TO MI-TABLE-ID.                 
C32676     MOVE 1                       TO MI-TRAN-APPL-NO.             
C32676     MOVE +3                      TO MI-PRV-COLUMN-VALUE-LEN.     
C32676     MOVE UT-PRV-RATE-PLAN-NO     TO MI-PRV-COLUMN-VALUE-TEXT.    
C32676     MOVE +3                      TO MI-CHG-COLUMN-VALUE-LEN.     
C32676     MOVE UT-RATE-PLAN-NO         TO MI-CHG-COLUMN-VALUE-TEXT.    
C32676     MOVE 'RATE PLAN CHNG '       TO MI-COLUMN-DESC.              
C32676*                                                                 03232700
C32676     PERFORM 6530-LOAD-MNT-TRANS-HIST THRU 6530-EXIT.             
C32676*                                                                 03232700
C32676 2500-EXIT.                                                       
C32676     EXIT.                                                        
                                                                        
       COPY CPD00040.                                                   03653000
       COPY CPD00037.                                                   03660000
                                                                        
      ***************************************************************** 03661000
      **  PREREQUISITES: THE PARM FILE (FCSJC01) MUST BE OPENED      ** 03669200
      **                 PRIOR TO INVOKING THIS ROUTINE              ** 03669300
      ***************************************************************** 03670000
      *                                                                 03670100
       6252-GET-REV-MONTH.                                              
      *                                                                 03670300
           MOVE  WS-PGRMNAME TO WS-PROGRAM.                             
           MOVE  WS-PARM     TO WS-COMMAND.                             
           MOVE  ZEROS       TO WS-SEQUENCE.                            
           MOVE  SPACES      TO WS-SYSIPT.                              
           MOVE  WS-KEY-AREA TO E-FJC01-KEY.                            
           PERFORM 7600-START-FCSJC01  THRU  7600-EXIT.                 
           PERFORM 7610-READ-FCSJC01   THRU  7610-EXIT                  
               UNTIL (REVENUE-MONTH AND INPUT-ACTIVE)                   
                  OR  END-OF-SYSIPT.                                    
      *                                                                 03671300
           IF  END-OF-SYSIPT                                            
               MOVE WS-N TO WS-OVERRIDE-REV-SW                          
           ELSE                                                         
               MOVE WS-Y TO WS-OVERRIDE-REV-SW                          
               IF  WS-REVENUE-MONTH-PARM NUMERIC                        
                   PERFORM 7611-CLOSE THRU 7611-EXIT                    
                   DISPLAY ' '                                          
                   DISPLAY '** ' WS-PGRMNAME ' PROCESSING MESSAGE **'   
                   DISPLAY '**  OVERRIDE REV MONTH BEING USED'          
                   DISPLAY '**    KEY =  ' E-FJC01-KEY                  
                   DISPLAY '**    DATE = ' WS-REVENUE-MONTH-PARM        
                   DISPLAY '**  PROCESSING CONTINUING  **'              
               ELSE                                                     
                   DISPLAY ' '                                          
                   DISPLAY '** ' WS-PGRMNAME ' PROCESSING ERROR  **'    
                   DISPLAY '**  OVERRIDE REV MONTH IS NOT NUMERIC'      
                   DISPLAY '**    KEY = ' E-FJC01-KEY                   
                   DISPLAY '**  PROCESSING TERMINATED  **'              
                   PERFORM 9900-ABEND  THRU  9900-EXIT
               END-IF
           END-IF.                 
      *                                                                 03673600
       6252-EXIT.                                                       
           EXIT.                                                        
                                                                        
C32676***************************************************************           
C32676* 6530-LOAD-MNT-TRANS-HIST                                                
C32676***************************************************************           
C32676     EXEC SQL                                                             
C32676        INCLUDE CPD00067                                                  
C32676     END-EXEC.                                                            
C32676*                                                                         
C32676****************************************************************  20231000
C32676* 6990-FETCH-CUR-ACCOUNT                                       *          
C32676*  TO FETCH THE MOST CURRENT ACCOUNT AT THE PREMISE.           *          
C32676****************************************************************  20231000
C32676     EXEC SQL                                                             
C32676          INCLUDE CPD00099                                                
C32676     END-EXEC.                                                            
C32676*                                                                 20231000
C32676 6995-CPD99-ERROR-ROUTINE.                                        
C32676*                                                                 20231000
C32676     MOVE ZEROES  TO  WS-CPD99-ACCOUNT-NO.                        
C32676*                                                                         
C32676     DISPLAY '****************** PCSCA524 ***************'.       
C32676     DISPLAY '* ERROR IN PARA ', ACTIVE-PARAGRAPH                 
C32676     DISPLAY '* PREMISE-NO = ', WS-CPD99-PREMISE-NO               
C32676     DISPLAY '* SQL CODE IS ', WS-CPD99-RETURN-CODE               
C32676     DISPLAY '*******************************************'.       
C32676     PERFORM 9900-ABEND     THRU  9900-EXIT.                      
C32676*                                                                 20231000
C32676 6995-EXIT.                                                       
C32676     EXIT.                                                        
C32676*                                                                         
       7000-OPEN-UTIL.                                                  
                                                                        
           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.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7000'            TO ACTIVE-PARAGRAPH                
              MOVE 'OPEN'            TO ABEND-FUNCTION                  
              MOVE 'CSS_ACCOUNT'     TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
       7000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7050-FETCH-UTIL.                                                 
                                                                        
           EXEC SQL                                                     
                FETCH UT-CURSOR                                         
                INTO  :UT-ACCOUNT-NO,                                   
                      :UT-IC-NO,                                        
                      :UT-RATE-PLAN-NO,                                 
                      :UT-GAS-BASE-USE,                                 
C32676                :BR-GAS-BASE-USE-DFLT                             
C32676               ,:BR-GAS-BASE-HIGH-RATE                            
C32676               ,:BR-GAS-BASE-LOW-RATE                             
C32676               ,:BR-GAS-BASE-USE-MIN                              
C32676               ,:AT-CODE-ACCT-STAT                                
C32676               ,:AT-PREMISE-NO                                    
C32676               ,:AT-CUSTOMER-NO                                   
T33924               ,:AT-COMPANY-NO                                    
T33924               ,:UT-AUTO-RATE-SW-FL                               
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7050'            TO ACTIVE-PARAGRAPH                
              MOVE 'FETCH'           TO ABEND-FUNCTION                  
              MOVE 'CSS_ACCOUNT'     TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
T26136     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T26136         ADD 1 TO WS-CNT-UT-READ
           END-IF.                                 
                                                                        
T26136*    IF WS-CNT-UT-READ > 398                                      04099000
T26136*        DISPLAY 'ABENDING PCSCA524 BECAUSE OF TO MANY READS'     04099000
T26136*        DISPLAY 'LIMIT AMT              ' WS-CNT-UT-READ         04099000
T26136*        DISPLAY 'NUMBER RECORDS READ    ' WS-CNT-UT-READ         04099000
T26136*        PERFORM 9900-ABEND     THRU 9900-EXIT.                   04099000
                                                                        
       7050-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7100-CLOSE-UT-CURSOR.                                            
                                                                        
           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.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7100'            TO ACTIVE-PARAGRAPH                
              MOVE 'CLOSE'           TO ABEND-FUNCTION                  
              MOVE 'CSS_ACCOUNT'     TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
       7100-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7150-OPEN-BG-CURSOR.                                             
                                                                        
           EXEC SQL                                                     
                OPEN BG-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.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7150'            TO ACTIVE-PARAGRAPH                
              MOVE 'OPEN'            TO ABEND-FUNCTION                  
              MOVE 'CSS_BILLING_DET' TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
       7150-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7200-FETCH-BG-CURSOR.                                            
                                                                        
           EXEC SQL                                                     
                FETCH BG-CURSOR                                         
                INTO  :BG-BTU-FACTOR,                                   
                      :BG-BILL-NO,                                      
                      :BG-BILL-ITEM-TIMESTMP,                           
                      :BG-REVENUE-MONTH                                 
T18137               ,:BG-CODE-BILL-ITM-IND                             
C26287               ,:BG-ACCOUNT-NO                                    
CIG                  ,:BG-IC-NO                                         
CIG                  ,:BG-RATE-PLAN-NO                                  
T27909               ,:BG-NO-OF-CONS-DAYS                               
C21122               ,:BG-CODE-DR-CR-CNSMPTN                            
           END-EXEC.                                                    

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7200'            TO ACTIVE-PARAGRAPH                
              MOVE 'FETCH'           TO ABEND-FUNCTION                  
              MOVE 'CSS_BILLING_DET' TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
       7200-EXIT.                                                       
           EXIT.                                                        
                                                                        
       7250-CLOSE-BG-CURSOR.                                            
                                                                        
           EXEC SQL                                                     
                CLOSE BG-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.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '7250'            TO ACTIVE-PARAGRAPH                
              MOVE 'CLOSE'           TO ABEND-FUNCTION                  
              MOVE 'CSS_BILLING_DET' TO TABLE-1                         
              PERFORM 9010-DISP-ERRS THRU 9010-EXIT                     
              PERFORM 9900-ABEND     THRU 9900-EXIT
           END-IF.                    
                                                                        
       7250-EXIT.                                                       
           EXIT.                                                        
      ************************************************************      04568000
      *   GET SERVICE START DATE                                        04568000
      ************************************************************      04568000
T33924 7275-GET-SVC-STRT-DATE.                                          
      *                                                                 04568200
           EXEC SQL                                                     
              SELECT  DATE_UTIL_SVC_STRT                                
                INTO :CH-DATE-UTIL-SVC-STRT                             
              FROM    CSS_CUST_PREM_HIST WITH(READUNCOMMITTED)                  
              WHERE   ACCOUNT_NO         = :UT-ACCOUNT-NO               
                AND   PREMISE_NO         = :AT-PREMISE-NO               
                                                                 
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     04568500
MFA-TR*       SELECT  DATE_UTIL_SVC_STRT                                02000500
MFA-TR*         INTO :CH-DATE-UTIL-SVC-STRT                                     
MFA-TR*       FROM    CSS_CUST_PREM_HIST                                02000900
MFA-TR*       WHERE   ACCOUNT_NO         = :UT-ACCOUNT-NO               02001000
MFA-TR*         AND   PREMISE_NO         = :AT-PREMISE-NO               02001100
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    02001700

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 WS-ANNUAL-REVIEW-SVC-ST TO CH-DATE-UTIL-SVC-STRT  
              ELSE                                                      
                 MOVE '7275'             TO ACTIVE-PARAGRAPH            
                 MOVE 'SELECT'           TO ABEND-FUNCTION              
                 MOVE 'CSS_CUST_PREM_HIST' TO TABLE-1                   
                 PERFORM 9010-DISP-ERRS  THRU 9010-EXIT                 
                 PERFORM 9900-ABEND      THRU 9900-EXIT                 
              END-IF                                                    
           END-IF.                                                      
                                                                        
T33924 7275-EXIT.                                                       
           EXIT.                                                        
                                                                        
C21122 7300-SELECT-CX-UNITS.                                            
C21122*                                                                 04568200
C21122     EXEC SQL                                                     
C21122        SELECT  SUM(NO_UNITS)                                     
C21122          INTO :CX-NO-UNITS :WS-NULL-IND                           
C21122        FROM    CSS_CNSMPTN_HIST WITH(READUNCOMMITTED)                    
C21122        WHERE   ACCOUNT_NO         = :BG-ACCOUNT-NO               
C21122         AND    BILL_NO            = :BG-BILL-NO                  
C21122         AND    CODE_UTIL_TYPE     = 'G'                          
C21122         AND    IC_NO              = :UT-IC-NO                    
C21122         AND    BILL_ITEM_TIMESTMP = CIS.CHAR2TIMESTAMP(
                                                 :BG-BILL-ITEM-TIMESTMP
              )       
C21122         AND    CODE_USAGE_TYPE    = 'C'                          
C34287                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     04568500
MFA-TR*       SELECT  SUM(NO_UNITS)                                     02000500
MFA-TR*         INTO :CX-NO-UNITS:WS-NULL-IND                                   
MFA-TR*       FROM    CSS_CNSMPTN_HIST                                  02000900
MFA-TR*       WHERE   ACCOUNT_NO         = :BG-ACCOUNT-NO               02001000
MFA-TR*        AND    BILL_NO            = :BG-BILL-NO                  02001100
MFA-TR*        AND    CODE_UTIL_TYPE     = 'G'                          02001200
MFA-TR*        AND    IC_NO              = :UT-IC-NO                    02001300
MFA-TR*        AND    BILL_ITEM_TIMESTMP = :BG-BILL-ITEM-TIMESTMP       02001400
MFA-TR*        AND    CODE_USAGE_TYPE    = 'C'                          02001400
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    02001700

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
C21122        MOVE '7300'             TO ACTIVE-PARAGRAPH               
C21122        MOVE 'SELECT'           TO ABEND-FUNCTION                 
              MOVE 'CSS_CNSMPTN_HIST' TO TABLE-1                        
              PERFORM 9010-DISP-ERRS  THRU 9010-EXIT                    
              PERFORM 9900-ABEND      THRU 9900-EXIT
           END-IF.                   
                                                                        
C21122 7300-EXIT.                                                       
           EXIT.                                                        
                                                                        
      *****************************************************************         
      ** 7450-CHECK-FOR-CIG-RATE                                     **         
      *****************************************************************         
       7450-CHECK-FOR-CIG-RATE.                                         
      *                                                                         
           EXEC SQL                                                     
              SELECT 'Y'                                                
                INTO :WS-CIG-RATE-FL                                    
                FROM CSS_RATE_COMP_DEF WITH(READUNCOMMITTED)                    
               WHERE RATE_PLAN_NO     = :J1-RATE-PLAN-NO                
                 AND CODE_UTIL_TYPE   = :J1-CODE-UTIL-TYPE              
                 AND CMPNT_ID_CD      = '10'                            
                 AND REG_TYPE_CD      = 'D'                             
C34287                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT 'Y'                                                        
MFA-TR*         INTO :WS-CIG-RATE-FL                                            
MFA-TR*         FROM CSS_RATE_COMP_DEF                                  05110000
MFA-TR*        WHERE RATE_PLAN_NO     = :J1-RATE-PLAN-NO                05120000
MFA-TR*          AND CODE_UTIL_TYPE   = :J1-CODE-UTIL-TYPE              05140000
MFA-TR*          AND CMPNT_ID_CD      = '10'                                    
MFA-TR*          AND REG_TYPE_CD      = 'D'                                     
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                    05230000

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 EQUAL SUCCESSFUL-CALL OR NOT-FOUND 
                                   OR -811                              
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY '****************************************'       
               DISPLAY '**     PCSCA524 PROCESSING ERROR      **'       
               DISPLAY '**      ABEND IN PARAGRAPH 7450       **'       
               DISPLAY '**           RATE = ' J1-RATE-PLAN-NO           
               DISPLAY '**     VERSION NO = ' J1-VERSION-NO-CNTRL       
               DISPLAY '**        SQLCODE = ' WS-ACTIVE-RETURN-CODE     
               DISPLAY '****************************************'       
               PERFORM 9900-ABEND THRU 9900-EXIT                        
           END-IF.                                                      
      *                                                                         
       7450-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
      *****************************************************************         
      ** 7500-GET-NO-UNITS                                           **         
      *****************************************************************         
       7500-GET-NO-UNITS.                                               
           EXEC SQL                                                     
              SELECT SUM(NO_UNITS)                                      
                    ,COUNT(*)                                           
                INTO :ND-NO-UNITS :WS-NULL-IND                          
                    ,:WS-NO-DAYS :WS-NULL-IND-1                        
                FROM CSS_VOL_DAILY WITH(READUNCOMMITTED)                        
               WHERE ACCOUNT_NO         = :ND-ACCOUNT-NO                
                 AND BILL_NO            = :ND-BILL-NO                   
                 AND CODE_UTIL_TYPE     = :ND-CODE-UTIL-TYPE            
                 AND IC_NO              = :ND-IC-NO                     
                 AND BILL_ITEM_TIMESTMP = CIS.CHAR2TIMESTAMP(
                                                 :ND-BILL-ITEM-TIMESTMP
              )        
                 AND VOL_TYPE_CD        = 'VB'                          
                 AND ENERGY_UNIT_CD     = 'D'                           
C34287                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                             
MFA-TR*       SELECT SUM(NO_UNITS)                                              
MFA-TR*             ,COUNT(*)                                                   
MFA-TR*         INTO :ND-NO-UNITS :WS-NULL-IND                                  
MFA-TR*             ,:WS-NO-DAYS  :WS-NULL-IND-1                                
MFA-TR*         FROM CSS_VOL_DAILY                                              
MFA-TR*        WHERE ACCOUNT_NO         = :ND-ACCOUNT-NO                        
MFA-TR*          AND BILL_NO            = :ND-BILL-NO                           
MFA-TR*          AND CODE_UTIL_TYPE     = :ND-CODE-UTIL-TYPE                    
MFA-TR*          AND IC_NO              = :ND-IC-NO                             
MFA-TR*          AND BILL_ITEM_TIMESTMP = :ND-BILL-ITEM-TIMESTMP                
MFA-TR*          AND VOL_TYPE_CD        = 'VB'                                  
MFA-TR*          AND ENERGY_UNIT_CD     = 'D'                                   
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                            

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

      *                                                                         
           MOVE SQLCODE                    TO WS-ACTIVE-RETURN-CODE.    
      *                                                                         
           IF  WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND 
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY '****************************************'       
               DISPLAY '**     PCSCA524 PROCESSING ERROR      **'       
               DISPLAY '**      ABEND IN PARAGRAPH 7500       **'       
               DISPLAY '**        ACCOUNT = ' ND-ACCOUNT-NO             
               DISPLAY '**           BILL = ' ND-BILL-NO                
               DISPLAY '**          IC NO = ' ND-IC-NO                  
               DISPLAY '**        SQLCODE = ' WS-ACTIVE-RETURN-CODE     
               DISPLAY '****************************************'       
               PERFORM 9900-ABEND THRU 9900-EXIT                        
           END-IF.                                                      
      *                                                                         
       7500-EXIT.                                                       
           EXIT.                                                        
      *                                                                         
T29922*****************************************************************         
T29922** 7700-SELECT-FUTURE-BILL-NO                                  **         
T29922*****************************************************************         
T29922 7700-SELECT-FUTURE-BILL-NO.                                      
T29922*                                                                         
T29922     EXEC SQL                                                     
T29922          SELECT BILL_NO                                          
T29922            INTO :BI-BILL-NO                                      
T29922            FROM CSS_BILLING_HDR BI WITH(READUNCOMMITTED)                 
T29922           WHERE BI.ACCOUNT_NO = :BI-ACCOUNT-NO                   
T29922             AND BI.DATE_BILLED IS NULL                           
C34287                                                           
T29922     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT BILL_NO                                                  
MFA-TR*           INTO :BI-BILL-NO                                              
MFA-TR*           FROM CSS_BILLING_HDR BI                                       
MFA-TR*          WHERE BI.ACCOUNT_NO = :BI-ACCOUNT-NO                           
MFA-TR*            AND BI.DATE_BILLED IS NULL                           01999900
MFA-TR*        WITH UR                                                          
MFA-TR*    END-EXEC.                                                            

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

T29922                                                                  
T29922     MOVE SQLCODE               TO WS-ACTIVE-RETURN-CODE.         
T29922     EVALUATE WS-ACTIVE-RETURN-CODE                               
T29922         WHEN SUCCESSFUL-CALL                                     
T29922         WHEN -811                                                
T29922              MOVE BI-BILL-NO         TO BG-BILL-NO               
T29922         WHEN NOT-FOUND                                           
T29922             DISPLAY ' NO FUTURE BILL HOOK ROW FOUND FOR ACCOUNT '
T29922                     BI-ACCOUNT-NO                                
T29922         WHEN OTHER                                               
T29922              DISPLAY ' ACCOUNT ' BI-ACCOUNT-NO ' FAILED WITH '   
T29922                      WS-ACTIVE-RETURN-CODE                       
T29922              MOVE '7700'             TO ACTIVE-PARAGRAPH         
T29922              MOVE 'SELECT'           TO ABEND-FUNCTION           
T29922              MOVE 'CSS_BILLING_HDR'  TO TABLE-1                  
T29922              PERFORM 9010-DISP-ERRS  THRU 9010-EXIT              
T29922              PERFORM 9900-ABEND      THRU 9900-EXIT              
T29922     END-EVALUATE.                                                
T29922*                                                                         
T29922 7700-EXIT.                                                       
T29922     EXIT.                                                        
                                                                        
C32676*****************************************************************         
C32676** 7750-SELECT-CURRENT-TS                                      **         
C32676*****************************************************************         
C32676 7750-SELECT-CURRENT-TS.                                          
C32676*                                                                         
C32676     EXEC SQL                                                     
T35434          SELECT
              REPLACE(REPLACE(CONVERT(CHAR(26), CIS.CURRENT$TIMESTAMP()
           , 121), ' ', '-'), ':', '.')
            INTO
              :WS-CURRENT-TS           
C32676     END-EXEC.                                                    

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

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

C32676                                                                  
C32676     MOVE SQLCODE               TO WS-ACTIVE-RETURN-CODE.         
C32676     EVALUATE WS-ACTIVE-RETURN-CODE                               
C32676         WHEN SUCCESSFUL-CALL                                     
C32676              CONTINUE                                            
C32676         WHEN OTHER                                               
C32676              MOVE '7750'             TO ACTIVE-PARAGRAPH         
T35434              MOVE 'SET'              TO ABEND-FUNCTION           
C32676              PERFORM 9010-DISP-ERRS  THRU 9010-EXIT              
C32676              PERFORM 9900-ABEND      THRU 9900-EXIT              
C32676     END-EVALUATE.                                                
C32676*                                                                         
C32676 7750-EXIT.                                                       
C32676     EXIT.                                                        
                                                                        
T33924*****************************************************************         
      ** 7800-GET-PSNC-DELINQ.                                       **         
      *****************************************************************         
       7800-GET-PSNC-DELINQ.                                            
      *                                                                         
           EXEC SQL                                                     
                SELECT DELINQ_VALUE                                     
                  INTO :C8-DELINQ-VALUE                                 
                  FROM CSS_DELINQUENCY WITH(READUNCOMMITTED)                    
                WHERE DELINQ_CD  = :C8-DELINQ-CD                        
                  AND COMPANY_NO = :C8-COMPANY-NO                       
T35434                                                           
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*         SELECT DELINQ_VALUE                                     04050000
MFA-TR*           INTO :C8-DELINQ-VALUE                                         
MFA-TR*           FROM CSS_DELINQUENCY                                          
MFA-TR*         WHERE DELINQ_CD  = :C8-DELINQ-CD                                
MFA-TR*           AND COMPANY_NO = :C8-COMPANY-NO                               
MFA-TR*         WITH UR                                                         
MFA-TR*    END-EXEC.                                                            

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

                                                                        
           MOVE SQLCODE               TO WS-ACTIVE-RETURN-CODE.         
           EVALUATE WS-ACTIVE-RETURN-CODE                               
               WHEN SUCCESSFUL-CALL                                     
                    CONTINUE                                            
               WHEN OTHER                                               
                    MOVE '7800'             TO ACTIVE-PARAGRAPH         
                    MOVE 'SELECT'           TO ABEND-FUNCTION           
                    MOVE 'CSS_DELINQUENCY'  TO TABLE-1                  
                    PERFORM 9010-DISP-ERRS  THRU 9010-EXIT              
                    PERFORM 9900-ABEND      THRU 9900-EXIT              
           END-EVALUATE.                                                
      *                                                                         
T33924 7800-EXIT.                                                       
            EXIT.                                                       
      *                                                                         
           EXEC SQL                                                     05970000
               INCLUDE CPD00038                                         05980000
           END-EXEC.                                                    05990000
                                                                        
           EXEC SQL                                                     06010000
               INCLUDE CPD00039                                         06020000
           END-EXEC.                                                    06030000
                                                                        
       8000-UPDATE-UTIL-ENV.                                            
                                                                        
           EXEC SQL                                                     
                UPDATE CSS_UTIL_ENVRNMT                                 
                SET    GAS_BASE_LAST_UPDT = IIF(TRY_CONVERT(DATE, 
                                                 :UT-GAS-BASE-LAST-UPDT
              ) IS NULL OR (PATINDEX('%.%', :UT-GAS-BASE-LAST-UPDT
              ) <> 0) OR (LEN(:UT-GAS-BASE-LAST-UPDT
              ) <> 10), CIS.CHAR2DATE(:UT-GAS-BASE-LAST-UPDT
              ), CONVERT(DATE, :UT-GAS-BASE-LAST-UPDT) ),     
                       GAS_PREV_BASE_USE  = :UT-GAS-PREV-BASE-USE,      
                       GAS_BASE_USE       = :UT-GAS-BASE-USE,           
T33924                 AUTO_RATE_SW_FL    = :UT-AUTO-RATE-SW-FL         
                WHERE  ACCOUNT_NO     = :UT-ACCOUNT-NO                  
                 AND   CODE_UTIL_TYPE = 'G'                             
                 AND   IC_NO          = :UT-IC-NO                       
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ054
MFA-TR*    EXEC SQL                                                     06460000
MFA-TR*         UPDATE CSS_UTIL_ENVRNMT                                 06470000
MFA-TR*         SET    GAS_BASE_LAST_UPDT = :UT-GAS-BASE-LAST-UPDT,     06480000
MFA-TR*                GAS_PREV_BASE_USE  = :UT-GAS-PREV-BASE-USE,      06481000
MFA-TR*                GAS_BASE_USE       = :UT-GAS-BASE-USE,           06482000
MFA-TR*                AUTO_RATE_SW_FL    = :UT-AUTO-RATE-SW-FL         06482000
MFA-TR*         WHERE  ACCOUNT_NO     = :UT-ACCOUNT-NO                  06490000
MFA-TR*          AND   CODE_UTIL_TYPE = 'G'                             06491000
MFA-TR*          AND   IC_NO          = :UT-IC-NO                       06492000
MFA-TR*    END-EXEC.                                                    06500000

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

                                                                        
           MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '8000'             TO ACTIVE-PARAGRAPH               
              MOVE 'UPDATE'           TO ABEND-FUNCTION                 
              MOVE 'CSS_UTIL_ENVRNMT' TO TABLE-1                        
              PERFORM 9010-DISP-ERRS  THRU 9010-EXIT                    
              PERFORM 9900-ABEND      THRU 9900-EXIT
           END-IF.                   
                                                                        
                                                                        
T26136     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
T26136         MOVE UT-GAS-PREV-BASE-USE TO WS-EDIT-PREV-BASE-USE       
T26136         MOVE WS-ACCUMULATE-USE TO WS-EDIT-ACCUMULATE-USE         
T26136         MOVE WS-ACCUMULATE-DAYS TO WS-EDIT-ACCUMULATE-DAYS       
T26136         MOVE UT-GAS-BASE-USE TO WS-EDIT-GAS-BASE-USE             
T26136             DISPLAY ' ' UT-ACCOUNT-NO         ' '                
T26136                         UT-RATE-PLAN-NO       ' '                
T26136                         WS-EDIT-PREV-BASE-USE ' '                
T26136                         WS-EDIT-ACCUMULATE-USE ' '               
T26236                         WS-EDIT-ACCUMULATE-DAYS ' '              
T26136                         WS-EDIT-GAS-BASE-USE  ' '                
T26136*                        UT-GAS-BASE-LAST-UPDT                            
T26136         ADD 1 TO WS-CNT-UT-UPDATE
           END-IF.                               
                                                                        
                                                                        
       8000-EXIT.                                                       
           EXIT.                                                        
T29922*                                                                         
T29922*****************************************************************         
T29922** 8100-UPDATE-BG-BASE-USE                                     **         
T29922*****************************************************************         
T29922*                                                                         
T29922 8100-UPDATE-BG-BASE-USE.                                         
T29922*                                                                         
T29922     EXEC SQL                                                     
T29922       UPDATE CSS_BILLING_DET                                     
T29922          SET GAS_BASE_USE = :BG-GAS-BASE-USE 
                                   :WS-NULL-GAS-BASE-USE                
C21122          WHERE ACCOUNT_NO        = :BG-ACCOUNT-NO                
C21122            AND BILL_NO           = :BG-BILL-NO                   
C21122            AND IC_NO             = :BG-IC-NO                     
C21122            AND RATE_PLAN_NO      = :BG-RATE-PLAN-NO              
C21122            AND CODE_UTIL_TYPE    = 'G'                           
C21122            AND REVENUE_MONTH     = 0                             
C21122            AND REV_MTH_ORIG_BILL = 0                             
C21122            AND DATE_ORIG_BILL IS NULL                            
T29922     END-EXEC.                                                    

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

T29922*                                                                         
T29922     MOVE SQLCODE TO WS-ACTIVE-RETURN-CODE.                       
C21122     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
T29922        NEXT SENTENCE                                             
T29922     ELSE                                                         
T29922        MOVE '8100'             TO ACTIVE-PARAGRAPH               
T29922        MOVE 'UPDATE'           TO ABEND-FUNCTION                 
T29922        MOVE 'CSS_BILLING_DET'  TO TABLE-1                        
C21122        DISPLAY '**        ACCOUNT = ' BG-ACCOUNT-NO              
C21122        DISPLAY '**           BILL = ' BG-BILL-NO                 
C21122        DISPLAY '**          IC NO = ' BG-IC-NO                   
C21122        DISPLAY '**           RATE = ' BG-RATE-PLAN-NO            
T29922        PERFORM 9010-DISP-ERRS  THRU 9010-EXIT                    
T29922        PERFORM 9900-ABEND      THRU 9900-EXIT                    
T29922     END-IF.                                                      
T29922*                                                                         
T29922 8100-EXIT.                                                       
T29922     EXIT.                                                        
                                                                        
       8200-UPDATE-RATE.                                                
                                                                        
           EXEC SQL                                                     
                UPDATE CSS_UTIL_ENVRNMT                                 
                SET    RATE_PLAN_NO       = :UT-RATE-PLAN-NO            
                      ,PRV_RATE_PLAN_NO   = :UT-PRV-RATE-PLAN-NO        
                      ,LAST_UPDATE_TS     = CIS.CURRENT$TIMESTAMP()           
                WHERE  ACCOUNT_NO     = :UT-ACCOUNT-NO                  
                 AND   CODE_UTIL_TYPE = 'G'                             
                 AND   IC_NO          = :UT-IC-NO                       
           END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ028
MFA-TR*    EXEC SQL                                                     06460000
MFA-TR*         UPDATE CSS_UTIL_ENVRNMT                                 06470000
MFA-TR*         SET    RATE_PLAN_NO       = :UT-RATE-PLAN-NO            06480000
MFA-TR*               ,PRV_RATE_PLAN_NO   = :UT-PRV-RATE-PLAN-NO        06481000
MFA-TR*               ,LAST_UPDATE_TS     = CURRENT TIMESTAMP           06482000
MFA-TR*         WHERE  ACCOUNT_NO     = :UT-ACCOUNT-NO                  06490000
MFA-TR*          AND   CODE_UTIL_TYPE = 'G'                             06491000
MFA-TR*          AND   IC_NO          = :UT-IC-NO                       06492000
MFA-TR*    END-EXEC.                                                    06500000

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

                                                                        
           DISPLAY 'RATE UPDATE' UT-ACCOUNT-NO                          
           MOVE SQLCODE                TO WS-ACTIVE-RETURN-CODE.        
           IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL OR NOT-FOUND      
              NEXT SENTENCE                                             
           ELSE                                                         
              MOVE '8200'             TO ACTIVE-PARAGRAPH               
              MOVE 'UPDATE'           TO ABEND-FUNCTION                 
              MOVE 'CSS_UTIL_ENVRNMT' TO TABLE-1                        
              PERFORM 9010-DISP-ERRS  THRU 9010-EXIT                    
              PERFORM 9900-ABEND      THRU 9900-EXIT
           END-IF.                   
                                                                        
       8200-EXIT.                                                       
           EXIT.                                                        
                                                                        
T34287************************************************************              
T34287*   8890-INSERT-WORK-QUEUE.                                               
T34287* INSERT THE WORK QUEUE ITEMS IN THE CSS_WQ_ITEMS_MF TABLE.               
T34287************************************************************              
T34287*                                                                         
T34287 8890-INSERT-WORK-QUEUE.                                          
T34287                                                                  
ACT007     MOVE 'SYSTEM '                   TO WS-77-USER-ID-ORIG.      
ACT007                                                                  
ACT007     CALL SCSCB077 USING CWS00077-FIELDS,                         
ACT007                         ABEND-FILE,                              
ACT007                         RS-RETURN-CODE                           
ACT007     MOVE RS-RETURN-CODE TO WS-ACTIVE-RETURN-CODE                 
ACT007                                                                  
ACT007     IF ABEND-FUNCTION > SPACES OR RS-RETURN-CODE NOT = 0         
ACT007        DISPLAY '8890-INSERT-WORK-QUEUE'                          
ACT007        DISPLAY 'CALL SCSCB077         '                          
ACT007        DISPLAY 'ACCOUNT_NO      ' WS-77-ACCOUNT-NO               
ACT007        DISPLAY 'PREMISE_NO      ' WS-77-PREMISE-NO               
ACT007        DISPLAY 'SERV_ORDER_NO   ' WS-77-SERV-ORDER-NO            
ACT007        DISPLAY 'SQL RETURN CODE ' WS-ACTIVE-RETURN-CODE          
ACT007        PERFORM 9900-ABEND    THRU 9900-EXIT                      
ACT007     END-IF.                                                      
T34287*                                                                         
T34287 8890-EXIT.  EXIT.                                                
      *                                                                         
A00765****************************************************************          
A00765* 9000-SEND-ERROR-RESULT. REQUIRED BY THE COPYBOOK             *          
A00765****************************************************************          
A00765 9000-SEND-ERROR-RESULT.                                          
A00765                                                                  
A00765     GO TO 9000-EXIT.                                             
A00765*                                                                         
       9000-TERMINATE.                                                  
                                                                        
           DISPLAY '<<< PCSCA524 COMPLETED >>>'.                        
                                                                        
       9000-EXIT.                                                       
           EXIT.                                                        
                                                                        
       9010-DISP-ERRS.                                                  
                                                                        
           DISPLAY '*******************************************'.       
           DISPLAY '*** PROGRAM    :  ' ABEND-PROGRAM.                  
           DISPLAY '*** PARAGRAPH  :  ' ACTIVE-PARAGRAPH.               
           DISPLAY '*** FUNCTION   :  ' ABEND-FUNCTION.                 
           DISPLAY '*** DB TABLE   :  ' TABLE-1.                        
           DISPLAY '*** RETURN CODE:  ' SQLCODE.                        
           DISPLAY '*******************************************'.       
                                                                        
       9010-EXIT.                                                       
           EXIT.                                                        
                                                                        
      ************************************************************              
      * THE BELOW PARAGRAPH IS NECESSARY TO BE ABLE TO USE THE   *              
      * COPYBOOK FOR WRITING THE MH AND MI.                      *              
      ************************************************************              
       9900-SQL-ERROR-ROUTINE.                                          
           EXEC SQL                                                     06780000
               INCLUDE CPD09900                                         06790000
           END-EXEC.                                                    06800000
                                                                        
