View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I have two tables, TA and TB, in two different subsystems respectively, I want to access the two tables in one COBOL program, can I do it? |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I forgot to say, the two subsystems are in the same LPAR. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
In essence, you can not have 2 (or more) active 'connects' to db2 in one thread.......
So, based on a one thread solution (such as SAS),
Connect to the 1st DB, do your SELECT and
save the results (either in memory or write it to dasd.
DECONNECT
Connect to the 2nd DB, do our SELECT and
save the results (either in memory or write it to dasd.
DECONNECT
then play with the data
and generate your output.
Now, if you are OO literate,
you could try starting two new tasks,
one would connect to the 1st DB and store the data and then signal finish.
the other would connect to the 2nd DB ......
then play with the data
and generate your output.
You will never beable to execute (what I would call) a-real-time-JOIN on tables in different z/OS db2 sub-systems.
what you would need is an 'super agent' in some db2 subsystem
supervising both of the 1st DB and 2nd DB agents.
happy Halloween! |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What we have done in our shop is to create an ALIAS for Table B in Subsystem A.
This ALIAS points to Table B is Subsystem B.
You code your program as is they are in the same subsystem, while the data for Table B is actually in the other Subsystem.
You need to make sure your executing Job has the proper authority to access the data in Subsystem B. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I imagine one could become very unpopular with thoughtless SQL. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
I imagine one could become very unpopular with thoughtless SQL |
I do not understand the meaning of this.... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i only meant,
as another giggle slithers thru my soul,
one has the ability
to simultaneously bring not just one
but two
db2 subsystems to their knees with some convoluted sql.
on the other hand,
yours is a tremendous contribution,
and I am at present someone deep into a few manuals
trying to figure out why ALIAS was not more visible than it was. |
|
Back to top |
|
|
|