getting the value from an environment variable
Posted: Tue Jul 08, 2008 5:18 am
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.
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.