How to assign value to Environment Variable from a table

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
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

How to assign value to Environment Variable from a table

Post 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.
opdas
Participant
Posts: 115
Joined: Wed Feb 01, 2006 7:25 am

Post 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
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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