       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.     SCSCB371.                                        
      *---------------------------------------------------------------*         
      **             SOUTH CAROLINA ELECTRIC & GAS                   **         
      **              CUSTOMER INFORMATION SYSTEM                    **         
      *---------------------------------------------------------------*         
      **              P R O G R A M  S U M M A R Y                   **         
      **                                                             **         
      ** THIS SUBPROGRAM UPDATES DNP DATA                            **         
      **                                                             **         
      *---------------------------------------------------------------*         
      **                                                              *         
      **              PROGRAM  MODIFICATION  LOG                      *         
      **                                                              *         
      **    DATE    INITIALS     REASON                               *         
      **  -------   --------     ------                               *         
      **  06/25/10  BASKAR V     NEW PROGRAM                          *         
      *---------------------------------------------------------------*         
                                                                        
       ENVIRONMENT DIVISION.                                            
       INPUT-OUTPUT SECTION.                                            
                                                                        
       FILE-CONTROL.                                                    
                                                                        
       DATA DIVISION.                                                   
                                                                        
       WORKING-STORAGE SECTION.                                         

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

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'SCSCB371'.
MSQ017     COPY MFASQLM.
       01  WS-WORK-AREA.                                                
           05  WS-ACCOUNT-NUM           PIC 9(13).                      
           05  WS-ACCOUNT-NO REDEFINES  WS-ACCOUNT-NUM PIC X(13).       
           05  WS-AMT-BOND              PIC S9(09)V99 COMP-3 VALUE +0.  
           05  WS-AMT-IRR-LTR           PIC S9(09)V99 COMP-3 VALUE +0.  
           05  WS-AMT-GUARANTEED        PIC S9(09)V99 COMP-3 VALUE +0.  
           05  WS-AMT-DEP-ON-HAND       PIC S9(09)V99 COMP-3 VALUE +0.  
           05  WS-AMT-SEC-BAL           PIC S9(09)V99 COMP-3 VALUE +0.  
           05  WS-AMT-SEC-BAL-N         PIC 9(09).99.                   
           05  WS-AMT-SEC-BAL-C         PIC X(12)     VALUE SPACES.     
           05  WS-AMT-DNP-BAL-N         PIC 9(09).99.                   
           05  WS-AMT-DNP-BAL-C         PIC X(12)     VALUE SPACES.     
           05  WS-NULL-INDICATOR        PIC S9(04) COMP VALUE ZEROES.   
           05  WS-CODE-ARREARS          PIC X(1)  VALUE SPACES.         
                                                                        
       01  WS-LITERALS.                                                 
           05  WS-A                     PIC X(01) VALUE 'A'.            
           05  WS-B                     PIC X(01) VALUE 'B'.            
                                                                        
       01  WS-MISC.                                                     
           05  PROGRAM-NAME             PIC X(08) VALUE 'SCSCB371'.     
                                                                        
      *01  LOC1                         USAGE IS SQL TYPE IS            
      *                                 RESULT-SET-LOCATOR VARYING.     
                                                                        
           EXEC SQL                                                             
              INCLUDE SQLCA                                                     
           END-EXEC.                                                            
                                                                        
      ***  DCLGEN FOR CSS_SURETY_BOND (SB)                                      
           EXEC SQL                                                             
              INCLUDE TBSTYBND                                                  
           END-EXEC.                                                            
                                                                        
      ***  DCLGEN FOR CSS_GUARANTOR (GU)                                        
           EXEC SQL                                                             
              INCLUDE TBGTNTR                                                   
           END-EXEC.                                                            
                                                                        
      ***  DCLGEN FOR CSS_DEP_ON_HAND (DO)                                      
           EXEC SQL                                                             
              INCLUDE TBDEPHND                                                  
           END-EXEC.                                                            
                                                                        
      ***  DCLGEN FOR CSS_CREDIT_PROFILE (CZ)                                   
           EXEC SQL                                                             
              INCLUDE TBCRPROF                                                  
           END-EXEC.                                                            
                                                                        
           COPY CWS00303.                                                       
MSQ001        EXEC SQL
MSQ001          DECLARE C2 CURSOR
MSQ001          FOR CALL CSR00428                                       
                       ( :WS-ACCOUNT-NO
                  , :WS-AMT-DNP-BAL-C
                  , :WS-AMT-SEC-BAL-C
                  , :WS-DATE-BILL-DAY-00
                  , :WS-CREDIT-GROUP
                  , :WS-CODE-ARREARS
                  )
MSQ001        END-EXEC.
       
                                                                        
       LINKAGE SECTION.                                                 
COB305 01 WS-ACCT-NO        PIC S9(13)V USAGE COMP-3 VALUE 0.       
       01  WS-DATE-BILL-DAY-00          PIC X(10).                      
       01  WS-CREDIT-GROUP              PIC X(1).                       
       01  WS-AMT-DNP-BAL               PIC S9(09)V99 COMP-3 VALUE +0.  
                                                                        
           EXEC SQL                                                             
               INCLUDE CWSX0010                                                 
           END-EXEC.                                                            
                                                                        
       01  RS-RETURN-CODE               PIC S9(09)    COMP VALUE 0.     
                                                                        
       PROCEDURE DIVISION USING WS-ACCT-NO                              
                               ,WS-DATE-BILL-DAY-00                     
                               ,WS-CREDIT-GROUP                         
                               ,WS-AMT-DNP-BAL                          
                               ,ABEND-FILE                              
                               ,RS-RETURN-CODE.                         
                                                                        
      *---------------------------------------------------------------*         
      *0000-MAINLINE.                                                 *         
      *---------------------------------------------------------------*         
       0000-MAINLINE.                                                   
           PERFORM 1000-PROCESS-INPUT  THRU 1000-EXIT                   
           PERFORM 2000-PROCESS-OUTPUT THRU 2000-EXIT                   
           EXIT PROGRAM                                                 
           .                                                            
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
           EXEC SQL                                                             
              INCLUDE CPD00371                                                  
           END-EXEC.                                                            
                                                                        
