I have seen programmer often tend to get confuse between the two.We know that we can get SQLCODE -818 when the consistency token ( Placed by DB2 precompiler ) between the load module and the DBRM doesn't match.On the other hand , we get -805 when any DBRM or Package is not found in Plan which supposed to be there.
Now lets see how we resolve both the abend.
In case of -818, if we have the correct DBRM (DBRM with same consistency token as there in the load module or in other word the output DBRM from the same precompiler step from where we got our load module) then we can just bind our plan with DBRM and intern run the job with this new plan and corresponding load module.In case you don't have the correct DBRM with you, just precompile the job again create new load module( via compile, link-edit) and bind to crate new plan so you can be sure that at run time the consistency token matches.
For -805, you just see which dbrm or Package is not there in plan and include it accordingly in plan by binding it in plan.
Now the real problem is even though sometimes the particular DBRM or the Package does exist in plan we get -805. Then obvious question is why???? why am i still getting -805 in this case.
The answer is main reason for getting -805 is not just DBRM or Package not found in plan but it is
-805 DBRM OR PACKAGE NAME
location-name.collection-id.progname.
consistency -token NOT FOUND IN PLAN plan-name REASON reason
Simply stated, it means that an application program attempted to use a package
'location-name.collection-id.progname.consistency-token' that was not found.
The DBRM name ‘dbrm-name’ matched one or more entries in the package list and the search of those entries did not find the package (that is, it is present but the consistency token does not match). In this case the LOADLIB and the DBRM from which the package was created are not the same.
So you can get timestamp mismatch (consistency token mismatch ) in case of -805 also as in case of -818
The difference is if you bind a DBRM to Package and then bind that Package to Plan and consistency token doesn't match then you get -805 where as If you bind DBRM directly to Plan ( without Packaging) and then consistency token doesn't match you get -818.
Now lets see how we resolve both the abend.
In case of -818, if we have the correct DBRM (DBRM with same consistency token as there in the load module or in other word the output DBRM from the same precompiler step from where we got our load module) then we can just bind our plan with DBRM and intern run the job with this new plan and corresponding load module.In case you don't have the correct DBRM with you, just precompile the job again create new load module( via compile, link-edit) and bind to crate new plan so you can be sure that at run time the consistency token matches.
For -805, you just see which dbrm or Package is not there in plan and include it accordingly in plan by binding it in plan.
Now the real problem is even though sometimes the particular DBRM or the Package does exist in plan we get -805. Then obvious question is why???? why am i still getting -805 in this case.
The answer is main reason for getting -805 is not just DBRM or Package not found in plan but it is
-805 DBRM OR PACKAGE NAME
location-name.collection-id.progname.
consistency -token NOT FOUND IN PLAN plan-name REASON reason
Simply stated, it means that an application program attempted to use a package
'location-name.collection-id.progname.consistency-token' that was not found.
The DBRM name ‘dbrm-name’ matched one or more entries in the package list and the search of those entries did not find the package (that is, it is present but the consistency token does not match). In this case the LOADLIB and the DBRM from which the package was created are not the same.
So you can get timestamp mismatch (consistency token mismatch ) in case of -805 also as in case of -818
The difference is if you bind a DBRM to Package and then bind that Package to Plan and consistency token doesn't match then you get -805 where as If you bind DBRM directly to Plan ( without Packaging) and then consistency token doesn't match you get -818.
5 comments:
super stuffs !! Good work by Nitin Gandhi
-raja
Thanks
Hi Nitin,
Very nice posts..
Regarding -805 and -818 ...
As binding DBRM directly to PLAN is stopped DB2 ver 9/10 (as you mentioned in one of you post), we will not get -818 ever in DB2 ver9/10?
I must say that you explained it nicely.
However, in the last but 3rd para, you have mentioned that 'The DBRM name ‘dbrm-name’ matched one or more entries in the package list and the search of those entries did not find the package'.
Do you mean 'package list' correspond to 'PKLIST - Collection id', right ?
wow very well explained
Post a Comment