Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


2.7.2 Defining and executing a jobnet

To automate job execution in JP1/AJS, you can define registered custom jobs, PC jobs (for Windows), or UNIX jobs (for UNIX) into a jobnet in JP1/AJS - View and then execute the jobnet. For details about JP1/AJS - View, see the description of job definition in the Job Management Partner 1/Automatic Job Management System 3 Operator's Guide.

To define and execute a jobnet in JP1/AJS3 - View:

  1. From the Windows Start menu, select All Programs, JP1_Automatic Job Management System 3 - View, and then Job Management System.

    The JP1/AJS3 - View - Login window is displayed.

  2. To log in, specify your user name, password, and the host to connect.

    The JP1/AJS3 - View window is displayed.

  3. Select Edit, New, then Jobnet.

    The Define Details - [Jobnet] dialog box is displayed.

  4. Specify information including attributes of the jobnet, and then click the OK button.

    Specify the appropriate information in Exec-agent according to the operating environment. This information can be omitted. For details about the JP1/AJS items, see the applicable JP1/AJS manual.

    The jobnet is created and displayed in the list area.

    [Figure]

  5. Double-click the created jobnet.

    The Jobnet Editor window is displayed.

    [Figure]

  6. Select Exclusive edit so that no other user can access the job while you are defining and associating it.

  7. Drag the required custom job, PC job, or UNIX job icon from the icon list to the map area.

    [Figure]

    The Define Details - [Custom Job], Define Details - [PC Job], or Define Details - [UNIX Job] dialog box is displayed.

    The steps below explain the definition method for custom jobs. For details about the settings required to use PC or UNIX jobs in JP1/Advanced Shell, see 2.7.3 Defining jobs as PC or UNIX jobs.

  8. In the Define Details - [Custom Job] dialog box, define information including job attributes.

    Specify the appropriate information on the Definition and Attributes pages as described in the applicable JP1/AJS manual. Also specify the appropriate information in Exec-agent according to the operating environment. This information can be omitted.

    [Figure]

    If you specify Standard output on the Definition page while one of the following is specified, an empty file is output:

    • The -s option is specified in the adshexec command or SPOOL is specified in the OUTPUT_STDOUT parameter in the environment file (the standard output is redirected to spool files).

    • EXTENDED is specified in the OUTPUT_MODE_ROOT parameter (the expansion output mode is selected).

    This is because the contents of the standard output are output to a separate file by JP1/Advanced Shell's job controller and nothing is output to the standard output that is returned to JP1/AJS.

  9. Select the Definition tab, and then click the Details button.

    The Define Script Execution dialog box for the current type of custom job is displayed. The following shows the dialog box for Windows and for UNIX.

    • In Windows

      [Figure]

    • In UNIX

      [Figure]

    For more information about steps 9 and 10, also see (2) Supplementary information about the jobnet definition procedure for custom jobs.

  10. In the Define Script Execution dialog box, specify the information required for JP1/Advanced Shell execution, and then click the OK button.

    • Job definition script file ~<path name> Windows: ((1 to 247 bytes)), UNIX: ((1 to 1,023 bytes))

      Specifies the name of the job definition script file. This item cannot be omitted.

    • Runtime parameters ~<ASCII character string>((0 to 1,022 bytes))

      Defines the parameters that are to be passed when the job definition script file is executed. If you specify multiple parameters, use the space as the delimiter.

    • Job environment file ~<path name> Windows: ((0 to 247 bytes)), UNIX: ((0 to 1,023 bytes))

      Specifies the name of the job environment file. When this item is specified, the system uses the specified job environment file, even if the ADSH_ENV environment variable is specified in JP1/Advanced Shell's job controller environment. If this item is omitted but the ADSH_ENV environment variable is defined in JP1/Advanced Shell's job controller environment, the system uses the specified ADSH_ENV environment variable value during execution. If this item is omitted and the ADSH_ENV environment variable is not defined in JP1/Advanced Shell's job controller environment, the system assumes that no job environment file is specified. JP1/Advanced Shell's job controller that was started by JP1/AJS sets the path of the job environment file that it used in the ADSH_ENV environment variable and then starts job execution. If another job controller is started as a descendant process, that job controller uses the value of the ADSH_ENV environment variable. Therefore, if the value of the ADSH_ENV environment variable is not set during job execution, the job controller uses the same job environment file that was used by JP1/Advanced Shell's job controller that was started by JP1/AJS. If the value of the ADSH_ENV environment variable is set during job execution, the job controller uses the job environment file containing the new value.

    • Logical host

      Specifies whether the job is to be executed on a logical host. If the Run on a logical host check box is selected, the job is executed on the logical host specified in JP1/AJS (value of the JP1_HOSTNAME environment variable).

    • Check syntax

      Specifies whether the job's contents are to be checked. When the Check job definition script syntax check box is selected, the contents of the job definition script file are checked but the job definition script file is not executed.

  11. Display the Define Details - [Custom Job] dialog box again, and then click the OK button.

    The job is defined in the jobnet. If necessary, define another job in the same manner.

  12. Associate the jobs according to their execution order.

    The jobnet is defined. The following shows an example job definition in JP1/AJS - View.

    [Figure]

  13. Execute the jobnet by using JP1/AJS.

    JP1/Advanced Shell's job controller returns its return code as the job return code to JP1/AJS.

Organization of this subsection

(1) Notes about jobnet definitions

(2) Supplementary information about the jobnet definition procedure for custom jobs

With respect to the job execution settings in steps 9 and 10 in 2.7.2 Defining and executing a jobnet, you can also specify the unit definition in the ajsdefine command in JP1/AJS and the job definition in JP1/AJS - Definition Assistant.

For details about the unit definition, see the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 2.

For details about JP1/AJS - Definition Assistant, see the manual JP1/Automatic Job Management System 3 - Definition Assistant.

The following provides the details of the environment variables and parameters that are specified in the unit definition and JP1/AJS - Definition Assistant when custom jobs are used.

The following shows an example unit definition:

unit=unit-name,,executing-user,;
{
    ty=cpj;
    cty="ADSHUX";
    sc="/opt/jp1as/bin/adshexec";
    env="AJS_BJEX_STOP=TERM";                               -->1.
    env="ADSH_AJS_SCRF=/tmp/JP1AS/scr/samplescrfile.ash";  -->2.
    prm="param1 param2";                                    -->3.
    env="ADSH_AJS_ENVF=/tmp/JP1AS/env/sampleenvfile";      -->4.
    env="ADSH_AJS_LHOST=-h";                                -->5.
    env="ADSH_AJS_GCHE=-c";                                 -->6.
    tho=0;
}

The following explains the lines of code based on the numbers shown in the right margin:

  1. AJS_BJEX_STOP: Because the AJS_BJEX_STOP environment variable is used by the system, make sure that you define this environment variable and specify TERM as its value.

  2. ADSH_AJS_SCRF: Specifies the name of the job definition script file.

    Make sure that you define the ADSH_AJS_SCRF environment variable.

  3. Specifies the prm parameter in the unit definition file.

  4. ADSH_AJS_ENVF: Specifies the name of the job environment file.

  5. ADSH_AJS_LHOST: If the job is to be executed on a logical host, specify -h; if not, specify nothing.

  6. ADSH_AJS_GCHE: If only syntax checking is to be performed, specify -c; otherwise, specify nothing.

After you have created a unit definition file, you can define the job by using JP1/AJS's ajsdefine command and JP1/AJS3 - Definition Assistant.