MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bind failed for integer column.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
EugeneE
Beginner


Joined: 24 Apr 2005
Posts: 8
Topics: 3

PostPosted: Wed Apr 27, 2005 6:43 pm    Post subject: Bind failed for integer column. Reply with quote

Hi,

We are trying to insert a record from the flat file into DB2 table using Cobol program. The bind step fails for the column ERROR_CD defined on the table as INTEGER.
Code:

DSNX200I  .ZT01 BIND SQL ERROR       
           USING VMFDB2T AUTHORITY   
           PLAN=(NOT APPLICABLE)     
           DBRM=VFSB983               
           STATEMENT=993             
           SQLCODE=-408               
           SQLSTATE=42821             
           TOKENS=ERROR_CD           
           CSECT NAME=DSNXOCAS       
           RDS CODE=-100             
DSNT233I  .ZT01 UNSUCCESSFUL BIND FOR 

The insert statement
      EXEC SQL                         
          INSERT INTO MFB_BALANCE_BO   
            ( CUSIP                     
             ,SBS_ACCOUNT               
             ,ERROR_DTE                 
             ,SB_ACCOUNT               
             ,ERROR_CD
             ,FUND_QTY                 
             ,ST_QTY                   
             ,SW_QTY                   
             ,SD_QTY                   
             ,EXPOSURE_QTY             
             ,REASON_DESC               
             ,ERROR_DAYS               
             ,SECURITY_DESC             
             ,PRICE                     
             ,FUND_FAMILY               
             ,CATEGORY                 
             ,DIFFERENCE_QTY           
             ,MFB_CODE                 
             ,CREATE_DTE                     
             ,SBSCKD                         
             ,SBSTYP                         
             ,SYMBOL)                       
       VALUES                           
        (:MFB-CUSIP                     
        ,:MFB-SBS-ACCOUNT               
        ,:WS-ERROR-DATE                 
        ,:MFB-SB-ACCOUNT                 
        ,:WS-TEST
        ,:DCLMFB-BALANCE-BO.FUND-QTY     
        ,:DCLMFB-BALANCE-BO.ST-QTY       
        ,:DCLMFB-BALANCE-BO.SW-QTY       
        ,:DCLMFB-BALANCE-BO.SD-QTY       
        ,:DCLMFB-BALANCE-BO.EXPOSURE-QTY
        ,:MFB-REASON-DESC               
        ,:DCLMFB-BALANCE-BO.ERROR-DTE   
        ,:MFB-SECURITY-DESC             
        ,:DCLMFB-BALANCE-BO.PRICE       
        ,:MFB-FUND-FAMILY                 
        ,:DCLMFB-BALANCE-BO.CATEGORY       
        ,:DCLMFB-BALANCE-BO.DIFFERENCE-QTY
        ,:DCLMFB-BALANCE-BO.MFB-CODE       
        ,:DCLMFB-BALANCE-BO.CREATE-DTE     
        ,:MFB-SBSCKD                       
        ,:MFB-SBSTYP                       
        ,:WS-SYMBOL)                       
  END-EXEC                                 


Corresponding host variable WS-TEST defined in working storage
01 WS-TEST PIC S9(9) USAGE COMP.

We are running out of ideas. Please help.

Thank you
Back to top
View user's profile Send private message
bullfighter
Beginner


Joined: 15 Apr 2005
Posts: 26
Topics: 9

PostPosted: Wed Apr 27, 2005 6:54 pm    Post subject: Reply with quote

declare WS-TEST PIC as PIC S9(9)V USAGE COMP-3

try this and let me know if this does not work..

thanks,
Back to top
View user's profile Send private message
EugeneE
Beginner


Joined: 24 Apr 2005
Posts: 8
Topics: 3

PostPosted: Wed Apr 27, 2005 8:35 pm    Post subject: Reply with quote

Thank you bullfighter.

Will try tomorrow morning. Do not have access to mainframe at this time.

Regards,
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Thu Apr 28, 2005 7:20 am    Post subject: Reply with quote

EugeneE,
The ERROR_CD looks ok, check beyond that, from FUND-QTY. What is the reference for ",:DCLMFB-BALANCE-BO." this does not look ok. Why would you need the reference ? or post the complete SQL. Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Apr 28, 2005 7:37 am    Post subject: Reply with quote

EugeneE,

Are you sure that the column ERROR_CD defined on the table is INTEGER? Also make sure that you are referencing the right table name.

bullfighter,

Why would you want it to change a integer column to Decimal column? A comp-3 is a decimal column. A DB2 integer column is equivalent to S9(09) comp field in cobol.

Sureshkumar,

Eugene is having a problem with ERROR_CD as you can see that in error message.
Code:

STATEMENT=993             
SQLCODE=-408               
SQLSTATE=42821             
TOKENS=ERROR_CD           


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
EugeneE
Beginner


Joined: 24 Apr 2005
Posts: 8
Topics: 3

PostPosted: Thu Apr 28, 2005 8:43 am    Post subject: Reply with quote

Hi Kolusu,

Here is the dclgen

