       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID.    CSR02054.                                         
COB303 DATE-WRITTEN.      MARCH 14, 1995.                               
       DATE-COMPILED.                                                   
                                                                        
CVT000******************************************************************00000100
CVT000*     - - - - - >   R P C   C O N V E R S I O N   < - - - - -    *00000200
CVT000*         S054 CONVERTED TO DB2 SP CSR02054 ON 06/13/2006        *00000300
CVT000*             -NOTE: AUTOMATED CONVERSION PROGRAM USED           *00000400
CVT000*                                                                *00000500
CVT000*                    CVT000 - CONVERTED CODE                     *00000501
CVT000*                    CVT004 - NEEDED REVIEW                      *00000502
CVT000*                    CVT999 - COMMENTED OUT CODE THAT CAN        *00000503
CVT000*                             POTENTIALLY BE DELETED             *00000510
CVT000*                                                                *00000520
CVT000******************************************************************00000600
      ***************************************************************** 00060000
      *                                                               * 00070000
      *                SOUTH CAROLINA ELECTRIC & GAS                  * 00080000
      *                                                               * 00090000
      *  THIS PROGRAM IS EXECUTED VIA A REMOTE PROCEDURE CALL (RPC).  * 00100000
      *                                                               * 00110000
      *  TRANID:        S054                                          * 00120000
      *  PROGRAM:       S054                                          * 00130000
      *  CALLING SP:    PA_S054                                       * 00140000
      *                                                               * 00150000
      ***************************************************************** 00160000
      *                P R O G R A M  S U M M A R Y                   * 00170000
      *                                                               * 00180000
      *  THIS PROGRAM CREATES A NEW ACCOUNT.                          * 00190000
      ***************************************************************** 00200000
      *                                                               * 00210000
      *                     PROGRAM MODIFICATION LOG                  * 00220000
      *                                                               * 00230000
      *    DATE    INITIALS   COMMENTS                                * 00240000
      *  --------  --------   --------------------------------------- * 00250000
      *  03/14/95    FAM      REMOTE PROCEDURE ORIGINALLY CODED.      * 00260000
      *  08/03/95    WMG      ADDED COMPANY NUMBER AS A RECEIVE PARM  * 00270000
      *                       AND CODE-COMPANY-ACCT FLAG AS A RETURN  * 00280000
      *                       PARM.  ALSO, INSERT LOCAL OFFICE FROM   * 00290000
      *                       THE PREMISE TO THE ACCOUNT LOCAL OFFICE * 00300000
      *                       WHEN INSERTING A NEW ACCOUNT.           * 00310000
      *  10/06/95    WMG      ADDED PREDICATE IN THE PARAGRAPH -      * 00320000
      *                       7696-GET-INTR-CO-IN.                    * 00330000
      *  10/11/95    MJL      RESET RS-RETURN-CODE-054 TO ALLOW FOR NO *        
      *                       CSS_CUST_STATS RECORD.                  * 00350000
      *  01/19/96    WMG      ADDED PARAGRAPH 7710 TO INSERT A BLANK  * 00360000
      *                       ROW INTO CSS_CREDIT_PROFILE AFTER A NEW * 00370000
      *                       ACCOUNT IS INSERTED INTO CSS_ACCOUNT.   * 00380000
      *                       FOR INITIAL ACCOUNT-TYPE-CODE, INSERT A * 00390000
      *                       '1' INSTEAD OF 'R'.  ALSO SET THE       * 00400000
      *                       WS-CODE-LANDLD INDICATOR ON CODES-DATA- * 00410000
      *                       PRESENT IF PREMISE ASSOCIATED WITH A NEW* 00420000
      *                       ACCOUNT HAS A LANDLORD (PARAGRAPH 7697).* 00430000
      *  03/07/96    WMG      ADDED PARAGRAPH 7698 TO DEFAULT THE 00, * 00440000
      *                       30, 60 AND 90 DATE-BILL-DAY HOST        * 00450000
      *                       VARIABLES FOR INSERTION INTO THE        * 00460000
      *                       CSS_ACCOUNT TABLE (TPR 3399).           * 00470000
      *                                                               * 00480000
      *  03/19/96    SR       CHANGES MADE DUE TO PCR#139.            * 00490000
      *                                                               * 00500000
      *  05/16/96    WMG      TPR 3635 - FIX MAINTENANCE TRANSACTION  * 00510000
      *                       JOURNALING ADDED FOR PCR139.            * 00520000
      *                                                               * 00530000
3699  *  07/23/96    JBW      TPR 3699 - ADDED PARAGRAPHS 7850 AND    * 00540000
3699  *                       7860 TO NOW ADD NAME-ACCT-XREF ROWS IF  * 00550000
3699  *                       CUSTOMER HAS A SPOUSE.                  * 00560000
      *                                                               * 00570000
3699  *  07/29/96    JBW      TPR 3699 - FIXED 2204- SO ZERO WILL BE  *         
3699  *                       IN WS-ACTIVE-RETURN-CD EVEN IF A SPOUSE * 00590000
3699  *                       WAS NOT FOUND.  ALSO IN 7800- TOOK OUT  * 00600000
3699  *                       CHECK OF NOT-FOUND AFTER THE INSERT.    * 00610000
      *                                                               * 00620000
      *  08/20/96    SG       TPR 4592 - CHANGED DEFAULT VALUE FOR    * 00630000
      *                       ACCOUNT-TYPE-CODE TO 'R'                * 00640000
      *                                                               * 00640100
T4999 *  10/14/96    JBW      TPR 4999 - MODIFIED CRITERIA IN PARA    * 00641000
T4999 *                       7850.  ALSO, ADDED LOGIC TO SEE IF WHEN * 00642000
T4999 *                       ASSOCAIATING A CUSTOMER TO A PREMISE    * 00643000
T4999 *                       (PARA 7600) IF THERE SHOULD ALSO BE A   * 00644000
T4999 *                       SIMILAR ROW ADDED TO NAME_ACCT_XREF FOR * 00645000
T4999 *                       THE SPOUSE.                             * 00646000
      *  12/13/96    AS       TPR 8162 - MOVED 'N' INSTEAD OF SPACES  * 00647000
      *                       TO AT-CREDIT-GROUP IN 2204-BUILD-RESULT *         
      *  05/13/97    WMG      TPR 11080 - SET THE CODE-COMPANY-ACCT   * 00649000
      *                       TO 'A' IN PARAGRAPH 7696.               * 00649100
