Page 1 of 1

How to assign value to Environment Variable from a table

Posted: Wed Jun 07, 2006 11:40 pm
by Amar_nath
Hi Folks,

I'm trying to use environment variables with DataStage and I'm having a little difficulty that I hope someone can help me with.

Background:
I have some server jobs that contains some Sequential File,Transformer and ODBC stages. I have defined some environment variables using DS Administrator and I have used that variables to define Data source name,User name and password in ODBC stage(eg #$xyz#).

QUESTION::
Here it takes the values which I have defined in Administrator, Now I want to define that values in some Table so that the Environment varibles will pick that value from that table.
How do I do that??
Any ideas are most welcome, thanks...

If you need more info to help, please let me know and I'll email you whatever you need.

Posted: Thu Jun 08, 2006 12:01 am
by opdas
Hi Amar,
If you want to store your parameter values in a table a want to pass that at run time then you probably have to write a script to fetch the value from the table and pass it as parameter while firing the job through command line.

Regards
OP

Posted: Thu Jun 08, 2006 12:23 am
by Amar_nath
Hi OP,

thats true, Can I write a routine (in Basic ) for that ?

If yes give some hints or examples.

Regards ,

Amarnath

Posted: Thu Jun 08, 2006 1:03 am
by ray.wurlod
You can, but you don't want to, because the UNIX based ODBC drivers that you will need to license cost megabucks. If you would like to research this strategy search the forum for "BCI".

A better approach is a job sequence that runs a job to extract the values from the table into either a text file or a hashed file, then to pick them up from there with a User Variables activity. The user variables can then be used to assign replacement values for the environment variables or for the job parameter settings.