global variable

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
acool
Participant
Posts: 29
Joined: Tue Feb 17, 2004 4:31 pm

global variable

Post by acool »

Hi everyone,

My database password changes once a month, is there any way I can create a global stage variable so that all jobs in the project can use it as the database password?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Only by working with job parameters can you achieve such a goal. You can put a job parameter as the password and supply the appropriate value at runtime. Environment variables work the same as parameters, you'll have to declare the envinronment variable as a job parameter.

I don't believe a macro works, but if it does, then you might have that as an option as well. The point is the same, you must feed each process with the approriate values.

If you can setup a trusted connection via the userid that jobs run under, then you bypass this requirement.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
Another way could be creating a Unix Shell Script, pass the user id and password values from your database to this script and let the script invoke the datastage job via dsjob command with all parameters.

Ketfos
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi,

You can create an environment variable for the Database password and add the environment variable to the job parameter list in all your jobs. Set the value to $PROJDEF which means the project default value is used for the parameter.

For each month change the value of the environment variable and $PROJDEF ensures that the new value is used in your jobs.

HTH
--Rich

Pride comes before a fall
Humility comes before honour
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Before attempting to use Environment Variables as Rich mentions, make sure you are running at least the 7.1 version. From what I recall, the original 7.0 release added the capability to use them, but you had to recompile the job to get it to notice a value change. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply