Page 1 of 1

BIND Error -408

PostPosted: Tue Jul 12, 2011 9:37 am
by Quasar
Hi friends -

I am trying to promote a package, in Changeman. The package has a program with embedded SQL in it. This program executes a SQL Query to fetch data from a PAYMENT_TB DB2 Table.

Here's the FETCH using the cursor -

Fetch from PAYMENT_TB Using Cursor
EXEC SQL                                   
   FETCH PAYMENT-TRANS                     
      INTO :PAY-BENE-SERIAL-NBR           
                ,:PAY-ROLE-CDE             
                ,:PAY-PYMNT-CTR           
                ,:PAY-GAC-NBR             
                ,:PAY-EVENT-CDE           
                ,:PAY-BRANCH-CDE           
                ,:PAY-ACCOUNTING-TYP       
                ,:PAY-FREQ-CDE             
                ,:PAY-AX-CDE               
                ,:PAY-AX-AMT               
                ,:PAY-EFF-DTE             
                ,:PAY-PAY-BC-POSTING-DTE   
                ,:PAY-APRV-CD:NULL-IND     
                ,:PAY-CTS-OPER-ID         
  END-EXEC.


After fetching the data, I just add +1 to the PYMNT_CTR, and insert the same row back into the table.

ADD +1 TO PAY-PYMNT-CTR


Insert a new row into the table
EXEC SQL                             
INSERT INTO PAYMENT_TB               
VALUES                               
      (:PAY-BENE-SERIAL-NBR         
      ,:PAY-ROLE-CDE                 
      ,:PAY-PYMNT-CTR               
      ,:PAY-GAC-NBR                 
      ,:PAY-EVENT-CDE               
      ,:PAY-BRANCH-CDE               
      ,:PAY-ACCOUNTING-TYP           
      ,:PAY-FREQ-CDE                 
      ,:PAY-AX-CDE                   
      ,:PAY-AX-AMT                   
      ,:PAY-PAY-BC-POSTING-DTE       
      ,:PAY-APRV-CD:NULL-IND                         
      ,:PAY-CTS-OPER-ID)             
 END-EXEC


Now, during promotion of the package, Changeman performs a DB2 BIND, where I am getting a -408 SQLCODE.

DSNT233I  -FDSN UNSUCCESSFUL BIND FOR                                           
           PACKAGE = RISCTEST.T0828_P_CICS.F0828D16.(CTTS003838)               
DSN                                                                             
BIND PACKAGE       (F0828_T_CICS)      OWNER         (F0828DBA)      QUALIFIER 
DATE      (BIND)      ISOLATION     (CS)      ENABLE        (*)      CURRENTDATA
  (1)      FLAG          (I)      SQLERROR      (NOPACKAGE)      EXPLAIN       (
DSNX200I  -FDSN BIND SQL ERROR                                                 
           USING F0828DBA AUTHORITY                                             
           PLAN=(NOT APPLICABLE)                                               
           DBRM=F0828D16                                                       
           STATEMENT=1677                                                       
           SQLCODE=-408                                                         
           SQLSTATE=42821                                                       
           TOKENS=APRV_CD                                                       
           CSECT NAME=DSNXOCAS                                                 
           RDS CODE=-100                                                       


The bad SQL CODE is with APRV_CD Column. Its a column which may contain NULL Values. So, I have included NULL-IND. The APRV_CD is CHAR(01), and the cobol variable PAY-APRV-CD is a PIC X(01). I am not able to understand what's wrong then. -408 SQLCODE explanation says, error in assigning a value. Doesn't give me sufficient hint.

Please help.

Re: BIND Error -408

PostPosted: Tue Jul 12, 2011 10:14 am
by Quasar
Well, I got it, I missed out coding one of the Columns EFF_DATE in the INSERT, and hence, an incorrect value was getting assigned to the APRV_CD Column. Here's the correct INSERT -

INSERT INTO PAYMENT_TB                 
VALUES(                                 
       :PAY-BENE-SERIAL-NBR             
            ,:PAY-ROLE-CDE             
            ,:PAY-PYMNT-CTR             
            ,:PAY-GAC-NBR               
            ,:PAY-EVENT-CDE             
            ,:PAY-BRANCH-CDE           
            ,:PAY-ACCOUNTING-TYP       
            ,:PAY-FREQ-CDE             
            ,:PAY-AX-CDE               
            ,:PAY-AX-AMT               
            ,:PAY-EFF-DTE               
            ,:PAY-PAY-BC-POSTING-DTE   
            ,:PAY-APRV-CD:NULL-IND     
            ,:PAY-CTS-OPER-ID)         
 END-EXEC