       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.     PCSMT652.                                        
       DATE-WRITTEN.   JUNE 1997.                                       
      ***************************************************************** 00040072
      **               SOUTH CAROLINA ELECTRIC & GAS                 ** 00050072
      **              COMPLETE BUSINESS SOLUTIONS INC.               ** 00060072
      **                                                             ** 00070072
      ********            CUSTOMER SERVICE SYSTEM             ********* 00080072
      ********                      DB2                       ********* 00090072
      ***************************************************************** 00100072
      **                                                             ** 00110072
      **              PROGRAM  MODIFICATION  LOG                     ** 00120072
      **                                                             ** 00130072
      **    DATE    INITIALS     REASON                              ** 00140072
      **    ____    ________     ______                              ** 00150072
T17120**                                                             ** 00150190
T17120**    07/98      CBSI      REPORT FORMAT CHANGED TO DISPLAY THE** 00151090
T17120**                         CUSTOMER ADDRESS IN TWO LINES.      ** 00152090
T17120**                                                             ** 00153090
T22243**    12/00      CBSI      CHANGES MADE TO IMPLEMENT  MULTI    **         
T22243**               MADRAS    COMPANY CHANGES                     **         
ACT019**    05/11      MC95456   THREE REPORTS ARE TO BE CONSOLIDATED**         
ACT019**  A03082-ACT019          TO DISPLAY AS SINGLE REPORT AND     **         
ACT019**                         TO BE SAVED AS EXCEL FILE           **         
ACT063**  A04480-ACT063          WHEN WE DON'T FIND A SPACE IN THE   **         
ACT063**                         FIRST 15 LETTERS OF THE STREE       **         
ACT063**                         ADDRESS, ASSUME THAT WE DON'T HAVE  **         
ACT063**                         A STREET NUMBER AND BYPASS THE PARSE**         
ACT063**                         ROUTINE.                            **         
      ***************************************************************** 00160072
           REMARKS.                                                     
                              PCSMT652 NARRATIVE                        
      ***************************************************************** 00190072
      *    THIS PROGRAM PRINTS THREE REPORTS OF THE METERS SELECTED   * 00200072
      *    FOR TESTING. INPUT TO THIS PROGRAM IS A FLAT FILE BUILT    * 00210072
      *    BY PCSCA656. THE OUTPUT IS THREE REPORTS. THE ONE IS WITH  * 00220072
      *    SORT ORDER TEST GROUP CD AND ACCOUNT NBR. THE SECOND AND   * 00230087
      *    THIRD ONES ARE SORTED BY TEST GOUP CD, LOCAL OFFICE AND    * 00240072
      *    READ-ROUTE IN THAT ORDER. THE SECOND RPT CONTAINS MTR SHOP * 00250072
      *    TESTS AND THE THIRD RPT CONTAINS FIELD TESTS.              * 00250072
      ***************************************************************** 00260072
                                                                        
                     ---- BASIC BATCH SEQUENCE STRUCTURE ----           
                    0000 - 0000     MAIN CONTROL PATH                   
                    0100 - 0100     INITIALIZATION                      
                    1000 - 1000     MAJOR PROCESSING LOOP               
                    1100 - 4999     PERFORMED PARAGRAPHS OF MAJOR       
                                    PROCESSING LOOPS                    
                    5000 - 5999     COMMON PROGRAM MODULES              
                    6000 - 6999     COMMON SYSTEM MODULES               
                    7000 - 7999     INPUT MODULES                       
                    8000 - 8999     OUTPUT MODULES                      
                    9000 - 9799     TERMINATION MODULES                 
                    9900 - 9999     ABEND/ABORT MODULES                 
HPCCDM*EJECT                                                            00400072
       ENVIRONMENT DIVISION.                                            
       CONFIGURATION SECTION.                                           
       SOURCE-COMPUTER.    IBM-4341.                                    
       OBJECT-COMPUTER.    IBM-4341.                                    
       SPECIAL-NAMES.      C01 IS NEW-PAGE.                             
      *                                                                 00460072
       INPUT-OUTPUT SECTION.                                            
       FILE-CONTROL.                                                    
       COPY CSSCA661.                                                   00490079
      *                                                                 00540079
       COPY CSSPT331.                                                   00510079
HPCCDM*EJECT                                                            00530072
      *                                                                 00540079
       DATA DIVISION.                                                   
       FILE SECTION.                                                    
       COPY CFDCA661.                                                   00570079
       COPY FIOCA66.                                                    00580072
      *                                                                         
      ******************************************************************        
      * CFDPT331- FD STATEMENT REPORT PRINT FILE  *                             
      ******************************************************************        
