multiple instances of Db2

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rob1
Participant
Posts: 5
Joined: Wed Sep 03, 2003 8:49 am

multiple instances of Db2

Post by rob1 »

How can we connect datastage jonb to different db2 instances ?
eg : 1 job uses db2 instance a and 1 job uses db2 instance b

Is it possible to modify dsenv to set variable DB2INSTANCE ?
at first glance, it seems that this shell is executed only once when datastage server is set up, and not each time a job is started.
Kim Bundgaard
Participant
Posts: 16
Joined: Fri Aug 08, 2003 3:30 am
Contact:

Post by Kim Bundgaard »

You don't connect to an instance, but to a database (DSN).
Catalog the two different databases, and you have the option to choose between the two databases.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The job itself can set an environment variable. So can an active stage.

In the Transformer stage that drives the connection to DB2, set up ExecTCL as a before-stage subroutine (in the Stage Properties window), and put the an ENV command into the Input Value field. The ENV command to set an environment variable has the syntax:

Code: Select all

ENV SET variable=value
You can also:

Code: Select all

ENV CLEAR variable
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rob1
Participant
Posts: 5
Joined: Wed Sep 03, 2003 8:49 am

Post by rob1 »

Thanks,
Is it possible to set another variable in the same way ?
What is the syntax ?

I have one job control which launches many other jobs who access to Db2.
Do I have to set these variables in the job control or in each job ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What do you mean by another variable? Another environment variable?

If you do this in a job control routine, you would invoke the command using the PERFORM statement (or via a call to DSExecute). Since controlled jobs run as child processes of control jobs, they inherit their parents' environment variables.

Or you can set them in the individual jobs, as advised earlier.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply