Hitachi

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


7.2.3 Conditional parameters

Organization of this subsection

(1) Defining the conditional parameters

You use conditional parameters to enclose the definitions of environment setting parameters and export parameters that are to apply only to a logical host or to the physical host.

Parameters specified outside the conditional parameters apply to all hosts. Specifications of the same parameter inside and outside conditional parameters are treated as duplicates, and if the total number of such parameters causes the permitted maximum number of specifications to be exceeded, an error results.

An example definition of conditional parameter is explained below.

(parameter group A)
#-adsh_conf lhost_start HOST01
(parameter group B)
#-adsh_conf lhost_end
#-adsh_conf lhost_start HOST02
(parameter group C)
#-adsh_conf lhost_end
#-adsh_conf phost_start
(parameter group D)
#-adsh_conf phost_end
#-adsh_conf lhost_start HOST01
(parameter group E)
#-adsh_conf lhost_end
#-adsh_conf lhost_start HOST02
(parameter group F)
#-adsh_conf lhost_end
#-adsh_conf phost_start
(parameter group G)
#-adsh_conf phost_end
(parameter group H)

Based on this definition, the following parameter groups are executed on the specified hosts:

Parameter groups executed on logical host HOST01:
(parameter group A)
(parameter group B)
(parameter group E)
(parameter group H)
Parameter groups executed on logical host HOST02:
(parameter group A)
(parameter group C)
(parameter group F)
(parameter group H)
Parameter groups executed on the physical host:
(parameter group A)
(parameter group D)
(parameter group G)
(parameter group H)

You can define conditional parameters in both the system environment file and the job environment file. For details about these files, see 2.6.1 Specifying the environment files.

The same parameters can be specified in the system environment file and the job environment file. Parameters specified in both the system environment file and the job environment file are handled as follows:

Example:
System environment file
#-adsh_conf lhost_start host01
#-adsh_conf TEMP_FILE_DIR /jp1as/temp
#-adsh_conf PATH_CONV /jp1as/abc c:\\jp1as\\sys1
#-adsh_conf PATH_CONV /jp1as/def c:\\jp1as\\sys2
#-adsh_conf lhost_end
Job environment file
#-adsh_conf lhost_start host01
#-adsh_conf TEMP_FILE_DIR /home/temp
#-adsh_conf PATH_CONV /jp1as/abc c:\\jp1as\\job1
#-adsh_conf PATH_CONV /jp1as/def c:\\jp1as\\job2
#-adsh_conf PATH_CONV /jp1as/kkk c:\\jp1as\\job3
#-adsh_conf lhost_end
The results of executing the job on logical host host01 are equivalent to the following:
#-adsh_conf TEMP_FILE_DIR /home/temp
#-adsh_conf PATH_CONV /jp1as/abc c:\\jp1as\\job1
#-adsh_conf PATH_CONV /jp1as/def c:\\jp1as\\job2
#-adsh_conf PATH_CONV /jp1as/kkk c:\\jp1as\\job3
#-adsh_conf PATH_CONV /jp1as/abc c:\\jp1as\\sys1
#-adsh_conf PATH_CONV /jp1as/def c:\\jp1as\\sys2

(2) List of conditional parameters

The following table lists and describes the conditional parameters. Specification of these parameters is optional.

Table 7‒2: Conditional parameters specified in the environment files of JP1/Advanced Shell

Parameter name

Definition

Maximum number of times parameter can be specified

lhost_start

Starts a set of environment setting parameters or export parameters that are to take effect only on a specified logical host.

This parameter also specifies the target logical host.

No limit

lhost_end

Ends the definition of a set of environment setting parameters or export parameters started by lhost_start. This parameter must always be paired with an lhost_start parameter.

phost_start

Starts a set of environment setting parameters or export parameters that are to take effect only on the physical host.

phost_end

Ends the definition of a set of environment setting parameters or export parameters started by phost_start. This parameter must always be paired with a phost_start parameter.

(3) Examples of definitions of conditional parameters

This subsection presents definition examples of parameters that are specified in the environment files.

(a) Example definitions of a system environment file and a job environment file