T12968*  09/08/97    MJG      IF THE PREMISE CURRENTLY HAS A READ     * 00649200
      *                       CYCLE USE THAT AS THE DEFAULT BILL CYCLE* 00649300
T14051*  12/16/97    RAH      USE UNIQUE KEY WHEN UPDATING CSS_NAME_  * 00649400
      *                       ACCT_XREF FOR A CUSTOMER.               * 00649500
T15535*  03/24/98    TQT      ADD NULL INIDICATOR TO FETCH IN 7880-   * 00649602
      *                       FOR READ CYCLE                          * 00649701
T17009*  07/09/98    FB       ADDED SPOUSE PROCESSING TO FIRST TIME   * 00649602
      *                       CUSTOMERS.                              * 00649701
CBSI  *  07/24/98   CBSI      ABEND LOG MODIFIED TO INCLUDE ALL THE   *         
CBSI  *             MADRAS    ABEND PARAMETERS                        *         
T18965*  01/25/99    FB       SET CODES_DATA_PRESENT TO SPACES BEFORE * 00649602
T18965*                       SETTING LANDLORD FLAG.                  * 00649602
T19368*  03/11/99    FB       DO NOT UPDATE WS-CODE-LANDLD.  FIELD ON * 00649602
T19368*                       CSS_PREMISE IS NOW USED AS LANDLORD     * 00649602
T19368*                       FLAG.                                   * 00649602
AGLPWC*  03/12/99    AMG      SEPARATED RPC INTO CWS0054A AND CPD0054A*         
T22281* 05/30/2000   SK       CODE ADDED TO CPD0054A TO UPDATE TOWN,  *         
T22281*                       STATE, AND LOCAL_OFFICE TO              *         
T22281*                       CSS_NAME_ACCT_XREF.                     *         
C23427*  01/22/02    FMB      DEFAULTED CODE_BILL_FREQ TO M01 IN      *         
C23427*                       CPD0054A.                               *         
C26959*  07/05/02    FMB      DETERMINE GROUP CODE.  INSERT INTO      *         
C26959*                       CSS_REG_PROFILE FOR GROUP 2.            *         
C36318*  01/02/08    FMB      READ ONLY FIRST SPOUSE ROW TO AVOID     *         
C36318*                       -811 SQLCODE.                           *         
C36013*  02/19/08    MSR      GENERATE WQ WHEN ACCOUNT IS CREATED WITH*         
C36013*                       APPL STATUS CD 'O' OR 'D'.              *         
A04860** 03/18/16  MR7E794    REPLACE CSS_WQ_ITEMS_MF WITH             *        
A04860**           ACT098     CSS_WQ_ITEMS.                            *        
      ***************************************************************** 00650000
      ***************************************************************** 00660000
      *                                                               * 00670000
      *                ---- BASIC SEQUENCE STRUCTURE ----             * 00680000
      *                                                               * 00690000
      *  0000 - 0999  MAIN CONTROL PATH AND INITIALIZATION            * 00700000
      *  1000 - 1999  INPUT PROCESSING CONTROL PATH                   * 00710000
      *  2000 - 2999  OUTPUT PROCESSING CONTROL PATH                  * 00720000
      *  3000 - 4999  NOT USED                                        * 00730000
      *  5000 - 5999  COMMON PROGRAM MODULES                          * 00740000
      *  6000 - 6999  COMMON SYSTEM MODULES                           * 00750000
      *  7000 - 7999  INPUT MODULES                                   * 00760000
      *  8000 - 8999  OUTPUT MODULES                                  * 00770000
      *  9000 - 9999  TERMINATION, ABEND, MESSAGING MODULES           * 00780000
      *                                                               * 00790000
      ***************************************************************** 00800000
                                                                        
       ENVIRONMENT DIVISION.                                            
       DATA DIVISION.                                                   
       WORKING-STORAGE SECTION.                                         

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

MSQ017 01 MFA-PROGRAM-ID PIC X(8) VALUE 'CSR02054'.
MSQ017     COPY MFASQLM.
                                                                        
       01  WS-START                                   PIC X(40) VALUE   
           'WORKING STORAGE FOR RPC S054 STARTS HERE'.                  
                                                                        
      ******************************************************************00890000
      *    DB2 INCLUDES                                                *00900000
      ******************************************************************00910000
                                                                        
      *---< ERROR PROCESSING >                                          00930000
           EXEC SQL                                                     00940000
              INCLUDE SQLCA                                             00950000
           END-EXEC.                                                    00960000
                                                                        
T12968*-------< INCLUDE CSS_CUST_PREM_HIST >                            00960200
T12968     EXEC SQL                                                     00960300
T12968        INCLUDE TBCSTPRM                                          00960400
T12968     END-EXEC.                                                    00961000
                                                                        
