View previous topic :: View next topic
|
Author |
Message |
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
Hi,
Please let me know the difference between the two parameters QUALIFIER and OWNER which we give while binding a DB2 program.
Regards,
Hari. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Hari,
Owner : Determines the authorization ID or the owner of the object (plan or package)
Qualifier :Determines the implicit qualifier for unqualified names of objects in the plan or package
From FM
Quote: |
A plan or package can contain SQL statements that use unqualified table and view names. For static SQL, the default qualifier for those names is the owner of the plan or package. However, we can use QUALIFIER option of the BIND command to specify a different qualifier. |
|
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
Is there any way to write a DB2 program which accesses tables that belong to two different databases.
There are two different database programs which do manipulations on each of the above mentioned tables separately.
These programs are already bound using their own Qualifier, owner etc.. parameters.
Now, I have a need of writing a program which will call the above two programs (ie, in turn it will do manipulations on tables from different databases). So, what are the things I need to take care while compiling this program?
Please let me know if the quesiton is not clear. |
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
Sorry. I just need to write a simple COBOL program not of DB2. |
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
One more clarificaiton is : both databases reside on the same DB2 subsystem. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
different qualifiers, doesn't mean different databases per se.
just qualify your tables in you program :
select * from xxx.tab1, yyy.tab2 |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What are you talking about?
Quote: |
Is there any way to write a DB2 program which accesses tables that belong to two different databases.
|
OK you need a DB2 program to access two different databases.
Quote: |
Sorry. I just need to write a simple COBOL program not of DB2.
|
OK this is not DB2 so you do not need to access any databases?
Quote: |
One more clarificaiton is : both databases reside on the same DB2 subsystem.
|
OK so which is it DB2 or not? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Believe it or not, I think i get what you trying to do.
First off, as a matter of terminology, if believe you mean DATABASE as grouping of tables with a like qualifier. Please confirm this as your understanding.
That is not technically correct, but let's save that for another discussion.
I think (major psychic skills here), you want to write a new (non-db2) cobol program A. This program will call existing DB2 Program B which will manipulate data in 'Database' B. It will then call existing DB2 Program C which will manipulate data in 'Database' C. Please confirm this as your understanding.
This can be done, but how to do it depends on how your Plan/Package configuration is set up.
How are the packages for Program A and B bound? What does the Bind statement look like?
How are the Plans for these bound? What does the Bind statement look like?
What does the SYSTSIN card look like in your JCL.
Once ALL of these are answered, an approach can be worked on. |
|
Back to top |
|
|
hariibm
New User
Joined: 05 Feb 2007 Posts: 61 Location: Chennai
|
|
|
|
GuyC,
Two different applications hosted on a mainframes server. And they make use of different databases.
daveporcelan,
Your below understanding is partially correct.
Quote: |
I think (major psychic skills here), you want to write a new (non-db2) cobol program A. This program will call existing DB2 Program B which will manipulate data in 'Database' B. It will then call existing DB2 Program C which will manipulate data in 'Database' C. Please confirm this as your understanding. |
I want to write a non DB2 program which will call a DB2 program B(for reading a table in database B). And it will call another DB2 program C to update data in a table in database C.
Both the programs are bound to different packages with different qualifiers, and owner. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Sounds good |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
hariibm,
If your wondering about the odd smiley face icon, it is because you must not have read all of my post I worked so hard on. To help you out, I repeated it again. Pay particular attention to bold face type.
How are the packages for Program A and B bound? What does the Bind statement look like?
How are the Plans for these bound? What does the Bind statement look like?
What does the SYSTSIN card look like in your JCL?
Once ALL of these are answered, an approach can be worked on. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
DB2 z/OS terminology :
Database : a physical grouping of tablespaces. The application developer should have no idea in which database a table resides. The database of tables is irrelevant to a program.
so like dave tries to figure out , you can mean two things :
DB2 Subsystem : separate "environments" each with there own catalog which can be up or down independantly.
(table-) schema/creator/owner/qualifier : a logical grouping of tables usually used as the first part of : select * from tbcreator.tbname
or for unqualified tables specified on the bind statement. |
|
Back to top |
|
|
Poha Eater
New User
Joined: 31 Aug 2016 Posts: 74 Location: India
|
|
|
|
Hi,
I know i am commenting on more than 8 year old thread. But i was going through these comments and found that TS didnt answer the questions which daveporcelan asked so that he can provide the answers.
I have seen on the forum previously if comments are added after such a long interval usually the post get locked. But before doing that can daveporcelan tell us how we can achieve the result for
Quote: |
you want to write a new (non-db2) cobol program A. This program will call existing DB2 Program B which will manipulate data in 'Database' B. It will then call existing DB2 Program C which will manipulate data in 'Database' C.
|
or if GuyC can tell
Quote: |
just qualify your tables in you program :
select * from xxx.tab1, yyy.tab2 |
if we qualify the table in the COBOL-DB2 programs with these qualifiers (i.e. xxx & yyy) then dont we need to mention QUALIFIER parameter in the BIND jcl ? Or if we also mention the QUALIFIER parameter in the jcl as well in the same scenario then what will happen ?
Please let me know before closing this topic. It will be a really helpful info. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Only if you share some of the poha..! |
|
Back to top |
|
|
Poha Eater
New User
Joined: 31 Aug 2016 Posts: 74 Location: India
|
|
|
|
Quote: |
Only if you share some of the poha..!
|
sure why not.... |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
if we qualify the table in the COBOL-DB2 programs with these qualifiers (i.e. xxx & yyy) then dont we need to mention QUALIFIER parameter in the BIND jcl ? Or if we also mention the QUALIFIER parameter in the jcl as well in the same scenario then what will happen ?
|
Please start a new topic next time, In this case whatever you used qualifier in the program will take precedence over what has provided in BIND card for that particular table. |
|
Back to top |
|
|
|