ACT019 FD  FCSPT331-FILE                                                
ACT019     BLOCK CONTAINS 0 RECORDS                                     
ACT019     RECORDING MODE IS F                                          
ACT019     LABEL RECORDS ARE STANDARD.                                  
ACT019 01  PRT331-RECORD                       PIC X(450).              
HPCCDM*EJECT                                                            00620072
      *                                                                 00630072
       WORKING-STORAGE SECTION.                                         

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'PCSMT652'.
MSQ017     COPY MFASQLM.
       01  WS-START                            PIC X(40) VALUE          
           'WORKING STORAGE FOR PCSMT652 STARTS HERE'.                  
      *                                                                 00670072
       01  WS-MISC.                                                     
           05  WS-SUB                          PIC 9(02)  VALUE ZEROES. 
           05  WS-N                            PIC X(01)  VALUE 'N'.    
           05  WS-Y                            PIC X(01)  VALUE 'Y'.    
           05  WS-P                            PIC X(01)  VALUE 'P'.    
           05  WS-R                            PIC X(01)  VALUE 'R'.    
           05  WS-G                            PIC X(01)  VALUE 'G'.    
ACT019     05  WS-TALLY                        PIC 9(02)  VALUE ZEROS.  
           05  WS-RANDOM-TEST-COMMENT          PIC X(09)  VALUE         
               'RANDOM  '.                                              
           05  WS-FCA661-STATUS                PIC X(02)  VALUE '00'.   
               88 FCA661-SUCCESSFUL                       VALUE '00'.   
           05  WS-FCA331-STATUS                PIC X(02)  VALUE '00'.   
               88 FCA331-SUCCESSFUL                       VALUE '00'.   
           05  WS-LINE-COUNT                   PIC 9(02)  VALUE ZEROES. 
           05  WS-PAGE-COUNT                   PIC 9(03)  VALUE ZEROES. 
           05  WS-FILE-FLAG                    PIC X(01)  VALUE 'Y'.    
               88  MORE-RECORDS                           VALUE 'Y'.    
               88  NO-MORE-RECORDS                        VALUE 'N'.    
T22243*  FLAG TO CHECK FOR FIRST RECORD IN INPUT FILE                           
T22243     05  WS-FIRST-REC-FLAG               PIC X(01)  VALUE 'Y'.    
ACT019     05  WS-STREET-NO                    PIC X(15).               
ACT019     05  FILLER REDEFINES WS-STREET-NO.                           
ACT019         10 WS-STREET-NO-C               PIC X(01)                
ACT019            OCCURS 15 TIMES.                                      
ACT019     05  WS-STREET-NO-N                  PIC 9(15).               
ACT019     05  FILLER REDEFINES WS-STREET-NO-N.                         
ACT019         10 WS-STREET-NO-N-X             PIC X(01)                
ACT019            OCCURS 15 TIMES.                                      
           05  WS-PGRMNAME                     PIC X(08)  VALUE         
               'PCSMT652'.                                              
      *                                                                 01080073
       01  WS-PREV-ACCOUNT-DETAILS.                                     
           05  WS-PREV-MTR-TST-GRP-CD          PIC X(02) VALUE SPACES.  
           05  WS-PREV-LOCAL-OFFICE            PIC X(03) VALUE SPACES.  
      *                                                                 01150072
       COPY CWS00303.                                                   01220072
       COPY CWS09900.                                                   01230072
      *                                                                 01240072
       COPY CWS00004.                                                   01250072
       COPY CWS00010.                                                   01260072
       COPY CWS00301.                                                   01270072
      *                                                                 01280072
       COPY FIOCA00.                                                    01290072
      *                                                                 01300072
       COPY FIOJC01.                                                    01310072
      *                                                                 01320073
            EXEC SQL                                                    01330072
                 INCLUDE CWS00038                                       01340072
            END-EXEC.                                                   01350072
      *                                                                 01360073
       COPY CWS00039.                                                   01370072
      *                                                                 01280072
       01  WS-CONTROL-LIST-AREA.                                        
           05  HEADER-01.                                               
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
T22243         10  WS-COMPANY-NAME             PIC X(31)  VALUE SPACES. 
      *                                                                 01520072
           05  HEADER-02.                                               
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
               10  FILLER                      PIC X(35)  VALUE         
                   'GAS SAMPLE METER TEST CONTROL LIST '.               
      *                                                                 01660072
           05  HEADER-03.                                               
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
               10  FILLER                      PIC X(14)  VALUE         
                   'CURRENT AS OF '.                                    
