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
 

 

Consistency Token Not found in Load Module !

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Wed Jun 06, 2012 9:47 am    Post subject: Consistency Token Not found in Load Module !
Reply with quote

During run time both consistency token will be compared,But i did't found Consistency Token in Load Module where as i found Consistency token in DBRMLIB & SYSIBM.SYSPACKAGE.

Now as per the DB2 theory its saying run time Cosistency token will be matched from Load lib and SYSIBM.SYSPACKGE (Consistency Token extracted from DBRM and stored in SYSIBM.SYSPACKGE)

My question is if Consistency token is not found in LOADMODULE then how it will compare during run time to ensuer both belongs to same source

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

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jun 06, 2012 10:56 am    Post subject:
Reply with quote

My questions

1.Did you execute your program?
2.Whats the SQL code you got after execution?
3.Is this just before very first run or is this program getting executed with the same load even before?
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Wed Jun 06, 2012 11:26 am    Post subject:
Reply with quote

The consistency token within the load module is stored slightly different to the DB2 catalog or the DBRM.
If for example the DB2 catalog has X'18111A4611239DE8' as consistency token, you have to split this data right in the middle and switch the two parts to build the string that you'll find in the load module.
In this example, split the token into X'18111A46' and X'11239DE8' and put them together again in reverse order, so it will be X'11239DE818111A46'.
You will find this token in the load module.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Wed Jun 06, 2012 7:43 pm    Post subject:
Reply with quote

Stefan, do you know if that is universal, or language-dependent? I know that Cobol does it that way, but I am not sure about other languages.

And, many years ago, OS/VS Cobol did not flip the contoken the way you described. I remember being surprised when I first saw the flipping behavior, but now it seems normal. The change in behavior broke an old tool of mine that used to search load modules for DBRM contokens.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Fri Jun 08, 2012 12:19 pm    Post subject:
Reply with quote

Don, I was not aware of the fact that it is compiler-dependent. I checked a PL/I load module now. It seems you are right. The consistency token mentioned in the DB2 catalog appears in the load module WITHOUT any change. So obviously the COBOL compiler does the trick with interchanging the two halfs of the token.

As I haven't found any documentation about this oddity, I have no clue about how other compilers work.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Jun 08, 2012 5:42 pm    Post subject:
Reply with quote

It's probably not documented because, to the Cobol compiler, there is nothing special about the consistency token: it is just another literal in the program.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 08, 2012 7:02 pm    Post subject:
Reply with quote

the pre-compiler (which is language dependent) generates the consistancy token.

pl1 generates a 'straight' token for both load and dbrm.
cobol has the halved/reversed
c has a quarters reversed.

so, i guess one would need to look at the documentation for pre-compilers.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 20, 2012 8:04 am    Post subject:
Reply with quote

Stephan already explained about the consistancy token.

here is another explanation of finding consistancy token in COBOL load
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Wed Jun 20, 2012 5:49 pm    Post subject:
Reply with quote

To figure out where the consistency token comes from, first look at your compiler listing:
Code:
01 SQL-PLIST8.                                           
   05 SQL-PLIST-CON   PIC S9(9) COMP-4 VALUE +2654208.   
   05 SQL-CALLTYPE    PIC S9(4) COMP-4 VALUE +30.       
   05 SQL-PROG-NAME   PIC X(8)         VALUE 'PXXXAM  '.
   05 SQL-TIMESTAMP-1 PIC S9(9) COMP-4 VALUE +370984864.
   05 SQL-TIMESTAMP-2 PIC S9(9) COMP-4 VALUE +414679900.


If you convert SQL-TIMESTAMP-1 and SQL-TIMESTAMP-2 to hex and concatenate them together, you get a string that looks like a consistency token:

SQL-TIMESTAMP-1 = X'161CC7A0'
SQL-TIMESTAMP-2 = X'18B7835C'

These hex strings appear in the DBRM text and in the CONTOKEN column of SYSIBM.SYSPACKAGE in the order shown above.

In the load module, as has been mentioned, the strings also appear, but SQL-TIMESTAMP-2 appears before SQL-TIMESTAMP1. This is entirely due to how the Cobol compiler chooses to store literal values. Also as mentioned, other languages follow their own rules.

If you go back to the compiler listing, you will also see that SQL-TIMESTAMP-1 and SQL-TIMESTAMP-2 appear several times in the Data Division. In each case the value is exactly the same. Why then don't you see these values several times in the load module?

The reason is that the Cobol compiler stores only one instance of a literal value in the object code. This is more efficient than storing multiple copies of the same value in several places.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts How to get the program name of callin... pkmurali COBOL Programming 8 Mon Aug 01, 2016 3:36 am


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