Previous Topic

Next Topic

Book Contents

Book Index

Defining Global Variables

As mentioned above, a Global variable is a user-defined variable that is placed in the IOA Global Variable database.

%%SET statements in the JCL, and SET VAR or DO SET statements in the job scheduling definition, enable Control-M jobs and SMART Table Entities to define Global variables and place them in the IOA Global Variable database. These variables can then be used and accessed by other jobs. These jobs can use %%SET, SET VAR and/or DO SET statements to change or update the variable values in the database.

You can now define some Global variables in the job scheduling definition and JCL of job IDJOB8.

  1. Enter the job scheduling definition for IDJOB8 and add the following SET VAR statements. When you define a SET VAR statement and press Enter, a new, blank SET VAR statement is opened to allow definition of the next SET VAR statement.

    SET VAR   %%\VAR1=AAA

    SET VAR   %%..\VAR2=BBB

    SET VAR   %%..\IDJOB9\VAR1=CCC

  2. Exit the job scheduling definition.
  3. Add the following statements to the JCL of job IDJOB8, and then exit the JCL:

    //* VAR1 FROM JOB JOB8 EQUALS %%\VAR1

    //* VAR2 FROM GROUP GRP3 EQUALS %%..\VAR2

    //* VAR1 FROM JOB JOB9 EQUALS %%..\IDJOB9\VAR1

  4. Order the job scheduling definition of IDJOB8.
  5. Check the sysout of IDJOB8. The following comments appear in the sysout:

    //* VAR1 FROM JOB JOB8 EQUALS AAA

    //* VAR2 FROM GROUP GRP3 EQUALS BBB

    //* VAR1 FROM JOB JOB9 EQUALS CCC

    From this sysout, you can see that the AutoEdit variables resolved as they should. However, because they appeared in the job scheduling definition and the JCL of the same job, you have not yet demonstrated their global nature.

    You will demonstrate the global nature of these variables shortly, but first, take a look at Global variable syntax.

Parent Topic

AutoEdit and JCL