View previous topic :: View next topic |
Author |
Message |
mikeg Beginner
Joined: 25 Aug 2003 Posts: 12 Topics: 6
|
Posted: Fri Oct 03, 2003 7:51 pm Post subject: Determine Plan name at execution time |
|
|
Program A calls Program B.
Program B is a DB2 program, while Program A is not.
I run Program A and Program B in CICS, IMS and Batch.
I would like to determine what PLAN Program B is bound to. Ideally, I would like to determine this before any SQL is executed. Is this possible? If it is not possible, how can I determine the PLAN after I go to DB2? Is there a command that I can execute? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Oct 04, 2003 7:54 am Post subject: |
|
|
mikeg,
I assuming that you want to find out who is invoking pgm B? Is that right? You can find out job-related data from mvs data areas.
Kolusu |
|
Back to top |
|
 |
mikeg Beginner
Joined: 25 Aug 2003 Posts: 12 Topics: 6
|
Posted: Sat Oct 04, 2003 12:25 pm Post subject: |
|
|
No, I know Program B is always invoked by Program A, Sometimes in Program A is running is CICS, IMS or batch. When it runs in those environments, it runs under various transaction/batch jobs. Various plans are associated with the transactions/batch job, these plans points to physically different databases, but the same table.
EXAMPLE: Transaction X points to aaa.table_idunno
Transaction Y points to bbb.table_idunno |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Oct 04, 2003 4:08 pm Post subject: |
|
|
Mikeg,
You can issue an EXEC SQL SET CURRENT PACKAGESET = 'CICS PACKAGE NAME', before the first sql so that the subsequent sql's dynamically switch to using the collection.
check this link for a detailed explanation of SET CURRENT PACKAGESET
Or you can even code a exit for dynamic plan selection. Check this link
Routines for dynamic plan selection in CICS
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Oct 06, 2003 5:49 am Post subject: |
|
|
The association of a plan at execution time is not a topic of a certain module but of the complete transaction.
In CICS that means, that you have to define all transaction ids, under which your DB2 module is called, as DB2Entries. You associate then associate a plan name with the tx-ids. In Batch, you have to start your main program under IKJEFT01 with a RUN PROGRAM command under the DB2 command processor and supply the appropriate plan name with it.
regards
Christian |
|
Back to top |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Oct 09, 2003 2:51 pm Post subject: |
|
|
Do you have OMEGAMON installed in your system. It is a fantastic tool for providing such statistics that you need(plan executing, current sql executing, exceution time etc.) either during runtime or historical data after the transaction/batch job has finished executing.
Regards,
Manas |
|
Back to top |
|
 |
mikeg Beginner
Joined: 25 Aug 2003 Posts: 12 Topics: 6
|
Posted: Sat Oct 18, 2003 5:15 pm Post subject: |
|
|
Kolusu, I believe that will either give me the package or the collection, not the Plan
CZerfas, I understand that, but at execution time, in Batch, CICS and IMS the transaction or batch job can have several different PLANs associated with it.
Manas Biswal, I want my program to know what the plan is at execution time, so it could act appropriately. |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Nov 03, 2003 9:27 am Post subject: |
|
|
My point in this discusison is, that associating a plan name with a transaction is not a matter of any running application program but of the shell (CICS, IKJEFT01), under which the first program of the transaction gets control.
To my knowledge there is no way for the running program to get the current plan name of it's execution.
Regards,
Christian |
|
Back to top |
|
 |
|
|