Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQLCODE -401 during BIND

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
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    Post subject: SQLCODE -401 during BIND
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    Post subject: Re: SQLCODE=-401 during BIND
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    Post subject: Re: SQLCODE=-401 during BIND
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    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What's plan, package, bind ? jackzhang75 DB2 2 Sun Feb 28, 2016 7:29 pm
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts What is Bind Error? Chetan Kumar Mainframe Interview Questions 1 Fri Oct 16, 2015 7:00 pm
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us