T12968*-------< INCLUDE CSS_UTIL_ENVRNMT >                              00971000
T12968     EXEC SQL                                                     00972000
T12968        INCLUDE TBUTLENV                                          00973000
T12968     END-EXEC.                                                    00974000
                                                                        
      *---< CSS_ACCOUNT      >                                          00980000
           EXEC SQL                                                     00990000
              INCLUDE TBACCT                                            01000000
           END-EXEC.                                                    01010000
                                                                        
      *---< CSS_CUSTOMER     >                                          01030000
           EXEC SQL                                                     01040000
              INCLUDE TBCUST                                            01050000
           END-EXEC.                                                    01060000
                                                                        
      *---< CSS_NAME         >                                          01080000
           EXEC SQL                                                     01090000
              INCLUDE TBNAME                                            01100000
           END-EXEC.                                                    01110000
                                                                        
      *---< CSS_NAME_ACCT_XREF>                                         01130000
           EXEC SQL                                                     01140000
              INCLUDE TBNMACTX                                          01150000
           END-EXEC.                                                    01160000
                                                                        
      *---< CSS_PREMISE      >                                          01180000
           EXEC SQL                                                     01190000
              INCLUDE TBPREM                                            01200000
           END-EXEC.                                                    01210000
                                                                        
      *---< CSS_CUST_STATS   >                                          01230000
           EXEC SQL                                                     01240000
              INCLUDE TBCSTSTS                                          01250000
           END-EXEC.                                                    01260000
                                                                        
      *---< CSS_CREDIT_PROFILE>                                         01280000
           EXEC SQL                                                     01290000
              INCLUDE TBCRPROF                                          01300000
           END-EXEC.                                                    01310000
                                                                        
      *---< CSS_LANDLORD     >                                          01330000
           EXEC SQL                                                     01340000
              INCLUDE TBLNDLRD                                          01350000
           END-EXEC.                                                    01360000
                                                                        
           EXEC SQL                                                     01380000
              INCLUDE TBMODEL                                           01390000
           END-EXEC.                                                    01400000
                                                                        
      *---< CSS_ACCT_NO_CNTL >                                          01420000
           EXEC SQL                                                     01430000
              INCLUDE TBATCNTL                                          01440000
           END-EXEC.                                                    01450000
                                                                        
      *---< CSS_USER_PROFILE >                                          01470000
           EXEC SQL                                                     01480000
              INCLUDE TBUSRPRF                                          01490000
           END-EXEC.                                                    01500000
                                                                        
      *---< CSS_MNT_TRANS_HIST >                                        01520000
           EXEC SQL                                                     01530000
              INCLUDE TBMNHIST                                          01540000
           END-EXEC.                                                    01550000
                                                                        
      *---< CSS_MT_TRN_HST_DET >                                        01570000
           EXEC SQL                                                     01580000
              INCLUDE TBMNHDT                                           01590000
           END-EXEC.                                                    01600000
                                                                        
T22281*---< CSS_ADDR_FORMATTED  DY >                                            
T22281     EXEC SQL                                                             
T22281        INCLUDE TBADRFMT                                                  
T22281     END-EXEC.                                                            
                                                                        
T22281*---< CSS_ADDR_FREEFORM  DZ >                                             
T22281     EXEC SQL                                                             
T22281        INCLUDE TBADRFRE                                                  
T22281     END-EXEC.                                                            
                                                                        
T22281*---< CSS_ZIP_CODE  A4 >                                                  
T22281     EXEC SQL                                                             
T22281        INCLUDE TBZIPCD                                                   
T22281     END-EXEC.                                                            
                                                                        
ONERAT**** CSS_DELINQUENCY ***                                                  
ONERAT     EXEC SQL                                                             
ONERAT        INCLUDE TBDELQ                                                    
ONERAT     END-EXEC.                                                            
ONERAT                                                                  
                                                                        
C26959**** CSS_LOCAL_OFFICE ****                                                
C26959     EXEC SQL                                                             
C26959        INCLUDE TBLOCOFC                                                  
C26959     END-EXEC.                                                            
C26959                                                                  
C26959**** CSS_REG_PROFILE  ****                                                
C26959     EXEC SQL                                                             
C26959        INCLUDE TBREGPRF                                                  
C26959     END-EXEC.                                                            
C26959                                                                  
C36013**** CSS_CRED_HISTORY ****                                                
C36013     EXEC SQL                                                             
C36013        INCLUDE TBCRHIST                                                  
C36013     END-EXEC.                                                            
C36013*                                                                         
                                                                        
      ******************************************************************01630000
      *    COBOL WORKING STORAGE COPY BOOKS                            *01640000
      ******************************************************************01650000
                                                                        
CVT999*    COPY SYGWCOB.                                                01670000
CVT999*    COPY SYDBCOB.                                                01680000
           COPY CCA00001.                                               01690000
CVT999*    COPY CWS00010.                                               01700000
           COPY CWS00027.                                               01710000
           COPY CWS00056.                                               01720000
           COPY CWS00303.                                               01730000
                                                                        
           EXEC SQL                                                     01750000
             INCLUDE CWS00013                                           01760000
           END-EXEC.                                                    01770000
                                                                        
           EXEC SQL                                                     01790000
              INCLUDE CWS0126A                                          01800000
           END-EXEC.                                                    01810000
                                                                        
           EXEC SQL                                                             
              INCLUDE CWS0054A                                                  
           END-EXEC.                                                            
                                                                        
                                                                        
      ******************************************************************01840000
      *    WORK AREAS                                                  *01850000
      ******************************************************************01860000
                                                                        
       01  GW-LIB-MISC-FIELDS.                                          
CVT999*    05  GWL-PROC                    POINTER.                     01890000
CVT999*    05  GWL-INIT-HANDLE             POINTER.                     01900000
CVT999*    05  GWL-RC                      PIC S9(9) COMP.              01910000
CVT999*    05  GWL-STATUS-NR               PIC S9(9) COMP.              01920000
CVT999*    05  GWL-STATUS-DONE             PIC S9(9) COMP.              01930000
CVT999*    05  GWL-STATUS-COUNT            PIC S9(9) COMP.              01940000
CVT999*    05  GWL-STATUS-COMM             PIC S9(9) COMP.              01950000
CVT999*    05  GWL-STATUS-RETURN-CODE      PIC S9(9) COMP.              01960000
           05  GWL-STATUS-SUBCODE          PIC S9(9) COMP.              
                                                                        
       01  FILLER                          PIC X(11) VALUE              
                                               'PARM FIELDS'.           
       01  PARM-FIELDS.                                                 
           05  PARM-L                      PIC S9(9) COMP.              
CVT999*    05  PARM-ID1                    PIC S9(9) COMP VALUE 1.      02030000
                                                                        
       01  SNA-FIELDS.                                                  
           05  SNA-SUBC                    PIC S9(9) COMP.              
CVT999*    05  SNA-CONNECTION-NAME         PIC X(08) VALUE SPACES.      02150000
                                                                        
       01  COUNTER-FIELDS.                                              
CVT999*    05  CTR-COLUMN                  PIC S9(9) COMP VALUE 1.      02180000
           05  CTR-ROWS                    PIC S9(9) COMP VALUE 0.      
                                                                        
       01  WORK-FIELDS.                                                 
CVT999*    05  MAX-LENGTH-PARM             PIC S9(9) COMP.              02220000
CVT999*    05  WRKLEN1                     PIC S9(9) COMP.              02230000
CVT999*    05  WRKLEN2                     PIC S9(9) COMP.              02240000
           05  WRK-DONE-STATUS             PIC S9(9) COMP.              
                                                                        
       01  FILLER  PIC X(32) VALUE 'THIS IS THE ROW RETURN AREA.'.      
                                                                        
       01  GTT-RETURN-FIELDS.                                           
           05  RS-RETURN-CODE              PIC S9(9) COMP VALUE 0.      
                                                                        
CVT999*01  CN-COLUMN-NAMES.                                             02340000
CVT999*    05  CN-RETURN-CODE              PIC X(11) VALUE              02350000
CVT999*                                       'RETURN_CODE'.            02360000
CVT999*    05  CN-ACCOUNT-NO               PIC X(10) VALUE              02370000
CVT999*                                       'ACCOUNT_NO'.             02380000
CVT999*    05  CN-CODE-COMPANY-ACCT        PIC X(17) VALUE              02390000
CVT999*                                       'CODE_COMPANY_ACCT'.      02400000
CVT999*                                                                 02410000
       01  SWITCHES.                                                    
           05  ALL-DONE-SW                 PIC X(01) VALUE 'N'.         
               88 NOT-ALL-DONE                       VALUE 'N'.         
               88 ALL-DONE                           VALUE 'Y'.         
           05  SEND-DONE-SW                PIC X(01) VALUE 'Y'.         
               88 SEND-DONE-ERROR                    VALUE 'N'.         
               88 SEND-DONE-OK                       VALUE 'Y'.         
                                                                        
       01  WS-MISCELLANEOUS.                                            
           05  PROGRAM-NAME                PIC X(08)  VALUE 'S054    '. 
ACT098     05  WS-PGM-NAME                 PIC X(08)  VALUE 'CSR02054'. 
           05  WS-U                        PIC X(01) VALUE 'U'.         
ACT098     05  MCSCB077                    PIC X(08)  VALUE 'MCSCB077'. 
ACT098     05  WS-MCSCB077-RET-CODE        PIC S9(04) COMP VALUE 0.     
                                                                        
HPCCDM*EJECT                                                            02800000
CVT000     EXEC SQL                                                     00000010
CVT000         INCLUDE CWSX0010                                         00000020
CVT000     END-EXEC.                                                    00000030
CVT000                                                                  
CVT000 01  CSRERLOG-P.                                                  
CVT000     10  S-SP-NAME                 PIC X(18) VALUE SPACES.        
CVT000     10  S-SQLCODE                 PIC S9(9) COMP VALUE 0.        
CVT000     10  S-SQLSTATE                PIC X(5)  VALUE ' '.           
CVT000     10  S-TABLE-NAME              PIC X(18) VALUE SPACES.        
CVT000     10  S-HOST-VARIABLES.                                        
CVT000         49  S-HOST-VARIABLES-L    PIC S9(4) USAGE COMP.          
CVT000         49  S-HOST-VARIABLES-V    PIC X(255).                    
CVT000     10  S-SQL-STATEMENT.                                         
CVT000         49  S-SQL-STATEMENT-L     PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-STATEMENT-V     PIC X(255).                    
CVT000     10  S-SQL-DESCRIPTION.                                       
CVT000         49  S-SQL-DESCRIPTION-L   PIC S9(4) USAGE COMP.          
CVT000         49  S-SQL-DESCRIPTION-V   PIC X(255).                    
CVT000     10  WS-ABEND-SQLERRMC.                                       
CVT000         49  WS-ABEND-SQLERRMC-L   PIC S9(4) USAGE COMP.          
CVT000         49  WS-ABEND-SQLERRMC-V   PIC X(255).                    
CVT000     10  S-RETURN-CODE             PIC S9(9) COMP VALUE 0.        
CVT000     10  WS-SQLSTATE               PIC X(05) VALUE SPACES.        
CVT000                                                                  
ACT098*                                                                 02867600
ACT098******************************************************************        
ACT098* WORKING STORAGE COPYBOOK FOR SCSCB077                          *        
ACT098******************************************************************        
ACT098*                                                                         
ACT098     EXEC SQL                                                             
ACT098        INCLUDE CWS00077                                                  
ACT098     END-EXEC.                                                            
ACT098*                                                                         
CVT000                                                                  
CVT000                                                                  
CVT000 LINKAGE SECTION.                                                 
CVT000 01  LINK-PREMISE-NO-054      PIC X(10)                .          
CVT000 01  LINK-CUSTOMER-NO-054     PIC X(10)                .          
CVT000 01  LINK-USERID-054          PIC X(07)                .          
CVT000 01  LINK-COMPANY-NO-054      PIC X(02)                .          
                                                                        
CVT000 PROCEDURE DIVISION USING                                         
CVT000          LINK-PREMISE-NO-054                                     
CVT000         ,LINK-CUSTOMER-NO-054                                    
CVT000         ,LINK-USERID-054                                         
CVT000         ,LINK-COMPANY-NO-054                                     
CVT000         .                                                        
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLWARNING                                      
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER SQLERROR                                        
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT000                                                                  
CVT000     EXEC SQL                                                     
CVT000         WHENEVER NOT FOUND                                       
CVT000             CONTINUE                                             
CVT000     END-EXEC.                                                    
CVT999*PROCEDURE DIVISION.                                              02810000
                                                                        
      ******************************************************************02830000
      * 0000-MAINLINE                                                  *02840000
      *     CONTROLS THE MAIN PATH OF THE PROGRAM                      *02850000
      ******************************************************************02860000
       0000-MAINLINE.                                                   
                                                                        
           PERFORM 0100-INITIALIZE            THRU 0100-EXIT.           
           PERFORM 1000-PROCESS-INPUT         THRU 1000-EXIT.           
           PERFORM 2000-PROCESS-OUTPUT        THRU 2000-EXIT.           
           PERFORM 9999-END-PROGRAM           THRU 9999-EXIT.           
                                                                        
       0000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************02980000
      * 0100-INITIALIZE                                                *02990000
      *                                                                *03000000
      *     1. RESET DB2 ERROR HANDLERS                                *03010000
      *     2. ESTABLISH GATEWAY ENVIRONMENT (TDINIT)                  *03020000
      *     3. ACCEPT CLIENT REQUEST/ESTABLISH SNA HANDLE (TDACCEPT)   *03030000
      *     4. DETERMINE IF CLIENT HAS SENT AN RPC PARAMETER (TDRESULT)*03040000
      *                                                                *03050000
      ******************************************************************03060000
       0100-INITIALIZE.                                                 
                                                                        
CVT999*    EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.              03090000
CVT999*    EXEC SQL WHENEVER SQLERROR   CONTINUE END-EXEC.              03100000
CVT999*    EXEC SQL WHENEVER NOT FOUND  CONTINUE END-EXEC.              03110000
                                                                        
CVT999*    CALL 'TDINIT'   USING DFHEIBLK, GWL-RC, GWL-INIT-HANDLE.     03130000
                                                                        
CVT999*    CALL 'TDACCEPT' USING GWL-PROC, GWL-RC, GWL-INIT-HANDLE,     03150000
CVT999*                          SNA-CONNECTION-NAME, SNA-SUBC.         03160000
                                                                        
CVT999*    CALL 'TDRESULT' USING GWL-PROC, GWL-RC.                      03180000
                                                                        
CVT999*    IF GWL-RC NOT = TDS-PARM-PRESENT                             03200000
CVT999*       MOVE PROGRAM-NAME                  TO ABEND-PROGRAM       03210000
CVT999*       MOVE '0100'                        TO ACTIVE-PARAGRAPH    03220000
CVT999*       MOVE 'TDRESULT - NO RPC PARM SENT' TO ABEND-FUNCTION      03230000
CVT999*       MOVE 'CICS TRANSACTION'            TO TABLE-1             03240000
CVT999*       MOVE GWL-RC                       TO WS-ACTIVE-RETURN-CODE03250000
CVT999*       PERFORM 9000-SEND-ERROR-RESULT    THRU 9000-EXIT          03260000
CVT999*       PERFORM 9900-SQL-ERROR-ROUTINE    THRU 9900-EXIT          03270000
CVT999*    END-IF.                                                      03280000
                                                                        
CVT000     EXEC SQL                                                     
CVT000       DECLARE C1 CURSOR  FOR                          
CVT000       SELECT                                                     
CVT000        :RS-RETURN-CODE-054          AS    RETURN_CODE_054        
CVT000       ,:RS-ACCOUNT-NO-054           AS    ACCOUNT_NO_054         
CVT000       ,:RS-CODE-COMPANY-ACCT-054    AS    CODE_COMPANY_ACCT      
CVT000          FROM CIS.SYSDUMMY1                                   
CVT000     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ027
MFA-TR*    EXEC SQL                                                             
MFA-TR*      DECLARE C1 CURSOR WITH RETURN FOR                                  
MFA-TR*      SELECT                                                             
MFA-TR*       :RS-RETURN-CODE-054          AS    RETURN_CODE_054                
MFA-TR*      ,:RS-ACCOUNT-NO-054           AS    ACCOUNT_NO_054                 
MFA-TR*      ,:RS-CODE-COMPANY-ACCT-054    AS    CODE_COMPANY_ACCT              
MFA-TR*         FROM SYSIBM.SYSDUMMY1                                           
MFA-TR*    END-EXEC.                                                            
CVT000     MOVE LINK-PREMISE-NO-054       TO PARM-PREMISE-NO-054      . 
CVT000     MOVE LINK-CUSTOMER-NO-054      TO PARM-CUSTOMER-NO-054     . 
CVT000     MOVE LINK-USERID-054           TO PARM-USERID-054          . 
CVT000     MOVE LINK-COMPANY-NO-054       TO PARM-COMPANY-NO-054      . 
       0100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************03340000
      * 1000-PROCESS-INPUT                                             *03350000
      *                                                                *03360000
      *     RECEIVE PARMS FROM THE CALLING STORED PROCEDURE.           *03370000
      *                                                                *03380000
      ******************************************************************03390000
       1000-PROCESS-INPUT.                                              
                                                                        
           PERFORM 1100-RECEIVE-PARMS THRU 1100-EXIT.                   
                                                                        
           MOVE PARM-PREMISE-NO-RED-054   TO WS-PREMISE-NO-NUM.         
                                                                        
       1000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ******************************************************************03500000
      *   1100-RECEIVE-PARMS                                           *03510000
      *                                                                *03520000
      *       RECEIVE THE PARAMETERS FROM SYBASE.                      *03530000
      *                                                                *03540000
      ******************************************************************03550000
       1100-RECEIVE-PARMS.                                              
                                                                        
CVT999*    MOVE 1                          TO PARM-ID1.                 03580000
CVT999*    MOVE LENGTH OF PARM-PREMISE-NO-054  TO MAX-LENGTH-PARM,              
CVT999*                                                                 03600000
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              03610000
CVT999*                          GWL-RC,                                03620000
CVT999*                          PARM-ID1,                              03630000
CVT999*                          PARM-PREMISE-NO-054,                           
CVT999*                          TDSCHAR,                               03650000
CVT999*                          MAX-LENGTH-PARM,                       03660000
CVT999*                          PARM-L.                                03670000
                                                                        
                                                                        
CVT999*    ADD  1                          TO PARM-ID1.                 03700000
CVT999*    MOVE LENGTH OF PARM-CUSTOMER-NO-054 TO MAX-LENGTH-PARM,              
CVT999*                                                                 03720000
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              03730000
CVT999*                          GWL-RC,                                03740000
CVT999*                          PARM-ID1,                              03750000
CVT999*                          PARM-CUSTOMER-NO-054,                          
CVT999*                          TDSCHAR,                               03770000
CVT999*                          MAX-LENGTH-PARM,                       03780000
CVT999*                          PARM-L.                                03790000
                                                                        
                                                                        
CVT999*    ADD  1                          TO PARM-ID1.                 03820000
CVT999*    MOVE LENGTH OF PARM-USERID-054  TO MAX-LENGTH-PARM,                  
CVT999*                                                                 03840000
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              03850000
CVT999*                          GWL-RC,                                03860000
CVT999*                          PARM-ID1,                              03870000
CVT999*                          PARM-USERID-054,                               
CVT999*                          TDSCHAR,                               03890000
CVT999*                          MAX-LENGTH-PARM,                       03900000
CVT999*                          PARM-L.                                03910000
                                                                        
                                                                        
CVT999*    ADD  1                          TO PARM-ID1.                 03940000
CVT999*    MOVE LENGTH OF PARM-COMPANY-NO-054  TO MAX-LENGTH-PARM,              
CVT999*                                                                 03960000
CVT999*    CALL 'TDRCVPRM' USING GWL-PROC,                              03970000
CVT999*                          GWL-RC,                                03980000
CVT999*                          PARM-ID1,                              03990000
CVT999*                          PARM-COMPANY-NO-054,                           
CVT999*                          TDSCHAR,                               04010000
CVT999*                          MAX-LENGTH-PARM,                       04020000
CVT999*                          PARM-L.                                04030000
                                                                        
       1100-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      ************************************************************      04090000
      *   2000-PROCESS-OUTPUT                                    *      04100000
      *                                                          *      04110000
      *   1. DESCRIBE RESULT SET                                 *      04120000
      *   2. RETRIEVE DB2 DATA AND BUILD RESULT SET              *      04130000
      *   3. SEND RESULT SET                                     *      04140000
      *                                                          *      04150000
      ************************************************************      04160000
       2000-PROCESS-OUTPUT.                                             
                                                                        
            MOVE '2000'                       TO ACTIVE-PARAGRAPH.      
            PERFORM 2100-DESCRIBE-RESULT      THRU 2100-EXIT.           
            PERFORM 2204-BUILD-ACCOUNT-RESULT THRU 2204-EXIT.           
