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 

Determine Plan name at execution time

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


Joined: 25 Aug 2003
Posts: 12
Topics: 6

PostPosted: Fri Oct 03, 2003 7:51 pm    Post subject: Determine Plan name at execution time Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Oct 04, 2003 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mikeg
Beginner


Joined: 25 Aug 2003
Posts: 12
Topics: 6

PostPosted: Sat Oct 04, 2003 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Oct 04, 2003 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon Oct 06, 2003 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Oct 09, 2003 2:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
mikeg
Beginner


Joined: 25 Aug 2003
Posts: 12
Topics: 6

PostPosted: Sat Oct 18, 2003 5:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon Nov 03, 2003 9:27 am    Post subject: Reply with quote

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
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