CHILDJOB_PGM parameter (defines a program path specification that is to be executed as descendent jobs)
- Organization of this page
Format
#-adsh_conf CHILDJOB_PGM program-path-name [arguments-of-executable-program]
Description
This parameter specifies that when the file specification program-path-name [arguments-of-executable-program] appears in a job definition script, the KNAX6830-I message is to be output to the job execution logs, the file is to be interpreted as a job definition script, and then the file is to be executed as a child job. You can use the JOBLOG_SUPPRESS_MSG parameter to suppress output of the KNAX6830-I message to the job execution logs.
The following shows an example:
- Example specification of parameter:
#-adsh_conf CHILDJOB_PGM sh -x
- Contents of job definition script:
sh -x $HOME/script/test.ash
This example interprets $HOME/script/test.ash as a job definition script and executes it as a child job.
The total number of program-path-name and arguments-of-executable-program operands combined that can be specified is 64. If more than 64 operands are specified, the command will terminate with an error during parameter analysis.
In the Windows edition, even if the CHILDJOB_PGM parameter is omitted from the environment file, a CHILDJOB_PGM parameter with adshscripttool -exec specified for the program path is defined. For details about the adshscripttool command, see adshscripttool command (supports creation of job definition scripts) (Windows only).
Operands
- program-path-name ~<path name>((1 to 1,023 bytes))
-
Defines a program path that is to be converted to a program to be executed as a child job. Specifying as a value only the null character enclosed in double quotation marks (") is not permitted. The backslash (\) is not handled as an escape character.
- arguments-of-executable-program ~<any character string>((1 to 1,023 bytes))
-
Defines arguments of the program path that is to be converted to a program to be executed as a child job. You can specify multiple arguments by delimiting them with the space or tab character. The backslash (\) is not handled as an escape character.
Notes
-
If this parameter is defined in both the system environment file and the job environment file, both definitions take effect. However, if the total number of times this parameter is specified in the system environment file and the job environment file combined exceeds 255, an error occurs.
-
If the same operand is defined in this parameter and the PATH_CONV parameter, conversion by the PATH_CONV parameter is performed first. An example follows:
Contents of environment file
#-adsh_conf PATH_CONV_ENABLE / : <- 1. #-adsh_conf PATH_CONV /usr/bin C:\\usr\\bin <- 2. #-adsh_conf CHILDJOB_PGM /usr/bin/ksh <- 3.
Contents of job definition script
"/usr/bin/ksh" C:\\script\\test.ash
In this example, steps 1 and 2 are executed first to convert /usr/bin/ksh into C:\\usr\\bin\\ksh. In step 3, /usr/bin/ksh is interpreted to be the program path for executing a child job. However, because no matching character string is found in the job definition script whose path has been converted, C:\\script\\test.ash is not executed as a child job.
-
If the same operand is specified in this parameter and the COMMAND_CONV_ARG parameter, conversion by the COMMAND_CONV_ARG parameter is performed first.
-
This parameter is applied to a character string following variable substitution or alias resolution. An example of variable substitution follows:
Contents of environment file
#-adsh_conf CHILDJOB_PGM /usr/bin/ksh
Contents of job definition script (the value of the variable SHELL is assumed to be /usr/bin/ksh)
$SHELL /home/usr/test.ash
In this example, because $SHELL is first resolved as /usr/bin/ksh and is then loaded according to the parameter definition, /home/usr/test.ash is executed as a child job.
-
If this parameter is used to execute a child job, the command name output to the job execution logs is the JP1/Advanced Shell command (adshexec or adshexecsub).
However, if the command is executed in any of the manners listed below, the program path name existing before this parameter is applied is output as the command name to the job execution logs:
-
Execution of a separate process by using a pipe (|)
-
Execution of a separate process by using a command substitution ($(), ``)
-
Execution of a background process by using |&
-
Execution of a subshell by grouping a single command
-
Background execution by using &
-
-
A program path specified in the argument of the exec, command, or eval standard shell command or the time reserved script command is also subject to this parameter.
-
This parameter is applied to the standard shell commands, extended shell commands, functions, and external commands in job definition scripts.
-
Specify a path name and the arguments for the executable program within the permitted maximum line length for the environment file.
Example
These examples execute $HOME/script/test.ash in the job definition script as a child job. The contents of the job definition script and environment file are shown below. The information specified in the CHILDJOB_PGM parameter is underlined.
-
Example 1
- Contents of environment file:
-
#-adsh_conf CHILDJOB_PGM /bin/sh
- Contents of job definition script:
-
/bin/sh $HOME/script/test.ash
-
Example 2
- Contents of environment file:
-
#-adsh_conf CHILDJOB_PGM /opt/jp1as/bin/adshexec
- Contents of job definition script:
-
/opt/jp1as/bin/adshexec $HOME/script/test.ash
-
Example 3
- Contents of environment file:
-
#-adsh_conf CHILDJOB_PGM sh -x
- Contents of job definition script:
-
sh -x $HOME/script/test.ash
-
Example 4
- Contents of environment file:
-
#-adsh_conf CHILDJOB_PGM /usr/bin/env ksh
- Contents of job definition script:
-
/usr/bin/env ksh $HOME/script/test.ash