C36013      IF C8-DELINQ-VALUE = 1                                      
C36013         PERFORM 2210-CHECK-APPL-STAT-CD THRU 2210-EXIT           
C36013      END-IF.                                                     
            PERFORM 8100-SEND-RESULT          THRU 8100-EXIT.           
                                                                        
       2000-EXIT.                                                       
           EXIT.                                                        
                                                                        
                                                                        
      *************************************************************     04280000
      *   2100-DESCRIBE-RESULT                                    *     04290000
      *                                                           *     04300000
      *       DESCRIBE EACH COLUMN IN THE RESULT SET.             *     04310000
      *                                                           *     04320000
      *************************************************************     04330000
       2100-DESCRIBE-RESULT.                                            
           MOVE '2100'                        TO ACTIVE-PARAGRAPH.      
                                                                        
CVT999*    MOVE 1                             TO CTR-COLUMN.            04370000
CVT999*    MOVE TDSINT4                       TO DB-HOST-TYPE.          04380000
CVT999*    MOVE TDSINT4                       TO DB-CLIENT-TYPE.        04390000
CVT999*    MOVE LENGTH OF RS-RETURN-CODE-054  TO WRKLEN1.                       
CVT999*    MOVE LENGTH OF CN-RETURN-CODE      TO WRKLEN2.               04410000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04430000
CVT999*                          GWL-RC,                                04440000
CVT999*                          CTR-COLUMN,                            04450000
CVT999*                          DB-HOST-TYPE,                          04460000
CVT999*                          WRKLEN1,                               04470000
CVT999*                          RS-RETURN-CODE-054,                            
CVT999*                          DB-NULL-INDICATOR,                     04490000
CVT999*                          TDS-FALSE,                             04500000
CVT999*                          DB-CLIENT-TYPE,                        04510000
CVT999*                          WRKLEN1,                               04520000
CVT999*                          CN-RETURN-CODE,                        04530000
CVT999*                          WRKLEN2.                               04540000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR           THRU 9100-EXIT.           04560000
                                                                        
                                                                        
CVT999*    ADD 1                              TO CTR-COLUMN.            04590000
CVT999*    MOVE TDSCHAR                       TO DB-HOST-TYPE.          04600000
CVT999*    MOVE TDSCHAR                       TO DB-CLIENT-TYPE.        04610000
CVT999*    MOVE LENGTH OF RS-ACCOUNT-NO-054   TO WRKLEN1.                       
CVT999*    MOVE LENGTH OF CN-ACCOUNT-NO       TO WRKLEN2.               04630000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04650000
CVT999*                          GWL-RC,                                04660000
CVT999*                          CTR-COLUMN,                            04670000
CVT999*                          DB-HOST-TYPE,                          04680000
CVT999*                          WRKLEN1,                               04690000
CVT999*                          RS-ACCOUNT-NO-054,                             
CVT999*                          DB-NULL-INDICATOR,                     04710000
CVT999*                          TDS-FALSE,                             04720000
CVT999*                          DB-CLIENT-TYPE,                        04730000
CVT999*                          WRKLEN1,                               04740000
CVT999*                          CN-ACCOUNT-NO,                         04750000
CVT999*                          WRKLEN2.                               04760000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR           THRU 9100-EXIT.           04780000
                                                                        
                                                                        
CVT999*    ADD 1                               TO CTR-COLUMN.           04810000
CVT999*    MOVE TDSCHAR                        TO DB-HOST-TYPE.         04820000
CVT999*    MOVE TDSCHAR                        TO DB-CLIENT-TYPE.       04830000
CVT999*    MOVE LENGTH OF RS-CODE-COMPANY-ACCT-054 TO WRKLEN1.                  
CVT999*    MOVE LENGTH OF CN-CODE-COMPANY-ACCT TO WRKLEN2.              04850000
                                                                        
CVT999*    CALL 'TDESCRIB' USING GWL-PROC,                              04870000
CVT999*                          GWL-RC,                                04880000
CVT999*                          CTR-COLUMN,                            04890000
CVT999*                          DB-HOST-TYPE,                          04900000
CVT999*                          WRKLEN1,                               04910000
CVT999*                          RS-CODE-COMPANY-ACCT-054,                      
CVT999*                          DB-NULL-INDICATOR,                     04930000
CVT999*                          TDS-FALSE,                             04940000
CVT999*                          DB-CLIENT-TYPE,                        04950000
CVT999*                          WRKLEN1,                               04960000
CVT999*                          CN-CODE-COMPANY-ACCT,                  04970000
CVT999*                          WRKLEN2.                               04980000
                                                                        
CVT999*    PERFORM 9100-CHECK-ERROR           THRU 9100-EXIT.           05000000
                                                                        
       2100-EXIT.                                                       
           EXIT.                                                        
