How to use Datastage environment variable in a unix script

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jeet_81
Participant
Posts: 12
Joined: Thu Oct 27, 2011 7:01 am
Location: India

How to use Datastage environment variable in a unix script

Post by jeet_81 »

Hi All,
I am using Datastage 8.1 set up on Linux.
Now is there any way, I can use Datastage environment variables in my unix script.

Please help.

Thanks.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Short answer is yes.

Which environment variables would those be? Project environment variables that are defined with the Administrator client? Those defined in dsenv?

For project environment variables you can grep/cut them from the DSParams file. Those with the encrypted string type will pose an additional hurdle.

For those in dsenv you can source the dsenv file.

Mike
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Just thought of another, more conventional approach...

Call the script from a job sequence using a routine or command activity and pass whatever values are needed on the command line to the script.

Mike
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you run the script from DataStage then there's no need to pass anything, they will be in the environment. Just reference them like any other environment variable.
-craig

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