Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


adshexec command (executes a batch job)

Organization of this page

Format

To run normally
adshexec [-v] [-c] [-m {EXTENDED|SIMPLE|MINIMUM}]
[-t [-f] [-o asc-file-path-name]] [-h logical-host-name]
[-s {SPOOL|PARENT}] [-x]
{-r command-line|job-definition-script-file-path-name}
[run-time-parameters]
To start in the debugger mode (UNIX only)
adshexec -d [-v] [-c] [-m {EXTENDED|SIMPLE|MINIMUM}]
[-t [-f] [-o asc-file-path-name]] [-h logical-host-name]
[-x] job-definition-script-file-path-name

Description

This command launches the job controller to execute the batch job in the job definition script file specified in an argument. You can also execute commands that would be specified in a job definition script file by directly specifying those commands in the -r option.

The command's arguments are specified before the values to be passed to the job definition script's positional parameters.

Arguments

-d (UNIX only)

Specifies that the job controller is to be started in the debugger mode. This option can be used in a UNIX environment. In the debugger mode, coverage information is collected in memory and continues to be collected each time the run command is executed. The coverage information stored in memory can be displayed by the info coverage command.

If the -t option is not specified, the coverage information collected in memory is discarded when you terminate the debugger with the quit command.

Job definition script operation information is not collected when the -d option is specified.

-v

Specifies that version information is to be displayed; no batch job is executed.

-c

Specifies that the job definition script file's syntax is to be checked.

Only syntax checking is performed; no batch job is executed.

-m {EXTENDED|SIMPLE|MINIMUM}

Specifies how to output the standard output and the standard error output of the job that is to be started. For details about the output modes, see 3.3.4 Suppressing output of information and warning messages to job execution logs.

  • EXTENDED

    Use the expansion output mode.

  • SIMPLE

    Use the simple output mode.

  • MINIMUM

    Use the minimum output mode.

If this option is omitted, the specifications of the OUTPUT_MODE_ROOT and OUTPUT_MODE_CHILD parameters take effect.

This option applies only to the job that is started with the adshexec command and is not inherited by jobs that are started from that job. For a job that is started separately, specify the -m option again in the adshexec command that you use to start the job.

If the root job is run in the simple output mode or the minimum output mode, the standard output is not redirected to a spool file even when the -s option is specified or SPOOL is specified in the OUTPUT_STDOUT environment setting parameter.

If you use the -r option, also specify -m SIMPLE or -m MINIMUM to avoid job execution logs from being mixed together with the output results.

-t

Specifies that coverage information is to be collected while the batch job executes and the collected coverage information is to be output to an asc file when the command terminates.

