changing the values of an env.variable at run time

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

changing the values of an env.variable at run time

Post by scorpion »

hi all,

i want to change the value of userdefined environment variable,defined for a perticular job ,at run time in a jobsequencer.

i want to assign a new value each time for that variable,
whenever job runs in a job sequencer.

how can i achieve this..can any one one help me on this?

tx in advance!
Thanx&Regards
scorpion
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Though you assign a new value to the variable, it will not be reflected to the rest of the job using the variable.
The Main sequence which holds the variable while getting triggered will hold the value till the last and supply to all the jobs which it calls it.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

changing the values of an env.variable at run time

Post by scorpion »

Thanks kumar for your quick response!

what I want is:

Can I change/update the value of the job parameter within the same job.

Before job : Paramter X holds the value "1"

After job : Parameter X has to be changed/updated to "2"

how can i achieve this?
Thanx&Regards
scorpion
jatayl
Premium Member
Premium Member
Posts: 47
Joined: Thu Jan 19, 2006 11:20 am
Location: Rogers, AR

Re: changing the values of an env.variable at run time

Post by jatayl »

scorpion wrote:Thanks kumar for your quick response!

what I want is:

Can I change/update the value of the job parameter within the same job.

Before job : Paramter X holds the value "1"

After job : Parameter X has to be changed/updated to "2"

how can i achieve this?
I would say pass Parameter X the value of "2" within a korn shell script that calls the dsjob command. That'll pass the value from the korn shell to the job sequence then along to the job level.

Jason
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You can set the value in the transformer.
Pls check this link
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post by scorpion »

jason,

Is there any alternate way to achieve this without using shell scripts?
i need to run the jobs from jobsequencer..
Thanx&Regards
scorpion
jatayl
Premium Member
Premium Member
Posts: 47
Joined: Thu Jan 19, 2006 11:20 am
Location: Rogers, AR

Post by jatayl »

scorpion wrote:jason,

Is there any alternate way to achieve this without using shell scripts?
i need to run the jobs from jobsequencer..
At run time, aren't you prompted to populate the parameter you defined? If not, you'll need to add it to your sequence job parameters, and then right click on each job in your sequence and map the parameter for it to pass.

Jason
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Have you checked the link.
This option has been tried by the poster in the transformer.

Code: Select all

$enFileName = DSLink.instance 
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply