NON-Global variables

Everything about Control-M Server installation or setup.
Post Reply
User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

NON-Global variables

Post by Kenton » 05 May 2009 2:11

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

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 05 May 2009 5:56

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.

User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

Thanks heaps for that

Post by Kenton » 06 May 2009 2:05

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?

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 06 May 2009 9:05

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.

User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

THAN YOU!

Post by Kenton » 07 May 2009 12:32

Yes

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

Thanks Heaps!

hipikll

Post by hipikll » 07 May 2009 10:48

welcome home commander ...

Post Reply