View previous topic :: View next topic |
Author |
Message |
pradeepg Beginner

Joined: 06 Jan 2003 Posts: 25 Topics: 12 Location: Columbus, OH
|
Posted: Tue Dec 06, 2005 6:48 pm Post subject: PLAN NAME or COLLID at runtime in COBOL program |
|
|
Hi,
Is there a way I can find out to which PLAN or COLLID the program belongs at run time. Any DB2 reserve words ?? I don't think I can get this in SQLCA. Based on the PLAN/COLLID I can decide if it is a batch or online program. So I am trying to find out is there a way to findout the plan name or collid of the program at runtime.
Thanks in advance.
- Pradeep |
|
Back to top |
|
 |
chandrankk Beginner
Joined: 06 Dec 2005 Posts: 8 Topics: 0
|
Posted: Tue Dec 06, 2005 11:36 pm Post subject: |
|
|
Try this
EXEC SQL
VALUES(CURRENT PACKAGESET)
INTO(:HV1)
your host variable should have the collection id. I think, there are some limitations for using this like if the program is running from a remote location, you may not get the proper value.
regards. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
pradeepg Beginner

Joined: 06 Jan 2003 Posts: 25 Topics: 12 Location: Columbus, OH
|
Posted: Wed Dec 07, 2005 1:34 pm Post subject: |
|
|
kolusu,
The code you provided can be used in calling programs also right. Will it work in lower level programs.
Chandrankk,
CURRENT PACKAGESET will have blank initially isn't it ???
because I am getting blank in the host variable. I think manual also says that, only after you set this special register with some value then it will have a value other wise it will be blank. OR did I understand it wrong? |
|
Back to top |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Wed Dec 07, 2005 5:05 pm Post subject: |
|
|
pradeepg,
Quote: |
Is there a way I can find out to which PLAN or COLLID the program belongs at run time. Any DB2 reserve words ?? I don't think I can get this in SQLCA. Based on the PLAN/COLLID I can decide if it is a batch or online program.
|
You mean to say that you bind and compile the same program to two different plans - one for batch and online?. If no, then the same plan will be used for both online and batch invocations and if yes, why?
Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
 |
|
|