MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 timestamp question

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
abhayasahoo
Beginner


Joined: 04 Dec 2002
Posts: 8
Topics: 6

PostPosted: Sat Dec 07, 2002 3:36 pm    Post subject: DB2 timestamp question Reply with quote

Many times, we get an SQLCODE of -805 or-818 on BIND. Is there a way we can find the date and time from the CONTOKEN stored in DB2 catalog ?
For example, can we decode the CONTOKEN 170A36060594C259 in YYYY-MM-DD-HH.MM.SS.NNNNNN format ? This will help us in finding out when the load module was created and when the package was created.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sat Dec 07, 2002 5:26 pm    Post subject: Reply with quote

abhayasahoo,

The SQL precompiler(the first step in preparing an application program) 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 which will result in -818,when the program execuetes.Timestamps 'x' and 'y' are DB2 internal timestamps.They do not have an external interpretation.

check here for a rexx routine which will convert the contoken into a displayable timestamp. The time is based on the STCK so does not include leap second or GMT offset considerations. It can be usefull in determining when the failing program was pre-compiled.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeev_jha
Beginner


Joined: 20 Dec 2002
Posts: 5
Topics: 0

PostPosted: Fri Dec 20, 2002 4:46 am    Post subject: Reply with quote

In case you do not have Platinum you can find it using SPUFI. Execute the following query

SELECT * FROM SYSIBM.SYSPLAN WHERE NAME = 'plan name';
SELECT * FROM SYSIBM.SYSDBRM WHERE PLNAME = 'plan name';

These two queries will give you the BIND and PRECOMP date/time which you can use to compare with the load modules

thanks
Rajeev
Back to top
View user's profile Send private message
ST
Beginner


Joined: 04 Jan 2003
Posts: 24
Topics: 12

PostPosted: Sat Jan 04, 2003 5:38 pm    Post subject: Reply with quote

Kolusu,
Thx for ur info reg Timestamps...But When we get Timestamp mismatch how do we fix that?

Suppose after the BIND,if the pgm is abended then do we really need to start from PRECOMPILE again? if not if we just REBIND the program then obviously we get TIMESTAMP mismatches I think..Correct me if am wrong and pls let me know the solution..

Thanks,
ST
Back to top
View user's profile Send private message
Rajeev_jha
Beginner


Joined: 20 Dec 2002
Posts: 5
Topics: 0

PostPosted: Sun Jan 05, 2003 11:42 pm    Post subject: Reply with quote

Once you get the precompile time from the catalog table(SYSIBM.SYSDBRM) try to find out the compile time from your load module. There can be any one of the following reasons

1) your load library name in your JCL can be wrong may be some old library

2) the DBRM library that you have used to BIND the plan can be wrong, not the one where your DBRM was generated at the compile time

3) Or may be you have not actually done the BIND

After you know what your problem is you can just change the load module name or the DBRM library name and BIND the program
Back to top
View user's profile Send private message
pravinba
Beginner


Joined: 05 Apr 2007
Posts: 4
Topics: 1

PostPosted: Thu Sep 27, 2007 5:21 am    Post subject: Specific Doubts on Plan consistency check Reply with quote

Hi,

I have read through the entire conversation on db2 timestamp and consistency token stuff.

1) It all falls in place when we consider the case where we bind our programs to a package (since its 1:1 relationship between package and program). In this case, there is only one timestamp involved (ie) only one program is involved.
Eg.,
DSN SYSTEM(XXXX)
BIND PACKAGE (PACKAGE1) -
MEMBER (PROGRAM1) -
ACTION (REPLACE) -
VALIDATE (BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
LIBRARY ('U99999.DEV.DBRMLIB')

2. When you bind program(s) to a single PLAN, its a N to 1 relationship. Each program might have a unique timestamp engraved on it when compiled.(assume that each program was compiled separately).

For eg.,
After precompile each program would have different timestamps
ProgA
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group