need two versions of same db2 pgm at same level



IBM's flagship relational database management system

need two versions of same db2 pgm at same level

Postby abhikulsh » Wed Dec 14, 2011 12:50 am

I need two versions of same db2 pgm at same level EXECUTING SUCCESSFULLY. HOW IS THIS POSSIBLE

Example:



Version 1 - ProgramA – SQL QRY - SELECT COUNT(*) FROM TABLEA

Version2 – ProgramA - SQL QRY - SELECT COLM1 FROM TABLEA

Both the program versions ((with two different SQL’s) should be compiled, promoted and available at DEV level.

Can someone answer this with and without changeman
abhikulsh
 
Posts: 2
Joined: Wed Mar 30, 2011 8:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: need two versions of same db2 pgm at same level

Postby Ed Goodman » Wed Dec 14, 2011 1:31 am

Seems like you'll need to pass the program some sort of parm to let it know which SQL to run.

Alternately, you could make a second ENTRY point. The name used to call the program would let you code which way it runs.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: need two versions of same db2 pgm at same level

Postby Akatsukami » Wed Dec 14, 2011 1:43 am

Or the sources could be saved to two different PDSs, the packages placed in two different collections, and the plans bound from those different collections.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: need two versions of same db2 pgm at same level

Postby dick scherrer » Wed Dec 14, 2011 2:24 am

Hello,

I need two versions of same db2 pgm at same level EXECUTING SUCCESSFULLY.
Why does someone believe this is needed. . . :?

Someone may have chosen such an implementation, but it is surely NOT needed.

Suggest you look into dynamic sql or simply have one program for each requirement. You wouldn't have to go very far with this "several of same" approach to reach an unmaintainable mess.

Is this something to actually be done or is this just some class experiment?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: need two versions of same db2 pgm at same level

Postby Akatsukami » Wed Dec 14, 2011 3:48 am

dick scherrer wrote:Hello,

I need two versions of same db2 pgm at same level EXECUTING SUCCESSFULLY.
Why does someone believe this is needed. . . :?

Someone may have chosen such an implementation, but it is surely NOT needed.

I assume that this is to be done in the development, not the production, environment (if it is in the production environment, I agree with you; nip this stupidity in the bud). At my site, we probably have dozens of load modules (each comprised of one to several thousand source modules, not to mention dynamically-loaded subprograms) with two or more versions (as many as half a dozen in some cases, I think) being developed simultaneously. Each development effort has its own libraries and DB2 objects (data bases, tables, package collections, etc.).
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: need two versions of same db2 pgm at same level

Postby GuyC » Wed Dec 14, 2011 2:10 pm

Akatsukami wrote:Or the sources could be saved to two different PDSs, the packages placed in two different collections, and the plans bound from those different collections.

just adding: If you have automatic package versioning (I believe it's default) the packages can be in the same collection, plan. because primary key of a package is (Location,collid,name,version)
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: need two versions of same db2 pgm at same level

Postby abhikulsh » Thu Dec 15, 2011 1:11 am

yes this is for development n nt in prod
abhikulsh
 
Posts: 2
Joined: Wed Mar 30, 2011 8:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: need two versions of same db2 pgm at same level

Postby Akatsukami » Thu Dec 15, 2011 2:58 am

abhikulsh wrote:yes this is for development n nt in prod

Well, you have Mr. Goodman's suggestion as to how to do it, my suggestion, Mr. Scherrer's suggestion, and GuyC's suggestion. Pick one and implement it.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post