ajsdefine
- Organization of this page
Format
ajsdefine [-F service-name] [-S] [{-x|-t}] [{-i|-e|-f}] [-p] [-d destination-unit-name] [unit-definition-file-name...]
Description
Defines a unit based on the parameters coded in a unit definition file.
For details about a unit definition file, see 5.1 Creating a unit definition file.
If you define a unit under a unit for which the upper-level unit-attribute inheritance function is set, a function will set the owner and JP1 resource group of the defined unit. For details on this function, see 6.4.1(4)(a) Overview of the upper-level unit-attribute inheritance function in the JP1/Automatic Job Management System 3 System Design (Work Tasks) Guide.
Execution privileges
You must have any of the following JP1 privileges:
-
JP1_AJS_Admin privilege
-
JP1_AJS_Manager privilege
-
JP1_AJS_Editor privilege
Arguments
-F service-name
Specify the name of the target scheduler service.
You can specify a character string of 1 to 30 bytes.
-S
This option makes it possible to update the definitions of nested jobnets and jobs, even for suspended jobnets that have been registered for execution. Even for suspended jobnets, however, you cannot update definitions in the following situations:
-
While the definition of the root jobnet is being updated
-
While the definitions of job groups containing the definition of the root jobnet are being updated
-
While jobnets are being executed
-x
Defines a unit based on the parameters coded in a unit definition file.
-t
Performs only a syntax check for the parameters coded in a unit definition file.
-i
Displays a message with a confirmation prompt if the definition destination contains a unit having the same name as the unit coded in the unit definition file. If you enter y for this prompt, the unit name is forcibly updated.# This option generates an error if the unit definition file contains the specification of units having the same name in the same layer.
- #
-
Delete the unit to be forcibly updated and subordinate units, and then create a unit and code in the unit definition file.
-e
Generates an error without updating information, if the definition destination contains a unit having the same name as the unit coded in the unit definition file. This option generates an error if the unit definition file contains the specification of units having the same name in the same layer. The system does not update information.
-f
Forcibly updates# the unit if the definition destination contains a unit that has the same name as the unit coded in the unit definition. This option generates an error if the unit definition file contains the specification of units having the same name in the same layer.
- #
-
Delete the unit to be forcibly updated and subordinate units, and then create a unit and code in the unit definition file.
-p
When the upper-level unit-attribute inheritance function is enabled, specify this option to ignore the unit-attribute profile when defining the unit.
Specify this option when you want to define units exactly as they appear in a unit definition file output by the ajsprint command.
-d destination-unit-name
Specify the name of the job group or jobnet in which you want to define the unit.
You can specify a character string of 1 to 930 bytes. You cannot specify the logical host name or execution ID. You cannot specify a job group or jobnet for which the number of nested units exceeds 30 (10 if the DEFLENTYPE environment setting parameter is set to sjis), the maximum allowed.
If this option is omitted, the root job group (/) is assumed, in which units will be created.
unit-definition-file-name
Specify the name of the file in which you defined the unit definition parameters (attributes of the unit).
You can specify a character string of 1 to 255 bytes.
You can specify more than one unit definition file. You cannot use wildcard characters here.
If the coding of any unit definition file is invalid, the system stops processing that file but continues processing other files.
If you omit this option, the system inputs the unit definition parameters from the standard input.
Notes
-
Either of the following users can define a unit:
-
A user granted the update privilege for the definition destination of the unit
-
A JP1 user mapped to the OS user who has Administrators or superuser privileges
Note, however, that if yes is set after changing the ADMACLIMIT environment setting parameter from its default, even a JP1 user who was mapped to an OS user with Administrators or superuser privileges must have the update privilege.
-
-
If an error occurs while the unit is being defined, the unit is deleted and the command ends abnormally. When a unit is forcibly updated by specifying the -i or -f option, if an error occurs after the unit to be updated is defined, the unit is deleted and the command ends abnormally.
-
If you forcibly update a job group or a jobnet by specifying the -i or -f option, the schedule for jobnet that references the forcibly updated job group is not recalculated. The schedule for jobnet for which the forcibly updated jobnet is specified in the exclusive schedule is also not recalculated.
-
If you forcibly update a unit by specifying the -i or -f option, the following jobnets that are registered for planned execution or for fixed execution for a specified number of future generations might be placed in Shutdown status or their execution schedules might not be created:
-
Jobnets for which the job group to be updated is specified in Refer to the calendar of another job group option
-
Jobnets for which the jobnet to be updated is specified in Exclusive schedule option
To prevent this, perform either of the following operations:
-
Cancel the registration of the jobnets mentioned in 1 or 2 above, and then execute the ajsdefine command with the -i or -f option specified.
-
Change the unit definition by using the ajscalendar, ajschange, or ajschgnet command, not by using the ajsdefine command.
-
-
If the jobnet specified for destination-unit-name is in either of the following states, this command terminates abnormally:
-
The jobnet is registered for execution, and is not in the suspend status.
-
The jobnet has been edited exclusively by JP1/AJS - View.
-
-
You cannot define a job group in a jobnet.
-
You cannot define a unit in a job, manager job group or manager jobnet.
-
You cannot update information about a root jobnet registered for execution or information about any job group or planning group containing that root jobnet.
-
For a jobnet registered for execution, you cannot define a unit in the jobnet or in its upper-level or lower-level unit.
-
In the following units, however, specifying the -s option in this command while keeping the target jobnet suspended allows you to specify information without having to cancel the registration of the jobnet: units in the root jobnet, those in the job groups containing the root jobnet, and those in other than remote jobnets. (If the target unit is currently being executed, specifying the -s option will not allow you to update the information.)
-
You cannot define a planning group in a jobnet.
-
You cannot define any unit other than a jobnet or remote jobnet in a planning group.
-
If you use the command to define a jobnet, the system does not check the consistency of the execution order of units.
A jobnet in which units will result in a loop or a judgment job without any associated dependent units results in an error and is placed in Invalid exe. seq. status.
-
If you attempt to define a unit in a release target jobnet (root jobnet for which release entry is made), the definition of the unit is added to the jobnet definitions in Being applied status.
-
You cannot define jobnet connectors or start conditions in release target jobnets (root jobnets for which release entry is made).
-
If a unit definition file is large, the command might abnormally terminate due to insufficient memory. If this happens, split the file so that each part is less than 200 MB.
Return values
0 |
Normal end |
Multiple of 4 within the range from 4 to 124 |
Abnormal end |
Additional information
If the window position is not specified for units to be defined, they are automatically located in an empty space on the Jobnet Editor window in JP1/AJS3 - View (somewhere from the top left to the bottom right).
Example
The following command defines a unit in job group /group1 based on the parameters coded in unit definition file /tmp/unit_def:
ajsdefine -d /group1 /tmp/unit_def