Page 1 of 1

Env variable value

Posted: Tue Mar 06, 2007 12:54 pm
by shrey3a
Hi,

We have requirment:

Currently the job has DSJobStartDate defined in transformer for column dervation.

We need to make it dynamic i.e. by default it should run for the DSJobStartDate but if user want to change the date he can do it run time by typing values for the param.\

I tried making it the Job parameter but it gives the hard code vaue as DSJobStartDate.

I'm trying to make it as ENV variable i setted up below in .profile of my login id
export DTIME=`date +%Y-%m-%d`
it works if I do echo on UNIX box.

But some how i'm not able to catch the value of variable in ETL. I defined the job parameter gave the value as $ENV but it goes ahead and show $ENV as o/p.

Any ideas or any other way to do above we are on 7.1

Thanks,

Posted: Tue Mar 06, 2007 1:51 pm
by vmcburney
Have a look at the first message in the Director logs that lists all the environment variables for that processing session. Sometimes a job uses a different profile to the one you expect. It's not all that dynamic since the user would need to keep changing the environment variable each time they run. What I recommend is adding a job parameter that by default is empty that users can add a date to. In a transformer use an IF statement, IF the job parameter is empty use the DSJobStartDate, if the job parameter is populate and it is a valid date use this value.

This lets the job parameter act as an override.