6.2.1 Defining variables for work paths used during job execution
You can define variables for the work paths of the following items that are displayed in the Define Details dialog box for a PC job, Unix job, HTTP connection job, or a queue job. Because specific values can be set for these variables for each agent host, the same job definition can be used to execute a job on all agent hosts.
Job definition item |
Whether variable can be defined |
---|---|
Command statement (UNIX only) |
Y |
File name (Windows only) |
Y |
Script file name (UNIX only)# |
Y |
Parameters |
Y |
Environment variables |
-- |
Environment file |
-- |
Working path |
-- |
Standard input |
Y |
Standard output |
Y |
Standard error output |
Y |
File to transfer |
-- |
Destination file |
-- |
- Legend:
-
Y: A variable can be defined for this item.
--: A variable cannot be defined for this item.
- #:
-
The variables discussed in this subsection have no effect in a script file.
The following describes how to define variables for the work paths used during job execution.
- Organization of this subsection
(1) Definition procedure
To define a variable for a job definition item:
-
In Windows Control Panel, open the Services administrative tool, and stop the following services:
-
JP1/AJS3 service
-
JP1/AJS3 Queueless Agent service#
- #:
-
This service needs to be stopped only if queueless jobs are used.
-
-
Execute the following command to set the environment setting parameter described in (2) below:
jajs_config -k definition-key "parameter-name"=value
-
Restart the services that you stopped in step 1.
The new settings are applied.
(2) Environment setting parameter
Definition key |
Environment setting parameter |
Explanation |
---|---|---|
[{JP1_DEFAULT|logical-host}\JP1NBQAGENT\Variable]# |
"variable-name"= |
Specifies the work path for a variable name. |
- #:
-
The specification of the {JP1_DEFAULT|logical-host} part depends on whether the host is a physical host or a logical host. For a physical host, specify JP1_DEFAULT. For a logical host, specify the logical host name.
For details about the definition of this environment setting parameter, see 20.5.2(72) variable-name.
(3) Definition example
The following shows an example of specifying the job definition and commands when the prog1.exe job program is in c:\pp1\bin on the Agent1 host and in d:\pp1\bin on the Agent2 host.
-
Job definition
file-name=$pp1_inst$\prog1.exe
-
Command to be executed on the Agent1 host
jajs_config -k [{JP1_DEFAULT|logical-host}\JP1NBQAGENT\Variable] "pp1_inst"="c:\pp1\bin"
The specification of the {JP1_DEFAULT|logical-host} part depends on whether the host is a physical host or a logical host. For a physical host, specify JP1_DEFAULT. For a logical host, specify the logical host name.
-
Command to be executed on the Agent2 host
jajs_config -k [{JP1_DEFAULT|logical-host}\JP1NBQAGENT\Variable] "pp1_inst"="d:\pp1\bin"
The specification of the {JP1_DEFAULT|logical-host} part depends on whether the host is a physical host or a logical host. For a physical host, specify JP1_DEFAULT. For a logical host, specify the logical host name.
With the above definition and commands, c:\pp1\bin\prog1.exe is executed on the Agent1 host and d:\pp1\bin\prog1.exe is executed on the Agent2 host.
(4) Note
Do not use a character string that begins with JP1, a character string that begins with JP1 is used by the system.