Determining plan name from within application program

Donna Domovic

Determining plan name from within application program
Hello,

We are currently running DB2 v8 NFM. One of our application support groups posed a question that I'm hoping someone can help us with.

The application has multiple environments with each using a different plan name. They would like to have a way to determine which environment the program is executing in by looking at the plan name it's currently running under.

Is there any way to determine the current plan name from within an application program written in Cobol? If this isn't possible in v8, is there a way to find the plan name in v9?

Thanks in advance for the assistance.

Donna Domovic

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Binyamin Dissen

Re: Determining plan name from within application program
(in response to Donna Domovic)
On Tue, 4 Jan 2011 16:56:34 -0500 Donna Domovic <[login to unmask email]>
wrote:

:>We are currently running DB2 v8 NFM. One of our application support groups posed a question that I'm hoping someone can help us with.

:>The application has multiple environments with each using a different plan name. They would like to have a way to determine which environment the program is executing in by looking at the plan name it's currently running under.

:>Is there any way to determine the current plan name from within an application program written in Cobol? If this isn't possible in v8, is there a way to find the plan name in v9?

EXEC SQL SET :hv1 = GETVARIABLE('SYSIBM.PLAN_NAME') END-EXEC

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

James Campbell

Re: Determining plan name from within application program
(in response to Binyamin Dissen)
select getvariable('SYSIBM.PLAN_NAME') ...

James Campbell

On 4 Jan 2011 at 16:56, Donna Domovic wrote:

> Hello,
>
> We are currently running DB2 v8 NFM. One of our application support groups posed a question that I'm hoping someone can help us with.
>
> The application has multiple environments with each using a different plan name. They would like to have a way to determine which environment the program is executing in by looking at the plan name it's currently running under.
>
> Is there any way to determine the current plan name from within an application program written in Cobol? If this isn't possible in v8, is there a way to find the plan name in v9?
>
> Thanks in advance for the assistance.
>
> Donna Domovic
>

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv