MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Binding a program to 2 differnt subsystems

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
svhgk
Beginner


Joined: 14 Feb 2006
Posts: 12
Topics: 5

PostPosted: Tue Oct 03, 2006 10:51 am    Post subject: Binding a program to 2 differnt subsystems Reply with quote

Hi,

I need to bind a program which accesses table A in one susbsystem SS1(under SQL1) & table B in another subsystem (under SQL2) SS2.

Kolusu,

I checked earlier links in the forum & found that using the CURRENT SQLID we can direct the DB2 to the particular subsystem. Now the program I am dealing with is a production program which does not have this statement. Then how the production program is working in this case?

We are copying the program to test region & then binding it. So incase we need to add the SET CURRENT SQLID command we need to edit the program. Any other work around on this other than the SET CURRENT SQLID command. Someone told me I need to create a synonym of the table B in SS1 & then bind it. Is this feasible?

Awaiting your reply.

Thanks,
Ganesh
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Wed Oct 04, 2006 4:56 am    Post subject: Reply with quote

svhgk,

are you talking about a program which accesses table a in system ss1 and at the same time table b in system ss2 ??? Program runs once ans accesses both tables at the same time ?

Or are you talking about a program wich accesses table a in system ss1 and accesses table b in system ss2? So program runs twice? Is table a in system ss1 the same table as table b in system ss2?


regards,
bauer
Back to top
View user's profile Send private message
svhgk
Beginner


Joined: 14 Feb 2006
Posts: 12
Topics: 5

PostPosted: Thu Oct 05, 2006 6:49 am    Post subject: Reply with quote

Bauer,

The same program in a single run accesses table A in SS1 & table B in SS2.

We checked out here yesterday. There were settings in the bind panel screen to specify the subsystems to which the program has to be bound.

Thanks,
Ganesh
Back to top
View user's profile Send private message
aashish.paul
Beginner


Joined: 17 Apr 2008
Posts: 12
Topics: 3

PostPosted: Mon Jan 10, 2011 10:47 am    Post subject: Reply with quote

Svghk,

I have a similiar requirement, a program that has sqls running against 2 Db2 susbsytems at different points in the program. my pkg binds are failing when binding against the second susytem.

How do you control which SQL is bound to which db2 subsystem?
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Jan 11, 2011 2:08 am    Post subject: Reply with quote

aashish.paul,

you can use

Code:
 EXEC SQL CONNECT TO :DB2_Subsystem_Name; 


in your coding if the sql statements are not qualified with the subsystem name,

or if the db2 subsystemname is fix, you can use

Code:
 

EXEC SQL SELECT * FROM <subsystemname>.<tablecreator>.<tablename> where .....


.


Additional check, if the 2 involved db2 subsystems are connected. (sysibm.syslocations, but for this catalog table name i'm not sure).
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Tue Jan 11, 2011 4:02 am    Post subject: Reply with quote

Concerning your question of binding: You have to BIND your program only against 1 DB2 subsystem. Within this subsystem, you have to implement the possibility for your program to access the table in the other subsystem with

- creating a communication between the two subsystems, so that you can work with the described three part name for the table

- creating an ALIAS for this table in subsystem 1, so that you don't have to code this three part name in your program but only use it in the ALIAS definition

regards
Christian
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Jan 11, 2011 5:20 am    Post subject: Reply with quote

CZerfas,

yes, i agree.

Do you remember how to connect the two db2 Subsystems, you said communication.

Was i right with sysibm.syslocations to see if the subsystems are connected, communication available ?

regards bauer
Back to top
View user's profile Send private message
aashish.paul
Beginner


Joined: 17 Apr 2008
Posts: 12
Topics: 3

PostPosted: Tue Jan 11, 2011 10:32 am    Post subject: Reply with quote

the table to check the connection is sysibm.locations, i did check that the subsystem i wanted to connect to is available.

My facility uses DRDA access, according to the manual I have to do a local bind and a remote pkg bind followed by aplan bind including both these packages to be able to execute the sql.

The issue with this is that I am unable to do a remote bind as this is failing on the SQLs that are to be executed at the local server.

I have tried the "Connect" followed by the SELECT which returned a -918 SQLCODE.

If i use an ALIAS would that still require a remote bind ?
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Wed Jan 12, 2011 8:39 am    Post subject: Reply with quote

Are you using VALIDATE(BIND), or VALIDATE(RUN) in your package BIND? You should be using VALIDATE(RUN).
Back to top
View user's profile Send private message
aashish.paul
Beginner


Joined: 17 Apr 2008
Posts: 12
Topics: 3

PostPosted: Fri Jan 14, 2011 12:22 pm    Post subject: Reply with quote

Changed the VALIDATE(BIND) to VALIDATE(RUN) and got a -805 bonk
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Tue Jan 18, 2011 8:36 am    Post subject: Reply with quote

Are you implying that DB2 returned the -805 on the bind? Do you know what causes a -805?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group