ACT019         10  HDR-03-DATE.                                         
ACT019             15 HDR-03-MM                PIC X(02)  VALUE SPACES. 
ACT019             15 FILLER                   PIC X(01)  VALUE '/'.    
ACT019             15 HDR-03-DD                PIC X(02)  VALUE SPACES. 
ACT019             15 FILLER                   PIC X(01)  VALUE '/'.    
ACT019             15 HDR-03-YY                PIC X(02)  VALUE SPACES. 
      *                                                                         
ACT019     05  HEADER-04.                                               
ACT019         10  FILLER                      PIC X(10)  VALUE         
ACT019             'READ CYCLE'.                                        
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(10)  VALUE         
ACT019             'READ ROUTE'.                                        
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(10)  VALUE         
ACT019             'ACCOUNT NO'.                                        
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(13)  VALUE         
ACT019             'CUSTOMER NAME'.                                     
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(18)  VALUE         
ACT019             'SERV ADDR STREET #'.                                
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(21)  VALUE         
ACT019             'SERV ADDR STREET NAME'.                             
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(24)  VALUE         
ACT019             'SERV ADDR CITY/STATE/ZIP'.                          
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(24)  VALUE         
ACT019             'MAIL ADDR STREET NO/NAME'.                          
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(24)  VALUE         
ACT019             'MAIL ADDR CITY/STATE/ZIP'.                          
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(04)  VALUE         
ACT019             'RATE'.                                              
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(12)  VALUE         
ACT019             'METER NUMBER'.                                      
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(10)  VALUE         
ACT019             'METER TYPE'.                                        
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(10)  VALUE         
ACT019             'METER DESC'.                                        
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(13)  VALUE         
ACT019             'READ SEQUENCE'.                                     
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(12)  VALUE         
ACT019             'LOCAL OFFICE'.                                      
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(13)  VALUE         
ACT019             'TEST GRP CODE'.                                     
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  FILLER                      PIC X(12)  VALUE         
ACT019             'LAST TEST DT'.                                      
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
      *                                                                 02260072
      *                                                                 02500072
           05  DTL-ACCT-NO.                                             
               10  DTL-ACT1                    PIC 9(01).               
               10  DTL-ACT2                    PIC 9(04).               
               10  DTL-ACT3                    PIC 9(04).               
               10  DTL-ACT4                    PIC 9(04).               
      *                                                                 02560072
      *                                                                 02650072
ACT019     05  DETAIL-REC.                                              
ACT019         10  DTL-READ-CYCLE              PIC X(02)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-READ-ROUTE              PIC X(04)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-ACCOUNT-NO.                                      
ACT019             15 DTL-A1                   PIC X(01).               
ACT019             15 FILLER                   PIC X(01)  VALUE '-'.    
ACT019             15 DTL-A2                   PIC X(04).               
ACT019             15 FILLER                   PIC X(01)  VALUE '-'.    
ACT019             15 DTL-A3                   PIC X(04).               
ACT019             15 FILLER                   PIC X(01)  VALUE '-'.    
ACT019             15 DTL-A4                   PIC X(04).               
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-CUST-NAME               PIC X(50)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-SERV-ST-NO              PIC X(15)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-SERV-ST-NAME            PIC X(40)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-SERV-STATE-CITY-ZIP     PIC X(41)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-MAIL-ADDR               PIC X(55)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-MAIL-STATE-CITY-ZIP     PIC X(41)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-RATE                    PIC X(03)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-METER-NO                PIC X(09)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-MTR-TYPE                PIC X(08)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-MTR-DESC                PIC X(10)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-READ-SEQUENCE           PIC X(10)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-LOCAL-OFFICE-DESC       PIC X(25)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-TEST-GRP-CD-DESC        PIC X(25)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
ACT019         10  DTL-TEST-DATE               PIC X(10)  VALUE SPACES. 
HEX01          10  FILLER                      PIC X(01)  VALUE X'09'.  
      *                                                                 02800072
       01  WS-SYSTEM-DATE.                                              
           05  WS-SYSTEM-YY                    PIC 9(02).               
           05  WS-SYSTEM-MM                    PIC 9(02).               
           05  WS-SYSTEM-DD                    PIC 9(02).               
      *                                                                 03070072
       01  WS-END                              PIC X(40) VALUE          
           'WORKING STORAGE FOR PCSMT652 ENDS HERE  '.                  
