Here is a bit more information about what is going on...
Question:
Is there a way to extract the DB2 consistency token (CONTOKEN) from a COBOL program object (V5.1+)?
Answer:
Presently, there is no solution. As mentioned in the previous reply, there is an enhancement request opened with the DB2 Support team to provide an interface module to obtain this for all programming languages/versions. See https://ibm-data-and-ai.ideas.aha.io/ideas/DB24ZOS-I-1074 . Because the internal layout of program objects is proprietary and can change without notice, customers should avoid trying to implement their own method to obtain the consistency token.
Basically, if the executable is a load module (usually a PDS member), the consistency token information is fixed and obtainable. That is why customers were able to extract it for COBOL V4.2. But if the executable is a program object (PDSE - used in COBOL V5+), not only is the consistency token not in a fixed position, but also the way it is stored varies by programming language. The layout of a load module hasn't changed in forever, but IBM holds the internal layout of a program object close to their chest (proprietary) so that they can change it at will without affecting customers. IBM doesn't want customers trying to reverse-engineer a program object to extract something from it. That is why some sort of DB2 module/API that can be dynamically called to obtain the consistency token is the only solution that is feasible. But in the mean time, it has left some or our customers with a validation gap in their processes. Feel free to get the word out for folks to vote for the enhancement request.
------------------------------
Terri Menchak
------------------------------
Original Message:
Sent: Mon May 03, 2021 06:43 AM
From: Priyadarasini Esvar
Subject: Cobol Precompiler contoken pattern in cobol 6.2
Hi -
We are trying to compile all our cobol db2 modules in our application under 6.2.
Usually the contoken pattern between DBRMLIB and LINKLIB will be in reverse of first 8 digits in Cobol l compile
version 4.2 . But we are not seeing a same consistency token pattern found(no reverse) in both DBRM and Load module.
Is this a change in Cobol 6.2 compiler version upgrade. Please clarify.
------------------------------
Thanks -
Priyadarasini Esvar
Mainframe technical manager.
------------------------------