Job Management Partner 1/Automatic Job Management System 3 Command Reference 1
Format
ajschgstat
[-F service-name]
[-t new-status]
[-v current-status]
[-c end-code]
[-h execution-host-name]
[-B execution-registration-number]
[-R]
[-E]
[-J]
[-X {yes|no|auto}]
job-name-or-jobnet-name-or-job-group-name...
Description
The ajschgstat command changes the status of a job or jobnet connector. Changing the status of a job also changes the status of a jobnet containing that job.
Execution privileges
You must have any of the following JP1 privileges:
- JP1_AJS_Admin privilege
- JP1_AJS_Manager privilege
- JP1_AJS_Operator privilege
Arguments
-F service-name
Specify the name of the target scheduler service.
You can specify a character string of 1 to 30 bytes.
-t new-status
Specify the new status to which you want to change the current status of a job or jobnet connector. You cannot specify this option for a judgment job.
Table 2-2 shows the statuses that can be specified and their meanings.
Table 2-3 shows which new statuses you can specify for a job when you want to change the current status. Likewise, Table 2-4 shows which new statuses you can specify for a jobnet connector when you want to change the current status.
Table 2-2 Statuses after change
Status Description normal Ended normally fail Failed to start
You cannot specify this for jobnet connector.warning Ended with warning abnormal Ended abnormally bypass Bypassed
You cannot specify this for jobnet connector.exit Change the status according to the end code and job threshold.
Changed to "Ended normally," "Ended with warning", or "Ended abnormally."
You cannot specify this for OR jobs, event jobs, action jobs, or jobnet connector.Table 2-3 Possible combinations (for a job)
Current
New Ended normally Failed to start Ended with warning Ended abnormally Bypassed Waiting for previous to end -- -- -- -- -- Being held -- -- -- -- -- Waiting to execute Indeterminate Indeterminate Indeterminate Indeterminate -- Now queuing Yes Yes Yes Yes -- Now running Yes -- Yes Yes -- Ended normally N/A Yes Yes Yes Yes Failed to start Yes N/A Yes Yes Yes Ended with warning Yes Yes N/A Yes Yes Ended abnormally Yes Yes Yes N/A Yes Killed Yes Yes Yes Yes Yes Unknown end status Yes Yes Yes Yes Yes Not executed, and ended Yes Yes Yes Yes Yes Bypassed Yes Yes Yes Yes N/A Now fault detecting Yes -- -- -- --
- Legend:
- Yes: Possible
- Indeterminate: Possible for queueless jobs and not possible for other jobs.
- --: Not possible
- N/A: Not applicable
Table 2-4 Possible combinations (for a jobnet connector)
Current New Ended normally Ended with warning Ended abnormally Not sched. to exe. No No No Waiting for previous to end No No No Not executed, and ended Yes Yes Yes Bypassed Yes Yes Yes Now running Yes Yes Yes Running + Warning Yes Yes Yes Now fault detecting Yes Yes Yes Ended normally -- Yes Yes Ended with warning Yes -- Yes Ended abnormally Yes Yes -- Killed Yes Yes Yes Unknown end status Yes Yes Yes Shutdown Yes Yes Yes
- Legend:
- Yes: Possible
- No: Not possible
- --: Not applicable
-v current-status
Specify the current status of the job.
The system can change the status of the job only if the current status of the job coincides with the status specified with this option. You cannot specify this option for a judgment job.
The following table lists the statuses you can specify.
Table 2-5 Statuses before change
Status Description queuing Now queuing running Now running normal Ended normally fail Failed to start warning Ended with warning abnormal Ended abnormally unknown Unknown end status unexec Not executed, and ended bypass Bypassed abend Failed to start, Ended abnormally, Killed, Unknown end status or Not executed, and ended exec-wait Waiting to execute noend Now queuing or Now running -c end-code
Specify the end code for the job.
- UNIX
- You can specify a value between 0 and 255.
- Windows
- You can specify a value between -2,147,483,648 and 2,147,483,647.
This option is valid only when the job is currently placed in an end status or when you change the job to an end status (an end status refers to "Ended normally," "Failed to start," "Ended with warning," "Ended abnormally," "Unknown end status," "Not executed, and ended" or "Bypassed"). You cannot specify this option when changing the status of a jobnet connector.
To set the job end result according to the value of the end code specified with this option, specify exit for the -t option. Note, however, that you cannot specify the -t option for a judgment job. You can only change the end code.
If you use the -t option to set the end status for a running job without specifying the -c option, the system assumes 0 as the end code.
-h execution-host-name
Specify the name of the host to execute the job.
You can specify a character string of 1 to 255 bytes.
-B execution-registration-number
Specify the execution registration number of the jobnet containing the job for which you want to change the status, in the YYYYMMDDNNN format. The meaning of YYYYMMDDNNN is as follows:
YYYY: Year of the date of execution
MM: Month of the date of execution
DD: Day of the date of execution
NNN: Execution registration sequence number for the date of execution
If you omit this option, the system assumes the execution registration number for the root jobnet containing the target job. (If the root jobnet is running, the system assumes the execution registration number for the current generation. Otherwise, the system assumes the execution registration number for the last generation in the log information.)
For details of the execution registration number, see 4.5.13 Methods of specifying generations when executing commands in the manual Job Management Partner 1/Automatic Job Management System 3 Overview.
-R
Specify this option if you want to change the status of all jobs or jobnet connectors included in the specified unit.
If you specify this option with the -E or -J option, the system modifies the status of jobs or jobnet connector according to the specification of each option.
-E
Changes the status of jobs in a jobnet registered for execution or the status of jobnet connector.
-J
Changes the status of a job.
-X {yes|no|auto}
Specify whether to automatically select the current unit for operation from the units listed in a planning group. The units in the job group are not, however, automatically selected regardless of the specified value. You cannot omit a root jobnet name.
- yes
Specify this to automatically select a target unit.
When specifying a unit name in the command, omit a root jobnet name in a planning group.
- no
Specify this if you do not want to automatically select a target unit.
You must specify a unit for which the command will operate. You cannot omit a root jobnet name in a planning group.
- auto
Whether a target unit will automatically be selected depends on how the unit name is specified.
- If you want to automatically select a target unit
Specify a unit name without a root jobnet name in a planning group.
- If you do not want to automatically select a target unit
Specify a unit name with a root jobnet name in a planning group. The command will operate for the specified unit only. However, if there is a unit having the same name as the path name specified without a root jobnet name in a planning group, a root jobnet name is assumed to be omitted so that a target unit will be selected automatically.
job-name-or-jobnet-name-or-job-group-name
Specify the name of the job for which you want to change the status. You can also specify a job name, jobnet name, or job group name with the -R, -E, or -J option.
You can specify a character string of 1 to 930 bytes.
You can specify more than one job name, jobnet name or job group name.
You can specify an execution ID as a job name. If you specify an execution ID, however, the -B option is disabled. For details about how to specify the execution ID, see 1.1 Command syntax.
You cannot specify a logical host name.
Notes
- This command terminates abnormally if you execute it when a scheduler service is not running.
- If you use JP1/AJS3 - View or the ajschgstat command to change the end status of a job being executed, the succeeding unit begins execution. If you change an abnormally ended job to the normal end status, however, the succeeding unit will not be executed.
- If you use JP1/AJS3 - View or the ajschgstat command to change the end status of a job being executed, an event, a message, or log information indicating the end of the job is output. If you change the status of an ended job, no event, message, or log information indicating the end of the job is output.
- You cannot use this command for units subordinate to remote jobnets.
- This command terminates abnormally if the target job is in a suspended state.
- You cannot change the status of an event job or judgment job defined in start conditions.
- When you specify that a target unit automatically be selected from the units in a planning group, an error occurs if you do not have the appropriate operation privilege for the automatically selected unit.
- When the -X option is omitted, a target unit in a planning group is determined according to the value specified for the AJSAUTOJUDGE environment variable.
- For an explanation of how to specify the name of a unit in a planning group, see Additional informations in ajsplan in 2. Commands.
- The command cannot perform an operation on suspended jobnet connectors.
Return values
0 Normal end Multiple of 4 within the range from 4 to 124 Abnormal end
Example
The following command changes the status of the abnormally ended job (job1) to "Ended normally." This job is contained in the root jobnet (net1) and the job group name is set in environment variable AJSPATH (if the job group name is set in environment variable AJSPATH, you can omit the specification of the job group when executing the command).
ajschgstat -t normal -v abnormal net1/job1
Copyright (C) 2009, 2010, Hitachi, Ltd.
Copyright (C) 2009, 2010, Hitachi Solutions, Ltd.