View previous topic :: View next topic |
Author |
Message |
edkir98 Beginner
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Fri Mar 28, 2008 10:01 am Post subject: Question regarding Collection IDs |
|
|
I have a program A which is under two different collection IDs C1 and C2. All the timestamp/Concurrency tokens are the same. If When I execute this program which collection ID will my program refer?
For example
There are two concurrent applications using this same program A. A is defined under the first application schema with collection ID C1 and it is defined under the second application schema with collection ID C2. When I execute which collection ID will it refer? _________________ Thanks |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Mar 31, 2008 7:09 am Post subject: |
|
|
Hello Edward,
you execute your application programs under a DB2 plan. In this plan you concatenate collection ids, and the package used during program execution will be the first occurance with the appropriate timestamp/consistency token in this list of collection ids.
regards
Christian |
|
Back to top |
|
|
edkir98 Beginner
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Mon Mar 31, 2008 8:41 am Post subject: Re |
|
|
Chris
My question was different.
Consider this example:
Suppose we have one set of tables for one group of clients, and another set of tables for another group of clients. The high-level qualifiers used for the two sets of tables are GROUP1 and GROUP2 , respectively. In such a case we can set up two collections, also called GROUP1 and GROUP2 . All programs use unqualified table names in SQL statements (that is to say, you have SELECT COL1 FROM EMPLOYEE instead of having SELECT COL1 FROM GROUP1.EMPLOYEE ). Every program is bound into each of the two collections. When binding program PROGXYZ into collection GROUP1 , we specify that GROUP1 is to be used as the high-level qualifier for unqualified table names (this is accomplished by specifying QUALIFIER(GROUP1) on the BIND PACKAGE command). When binding the same program into the GROUP2 collection, we specify QUALIFIER(GROUP2) on the BIND PACKAGE command.
How will I differentiate the two collection IDs and make the program execute for the two different tables simultaneously? _________________ Thanks |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Tue Apr 01, 2008 2:50 am Post subject: |
|
|
Hello Edward,
in our shop we use two different DB2 plans for this purpose.
The other alternative is to set the variable CURRENT PACKAGESET in your program, probably reading the appropriate collection name during program start. With this register set only the named collection is considered during program execution time.
But using this you have to fiddle with the program code, so to my eyes, the usage of different plans (one for each table qualifier) is preferable.
regards
Christian |
|
Back to top |
|
|
RMi Beginner
Joined: 21 Jun 2006 Posts: 8 Topics: 0 Location: India
|
Posted: Wed Apr 02, 2008 4:03 am Post subject: |
|
|
Hello Edward,
As Christian said, you will have to go for CURRENT PACKAGESET if you have only one plan for both the groups. I would say that it is better to have a wrapper program for all your batch programs which will do the packagesetting, rather than coding it in all the programs. For online programs, you will have to have it in all the programs or a subprogram which does packageset.
Regards,
RMi |
|
Back to top |
|
|
edkir98 Beginner
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Wed Apr 02, 2008 6:32 am Post subject: |
|
|
Hi RMI and Christian
I can understand what you say. But how is that we'll pass a parameter for CURRENT PACKAGESET thru online?
If it were batch I could pass the parameter to the linkage area variable from the JCL but how do we do it for the onlines? _________________ Thanks |
|
Back to top |
|
|
RMi Beginner
Joined: 21 Jun 2006 Posts: 8 Topics: 0 Location: India
|
Posted: Wed Apr 02, 2008 7:55 am Post subject: |
|
|
You have store the parameter some where you can access from CICS. It could be
1) A VSAM file
2) In a DB2 table belonging to the default colletion ID (In your case it can be group1)
3) Hardcode in the program itself (for all the possible regions like developments, QA and Prod)
Regards,
RMi |
|
Back to top |
|
|
|
|