Job Management Partner 1/Automatic Job Management System 3 Overview
During registration for execution, you can specify macro variables and their values (passing information). If the specified macro variables 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 illustrates processing when values of a macro variable are specified during registration for execution.
Figure 4-5 Processing when values of a macro variable are specified during registration for execution
Macro variable value 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 variable values 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.
- Organization of this subsection
- (1) Scope of the macro variable value
- (2) How to check macro variables
- (3) Setting the status when replacement of a macro variable has failed
- (4) Cluster system
- (5) Cautionary Notes
(1) Scope of the macro variable value
The scope of the macro variable value is as follows.
n Macro variable value for each method of registration for execution
Macro variables and passing information can be used during registrations for planned execution, fixed execution, and immediate execution. The following table describes how the macro variable value is treated for each registration method.
Table 4-2 How the macro variable value is treated for each method of registration for execution
Method of registration for execution (option of the ajsentry command) How the macro variable value is treated Registration for immediate execution (-n) The specified macro variable value is applied. Registration for planned execution (-s) The specified macro variable value is applied to all the schedules. If you want to change the macro variable value that was specified during registration for execution, cancel the registration, change the macro variable value, and then re-execute registration. Registration for fixed execution Specifying a fixed period (-p) The specified macro variable value 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 value for each generation, divide the period and perform registration for each division. If you want to change the macro variable value that was specified during registration for execution, cancel the registration for the desired period, change the macro variable value, and then re-execute registration. Specifying the number of generations (-g) The specified macro variable value is applied to all of the specified future generations of the jobnet. If you want to change the macro variable value that was specified during registration for execution, cancel the registration, change the macro variable value, and then re-execute registration. Addition (-d) The specified macro variable value is applied to the execution at the specified date and time. If you want to change the macro variable value that was specified during registration for execution, cancel the registration, change the macro variable value, and then re-execute registration. n Macro variable values during re-execution
The macro variable and passing information specified during registration for execution are applied without change during re-execution also.
n Macro variable values during a temporary plan change
Macro variables and passing information specified at the time of registration for execution continue to apply even during a temporary plan change.
n Macro variable values with identical names
If the name of the macro variable specified during registration for execution has already been specified for the preceding job, the passing information for the macro variable of the preceding job is applied wherever the preceding job uses the passing information. If the same macro variable name is specified in the start condition, the name specified in the start condition prevails.
n Macro variable values when concurrent execution is enabled
The macro variable value specified during registration for execution is applied to all the generations of the jobnet, regardless of whether the jobnet allows concurrent execution.
(2) How to check macro variables
The following describes how to check macro variables before and after registration for execution.
(a) Checking macro variables before registration for execution
JP1/AJS3 - View or the ajsprint -v command can display a list of macro variables used in subordinate units. For details, see 15.3.21 Variables Used dialog box in the Job Management Partner 1/Automatic Job Management System 3 Operator's Guide and the ajsprint in 2. Commands in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 1.
The following figure illustrates an example of listing macro variables by using the ajsprint command.
Figure 4-6 Example of listing macro variables used in subordinate units
(b) Checking macro variables after registration for execution
JP1/AJS3 - View can display the macro variables and passing information specified during registration for execution. Also, JP1/AJS3 - View can display the macro variables passed during job execution and the results of passing. For details, see 15.7.10 Inherit Result dialog box in the Job Management Partner 1/Automatic Job Management System 3 Operator's Guide.
You can also use the ajsshow command to check macro variables after registration for execution. By specifying a %MV two-byte format indicator in the -i option, the command can display the macro variables passed during job execution and the results of passing. When there are multiple output results, they are separated using a comma (,). When there are multiple generations, they are output one to a line. An example of the output results of the ajsshow command is shown below:
ajsshow -F AJSROOT2 -g 2 -i "%MV" /net "AJS2ENV:/jp1_data/Job_Report","AJS2COM:c:\temp\test.exe" "AJS2ENV:/jp1_data/Job_Report","AJS2COM:c:\temp\test.exe" ajsshow -F AJSROOT2 -i "%MV" /net2 "AJS2ENV:/jp1_data2/Job Report","AJS2COM:c:\temp\test2.exe"For details about the ajsshow command, see the ajsshow in 2. Commands in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 1.
The following table lists the unit types, unit statuses, and whether the results of passing can be displayed.
Table 4-3 Whether the results of passing can be displayed
Unit type Unit status Whether the results of passing can be displayed Root jobnet Not registered -- Other statuses Yes#1 Nested jobnet -- -- Job#2, #3 Not registered -- Not sched. to exe. -- Waiting for prev. to end -- Being held -- Now queuing -- Waiting to execute -- Now running -- Ended normally Yes Normal end + False Yes Ended with warning Yes Ended abnormally Yes Failed to start Yes Unknown end status Yes Killed Yes Not executed -- Bypassed -- Interrupted monitoring Yes Shutdown --
- Legend:
- Yes: The results can be displayed.
- --: The results cannot be displayed.
- #1
- Remote jobnets are excluded.
- #2
- The following jobs are excluded:
The jobs subordinate to remote jobnets
The jobs deleted during suspension
The jobs added during suspension (other than those added after suspension is canceled)
- #3
- If the job status is changed, whether results can be displayed depends on the new status.
The results of passing for a job are displayed based on the passing information at that time. By displaying the results of passing, you can check the information to be passed when the job is re-executed.
- Supplementary note
- The results of passing differ from the previous execution in the following cases:
- When the preceding job from which information is passed is being-re-executed:
The information passed from the preceding job is not displayed.
- When the preceding job from which information is passed was re-executed and the re-execution has finished:
The passing information after the preceding job is re-executed is displayed.
- When the preceding job from which information is passed was deleted during suspension:
The information passed from the preceding job is not displayed.
(3) Setting the status when replacement of a macro variable has failed
The MACROCHANGEFAIL environment setting parameter can set whether to change the status of the job to Ended abnormally (Failed to start) if replacement of a macro variable has failed.
For details about how to use the parameter, see 6.2.10 Setting the action to be taken if the value of a macro variable cannot be passed in the Job Management Partner 1/Automatic Job Management System 3 Configuration Guide 1 (Windows) or 14.2.10 Setting the action to be taken if the value of a macro variable cannot be passed in the Job Management Partner 1/Automatic Job Management System 3 Configuration Guide 1 (UNIX).
(4) Cluster system
Macro variable values 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 variables 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. The jobnets that were not started will be executed according to the schedule. 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 variables 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 variables 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 variables and values specified during registration for execution are applied.
(5) Cautionary Notes
This subsection provides notes on specifying macro variable values during registration for execution.
- If macro variable values are specified during registration for execution, the specified information is stored in a file for each root jobnet or for each generation. Since the file must be deleted when the registration for execution is canceled, specification of macro variable values 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 14.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 variable values cannot be specified during registration for execution. Also, for a remote jobnet that is a nested jobnet, macro variable values cannot be specified for any dependent jobnet during registration for execution.
Copyright (C) 2009, 2010, Hitachi, Ltd.
Copyright (C) 2009, 2010, Hitachi Solutions, Ltd.