Hitachi

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


3.2.2 Starting batch jobs by using commands from the execution environment

Organization of this subsection

(1) Specifying job definition scripts in the argument of the adshexec command

To start batch jobs by using commands from the execution environment, you use the adshexec command shown below. In Windows, enter the command from the command prompt; in UNIX, enter the command from the shell.

adshexec batchjob1.ash

You can also use the -r option of the adshexec command to directly specify the contents of a job definition script. To specify multiple commands, use the adshexec command as follows:

adshexec -r "export DATA=file01 ; pgm001"

In UNIX, you can also debug batch jobs by specifying the -d option in the adshexec command. For details about the adshexec command, see adshexec command (executes a batch job) in 8.3 Shell operation commands.

(2) Specifying job definition scripts as commands

In UNIX, you can start a batch job by simply entering the name of the job definition script (assuming that execution permissions have been granted to that job definition script) by specifying the path of the adshexec command beginning with #! on the first line (example: #! /opt/jp1as/bin/adshexec).

Job definition script file (file name: /home/user1/scripts/batchjob2.ash):
#! /opt/jp1as/bin/adshexec
#-adsh_job SAMPLE
(followed by the body of the job definition script)
Execution example of batch job start:
/home/user1/scripts/batchjob2.ash
Notes

In Windows, a batch job cannot be started by a method such as specifying from the command prompt the path of the adshexec command beginning with #! on the first line, and then entering the file name of the job definition script.

However, if you provide a job definition script in which #! followed by /opt/jp1as/bin/adshexec or /opt/jp1as/bin/adshexec -m MINIMUM is specified on the first line, and then enter its file name from another job definition script, you can start child jobs in Window as well as in UNIX. Therefore, we recommend that you specify #! followed by /opt/jp1as/bin/adshexec or /opt/jp1as/bin/adshexec -m MINIMUM on the first line of new job definition scripts even in Windows.

If the first line already contains #!/bin/sh, such as when existing shell scripts have been migrated, you can also run the shell scripts as child jobs without editing the scripts.

For details about child jobs, see 3.2.3 Running job definition scripts as child jobs.