IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE -401 during BIND


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mfhelp
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 33

PostPosted: Wed Nov 29, 2006 12:17 pm
Reply with quote

I am getting -401 Error during bind operation which means operand used in comparison not compatible. How can I come to know which statement caused this error. There are many SQLs used in my prog. Is there any precompiler option which will list all the SQL statments with the line no so that i can trace the problematic one.
Back to top
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Wed Nov 29, 2006 9:48 pm
Reply with quote

Can you put your bind card here.

-401 means

Code:

 -401   THE OPERANDS OF AN ARITHMETIC OR COMPARISON OPERATION ARE NOT         
        COMPARABLE                                                           
                                                                             
 Explanation:  An arithmetic operation appearing within the SQL statement     
 contains a mixture of numeric and non-numeric operands, or the operands of   
 a comparison operation are not compatible.                                   
                                                                             
 One reason for this error is that a field procedure exists on one of the     
 columns. If one column of arithmetic or comparison operation is defined     
 with a field procedure, other columns in the operation must be defined       
 with the same field procedure.                                               
                                                                             
 System Action:  The statement cannot be executed.                           
                                                                             
 Programmer Response:  Check the data types of all operands to ensure that   
 their data types are comparable and compatible with their usage in the       
 statement.                                                                   
                                                                             
 If all the operands of the SQL statement are correct, then, if a view is     
 being accessed, check the data types of all the operands in the view         
 definition.                                                                 
                                                                             
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Thu Nov 30, 2006 8:22 pm
Reply with quote

hello,

Finding any SQL error in DB2 cobol/Pl1 any lang for that reason

1. See the bind step in detail, to find the satement number where the SQLcode is negative.

2. Then in the (note this) modified program, you need to search for that number.

3. Scroll to the 01 level and find for that variable.

4. You can find where the error has occured, and try to slove it.

I feel your's error is due to pic clause.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts JCL for pl1 db2 precompile, compile a... JCL & VSAM 4
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
Search our Forums:

Back to Top