HPCCDM*EJECT                                                            03260072
      *                                                                 03270072
           EXEC SQL                                                     03280072
               INCLUDE SQLCA                                            03290072
           END-EXEC.                                                    03300072
      *                                                                 03310072
      * TABLE DECLARATION FOR CSS_LOCAL_OFFICE ********************     03330079
      *                                                                 03340073
           EXEC SQL                                                     03350072
               INCLUDE TBLOCOFC                                         03360072
           END-EXEC.                                                    03370072
      *                                                                         
      * TABLE DECLARATION FOR CSS_MTR_TEST_GROUP***************         03380072
      *                                                                 03390072
           EXEC SQL                                                     03400072
               INCLUDE TBMTRGP                                          03410072
           END-EXEC.                                                    03420072
      *                                                                 03430072
T22243* TABLE DECLARATION FOR CSS_COMPANY  ********************         03380072
T22243*                                                                 03390072
T22243     EXEC SQL                                                     03400072
T22243         INCLUDE TBCOMPNY                                         03410072
T22243     END-EXEC.                                                    03420072
T22243*                                                                 03430072
      * TABLE DECLARATION FOR CSS_JOB_PARM ********************         03440072
      *                                                                 03450072
           EXEC SQL                                                     03460072
               INCLUDE TBJBPARM                                         03470072
           END-EXEC.                                                    03480072
      *                                                                 03490072
           EXEC SQL                                                     03500072
               INCLUDE CWS00042                                         03510072
           END-EXEC.                                                    03520072
      *                                                                 03530072
       LINKAGE SECTION.                                                 
HPCCDM*    EJECT                                                        03550072
       PROCEDURE DIVISION.                                              
      ******************************************************************03570072
      *   CONTROLS MAIN PATH OF PROGRAM                                *03580072
      ******************************************************************03590072
       0000-MAINLINE.                                                   
                                                                        
ACT019     PERFORM 0100-INITIALIZATION     THRU 0100-EXIT.              
           PERFORM 1000-FCSCA661-PROCESS   THRU 1000-EXIT               
               UNTIL NO-MORE-RECORDS.                                   
                                                                        
           PERFORM 9000-TERMINATE THRU 9000-EXIT.                       
      *                                                                 03900072
           STOP RUN.                                                    
      *                                                                 03920072
       0000-EXIT.                                                       
           EXIT.                                                        
HPCCDM*EJECT                                                            03950072
      ******************************************************************03960072
      *   INITIALIZATION ROUTINE                                       *03970072
      ******************************************************************03980072
       0100-INITIALIZATION.                                             
      *                                                                 04000079
           MOVE SPACES                         TO                       
                                           WS-PREV-ACCOUNT-DETAILS.     
      *                                                                 04120072
           ACCEPT WS-SYSTEM-DATE FROM DATE.                             
                                                                        
      *                                                                 04190072
ACT019      MOVE WS-SYSTEM-DD                  TO  HDR-03-DD.           
ACT019      MOVE WS-SYSTEM-MM                  TO  HDR-03-MM.           
ACT019      MOVE WS-SYSTEM-YY                  TO  HDR-03-YY.           
      *                                                                 04230072
           OPEN INPUT FCSCA661-FILE.                                    
                                                                        
           IF  FCA661-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY 'FCSCA661 FILE OPEN ERROR'                       
               DISPLAY 'FCSCA661 FILE STATUE IS ==>' WS-FCA661-STATUS   
               PERFORM 9900-ABEND THRU 9900-EXIT                        
           END-IF.                                                      
                                                                        
           OPEN OUTPUT FCSPT331-FILE.                                   
           IF  FCA331-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY 'FCSPT331 FILE OPEN ERROR'                       
               DISPLAY 'FCSPT331 FILE STATUE IS ==>' WS-FCA331-STATUS   
               PERFORM 9900-ABEND THRU 9900-EXIT                        
           END-IF.                                                      
      *                                                                 04520072
       0100-EXIT.                                                       
           EXIT.                                                        
      *                                                                 04800072
      *                                                                 04000079
      ******************************************************************04830072
      *   MAIN PROCESS                                                 *04840072
      ******************************************************************04850072
                                                                        
      *COPY CPD00024.                                                   04880072
                                                                        
           EXEC SQL                                                     04900072
              INCLUDE CPD00038                                          04910072
           END-EXEC.                                                    04920072
HPCCDM*EJECT                                                            04930072
           EXEC SQL                                                     04940072
               INCLUDE CPD00039                                         04950072
           END-EXEC.                                                    04960072
HPCCDM*EJECT                                                            04970072
                                                                        
       1000-FCSCA661-PROCESS.                                           
      *                                                                 05000072
           PERFORM 7001-READ-FCSCA661-FILE    THRU 7001-EXIT.           
      *                                                                 05020072
ACT019     IF E-FCA66-HEADER-ID = 'H'                                   
ACT019        PERFORM 7001-READ-FCSCA661-FILE THRU 7001-EXIT            
ACT019     END-IF.                                                      
      *                                                                 05000072
ACT019     IF MORE-RECORDS                                              
ACT019        IF WS-FIRST-REC-FLAG = 'Y'                                
ACT019           MOVE E-FCA66-COMPANY-NO             TO GR-COMPANY-NO,  
ACT019                                                  C7-COMPANY-NO,  
ACT019                                                  G6-COMPANY-NO   
ACT019          PERFORM 7000-GET-COMP-NAME          THRU 7000-EXIT      
ACT019          MOVE C7-COMPANY-NAME           TO WS-COMPANY-NAME       
ACT019          MOVE 'N'                            TO WS-FIRST-REC-FLAG
ACT019          PERFORM 8000-PRINT-REPORT-HEADERS   THRU 8000-EXIT      
ACT019        END-IF                                                    
ACT019        PERFORM 2000-MOVE-DETAILS-PARA THRU 2000-EXIT             
ACT019     END-IF.                                                      
      *                                                                 05070072
       1000-EXIT.                                                       
           EXIT.                                                        
HPCCDM*EJECT                                                            05100072
      *                                                                 05110072
ACT019******************************************************************05410072
ACT019***MOVES THE FILE FCSCA661 VALUES  TO DETAIL RECORD              *05420072
ACT019******************************************************************05430072
ACT019*                                                                 05230079
ACT019 2000-MOVE-DETAILS-PARA.                                          
ACT019*                                                                 05250079
ACT019     INITIALIZE WS-TALLY                                          
ACT019                WS-STREET-NO-N.                                   
ACT019     MOVE E-FCA66-ACCT-NO                TO  DTL-ACCT-NO.         
ACT019     MOVE DTL-ACT1                       TO  DTL-A1.              
ACT019     MOVE DTL-ACT2                       TO  DTL-A2.              
ACT019     MOVE DTL-ACT3                       TO  DTL-A3.              
ACT019     MOVE DTL-ACT4                       TO  DTL-A4.              
ACT019     MOVE E-FCA66-NAME                TO  DTL-CUST-NAME           
ACT019     INSPECT E-FCA66-SERV-ADDR TALLYING  WS-TALLY FOR             
ACT019             CHARACTERS BEFORE ' '.                               
ACT019     MOVE E-FCA66-SERV-ADDR(1:WS-TALLY)                           
ACT019                                      TO  WS-STREET-NO.           
ACT063     IF WS-TALLY < LENGTH OF WS-STREET-NO-N                       
ACT019         PERFORM VARYING WS-SUB FROM 1 BY 1                       
ACT019             UNTIL WS-SUB > WS-TALLY                              
ACT019                 MOVE   WS-STREET-NO-C(WS-SUB)                    
ACT019                     TO WS-STREET-NO-N-X(WS-SUB)                  
ACT019         END-PERFORM                                              
ACT019         IF WS-STREET-NO-N IS NUMERIC                             
ACT019             MOVE WS-STREET-NO             TO  DTL-SERV-ST-NO     
ACT019             ADD  +1  TO  WS-TALLY                                
ACT019             MOVE E-FCA66-SERV-ADDR(WS-TALLY:40)                  
ACT019                 TO  DTL-SERV-ST-NAME                             
ACT019         ELSE                                                     
ACT019             MOVE ' '                      TO  DTL-SERV-ST-NO     
ACT019             MOVE E-FCA66-SERV-ADDR        TO  DTL-SERV-ST-NAME   
ACT019         END-IF                                                   
ACT063     ELSE                                                         
ACT063         MOVE ' '                      TO  DTL-SERV-ST-NO         
ACT063         MOVE E-FCA66-SERV-ADDR        TO  DTL-SERV-ST-NAME       
ACT063     END-IF.                                                      
ACT019     MOVE E-FCA66-ADDR-CITY-ST-ZIP    TO  DTL-SERV-STATE-CITY-ZIP.
ACT019     MOVE E-FCA66-MAIL-ADDR           TO  DTL-MAIL-ADDR.          
ACT019     MOVE E-FCA66-MAIL-CITY-ST-ZIP    TO  DTL-MAIL-STATE-CITY-ZIP.
ACT019     MOVE E-FCA66-RATE                TO  DTL-RATE.               
ACT019     MOVE E-FCA66-METER-NO            TO  DTL-METER-NO.           
ACT019     MOVE E-FCA66-TEST-DATE           TO  DTL-TEST-DATE.          
ACT019     MOVE E-FCA66-READ-ROUTE          TO  DTL-READ-ROUTE.         
ACT019     MOVE E-FCA66-READ-CYCLE          TO  DTL-READ-CYCLE.         
ACT019     MOVE E-FCA66-METER-SIZE          TO  DTL-MTR-TYPE.           
ACT019     MOVE E-FCA66-METER-TYPE-DESC     TO  DTL-MTR-DESC.           
ACT019     MOVE E-FCA66-REGISTER-RD-SEQ     TO  DTL-READ-SEQUENCE.      
ACT019     IF  E-FCA66-MTR-TEST-GRP-CD NOT EQUAL WS-PREV-MTR-TST-GRP-CD 
ACT019         MOVE E-FCA66-MTR-TEST-GRP-CD TO  GR-MTR-TEST-GRP-CD      
ACT019         MOVE WS-G                    TO  GR-CODE-UTIL-TYPE       
ACT019         PERFORM 7100-GET-GROUP-CD-DESC  THRU 7100-EXIT           
ACT019         MOVE GR-MTR-TEST-GRP-TX      TO  DTL-TEST-GRP-CD-DESC    
ACT019         MOVE E-FCA66-MTR-TEST-GRP-CD TO  WS-PREV-MTR-TST-GRP-CD  
ACT019     ELSE                                                         
ACT019         MOVE GR-MTR-TEST-GRP-TX      TO  DTL-TEST-GRP-CD-DESC    
ACT019     END-IF.                                                      
ACT019     IF  E-FCA66-LOCAL-OFFICE  NOT EQUAL WS-PREV-LOCAL-OFFICE     
ACT019         MOVE E-FCA66-COMPANY-NO      TO  B1-COMPANY-NO           
ACT019         MOVE E-FCA66-LOCAL-OFFICE    TO  B1-LOCAL-OFFICE         
ACT019         PERFORM 7200-GET-LOCAL-OFFICE   THRU 7200-EXIT           
ACT019         MOVE B1-LOCAL-OFFICE-DESC    TO  DTL-LOCAL-OFFICE-DESC   
ACT019         MOVE E-FCA66-LOCAL-OFFICE    TO  WS-PREV-LOCAL-OFFICE    
ACT019     ELSE                                                         
ACT019         MOVE B1-LOCAL-OFFICE-DESC    TO  DTL-LOCAL-OFFICE-DESC   
ACT019     END-IF.                                                      
ACT019*                                                                 05380072
ACT019     PERFORM 8500-WRITE-DETAIL-RECORD THRU 8500-EXIT.             
      *                                                                         
