Setting a global variable with a dynamic value

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
meriem_ens
Participant
Posts: 30
Joined: Thu Jun 06, 2013 9:12 am

Setting a global variable with a dynamic value

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
meriem_ens
Participant
Posts: 30
Joined: Thu Jun 06, 2013 9:12 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
meriem_ens
Participant
Posts: 30
Joined: Thu Jun 06, 2013 9:12 am

Post by meriem_ens »

Thank you.
Post Reply