Env variable value

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
shrey3a
Premium Member
Premium Member
Posts: 234
Joined: Sun Nov 21, 2004 10:41 pm

Env variable value

Post 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,
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

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