3.1.3 Defining batch jobs as UNIX jobs
This subsection explains the items required to define JP1/Advanced Shell batch jobs as UNIX jobs.
-
Script file name
Specify the path of the adshexec command in Script file name on the Definition tab in the Define Details - [UNIX Job] dialog box or in sc="script-file-name" in the unit definition file:
/opt/jp1as/bin/adshexec
Alternatively, you can specify the path of the adshexec command following #! on the first line (example: #!/opt/jp1as/bin/adshexec), and then specify the path of the job definition script file with execution permissions granted:
Path of job definition script file
-
Command statement
You can specify, as part of command text, the path of the adshexec command or path of the job definition script file in the same way as for the script file name. Specify the path in Command statement on the Definition tab in the Define Details - [UNIX Job] dialog box, or in te="command-text" in the unit definition file. If a job defined in the command statement is terminated forcibly in JP1/AJS, the following restrictions apply.
-
Depending on the timing at which forced termination is performed, you might not be able to reference the contents of the job execution log or standard error output for the job from JP1/AJS - View. In this case, you can check the contents of the job execution log in the spool job directory.
-
Jobs with return code 143 are output to the job execution log. However, jobs with return code -1 can be referenced from JP1/AJS - View.
-
Parameters
Specify the options, job definition script file name, and runtime parameters for the adshexec command in Parameters on the Definition tab in the Define Details - [UNIX Job] dialog box or in prm="parameter" in the unit definition file.
If you specified a job definition script file name for the script file name, specify only the runtime parameters.
Environment variables
Specify the following value in Environment variables on the Definition tab in the Define Details - [UNIX Job] dialog box or in env="environment-variable" in the unit definition file:
AJS_BJEX_STOP=TERM
The following figure shows a specification example of a JP1/Advanced Shell batch job In this example, the adshexec command is specified for "script file name" and job definition script file path is specified.