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

Regarding Sqlcode -818


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suthandira

New User


Joined: 06 Apr 2005
Posts: 10

PostPosted: Fri Apr 08, 2005 12:17 pm
Reply with quote

Hi,

In Which Situation -818 will occur? How to rectify that?

Thanks in advance.

Devi.
Back to top
View user's profile Send private message
Niteshs

New User


Joined: 24 Mar 2005
Posts: 6

PostPosted: Fri Apr 08, 2005 12:23 pm
Reply with quote

Its a timestamp mismatch .please precomplie,link edit and re bind the program once again
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Fri Apr 08, 2005 12:29 pm
Reply with quote

Hi Suthandira,

When the DB2 COBOL program is run then during runtime the load module starts up and hits all the SQL codes calls in the cobol program which were separated at the time of precompiling. And this Call invokes the COBOL-DB2 interface program, which connects to DB2.If the runtime code necessary to execute your SQL isn't currently resident inside the DB2, then it will go to the buffer pool assigned to DB2 directory and look collections named in the PLAN for the package with the same name.

IF you don;t find it there also then you will get -818 error code and sometimes -805 code also.

To rectify this you should confirm that the SQL code written in the cobol program is resident inside the DB2 or not..i.e. you should confirm this during precompilation that whether it is done properly or not.
Back to top
View user's profile Send private message
Suthandira

New User


Joined: 06 Apr 2005
Posts: 10

PostPosted: Fri Apr 08, 2005 12:39 pm
Reply with quote

Hi Aishwarya,

Thanks , but

I read from one material as follows

When -818 occurs u have to supply the foll query


Select hex(contoken) from sysibm.syspackage


where package name = 'name'.

But after this what i have to do?
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Fri Apr 08, 2005 12:51 pm
Reply with quote

Yes, in the package only the SQL code information+ access path will be avalable so you have to supply this and run the program again.

Please tell anybody if this is right.
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Fri Apr 08, 2005 2:05 pm
Reply with quote

Sorry,This is the exact answer for SQLcode-818. It means that the consistency token in the DBRM and Loadmodule are different. hence for resolving that you have to precompile again the program and then compile and run.I suppose the consistency token is related to the TIMESTAMP which may be different.
Back to top
View user's profile Send private message
Pushpak

New User


Joined: 06 May 2005
Posts: 18

PostPosted: Tue May 17, 2005 3:58 pm
Reply with quote

Hi

-818 - Means timestamp mismatch. CONTOKEN for your DBRM is not matching with the CONTOKEN generated by precompiler.

If your package is directly taggling with plan & you are very sure that u have compiled your package properly, then u have to use correct DB2 load library in your jcl to resolve -818.

One very comman reason of -818 is "Attempting to run against a test
subsystem, using the prod ligrary, or vice versa."

If you are using Package - Collection - Plan concept .. then there might be different soln to resolve -818 / -805

Pushpak
Back to top
View user's profile Send private message
Pushpak

New User


Joined: 06 May 2005
Posts: 18

PostPosted: Tue May 17, 2005 4:51 pm
Reply with quote

Hi,

Please also check out link

ibmmainframes.com/viewtopic.php?t=2535&highlight=bind"

for more info of -818.

Pushpak.
Back to top
View user's profile Send private message
Ganesh K Rajan

New User


Joined: 13 May 2005
Posts: 7

PostPosted: Wed May 18, 2005 12:58 pm
Reply with quote

Reason of this Error:

THE PRECOMPILER GENERATED TIMESTAMP x IN THE LOAD MODULE IS DIFFERENT FROM THE BIND TIMESTAMP y BUILT FROM THE DBRM z

Description :

The SQL precompiler places timestamp 'y' in the DBRM, and time stamp 'x' in the parameter list in the application program for each SQL statement. At BIND time, DB2 stores the DBRM timestamp for run time use. At run time, timestamp 'x', for the SQL statement being processed,is compared with timestamp 'y' derived from the DBRM 'z' at BIND time. If the two timestamps do not match, the DBRM and the application program were not the result of the same precompile. This problem can occur if you: * Precompile, compile, and link, without doing a BIND of the application, * Precompile and BIND, without doing the compile and link for the application program, or * BIND the application using a DBRM that resulted from a different precompile of the application program than that which produced the object module that is linked into the application module. The timestamps 'x' and 'y' are DB2 internal timestamps. They do not have an external interpretation.

Action to Over come this Error:

BIND the application again, using the DBRM for the application program that matches the object module.

Rgs,
Ganesh
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 -> DB2

 


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 Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
No new posts Getting sqlcode 805 while executing R... DB2 10
Search our Forums:

Back to Top