If the -t option is not specified when the debugger mode is started in UNIX, the coverage information is collected in memory only (however, it can be displayed with the debugger's info coverage command). When you terminate the debugger with the quit command, the collected coverage information is discarded.

-f

Specifies that if coverage information has already been collected, the existing asc file is to be overwritten when differences are detected between the job definition script file to be executed and the backup information. The -f option can be specified only when the -t option is also specified.

When this option is specified

If coverage information has already been collected and differences are detected between the job definition script file to be executed and the backup information, the backup information is discarded and new coverage information is collected.

If no coverage information has been collected, the newly collected coverage information is output to an asc file.

When this option is not specified

If coverage information has already been collected and differences are detected between the job definition script file to be executed and the backup information, a command error occurs and the job definition script file is not executed. The asc file is not updated.

-o asc-file-path-name

Windows: ~<path name>((1 to 229 bytes))

UNIX: ~<path name>((1 to 1,005 bytes))

Specifies the path name for the asc file to be used for collection of coverage information, when you want to use a different file from the existing asc file. The -o option can be specified only when the -t option is also specified.

Omitting this option is equivalent to specifying the asc file in the current directory when the adshexec command is executed. The following shows the format of an asc file name:

name-of-job-definition-script-without-extension_user-name.asc

In the example below, the adshexec command is executed under the following conditions:

  • Current directory when the adshexec command is executed: /home/user1/test

  • User name: user1

  • Name of job definition script: script1.ash

The name of the asc file when the -o option is omitted is as follows:

/home/user1/test/script1_user1.asc

-h logical-host-name ~<logical host name>((1 to 255 bytes))

Specifies the name of the logical host to be used for execution on a logical host. In Windows, the length of the logical host name must not exceed 196 bytes, and it is recommended that it not exceed 63 bytes. If you specify a name that exceeds 63 bytes, the command might not function correctly.

If an empty string is specified for logical-host-name, the value specified in the JP1_HOSTNAME environment variable is assumed. If the JP1_HOSTNAME environment variable is not set, the KNAX0220-E message is output and the command terminates. For details about the JP1_HOSTNAME environment variable, see the Job Management Partner 1/Base User's Guide.

Do not specify this option when running on the physical host.

-s {SPOOL|PARENT}

Specifies the destination for the standard output from the root job. child jobs assume that PARENT was specified in this option.

If this option is omitted, the root job assumes the value specified in the OUTPUT_STDOUT parameter. If the root job is run in the simple output mode or the minimum output mode, the standard output is not redirected to a spool file, regardless of this option.

  • SPOOL

    Output the standard output from the root job to a file on the spool.

  • PARENT

    Output the standard output from the root job to the destination inherited from the parent process when the process starts. Assuming the destination is not later redirected in the parent process, output goes to the same destination as for the parent process.

-x

Enables the xtrace shell option.

You can disable the xtrace shell option by executing set +x or set +o xtrace in the job definition script.

-r command-line

Specifies what is to be executed from the command line. In command-line, you can specify any commands that can be specified in a job definition script, such as standard shell commands and UNIX-compatible commands. Make sure that the command-line specification does not exceed the maximum length permitted for a line of a job definition script (8,191 bytes).

If this option is specified together with the -v option, the -v option takes effect.

In UNIX:

This argument cannot be specified together with the -c, -d, or -t option. An error results if this argument is specified together with any of these options.

In Windows:

This argument cannot be specified together with the -c or -t option. An error results if this argument is specified together with either of these options.

For details, see 3.2.4 Specifying what is to be executed by a job from the command line.

job-definition-script-file-path-name

Windows: ~<path name>((1 to 247 bytes))

UNIX: ~<path name>((1 to 1,023 bytes))

Specifies the path name of the job definition script file that is to be run.

run-time-parameters ~<any character string>((1 to 1,022 bytes))

Specifies values to be stored in the positional parameters of the job definition script. If a run-time parameter includes a space, you must enclose that string in double quotation marks (").

Return codes

Trigger

Return code

-c option specified

-c option not specified

Normal execution of the exit command or of the return command from an outside function

Return code specified in the command

--

Normal execution of an external command by specifying it in the argument to the exec command

Return code of the external command specified in the argument

--

Normal execution of the job definition script through the end of the job definition script file

Return code of the most recently executed standard shell command or extended script command

--

No errors in the job controller in the debugger mode

0

--

No syntax errors in the job definition script file

The job definition script is executed, with the following return code:

  • Return code specified in a command

  • Return code of the most recently executed standard shell command or extended script command

0

Syntax error in the job definition script file

1 or the value set in the ADSH_JOBRC_FATAL environment variable

1 or the value set in the ADSH_JOBRC_FATAL environment variable

An error in the job controller, except for an error in executing the job definition script, such as an error in reading an environment file

1 or the value set in the ADSH_JOBRC_FATAL environment variable

1 or the value set in the ADSH_JOBRC_FATAL environment variable

The job controller process receives a signal and terminates (UNIX only).

128 + signal number

128 + signal number

The job controller process is forcibly terminated from outside, for example from JP1/AJS or the Windows Task Manager (Windows only).

Return code specified by the program that forcibly terminated the job controller

Return code specified by the program that forcibly terminated the job controller

Failure to start the job controller for a reason attributable to the OS (Windows only)

1 to 3

1 to 3

A parsing error occurred in the ADSH_JOBRC_FATAL environment variable.

255

255

Legend:

--: Does not apply because the job definition script is not executed.

Notes

Usage examples