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
 

 

Possible causes for getting an SQLCODE of -804

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Fri Oct 21, 2011 10:02 pm    Post subject: Possible causes for getting an SQLCODE of -804
Reply with quote

What are the possible causes for getting an SQLCODE of -804.

We are executing a Embeded SQL Query repeatedly in one of our program. It was working fine in production for several years, But suddenly abended with SQLCODE -804 .

44225 records got updated and it abends in 4439th record.

When restarted the job it started from 4426th record as commit point is 25 recs and it abends again in 4439th record.

Skipped the problem record and tried, again facing same issue.

The below is the QL Quey used:

EXEC SQL
UPDATE VALTY_ADR
SET RANK_NUM = :WS-RANK-NUM
,UPDT_DT = CURRENT DATE
WHERE ACCT_NUM = :WS-SEARCH-ACCT-NUM
AND REGN_PROCS_CDE = :WS-SEARCH-REGN-PROC-CDE
AND SRCE_SYS_TYPE = :WS-SEARCH-REF-TYPE
AND ORG_CDE = :WS-SEARCH-ORG-CDE
AND SRCE_SYS_REL_CDE = :WS-SEARCH-REL-CODE
AND SRCE_SYS_SUB_NUM = :WS-SEARCH-REF-SUBNUM
END-EXEC.

Checked the I/P file as well data looks good.

Please provide solution to fix this abend.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Oct 21, 2011 10:08 pm    Post subject: Reply to: SQLCODE of -804 abend cause
Reply with quote

Quote:
What are the possible causes for getting an SQLCODE of -804.


did You care to look at the relevant manuals ?
everything is written in better style than the one You might find in a forum reply
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Fri Oct 21, 2011 10:09 pm    Post subject:
Reply with quote

Already Gone through it... it get solution... that is the reason posted in Forum.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Oct 21, 2011 10:13 pm    Post subject:
Reply with quote

lagneshp wrote:
Already Gone through it

Then you know that you have omitted a significant piece of information, without which we won't bother to try and diagnose the problem.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Fri Oct 21, 2011 10:16 pm    Post subject:
Reply with quote

The manual refers to a reason code.

This reason code points to the possible issue.

You did not provide this information.

Quote:
Please provide solution to fix this abend.


How on earth do you expect anyone to provide YOU with a solution when YOU did not provide ll the information needed?
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Fri Oct 21, 2011 10:19 pm    Post subject:
Reply with quote

I Got the below Info.. But issue didn't fix..

Please let me know if you have any suggestions.

plz read the explination it may help you
qw -804 ,gives the detailed information of the error code as below :

804 AN ERROR WAS FOUND IN THE APPLICATION PROGRAM INPUT PARAMETERS FOR THE SQL STATEMENT, REASON reason

Explanation: The call parameter list or the SQLDA is invalid.

o The call parameter list, which is created by the precompiler, might be
invalid if the application programmer has modified the output of the
precompiler, used a variable name beginning with 'SQL' in the
application program, or overwritten the call parameter list in some otherway.
o The SQLDA, which is created by the application program, has an invalid
data type or data length.

o The value of SQLDABC is not consistent with the value of SQLD.
01 Open issued for non-cursor.
02 Close issued for non-cursor.
03 Prepare of EXECUTE IMMEDIATE.
04 Statement is not recognized.
05 No statement string present.
06 Bad SQLDA format in parameter list.
07 SQLDA length is invalid.
08 Unrecognized input data type.
09 Invalid length for input variable.
10 Invalid data length for output variable.
11 The value of SQLDABC is not consistent with the value of SQLD.
12 Invalid input data pointer 13 Invalid output data pointer.
14 SQLN has too many items for SQLDABC.
15 Input RDI pointer is invalid.
16 Unrecognized output data type.
17
The value of the 7th byte of SQLDAID is not consistent with the
data types contained in the SQLDA. The SQLDA contains a LOB type host variable, but the 7th byte of SQLDAID is not set to '2' or
greater to indicate that the extended SQLVARs have been
allocated.

System Action: The statement cannot be executed.

System Programmer Response:
Examine the application program for any of the errors noted under the explanation above. In general, the application programmer should not attempt to modify the output of the precompiler.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Fri Oct 21, 2011 10:21 pm    Post subject:
Reply with quote

So which reason code did you get?
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Fri Oct 21, 2011 10:23 pm    Post subject:
Reply with quote

The Reason Code .. got is 06.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Oct 21, 2011 10:54 pm    Post subject:
Reply with quote

Well, then, the answer is obvious: one of you software engineers corrupted the output of the precompiler, wittingly or otherwise. Since getting information out of you is like unto pulling teeth, it was probably done as an attempted shortcut to something else, and you and your buddies are now sweating bullets, trying to fix the problem without admitting that its your fault, or even that there is one.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 21, 2011 10:57 pm    Post subject:
Reply with quote

Hello,

Now that you know the 06 is caused by a bad parameter list, have you looked at the generated code to see if anything is wrong?

If the generated code is correct (and it probably is because it works thousands of times before failing), you probably have your own code that is "walking on" your working storage. Does this program have any arrays?

Just because some code ran for years does not mean that the code did not have errors - they just haven't been discovered.
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Thu Oct 27, 2011 7:20 pm    Post subject:
Reply with quote

Hi .......

Some home we managed to run the Job by modified th I/P data in a such a way that not to execute that Particular query and completed the Job.

But the same Job Ran fine from next day onwards which has the data which will execute that particular query which causes the issue.

This is one of the unknown Mystery i have seen in DB2 which fix by itself..
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 27, 2011 8:08 pm    Post subject: Reply to: SQLCODE of -804 abend cause
Reply with quote

You really have to fix this. There was an error which caused a problem that day which caused an Abend. Maybe every other day it is causing a problem you are not aware of, but just not going far enough to cause an abend.

Did you investigate the suggestions made earlier? If you are "walking on" your code as Dick points out as a possibility, then maybe with that input it just happened to "walk" far enough to cause the Abend, whereas normally it is just a short stroll doing something more subtle.

My advice is to not leave a problem unresolved. You can very easily regret it later, when you discover that you could have saved six months of backout when you eventually find the problem for some other reason.

Get the same set-up in an environment where you can "play" with it. Recreate the error. Then track it down.

If your boss doesn't like this idea, CYA with a memo/e-mail so it is not your nuts on the line sometime in the future. Be diplomatic, don't send it until he's seen it, but CYA.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 28, 2011 5:40 am    Post subject:
Reply with quote

Hello,

Quote:
This is one of the unknown Mystery i have seen in DB2 which fix by itself..
Neither db2, cics, cobol, or anything else "fixes itself". Just because the problem did not happen again immediately, does not mean any "fixing" has happened. The problem (possibly a combination of unexpected data and bad code) is there waiting to fail.

When the same situation occurs again, the problem will occur again.

What you post shows it that there are probably several time bombs luring in the code that will cause problems again. . . I say this because if there have been "other things" db2 fixed by itself, each is probably gong t fail again. This points to a larger problem that code is not thoroughly tested. Possibly only testing situations that are supposed to happen, not when there are inconsistencies. . .
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am
No new posts -81 SQLCODE returned when Remote Stor... kameswaramanoj.Akella DB2 1 Wed Dec 03, 2014 5:36 am


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