397 lines
17 KiB
HTML
397 lines
17 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>End Job (ENDJOB)</title>
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<a name="ENDJOB.Top_Of_Page"></a>
|
|
<h2>End Job (ENDJOB)</h2>
|
|
<table width="100%">
|
|
<tr>
|
|
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
|
|
<b>Threadsafe: </b>No
|
|
</td>
|
|
<td valign="top" align="right">
|
|
<a href="#ENDJOB.PARAMETERS.TABLE">Parameters</a><br>
|
|
<a href="#ENDJOB.COMMAND.EXAMPLES">Examples</a><br>
|
|
<a href="#ENDJOB.ERROR.MESSAGES">Error messages</a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div> <a name="ENDJOB"></a>
|
|
<p>The End Job (ENDJOB) command ends the specified job and any associated inline data files. The job can be on a job queue, it can be active, or it can have already completed running.
|
|
</p>
|
|
<p>You can specify that the application program is given time to control end-of-job processing. If no time is given or if cleanup cannot be performed within the given time, the system performs minimal end-of-job processing, which can include:
|
|
</p>
|
|
<ul>
|
|
<li>Closing the database files.
|
|
</li>
|
|
<li>Spooling the job log to an output queue.
|
|
</li>
|
|
<li>Cleaning up internal objects in the operating system.
|
|
</li>
|
|
<li>Showing the end-of-job display (for interactive jobs).
|
|
</li>
|
|
<li>Completing commitment control processing
|
|
<p>Before ending the job, you should verify that no logical unit of work is in an in doubt state due to a two-phase commit operation that is in progress. If it is, then the value of the Action if ENDJOB commitment option can greatly impact the ENDJOB processing. For example, if the Action if ENDJOB commitment option is the default value of WAIT, this job will be held up and will not complete its end of job processing until the commitment control operation is completed. This ensures database integrity on all related systems. For specific instructions on how to determine these conditions, and for a description of all the impacts of ending this job under these conditions, see the Backup and Recovery book.
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
<p><b>Restrictions:</b> The issuer of the command must be running under a user profile which is the same as the job user identity of the job being ended, or the issuer of the command must be running under a user profile which has job control (*JOBCTL) special authority. This restriction is enforced even when ending the current job.
|
|
</p>
|
|
<p>The job user identity is the name of the user profile by which a job is known to other jobs. It is described in more detail in the Work Management book.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
|
|
<div>
|
|
<h3><a name="ENDJOB.PARAMETERS.TABLE">Parameters</a></h3>
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<!-- col1="10" col2="15" col3="30" col4="10" -->
|
|
<tr>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="4"><a href="#ENDJOB.JOB"><b>JOB</b></a></td>
|
|
<td valign="top">Job name</td>
|
|
<td valign="top">Single values: *<br>Other values: <i>Qualified job name</i></td>
|
|
<td valign="top" rowspan="4">Required, Positional 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Qualifier 1: Job name</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top">Qualifier 2: User</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top">Qualifier 3: Number</td>
|
|
<td valign="top">000000-999999</td>
|
|
</tr><tr>
|
|
<td valign="top"><a href="#ENDJOB.OPTION"><b>OPTION</b></a></td>
|
|
<td valign="top">How to end</td>
|
|
<td valign="top"><b><u>*CNTRLD</u></b>, *IMMED</td>
|
|
<td valign="top">Optional, Positional 2</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#ENDJOB.DELAY"><b>DELAY</b></a></td>
|
|
<td valign="top">Controlled end delay time</td>
|
|
<td valign="top">1-999999, <b><u>30</u></b></td>
|
|
<td valign="top">Optional, Positional 3</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#ENDJOB.SPLFILE"><b>SPLFILE</b></a></td>
|
|
<td valign="top">Delete spooled files</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional, Positional 4</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#ENDJOB.LOGLMT"><b>LOGLMT</b></a></td>
|
|
<td valign="top">Maximum log entries</td>
|
|
<td valign="top"><i>Integer</i>, <b><u>*SAME</u></b>, *NOMAX</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#ENDJOB.ADLINTJOBS"><b>ADLINTJOBS</b></a></td>
|
|
<td valign="top">Additional interactive jobs</td>
|
|
<td valign="top"><b><u>*NONE</u></b>, *GRPJOB, *ALL</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#ENDJOB.DUPJOBOPT"><b>DUPJOBOPT</b></a></td>
|
|
<td valign="top">Duplicate job option</td>
|
|
<td valign="top"><b><u>*SELECT</u></b>, *MSG</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</div>
|
|
<div> <a name="ENDJOB.JOB"></a>
|
|
<h3>Job name (JOB)</h3>
|
|
<p>Specifies the qualified job name of the job to be ended.
|
|
</p>
|
|
<p>This is a required parameter.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*</b></dt>
|
|
<dd>The job from which this command is run is ended. Specifying this value is the only way to end the current job.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 1: Job name</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the job.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 2: User</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the user name that identifies the user profile under which the job is run.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 3: Number</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>000000-999999</i></b></dt>
|
|
<dd>Specify the system-assigned job number.
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<b>Note: </b>If no user name or job number is specified, all jobs currently in the system are searched for the job name. If more than one occurrence of the specified name is found, a qualified job name must be provided either explicitly or through the selection display. Refer to the <b>Duplicate job option (DUPJOBOPT)</b> parameter for more information.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.OPTION"></a>
|
|
<h3>How to end (OPTION)</h3>
|
|
<p>Specifies whether the job ends immediately or in a controlled manner that lets the application program perform end-of-job processing. In either case, the system performs certain job cleanup processing.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*CNTRLD</u></b></dt>
|
|
<dd>The job ends in a controlled manner. This allows the program running to perform cleanup (end-of-job processing). When a job being ended has a signal handling procedure for the asynchronous signal SIGTERM, the SIGTERM signal is generated for that job. The application has the amount of time specified on the DELAY parameter to complete cleanup before the job is ended.
|
|
</dd>
|
|
<dt><b>*IMMED</b></dt>
|
|
<dd>The job ends immediately and the system performs end-of-job cleanup. System cleanup can take from a brief amount of time to several minutes. When a job being ended has a signal handling procedure for the asynchronous signal SIGTERM, the SIGTERM signal is generated for that job and the QENDJOBLMT system value specifies the time limit. Other than by handling the SIGTERM signal, the program that is running is not allowed to perform any cleanup.
|
|
<p>
|
|
<b>Note: </b>The *IMMED value might cause undesirable results if data has been partially updated. This value should be used only after a controlled end has been attempted unsuccessfully.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>When a SIGTERM signal handler is running during the immediate ending of a job, an ENDJOB command with OPTION(*IMMED) can be used to end the SIGTERM signal handler. This is only allowed if the SIGTERM signal handler has already had at least two minutes to run.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.DELAY"></a>
|
|
<h3>Controlled end delay time (DELAY)</h3>
|
|
<p>Specifies the amount of time (in seconds) allowed for the job to complete its cleanup processing during a controlled end. If the cleanup is not completed before the end of the delay time, the job is ended immediately. (Only system cleanup is performed.)
|
|
</p>
|
|
<p>The delay time does not start until the job becomes active if the job is suspended because of one of the following conditions:
|
|
</p>
|
|
<ul>
|
|
<li>The system request option 1 is selected.
|
|
</li>
|
|
<li>The job is held by the Hold Job (HLDJOB) command.
|
|
</li>
|
|
<li>The job is transferred by the Transfer Secondary Job (TFRSECJOB) command.
|
|
</li>
|
|
<li>The job is transferred by the Transfer to Group Job (TFRGRPJOB) command.
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
<b>Note: </b>This parameter is valid only when OPTION(*CNTRLD) is specified.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>30</u></b></dt>
|
|
<dd>A maximum delay time of 30 seconds is allowed for cleanup before the job ends.
|
|
</dd>
|
|
<dt><b><i>1-999999</i></b></dt>
|
|
<dd>Specify the maximum amount of delay time (in seconds) before the job ends.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.SPLFILE"></a>
|
|
<h3>Delete spooled files (SPLFILE)</h3>
|
|
<p>Specifies whether spooled output files created by this job are kept for normal processing or deleted. Regardless of whether the spooled files are deleted, the job logs are kept.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>The spooled output files created by the job being ended are kept for normal processing by a writer. When the job ends, the spooled file action (SPLFACN) job attribute determines whether spooled files are detached from the job or kept with the job.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>The spooled output files created by the job being ended and which are on output queues in the library name space of the thread issuing this command are deleted. The job log is not deleted. If the job has already ended and the spooled file action for the job is to detach the spooled files, the End Job (ENDJOB) command will not find the job and the spooled files will not be deleted.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.LOGLMT"></a>
|
|
<h3>Maximum log entries (LOGLMT)</h3>
|
|
<p>Specifies the maximum number of entries in the message queue of the job being ended that are written to the job log. This parameter can be used to limit the number of messages written to the job log printer file, QPJOBLOG, for a job that ends.
|
|
</p>
|
|
<p>The value specified on this parameter can change the logging limit of the job even if the job is already ending or the job has already ended. The following are examples of how the logging limit can be changed:
|
|
</p>
|
|
<ol>
|
|
<li>If the value specified is greater than the number of messages written at the time the command is issued, messages continue to be written until the new limit is reached.
|
|
</li>
|
|
<li>If the value specified is less than the number of messages already written to the spooled file, a message indicating that the limit has been reached is immediately put in the spooled file as the last entry. The remaining messages on the queue are ignored.
|
|
</li>
|
|
<li>If 0 (zero) is specified before any messages are written to the spooled file, no job log is produced for the job that is ending. If the job has already ended and the job log has not yet been produced, the job log is removed regardless of the value of the job log output (LOGOUTPUT) job attribute. For more information on removing pending job logs, refer to the Remove Pending Job Log (QWTRMVJL) API.
|
|
</li>
|
|
</ol>
|
|
<dl>
|
|
<dt><b><u>*SAME</u></b></dt>
|
|
<dd>The message logging limit does not change. If the logging limit does not change for this job on a previous command, *NOMAX is the value used by the system.
|
|
</dd>
|
|
<dt><b>*NOMAX</b></dt>
|
|
<dd>There is no limit to the number of messages logged; <b>all</b> messages on the job message queue are written to the job log.
|
|
</dd>
|
|
<dt><b><i>integer-number</i></b></dt>
|
|
<dd>Specify the maximum number of messages that can be written to the job log.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.ADLINTJOBS"></a>
|
|
<h3>Additional interactive jobs (ADLINTJOBS)</h3>
|
|
<p>Specifies whether the additional interactive jobs associated with the job specified in the <b>Job name (JOB)</b> parameter are ended.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>Only the job specified in the JOB parameter is ended.
|
|
</dd>
|
|
<dt><b>*GRPJOB</b></dt>
|
|
<dd>If the job specified in the JOB parameter is a group job, all group jobs associated with the group are ended. If the job is not a group job, the job specified in the JOB parameter is ended.
|
|
</dd>
|
|
<dt><b>*ALL</b></dt>
|
|
<dd>All interactive jobs running on the workstation associated with the job specified in the JOB parameter are ended. This includes group jobs and secondary jobs.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="ENDJOB.DUPJOBOPT"></a>
|
|
<h3>Duplicate job option (DUPJOBOPT)</h3>
|
|
<p>Specifies the action taken when duplicate jobs are found by this command.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*SELECT</u></b></dt>
|
|
<dd>The selection display is shown when duplicate jobs are found during an interactive session. Otherwise, a message is issued.
|
|
</dd>
|
|
<dt><b>*MSG</b></dt>
|
|
<dd>A message is issued when duplicate jobs are found.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="ENDJOB.COMMAND.EXAMPLES">Examples</a> </h3>
|
|
<p><b>Example 1: Ending a Job Immediately</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
ENDJOB JOB(JOB1) OPTION(*IMMED) SPLFILE(*YES)
|
|
</pre>
|
|
</p>
|
|
<p>This command ends a job named JOB1 immediately. Spooled output produced by the job is deleted; the job log is saved.
|
|
</p>
|
|
<p><b>Example 2: Saving Spooled Output</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
ENDJOB JOB(001234/XYZ/JOB2) OPTION(*CNTRLD)
|
|
DELAY(50) SPLFILE(*NO)
|
|
</pre>
|
|
</p>
|
|
<p>This command ends a job named 001234/XYZ/JOB2. Spooled output is saved for normal processing by the spooling writer. The job has 50 seconds to perform any cleanup routines, after which it is ended immediately.
|
|
</p>
|
|
<p><b>Example 3: Removing a Pending Job Log</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
ENDJOB JOB(543210/ABCDE/JOB3) LOGLMT(0)
|
|
</pre>
|
|
</p>
|
|
<p>This command removes the pending job log for a completed job named 543210/ABCDE/JOB3. This has the same effect as the Remove Pending Job Log (QWTRMVJL) API.
|
|
</p>
|
|
<p><b>Example 4: Ending the Current Job</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
ENDJOB JOB(*) OPTION(*IMMED)
|
|
</pre>
|
|
</p>
|
|
<p>This command ends the job in which the command is issued. To exit from a SIGTERM signal handling procedure after the required cleanup has been performed, immediately end the current job. Control may be returned to the command issuer, even though the immediate option has been used. To handle this situation, the program which issued this command should return.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="ENDJOB.ERROR.MESSAGES">Error messages</a> </h3>
|
|
<p><b><u>*ESCAPE Messages</u></b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>CPF1317</b></dt>
|
|
<dd>No response from subsystem for job &3/&2/&1.
|
|
</dd>
|
|
<dt><b>CPF1321</b></dt>
|
|
<dd>Job &1 user &2 job number &3 not found.
|
|
</dd>
|
|
<dt><b>CPF1332</b></dt>
|
|
<dd>End of duplicate job names.
|
|
</dd>
|
|
<dt><b>CPF1340</b></dt>
|
|
<dd>Job control function not performed.
|
|
</dd>
|
|
<dt><b>CPF1341</b></dt>
|
|
<dd>Reader or writer &3/&2/&1 not allowed as job name.
|
|
</dd>
|
|
<dt><b>CPF1342</b></dt>
|
|
<dd>Current job not allowed as job name on this command.
|
|
</dd>
|
|
<dt><b>CPF1343</b></dt>
|
|
<dd>Job &3/&2/&1 not valid job type for function.
|
|
</dd>
|
|
<dt><b>CPF1344</b></dt>
|
|
<dd>Not authorized to control job &3/&2/&1.
|
|
</dd>
|
|
<dt><b>CPF1351</b></dt>
|
|
<dd>Function check occurred in subsystem for job &3/&2/&1.
|
|
</dd>
|
|
<dt><b>CPF1352</b></dt>
|
|
<dd>Function not done. &3/&2/&1 in transition condition.
|
|
</dd>
|
|
<dt><b>CPF135D</b></dt>
|
|
<dd>ENDJOB OPTION(*IMMED) not allowed at this time.
|
|
</dd>
|
|
<dt><b>CPF1360</b></dt>
|
|
<dd>&3/&2/&1 already ending because of ENDJOBABN.
|
|
</dd>
|
|
<dt><b>CPF1361</b></dt>
|
|
<dd>Job &3/&2/&1 already ending with *IMMED option.
|
|
</dd>
|
|
<dt><b>CPF1362</b></dt>
|
|
<dd>Job &3/&2/&1 has completed.
|
|
</dd>
|
|
<dt><b>CPF1363</b></dt>
|
|
<dd>Job &3/&2/&1 is already ending *CNTRLD.
|
|
</dd>
|
|
<dt><b>CPF8172</b></dt>
|
|
<dd>Spool control block for job &10/&9/&8 damaged.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDJOB.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</body>
|
|
</html>
|