ACT019 2000-EXIT.                                                       
ACT019     EXIT.                                                        
      ******************************************************************05410072
      ***READS THE FILE FCSCA661 AND SETS END-OF-FILE FLAG AT THE END***05420072
      ******************************************************************05430072
       7001-READ-FCSCA661-FILE.                                         
      *                                                                 05450072
           READ FCSCA661-FILE                                           
           AT END                                                       
              SET NO-MORE-RECORDS TO TRUE                               
              GO TO 7001-EXIT                                           
           END-READ.                                                    
      *                                                                 05510072
           IF  FCA661-SUCCESSFUL                                        
ACT019         CONTINUE                                                 
           ELSE                                                         
               DISPLAY 'FCSCA661 FILE READ ERROR'                       
               DISPLAY 'FCSCA661 FILE STATUE IS ==>' WS-FCA661-STATUS   
               PERFORM 9900-ABEND THRU 9900-EXIT                        
           END-IF.                                                      
      *                                                                 05620072
       7001-EXIT.                                                       
           EXIT.                                                        
T22243******************************************************************06420072
T22243*   SELECT COMPANY NAME FROM CSS_COMPANY TABLE                   *06430072
T22243******************************************************************06440072
T22243 7000-GET-COMP-NAME.                                              
T22243     EXEC SQL                                                     
T22243         SELECT COMPANY_NAME                                      
T22243           INTO :C7-COMPANY-NAME                                  
T22243           FROM  CSS_COMPANY WITH(READUNCOMMITTED)                        
T22243           WHERE COMPANY_NO = :C7-COMPANY-NO                      
ACT019                                                           
ACT019                                                      
T22243     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT COMPANY_NAME                                              
MFA-TR*          INTO :C7-COMPANY-NAME                                          
MFA-TR*          FROM  CSS_COMPANY                                              
MFA-TR*          WHERE COMPANY_NO = :C7-COMPANY-NO                              
MFA-TR*          WITH UR                                                        
MFA-TR*          QUERYNO 7000                                                   
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

