My program is receiving SQL CODE = 514 and I don't know what should to do, in my program I have used dynamic sql to fetching the data from table, also the select statement and the Where clause are in their variables compile, link, edit and bind return code are "0" but the sql code is 514 in run time.

As you have toled, I 've checked the SQL code after every SQL statment,
so the SQL code after prepare is 311 SQLCODE -311, Error: THE LENGTH OF INPUT HOST VARIABLE NUMBER IS NEGATIVE OR GREATER THAN THE MAXIMUM
But I don't know what dose it mean when it says MAXIMUM.
also this is a piece of real code which I've sent.

Then this should have been in the post. Copy/paste is far better than picking and choosing some parts of the info to type in with different names, missing code, etc.

One you have an error, it is best to solve that error rather than letting the code and trying to diagnose something that fails later in the code due to the already known error. As far as getting help from the forum, we can't do much if the real/first error is not the one posted. It just wastes time until the actual problem is posted and resolved.