C36013******************************************************************        
C36013*   2210-CHECK-APPL-STAT-CD                                      *        
C36013*                                                                *        
C36013*   1.  CHECK APPL STATUS CD.                                    *        
C36013*                                                                *        
C36013******************************************************************        
C36013 2210-CHECK-APPL-STAT-CD.                                         
C36013                                                                  
C36013     PERFORM 7730-GET-APPL-STAT-CD    THRU 7730-EXIT.             
C36013     IF WS-ACTIVE-RETURN-CODE = NOT-FOUND                         
C36013        MOVE SPACES                   TO CK-APPL-STATUS-CD        
C36013     END-IF.                                                      
C36013     IF CK-APPL-STATUS-CD = 'O' OR 'D'                            
C36013        PERFORM 7740-GENERATE-WQ      THRU 7740-EXIT              
C36013     END-IF.                                                      
C36013                                                                  
C36013 2210-EXIT.                                                       
C36013     EXIT.                                                        
C36013                                                                  
C36013******************************************************************        
C36013*   7730-GET-APPL-STAT-CD                                        *        
C36013*                                                                *        
C36013*   1.  GET APPL STATUS CD FROM CSS_CREDIT_HIST                  *        
C36013*                                                                *        
C36013******************************************************************        
C36013 7730-GET-APPL-STAT-CD.                                           
C36013                                                                  
C36013     MOVE '7730'                     TO ACTIVE-PARAGRAPH.         
C36013                                                                  
C36013     EXEC SQL                                                     
C36013         SELECT TOP(1) APPL_STATUS_CD                                    
C36013           INTO :CK-APPL-STATUS-CD                                
C36013           FROM CSS_CREDIT_HIST WITH(READUNCOMMITTED)                     
C36013          WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM-054             
C36013           ORDER BY CR_HIST_TRAN_DT DESC,                         
C36013                    CR_HIST_TRAN_TM DESC                          
C36013                                              
C36013                                                           
C36013     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ020
MFA-TR* MSQ022
MFA-TR*    EXEC SQL                                                             
MFA-TR*        SELECT APPL_STATUS_CD                                            
MFA-TR*          INTO :CK-APPL-STATUS-CD                                        
MFA-TR*          FROM CSS_CREDIT_HIST                                           
MFA-TR*         WHERE CUSTOMER_NO = :WS-CUSTOMER-NO-NUM-054                     
MFA-TR*          ORDER BY CR_HIST_TRAN_DT DESC,                                 
MFA-TR*                   CR_HIST_TRAN_TM DESC                                  
MFA-TR*         FETCH FIRST ROW ONLY                                            
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

C36013                                                                  
C36013     MOVE SQLCODE                    TO WS-ACTIVE-RETURN-CODE.    
C36013                                                                  
C36013     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL OR NOT-FOUND  
C36013        NEXT SENTENCE                                             
C36013     ELSE                                                         
C36013        MOVE SQLCODE                    TO RS-RETURN-CODE-054     
C36013        MOVE WS-ACTIVE-RETURN-CODE      TO RS-RETURN-CODE-054     
C36013        MOVE PROGRAM-NAME               TO ABEND-PROGRAM          
C36013        MOVE 'SELECT'                   TO ABEND-FUNCTION         
C36013        MOVE SPACES                     TO ABEND-SQL-PREDICATES   
C36013                                           ABEND-TABLES           
C36013        MOVE 'CSS_CREDIT_HIST'          TO TABLE-1                
C36013        MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-1        
C36013        MOVE 'CUSTOMER_NO'              TO TABLE-ELEMENT-2        
C36013        MOVE WS-PREMISE-NO-NUM          TO HOSTVAR-ELEMENT-1      
C36013        MOVE WS-CUSTOMER-NO-NUM-054     TO HOSTVAR-ELEMENT-2      
C36013        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
C36013        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
C36013     END-IF.                                                      
C36013                                                                  
C36013 7730-EXIT.                                                       
C36013     EXIT.                                                        
C36013******************************************************************        
C36013*   7740-GENERATE-WQ                                             *        
C36013*                                                                *        
C36013*   1.  GENERATE WQ                                              *        
C36013*                                                                *        
C36013******************************************************************        
C36013 7740-GENERATE-WQ.                                                
C36013                                                                  
C36013     MOVE '7740'                     TO ACTIVE-PARAGRAPH.         
C36013*                                                                         
ACT098     INITIALIZE CWS00077-FIELDS.                                  
C36013     EXEC SQL                                                     
ACT098         SELECT
              CAST(SYSDATETIMEOFFSET() AS DATE)
            INTO
              :WS-77-DATE-CREATED                   
C36013     END-EXEC.                                                    

MFA-TR* TRANSFORMATION LIST
MFA-TR* MSQ006
MFA-TR* MSQ028
MFA-TR*    EXEC SQL                                                     39770000
MFA-TR*        SET :WS-77-DATE-CREATED = CURRENT DATE                   39780000
MFA-TR*    END-EXEC.                                                    39790000

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

C36013                                                                  
C36013     MOVE SQLCODE                       TO WS-ACTIVE-RETURN-CODE. 
C36013                                                                  
C36013     IF WS-ACTIVE-RETURN-CODE EQUAL SUCCESSFUL-CALL               
C36013        NEXT SENTENCE                                             
C36013     ELSE                                                         
C36013        MOVE 'ACCOUNT_NO'        TO TABLE-ELEMENT-1               
C36013        MOVE AT-ACCOUNT-NO       TO HOSTVAR-ELEMENT-1             
C36013        PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT             
C36013        PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT             
C36013     END-IF.                                                      
C36013*                                                                         
ACT098     MOVE PF-RESP-AREA-ID           TO WS-77-RESP-AREA-ID.        
ACT098     MOVE ZEROS                     TO WS-77-SERV-ORDER-NO.       
ACT098     MOVE PARM-USERID-054           TO WS-77-USER-ID-ORIG.        
ACT098     MOVE WS-77-DATE-CREATED        TO WS-77-DATE-REQUIRED.       
ACT098     MOVE AT-ACCOUNT-NO             TO WS-77-ACCOUNT-NO.          
ACT098     MOVE WS-CUSTOMER-NO-NUM-054    TO WS-77-CUSTOMER-NO.         
ACT098     MOVE ZEROS                     TO WS-77-PREMISE-NO.          
ACT098     MOVE AT-LOCAL-OFFICE           TO WS-77-LOCAL-OFFICE.        
ACT098     MOVE 2                         TO WS-77-ROUTE-CATEGORY.      
ACT098     MOVE 'N'                       TO WS-77-PRIORITY.            
C36013     IF CK-APPL-STATUS-CD EQUAL 'O'                               
ACT098        MOVE 454                    TO WS-77-CATEGORY-ID          
C36013        MOVE 'APPLICATION STATUS ON HOLD AND ACCOUNT CREATED.'    
ACT098                                    TO WS-77-COMMENTS-TEXT        
C36013     ELSE                                                         
ACT098        MOVE 455                    TO WS-77-CATEGORY-ID          
C36013        MOVE 'APPLICATION STATUS DENY AND ACCOUNT CREATED.'       
ACT098                                    TO WS-77-COMMENTS-TEXT        
C36013     END-IF.                                                      
ACT098     MOVE LENGTH OF WS-77-COMMENTS-TEXT                           
ACT098                                    TO WS-77-COMMENTS-LEN.        
ACT098     MOVE SPACES                    TO WS-77-FREE-FORM-TXT.       
ACT098     MOVE ZERO                      TO WS-77-FREE-FORM-LEN.       
ACT098     MOVE WS-PGM-NAME               TO WS-77-CREATED-BY.          
C36013                                                                  
C36013     PERFORM 8895-INSERT-WORK-QUEUE THRU 8895-EXIT.               
C36013*                                                                         
C36013 7740-EXIT.                                                       
C36013     EXIT.                                                        
C36013*                                                                         
           EXEC SQL                                                             
               INCLUDE CPD0054A                                                 
           END-EXEC.                                                            
                                                                        
           EXEC SQL                                                     06700000
               INCLUDE CPD00126                                         06710000
           END-EXEC.                                                    06720000
                                                                        
           EXEC SQL                                                     06740000
               INCLUDE CPD00071                                         06750000
           END-EXEC.                                                    06760000
                                                                        
           EXEC SQL                                                     06780000
               INCLUDE CPD00067                                         06790000
           END-EXEC.                                                    06800000
                                                                        
      ******************************************************************15320000
      * 9900- JOURNALING / ERROR HANDLING INCLUDE *                     15330000
      ******************************************************************15340000
           EXEC SQL                                                     15350000
              INCLUDE CPDSP300                                          15360000
           END-EXEC.                                                    15370000
                                                                        
      ******************************************************************15390000
      *       END PROGRAM COPYLIB                                      *15400000
      ******************************************************************15410000
CVT999*    COPY CPD00302.                                               15420000
                                                                        
CVT000 8100-SEND-RESULT.                                                
CVT000       ADD 1 TO CTR-ROWS.                                         
CVT000 8100-EXIT.                                                       
CVT000        EXIT.                                                     
CVT000     EXEC SQL                                                     00000100
CVT000         INCLUDE CPD00321                                         00000200
CVT000     END-EXEC.                                                    00000300
C36013*                                                                *63030000
C36013******************************************************************        
C36013*    INSERT WQ INTO CSS_WQ_ITEMS TABLE                           *        
C36013******************************************************************        
C36013*                                                                         
C36013 8895-INSERT-WORK-QUEUE.                                          
C36013                                                                  
ACT098     CALL MCSCB077 USING CWS00077-FIELDS                          
ACT098                        ,ABEND-FILE                               
ACT098                        ,WS-MCSCB077-RET-CODE.                    
ACT098                                                                  
ACT098     MOVE WS-MCSCB077-RET-CODE         TO WS-ACTIVE-RETURN-CODE.  
ACT098                                                                  
ACT098     IF WS-ACTIVE-RETURN-CODE = SUCCESSFUL-CALL                   
ACT098         CONTINUE                                                 
ACT098     ELSE                                                         
ACT098        DISPLAY '8895-INSERT-WORK-QUEUE'                          
ACT098        DISPLAY 'CALL MCSCB077         '                          
ACT098        MOVE WS-ACTIVE-RETURN-CODE      TO RS-RETURN-CODE-054     
ACT098        MOVE WS-PGM-NAME                TO ABEND-PROGRAM          
ACT098        MOVE '8895'                     TO ACTIVE-PARAGRAPH       
ACT098        MOVE 'CALL'                     TO ABEND-FUNCTION         
ACT098        MOVE SPACES                     TO ABEND-SQL-PREDICATES   
ACT098                                           ABEND-TABLES           
ACT098        MOVE 'MCSCB077'                 TO TABLE-1                
ACT098        MOVE 'ACCOUNT_NO'               TO TABLE-ELEMENT-1        
ACT098        MOVE 'PREMISE_NO'               TO TABLE-ELEMENT-2        
ACT098        MOVE 'CUSTOMER_NO'              TO TABLE-ELEMENT-3        
ACT098        MOVE WS-77-ACCOUNT-NO           TO HOSTVAR-ELEMENT-1      
ACT098        MOVE WS-77-PREMISE-NO           TO HOSTVAR-ELEMENT-2      
ACT098        MOVE WS-77-CUSTOMER-NO          TO HOSTVAR-ELEMENT-3      
ACT098        PERFORM 9000-SEND-ERROR-RESULT  THRU 9000-EXIT            
ACT098        PERFORM 9900-SQL-ERROR-ROUTINE  THRU 9900-EXIT            
ACT098     END-IF.                                                      
ACT098                                                                  
ACT098 8895-EXIT.                                                       
ACT098     EXIT.                                                        
C36013******************************************************************63030100
C36013* 9700-PROCESS-ABEND.                                            *63030200
C36013* THIS PARAGRAPH DUPLICATES THE CODE IN CPD0023C, BECAUSE        *63030300
C36013* 9700-PROCESS-ABEND IS NOT APPLICABLE TO THIS PROGRAM           *63030400
C36013*                                                                *63030600
C36013******************************************************************63030700
C36013*9700-PROCESS-ABEND.                                              63030800
C36013*                                                                 63030900
C36013*    PERFORM 9000-SEND-ERROR-RESULT THRU 9000-EXIT.                       
C36013*    PERFORM 9900-SQL-ERROR-ROUTINE THRU 9900-EXIT.                       
C36013*                                                                 63031200
C36013*9700-EXIT.                                                       63031300
C36013*    EXIT.                                                        63031400
C36013*                                                                         
