Previous Topic

Next Topic

Book Contents

Book Index

Global Variable Access by Another Job

You can now take a look at the global nature of these variables.

  1. Enter the job scheduling definition for IDJOB9 and do the following:
    1. Enter ALL in the DAYS field.
    2. Enter ANYSTEP in the ON field.
    3. Enter C0000 in the CODES field.
    4. Add a DO SHOUT statement whose destination is your user ID, and which contains the following message text:

      FIRST SHOUT: %%\VAR1

    5. Add a second DO SHOUT statement whose destination is your user ID, and which contains the following message text:

      SECOND SHOUT: %%..\VAR2

    6. Add a third DO SHOUT statement whose destination is your userID, and which contains the following message text:

      THIRD SHOUT: %%..\IDJOB8\VAR1

    7. Exit the job scheduling definition.

    Before running the job, determine the anticipated results.

    Table 17 Anticipated Results of Job

    Shout

    Anticipated Resolution and Explanation

    FIRST SHOUT:

    CCC

    The Shout in IDJOB9 specifies Global variable %%\VAR1, which refers to a Global variable %%\VAR1 that is owned by itself (IDJOB9).

    Job IDJOB8 assigned the value CCC to the Global variable %%\VAR1 that is owned by IDJOB9.

    SECOND SHOUT:

    BBB

    The Shout in IDJOB9 specifies Global variable %%..\VAR2, which refers to a Global variable %%\VAR2 that is owned its group (IDGRP3).

    Job IDJOB8 assigned the value BBB to the Global variable %%\VAR2 that is owned by group IDGRP3.

    THIRD SHOUT:

    AAA

    The Shout in IDJOB9 specifies Global variable %%..\IDJOB8\VAR1, which refers to a Global variable %%\VAR1 that is owned by IDJOB8.

    Job IDJOB8 assigned the value AA A to the Global variable %%\VAR1 that is owned by itself (IDJOB8).

  2. Order the job scheduling definition for job IDJOB9.
  3. Check the Sysout of the job. The Sysout contains the following:

    FIRST SHOUT: CCC

    SECOND SHOUT: BBB

    THIRD SHOUT: AAA

    These values clearly indicate that these variables have been globally accessed. You can demonstrate that these variables can be globally updated.

Parent Topic

Defining Global Variables