T22243                                                                  
T22243     IF  SQLCODE EQUAL SUCCESSFUL-CALL                            
T22243         NEXT SENTENCE                                            
T22243     ELSE                                                         
T22243         DISPLAY '* SELECT ERROR IN 7000-GET-COMP-NAME *'         
T22243         DISPLAY '* RETURN CODE = ' SQLCODE                       
T22243         DISPLAY '* COMPANY NO  = ' C7-COMPANY-NO                 
T22243         DISPLAY '*         PROCESSING TERMINATED         *'      
T22243         PERFORM 9900-ABEND            THRU 9900-EXIT             
T22243     END-IF.                                                      
T22243 7000-EXIT.                                                       
T22243     EXIT.                                                        
T22243*                                                                         
      *************************************************************     05920072
      *   GET GROUP CODE  DESCRIPTION  FROM CSS_MTR_TEST_GROUP          05930072
      *************************************************************     05940072
       7100-GET-GROUP-CD-DESC.                                          
      *                                                                 05960072
            EXEC SQL                                                    
                SELECT   MTR_TEST_GRP_TX                                
                 INTO   :GR-MTR-TEST-GRP-TX                             
                 FROM   CSS_MTR_TEST_GROUP WITH(READUNCOMMITTED)                
                 WHERE    MTR_TEST_GRP_CD = :GR-MTR-TEST-GRP-CD         
                  AND     CODE_UTIL_TYPE  = :GR-CODE-UTIL-TYPE          
T22243            AND     COMPANY_NO      = :GR-COMPANY-NO              
ACT019                                                           
ACT019                                                      
            END-EXEC.                                                   

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*     EXEC SQL                                                    05970072
MFA-TR*         SELECT   MTR_TEST_GRP_TX                                05980072
MFA-TR*          INTO   :GR-MTR-TEST-GRP-TX                             05990072
MFA-TR*          FROM   CSS_MTR_TEST_GROUP                              06000072
MFA-TR*          WHERE    MTR_TEST_GRP_CD = :GR-MTR-TEST-GRP-CD         06010072
MFA-TR*           AND     CODE_UTIL_TYPE  = :GR-CODE-UTIL-TYPE          06020072
MFA-TR*           AND     COMPANY_NO      = :GR-COMPANY-NO                      
MFA-TR*          WITH UR                                                        
MFA-TR*          QUERYNO 7100                                                   
MFA-TR*     END-EXEC.                                                   06030072

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

      *                                                                 06040072
            IF  SQLCODE EQUAL SUCCESSFUL-CALL                           
                NEXT SENTENCE                                           
            ELSE                                                        
                DISPLAY '* SELECT ERROR IN 7100-GET-GROUP-CODE   *'     
                DISPLAY '* RETURN CODE = ' SQLCODE                      
T22243          DISPLAY '* COMPANY NO  = ' GR-COMPANY-NO                
                DISPLAY '*         PROCESSING TERMINATED         *'     
                PERFORM 9900-ABEND            THRU 9900-EXIT            
            END-IF.                                                     
                                                                        
       7100-EXIT.                                                       
            EXIT.                                                       
ACT019*                                                                 06160072
ACT019 7200-GET-LOCAL-OFFICE.                                           
ACT019******************************************************************06180072
ACT019*   GET LOCAL OFFICE DESCRIPTION  FROM CSS_LOCAL_OFFICE TABLE    *06190072
ACT019******************************************************************06200072
ACT019*                                                                 06210072
ACT019     EXEC SQL                                                     
ACT019         SELECT   LOCAL_OFFICE_DESC                               
ACT019           INTO   :B1-LOCAL-OFFICE-DESC                           
ACT019           FROM   CSS_LOCAL_OFFICE WITH(READUNCOMMITTED)                  
ACT019         WHERE    COMPANY_NO   = :B1-COMPANY-NO                   
ACT019         AND      LOCAL_OFFICE = :B1-LOCAL-OFFICE                 
ACT019                                                           
ACT019                                                      
ACT019     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ003
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                     06220072
MFA-TR*        SELECT   LOCAL_OFFICE_DESC                               06230072
MFA-TR*          INTO   :B1-LOCAL-OFFICE-DESC                           06240072
MFA-TR*          FROM   CSS_LOCAL_OFFICE                                06250072
MFA-TR*        WHERE    COMPANY_NO   = :B1-COMPANY-NO                   06260072
MFA-TR*        AND      LOCAL_OFFICE = :B1-LOCAL-OFFICE                 06270072
MFA-TR*        WITH UR                                                          
MFA-TR*        QUERYNO 7200                                                     
MFA-TR*    END-EXEC.                                                    06280072

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

