Page 1 of 1

Setting a global variable with a dynamic value

Posted: Wed Jun 19, 2013 8:59 am
by meriem_ens
Hi,


I have the following requirement that i can't implement in Datastage :

I have a projet composed of multiple job sequences and job activities, this is the kind of structure I'm dealing with

Code: Select all

JS1
  |-------JS2
  |-------JS3
  |-------JS4
              |------- JA1
              |------- JA2
              |------- JA3
  | -------JS5
              |------- JA4

I need to declare a global variable. The global variable value need to be set - just one time - with the time of when the master job sequence has been launched. All the sub job sequences or activities should have access (read) to the global variable.


I just can't figure how to implement this functionality in datastage. if anyone could give me some insight I would be very grateful.

Thanks

Posted: Wed Jun 19, 2013 9:14 am
by ArndW
The normal approach is that you define a parameter in the sequences and jobs and pass the value from the parent downwards. Is there any pressing reason why you cannot do that here?

Posted: Wed Jun 19, 2013 9:23 am
by meriem_ens
Hi,

I'm just super lazy.

Ok, so if I follow your approach how can I set a parameter with a value that was defined at the master job sequence, and most importantly how can I pass the value from the parent downwards.

Thank you

Posted: Wed Jun 19, 2013 9:30 am
by chulett
Just like any parameter you set it at run time, for a 'top level' job either via the Run dialog or from your command line execution. And you pass it downwards by doing literally that - defining the parameter in all the jobs that need it and passing it from the Sequence to each called job in the Job Activity stage.

Posted: Sat Jul 06, 2013 12:10 pm
by meriem_ens
Thank you.