Page 1 of 1

getting the value from an environment variable

Posted: Tue Jul 08, 2008 5:18 am
by jasper
hi,

We have 2 requierments which we need to combine
- shield off all DB-paswords from everyone within datastage
- create a Job to do an oracle materialized view refresh on all databases.


What we were planning to do:
- create structured environment variables (example for a database called cust we will have 3 variables: CUSTDB,CUSTUSER,CUSTPWD). the CUSTPWD will be encrypted (we'll ask the DBA to fill it in to shield it of from everyone)

-create a job to do the materialized refresh. This will typically have as parameters DB,USER and PWD. depending on a variable these need to get the values from one DB.
We can use unix-code before calling dsjob, or use logic inside a datastage workflow before calling this job to do this trick.

At this point we can get the value for non-encrypted values trough a uservariables stage where we do:
Trim(executeUnixCommandReturnOutput("echo $CUSTUSER"),@FM)

($CUSTUSER is then calculated before this, it's actually a concatenation of param1 and USER)
This doesn't work for encrypted variables however.


The only way we see now is to add all variables to this flow and then take out the correct one. This would lead to recompile for every new source, which is not in synch with the multifunctional job we want to create.

Posted: Tue Jul 08, 2008 6:33 am
by ray.wurlod
Investigate using a Parameter Set, in which you can specify different files to be read to provide the values.

Posted: Thu Jul 10, 2008 3:03 am
by jasper
Ray,

One of the requierments is to keep the paswords hidden. How can we make sure nobody is able to read them if they are in a file?

Posted: Thu Jul 10, 2008 3:10 am
by mahadev.v
Passwords are encrypted in the file. You cannot directly read from the file. Other variables values Yes, passwords No.