4.1.2 Specifying macro variables during registration for execution
During registration for execution, you can specify macro variable names and their values (passing information). If the specified macro variable names are used in a subordinate unit, they are replaced with the specified values at runtime. With this function, you only have to create one jobnet for a number of jobnets that are the same except for some parameters. For example, to change an environment variable at each execution of a jobnet, you needed to script the following three steps for each execution: copying the jobnet (ajscopy command), changing the environment variable (ajschange command), and registering the jobnet for execution (ajsentry command). If you use a macro variable, however, you can perform this simply by specifying a desired value during registration for execution. The following figure shows how information is passed via a macro variable specified during registration for execution.
|
Macro variable specification during registration for execution is performed using JP1/AJS3 - View and the ajsentry command. For details about how to specify the value of a macro variable, see 7.2 Specifying macro variables during registration for execution in the Job Management Partner 1/Automatic Job Management System 3 Operator's Guide and the ajsentry in 2. Commands in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 1.
For details about macro variables see 2.2.6 Considerations regarding the use of macro variables in the Job Management Partner 1/Automatic Job Management System 3 System Design (Work Tasks) Guide.
- Organization of this subsection
(1) Handling of the macro variable specified during registration for execution
The following describes how the macro variable specified during registration for execution is treated.
-
Macro variable for each method of registration for execution
Macro variable names and passing information can be used during registrations for planned execution, fixed execution, and immediate execution. The following table describes how the macro variable is treated for each registration method.
Table 4‒2: How the macro variable is treated for each method of registration for execution Method of registration for execution (option of the ajsentry command)
How the macro variable is treated
Registration for immediate execution (-n)
The specified macro variable is applied.
Registration for planned execution (-s)
The specified macro variable is applied to all the schedules. If you want to change the macro variable that was specified during registration for execution, cancel the registration, change the macro variable, and then re-execute registration.
Registration for fixed execution
Specifying a fixed period (-p (alternatively, -b and -e))
The specified macro variable is applied to all the generations of the jobnet to be executed within the specified fixed period. If you want to change the macro variable for each generation, divide the period and perform registration for each division. If you want to change the macro variable that was specified during registration for execution, cancel the registration for the desired period, change the macro variable, and then re-execute registration.
Specifying the number of generations (-g)
The specified macro variable is applied to all of the specified future generations of the jobnet. If you want to change the macro variable that was specified during registration for execution, cancel the registration, change the macro variable, and then re-execute registration.
Addition (-d)
The specified macro variable is applied to the execution at the specified date and time. If you want to change the macro variable that was specified during registration for execution, cancel the registration, change the macro variable, and then re-execute registration.
-
Macro variables during re-execution
The macro variable name and passing information specified during registration for execution are applied without change during re-execution also.
-
Macro variables during a temporary plan change
Macro variable names and passing information specified at the time of registration for execution continue to apply even during a temporary plan change.
-
Macro variables with identical names
If the macro variable name specified during registration for execution is specified in the preceding job, the passing information for the preceding job is used wherever information is passed from the preceding job. If the same macro variable name is specified in the start condition, the name specified in the start condition prevails.
-
Macro variables when concurrent execution is enabled
The macro variable specified during registration for execution is applied to all the generations of the jobnet, regardless of whether the jobnet allows concurrent execution.
(2) Cluster system
Macro variables specified during registration for execution can be used in all the cluster software products supported by JP1/AJS3.
The following subsections describe the behavior if a failover has occurred.
(a) When the service start mode is set to "Cold"
Only the jobnet and job definition information immediately before the failover has occurred is inherited, and all the jobnets are unregistered. Therefore, the macro variable names and values specified during registration for execution are canceled.
(b) When the service start mode is set to "Warm"
The jobnet is placed in the Interrupted status. A jobnet that has not been started is executed according to its schedule, and the macro variable name and value specified during registration for execution are applied. For a jobnet abnormally terminated by a warm start, check the status, and then re-execute the jobnet manually. When the jobnet is re-executed, the macro variable names and values specified during registration for execution are applied.
(c) When the service start mode is set to "Hot"
The status immediately before the failover is inherited. If the actual job status was successfully acquired, the jobnet is automatically resumed based on the definition, and the macro variable names and values specified during registration for execution are applied. If JP1/AJS3 has failed to acquire information from the server where the job was executed, JP1/AJS3 places the job in the Abnormal end status. If this has occurred, check the job status, and then re-execute the jobnet manually. When the jobnet is re-executed, the macro variable names and values specified during registration for execution are applied.
(3) Cautionary Notes
This subsection provides notes on specifying macro variables during registration for execution.
-
If a macro variable is specified during registration for execution, the name and value of the macro variable are stored in a file on a root jobnet or generation basis. Since the file must be deleted when the registration for execution is canceled, specification of macro variables during registration for execution degrades the system performance. To reduce the turnaround time for unregistration, set asynchronous unregistration for the scheduler service (by setting the BACKGROUNDLEAVE environment setting parameter to yes). For details about settings for BACKGROUNDLEAVE, see 6.1.6 Changing the mode in which unregistration or generation management deletes the generations of a jobnet in the Job Management Partner 1/Automatic Job Management System 3 Configuration Guide 1 (Windows) or 15.1.6 Changing the mode in which unregistration or generation management deletes the generations of a jobnet in the Job Management Partner 1/Automatic Job Management System 3 Configuration Guide 1 (UNIX).
-
For a root jobnet that is a remote jobnet, macro variables cannot be specified during registration for execution. Also, for a remote jobnet that is a nested jobnet, macro variables cannot be specified for any dependent jobnet during registration for execution.