This subsection explains the relationship between the system environment file and the job environment file by way of examples.

  • Running a single host

    This example defines a system environment file as the system default. The example defines the following information:

    • The name of the host to which JP1 events are issued is HostJp1IM.

    • Output of the KNAX6110-I and KNAX6111-I messages is suppressed.

    The following is an example of definitions in the system environment file:

    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6110-I
    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6111-I
    #-adsh_conf  HOSTNAME_JP1IM_MANAGER  HostJp1IM

    This example uses job environment files to define changes to the settings for each job.

    You can convert the arguments in a job definition script to different values for each logical host, and you can define for each job the return code to be used in the event of an error in an extended script command.

    The following is an example of definitions in the job environment file:

    #-adsh_conf  ADSHCMD_RC_ERROR  8
    #-adsh_conf  COMMAND_CONV_ARG  /var/tmp  /home/user01/tmp
  • Running logical hosts HOST01 and HOST02 at the same time

    This example defines a system environment file as the system default. The example defines the following information:

    • Output of the KNAX6110-I and KNAX6111-I messages is suppressed.

    • So that the logical hosts can use different execution environments, the SPOOL_DIR, LOG_DIR, TRACE_DIR, TEMP_FILE_DIR, and HOSTNAME_JP1IM_MANAGER parameters are defined separately for each host.

    • The value of the ABC environment variable is specified for each logical host.

    The following is an example of definitions in the system environment file:

    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6110-I
    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6111-I
    #-adsh_conf  lhost_start HOST01
    #-adsh_conf  SPOOL_DIR  /jp1as/host01/spool
    #-adsh_conf  LOG_DIR    /jp1as/host01/log
    #-adsh_conf  TRACE_DIR  /jp1as/host01/trace
    #-adsh_conf  TEMP_FILE_DIR /jp1as/host01/temp
    #-adsh_conf  HOSTNAME_JP1IM_MANAGER  HostJp1IM01
    #-adsh_conf  lhost_end
    #-adsh_conf  lhost_start HOST02
    #-adsh_conf  SPOOL_DIR  /jp1as/host02/spool
    #-adsh_conf  LOG_DIR    /jp1as/host02/log
    #-adsh_conf  TRACE_DIR  /jp1as/host02/trace
    #-adsh_conf  TEMP_FILE_DIR /jp1as/host02/temp
    #-adsh_conf  HOSTNAME_JP1IM_MANAGER  HostJp1IM02
    #-adsh_conf  lhost_end
    #-adsh_conf  lhost_start HOST01
    export  ABC=/jp1as/host01/abc
    #-adsh_conf  lhost_end
    #-adsh_conf  lhost_start HOST02
    export  ABC=/jp1as/host02/abc
    #-adsh_conf  lhost_end

    This example uses job environment files to define changes to the settings for each job.

    You can convert the arguments in a job definition script to different values for each logical host, and you can define for each job the return code to be used in the event of an error in an extended script command.

    The following is an example of definitions in a job environment file:

    #-adsh_conf ADSHCMD_RC_ERROR  8
    #-adsh_conf lhost_start HOST01
    #-adsh_conf COMMAND_CONV_ARG  /var/tmp  /home/user01/tmp01
    #-adsh_conf lhost_end
    #-adsh_conf lhost_start HOST02
    #-adsh_conf COMMAND_CONV_ARG  /var/tmp  /home/user01/tmp02
    #-adsh_conf lhost_end
  • Running logical host HOST01 during normal operation and temporarily running the physical host

    This example defines a system environment file as the system default. The example defines the following information:

    • Output of the KNAX6110-I and KNAX6111-I messages is suppressed.

    • The SPOOL_DIR, LOG_DIR, TRACE_DIR, TEMP_FILE_DIR, and HOSTNAME_JP1IM_MANAGER parameters are defined separately for the logical host and for the physical host so that they can use different execution environments.

    • The default directory is used for the SPOOL_DIR, LOG_DIR, TRACE_DIR, and TEMP_FILE_DIR parameters for the physical host.

    • Different values are used for the ABC environment variable in the logical host and the physical host.

    The following is an example of definitions in the system environment file:

    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6110-I
    #-adsh_conf  JOBLOG_SUPPRESS_MSG  KNAX6111-I
    #-adsh_conf  lhost_start HOST01
    #-adsh_conf  SPOOL_DIR  /jp1as/host01/spool
    #-adsh_conf  LOG_DIR    /jp1as/host01/log
    #-adsh_conf  TRACE_DIR  /jp1as/host01/trace
    #-adsh_conf  TEMP_FILE_DIR /jp1as/host01/temp
    #-adsh_conf  HOSTNAME_JP1IM_MANAGER  HostJp1IM01
    #-adsh_conf  lhost_end
    #-adsh_conf  phost_start
    #-adsh_conf  HOSTNAME_JP1IM_MANAGER  HostJp1IM01
    #-adsh_conf  phost_end
    #-adsh_conf  lhost_start HOST01
    export  ABC=/jp1as/host01/abc
    #-adsh_conf  lhost_end
    #-adsh_conf  phost_start
    export  ABC=/jp1as/abc
    #-adsh_conf  phost_end

    This example uses job environment files to define changes to the settings for each job.

    You can convert the arguments in a job definition script to different values for the logical host and the physical host, and you can define for each the return code to be used in the event of an error in an extended script command.

    The following is an example of definitions in a job environment file:

    #-adsh_conf ADSHCMD_RC_ERROR  8
    #-adsh_conf lhost_start HOST01
    #-adsh_conf COMMAND_CONV_ARG  /var/tmp  /home/user01/tmp01
    #-adsh_conf lhost_end
    #-adsh_conf phost_start
    #-adsh_conf COMMAND_CONV_ARG  /var/tmp  /home/user01/tmp00
    #-adsh_conf phost_end

(b) Example definitions of conditional parameters

This subsection explains by way of an example the definition of conditional parameters and parameters that are applied to different hosts.

This example defines the conditional parameters as follows:

(parameter group A)
#-adsh_conf lhost_start HOST01
(parameter group B)
#-adsh_conf lhost_end
#-adsh_conf lhost_start HOST02
(parameter group C)
#-adsh_conf lhost_end
#-adsh_conf phost_start
(parameter group D)
#-adsh_conf phost_end
#-adsh_conf lhost_start HOST01
(parameter group E)
#-adsh_conf lhost_end
#-adsh_conf lhost_start HOST02
(parameter group F)
#-adsh_conf lhost_end
#-adsh_conf phost_start
(parameter group G)
#-adsh_conf phost_end
(parameter group H)

Based on these definitions, the following parameter groups are executed on each host:

Parameter groups executed on logical host HOST01:
(parameter group A)
(parameter group B)
(parameter group E)
(parameter group H)
Parameter groups executed on logical host HOST02:
(parameter group A)
(parameter group C)
(parameter group F)
(parameter group H)
Parameter groups executed on the physical host:
(parameter group A)
(parameter group D)
(parameter group G)
(parameter group H)