Code:

      ******************************************************************       
      * DCLGEN TABLE(MFB_BALANCE_BO)                                   *       
      *        LIBRARY(DB2TEST.DCLGEN.VMFDB2T(MFBALBO))                *       
      *        ACTION(REPLACE)                                         *       
      *        LANGUAGE(COBOL)                                         *       
      *        QUOTE                                                   *       
      * ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS   *       
      ******************************************************************       
           EXEC SQL DECLARE MFB_BALANCE_BO TABLE                               
           ( CUSIP                          CHAR(9) NOT NULL,                   
             SBS_ACCOUNT                    CHAR(8) NOT NULL,                   
             ERROR_DTE                      TIMESTAMP NOT NULL,                 
             SB_ACCOUNT                     CHAR(9) NOT NULL,                   
             ERROR_CD                       INTEGER NOT NULL,                   
             FUND_QTY                       DECIMAL(18, 4) NOT NULL,           
             ST_QTY                         DECIMAL(18, 4) NOT NULL,           
             SW_QTY                         DECIMAL(18, 4) NOT NULL,           
             SD_QTY                         DECIMAL(18, 4) NOT NULL,           
             EXPOSURE_QTY                   DECIMAL(18, 4) NOT NULL,           
             REASON_DESC                    CHAR(10) NOT NULL,                 
             ERROR_DAYS                     INTEGER NOT NULL,                   
             SECURITY_DESC                  CHAR(30) NOT NULL,                 
             PRICE                          DECIMAL(7, 4) NOT NULL,             
             FUND_FAMILY                    CHAR(3) NOT NULL,                   
             CATEGORY                       INTEGER NOT NULL,                   
             DIFFERENCE_QTY                 DECIMAL(18, 4) NOT NULL,           
             MFB_CODE                       INTEGER NOT NULL,                   
             CREATE_DTE                     TIMESTAMP NOT NULL,                 
             SBSCKD                         CHAR(1) NOT NULL,                   
             SBSTYP                         CHAR(1) NOT NULL,                   
             SYMBOL                         CHAR(5) NOT NULL                   
           ) END-EXEC.                                                         
      ******************************************************************       
      * COBOL DECLARATION FOR TABLE MFB_BALANCE_BO                     *       
      ******************************************************************       
       01  DCLMFB-BALANCE-BO.                                                   
           10 CUSIP                PIC X(9).                                   
           10 SBS-ACCOUNT          PIC X(8).                                   
           10 ERROR-DTE            PIC X(26).                                   
           10 SB-ACCOUNT           PIC X(9).                                   
           10 ERROR-CD             PIC S9(9) USAGE COMP.
           10 FUND-QTY             PIC S9(14)V9(4) USAGE COMP-3.               
           10 ST-QTY               PIC S9(14)V9(4) USAGE COMP-3.               
           10 SW-QTY               PIC S9(14)V9(4) USAGE COMP-3.               
           10 SD-QTY               PIC S9(14)V9(4) USAGE COMP-3.               
           10 EXPOSURE-QTY         PIC S9(14)V9(4) USAGE COMP-3.               
           10 REASON-DESC          PIC X(10).                                   
           10 ERROR-DAYS           PIC S9(9) USAGE COMP.                       
           10 SECURITY-DESC        PIC X(30).                                   
           10 PRICE                PIC S9(3)V9(4) USAGE COMP-3.                 
           10 FUND-FAMILY          PIC X(3).                                   
           10 CATEGORY             PIC S9(9) USAGE COMP.                       
           10 DIFFERENCE-QTY       PIC S9(14)V9(4) USAGE COMP-3.               
           10 MFB-CODE             PIC S9(9) USAGE COMP.                       
           10 CREATE-DTE           PIC X(26).                                   
           10 SBSCKD               PIC X(1).                                   
           10 SBSTYP               PIC X(1).                                   
           10 SYMBOL               PIC X(5).                                   
      ******************************************************************       
      * THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 22      *       
      ******************************************************************     


Thank you
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Apr 28, 2005 9:09 am    Post subject: Reply with quote

EugeneE,

Is WS-ERROR-DATE field defined as PIC X(26) since it is a time stamp field. If you defined it as only 10 bytes you are going to have a problem

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Thu Apr 28, 2005 12:09 pm    Post subject: Reply with quote

Kolusu,
I still feel its the reference to "DCLMFB-BALANCE-BO.FUND-QTY " that may be the cause. Why would we build a reference if the table is not being referenced in the same sql statement. Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Apr 28, 2005 1:27 pm    Post subject: Reply with quote

Quote:

I still feel its the reference to "DCLMFB-BALANCE-BO.FUND-QTY " that may be the cause. Why would we build a reference if the table is not being referenced in the same sql statement.


Suresh kumar,

May be there is another table with same column name FUND-QTY which is being used in the same program. In that case he needs to reference the column with the right qualifier.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
EugeneE
Beginner


Joined: 24 Apr 2005
Posts: 8
Topics: 3

PostPosted: Sat Apr 30, 2005 7:53 am    Post subject: Reply with quote

Hi Guys,

I greatly appreciate your help. Somehow the problem disappeared. In the matter of fact, it is a web Java application with the mainframe DB2 on the backend. I am a web programmer and lead this project. Therefore I do not know all the details, how my mainframe programmers finally solved this. Embarassed

Again, thank you very much for your incredible help. You are doing a great job here.

Best Regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group