ACT019*                                                                 06290072
ACT019     IF  SQLCODE EQUAL SUCCESSFUL-CALL                            
ACT019         NEXT SENTENCE                                            
ACT019     ELSE                                                         
ACT019         DISPLAY '* SELECT ERROR IN 7200-GET-LOCAL-OFFICE *'      
ACT019         DISPLAY '* LOCAL OFFICE = ' B1-LOCAL-OFFICE              
ACT019         DISPLAY '* COMPANY NO   = ' B1-COMPANY-NO                
ACT019         DISPLAY '* RETURN CODE = ' SQLCODE                       
ACT019         DISPLAY '*         PROCESSING TERMINATED         *'      
ACT019         PERFORM 9900-ABEND            THRU 9900-EXIT             
ACT019     END-IF.                                                      
ACT019*                                                                 06380073
ACT019 7200-EXIT.                                                       
ACT019     EXIT.                                                        
      *                                                                 06410072
      *                                                                 07380072
ACT019 8000-PRINT-REPORT-HEADERS.                                       
ACT019******************************************************************07640072
ACT019*   WRITES THE REPORT HEADER LINES FOR CFDPT331 FILE             *07650072
ACT019******************************************************************07660072
ACT019*                                                                 07670072
ACT019     WRITE PRT331-RECORD FROM HEADER-01.                          
ACT019     WRITE PRT331-RECORD FROM HEADER-02.                          
ACT019     WRITE PRT331-RECORD FROM HEADER-03.                          
ACT019     WRITE PRT331-RECORD FROM HEADER-04.                          
      *                                                                 07710072
ACT019 8000-EXIT.                                                       
ACT019     EXIT.                                                        
      *                                                                 07820072
ACT019******************************************************************06420072
ACT019*   PRINT REPORT WITH DEAIL LINES                                *06430072
ACT019******************************************************************06440072
ACT019 8500-WRITE-DETAIL-RECORD.                                        
ACT019*                                                                 06460072
ACT019     WRITE PRT331-RECORD FROM DETAIL-REC.                         
      *                                                                 06750072
ACT019 8500-EXIT.                                                       
ACT019     EXIT.                                                        
      *                                                                 06780072
      ***************************************************************** 08170072
      ** 6251-GET-FJC01-DATE                                         ** 08180072
      ***************************************************************** 08190072
      *                                                                 08200072
       COPY CPD00037.                                                   08210072
      *                                                                 08220072
       COPY CPD00040.                                                   08230072
      *                                                                 08240072
HPCCDM* EJECT                                                           08250072
      ******************************************************************08260072
      *   TERMINATION ROUTINE                                          *08270072
      ******************************************************************08280072
      *                                                                 08290072
       9000-TERMINATE.                                                  
           PERFORM 9100-TERMINATE-CA661  THRU 9100-EXIT.                
       9000-EXIT.                                                       
           EXIT.                                                        
      *                                                                 08340072
       9100-TERMINATE-CA661.                                            
                                                                        
           CLOSE FCSCA661-FILE.                                         
      *                                                                 08380072
           IF  FCA661-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY 'FILE CLOSE ERROR'                               
               DISPLAY 'FCSCA661 FILE STATUS ==>' WS-FCA661-STATUS      
           END-IF.                                                      
                                                                        
           CLOSE FCSPT331-FILE.                                         
           IF  FCA331-SUCCESSFUL                                        
               NEXT SENTENCE                                            
           ELSE                                                         
               DISPLAY 'FILE CLOSE ERROR'                               
               DISPLAY 'FCSCA331 FILE STATUS ==>' WS-FCA331-STATUS      
           END-IF.                                                      
       9100-EXIT.                                                       
           EXIT.                                                        
      *                                                                 08570072
      **************************************************************    08810000
      *     THIS INCLUDES THE DB2 SQL SYSTEM ABEND MODULE          *    08820000
      **************************************************************    08830000
           EXEC SQL                                                     08840000
             INCLUDE CPD09900                                           08850001
           END-EXEC.                                                    08860000
                                                                        
