Page 1 of 1

NON-Global variables

Posted: 05 May 2009 2:11
by Kenton
Hello

I tried reading the Variable and Params doco but got completely lost. :cry:

We have a Group Schedule that is called and uses a variable in every job (submission_id) as a parameter for the commands that are run.
ie Command: /script.sh -i %%submission_id

Problem is that we need to call the next Group Schedule part way through the current so the global variable changes value part way through the initial GS.

For example: the first half of the Group Schedule %%submission_id = 12345 and then when the next instance of the GS is called %%submission_id = 12349 and messes up the command calls on the previous GS.

Is there a way of either declaring a variable that is specific to a Group Schedule or passing a variable from one job to the next?

Any help would be greatly appreciated

Posted: 05 May 2009 5:56
by gglau
Define the variable %%submission_id at the group level, and it can be available readonly to all jobs within the same Schedule Group. Do not define it as %%\submission_id to make it a global variable.

Thanks heaps for that

Posted: 06 May 2009 2:05
by Kenton
Please excuse my newbieness :oops:

So, correct me if I'm wrong, what you're saying is that I add add a variable (say submission_number) in the SET tab of the first job in the group and assign it %%submission_id.

From there, wherever I use %%submission_number it will be the same value within that group.

Is that correct?

Posted: 06 May 2009 9:05
by gglau
My assumptions on your question:
- You are using Group Scheduling
- A global variable %%\submission_id is defined somewhere within the group

Group Scheduling (or Scheduling Group) is different from regular group. Scheduling Group can have IN/OUT conditions as well as variables. Variables defined at group level are visible to all jobs within the group.

If you are using Scheduling Group, then define %%submission_id in the SET tab of the Scheduling Group.

If you are using regular Group, you need a global variable per group to avoid overwriting the variable.

THAN YOU!

Posted: 07 May 2009 12:32
by Kenton
Yes

I totally missed the SET tab in the Scheduling Group!!!

Thanks Heaps!

Posted: 07 May 2009 10:48
by hipikll
welcome home commander ...