End Prestart Jobs (ENDPJ)

The End Prestart Jobs (ENDPJ) command ends all jobs and any associated inline data files for a prestart job entry in an active subsystem.

Jobs can be waiting for a request or can already be associated with a request. Spooled output files associated with the jobs being ended can also be ended or allowed to remain on the output queue. The limit on the number of messages being written to each of the job logs can also be changed.

Restrictions:

  1. To use this command, you must have:
    • job control (*JOBCTL) special authority.
    • execute (*EXECUTE) authority to the library that contains the program.
    • use (*USE) authority to all auxiliary storage pool (ASP) device descriptions in the ASP group if the subsystem description specifies an ASP group.
  2. Spooled output files on output queues in independent auxiliary storage pools (ASPs 33-255) are not deleted unless the subsystem description specifies an ASP group and the spooled output files are on output queues in that ASP group.

Parameters

Keyword Description Choices Notes
SBS Subsystem Name Required, Positional 1
PGM Program Qualified object name Required, Positional 2
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OPTION How to end *CNTRLD, *IMMED Optional, Positional 3
DELAY Controlled end delay time 1-999999, 30 Optional, Positional 4
SPLFILE Delete spooled files *NO, *YES Optional, Positional 5
LOGLMT Maximum log entries Integer, *SAME, *NOMAX Optional

Subsystem (SBS)

Specifies the name of the active subsystem that contains the prestart job entry.

This is a required parameter.

name
Specify the name of the active subsystem that contains the prestart job entry.

Program (PGM)

Specifies the qualified name of the program that identifies the prestart job entry.

This is a required parameter.

Qualifier 1: Program

name
Specify the name of the program that identifies the prestart job entry.

Qualifier 2: Library

*LIBL
All libraries in the thread's library list are searched until a match is found.
*CURLIB
The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the library where the program is located.

How to end (OPTION)

Specifies whether the jobs are ended in a controlled manner, which lets the application program perform end-of-job processing, or the jobs are ended immediately.

*CNTRLD
The jobs are ended in a controlled manner. This allows the program that is running to perform 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.
*IMMED
The jobs end immediately. 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 end-of-job processing.

Note: 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.

Controlled end delay time (DELAY)

Specifies the time (in seconds) allowed for the program to complete end-of-job processing during a controlled end. If the end-of-job processing is not completed before the end of the delay time, the job is immediately ended. Only system cleanup is performed. This parameter is not valid if *IMMED is specified for the How to end (OPTION) parameter.

30
A maximum delay time of 30 seconds is allowed for end-of-job processing before each prestart job is ended.
1-999999
Specify the maximum delay time (in seconds) before each prestart job is ended.

Delete spooled files (SPLFILE)

Specifies whether spooled output files created by the jobs are retained for normal processing by a writer or deleted.

*NO
The spooled output files created by the jobs being ended are retained 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.
*YES
The spooled output files created by the jobs being ended and which are on output queues in the system auxiliary storage pool (ASP 1) or in a basic user ASP (ASPs 2-32) are deleted. Spooled output files on output queues in independent ASPs (ASPs 33-255) are not deleted. The job log is not deleted.

Maximum log entries (LOGLMT)

Specifies the maximum number of entries in the message queue of the jobs 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 each job that is ended.

*SAME
The message logging limit does not change. If the logging limit was not changed for these prestart jobs on a previous command, *NOMAX is the value used by the system.
*NOMAX
There is no limit to the number of messages being logged. All messages on each job message queue are written to the job log for each job.
integer-number
Specify the maximum number of messages being written to the job log for each job. This value is the maximum only if it is entered before the job log contains that number of messages. Otherwise, the limit only stops the process of writing any more messages to the job log. If 0 is specified before any messages are written to the log, no job log is produced.

Examples

Example 1: Ending a Job Immediately

ENDPJ   SBS(SBS1)  PGM(PJLIB/PJPGM)  OPTION(*IMMED)
        SPLFILE(*YES)

This command ends all jobs associated with prestart job entry PJPGM in subsystem SBS1 immediately. Spooled output produced by these prestart jobs is deleted and the job log is saved.

Example 2: Delaying a Job End

ENDPJ   SBS(SBS2)  PGM(PJPGM2)  OPTION(*CNTRLD)
        DELAY(50)  SPLFILE(*NO)

This command ends all the jobs associated with prestart job entry PJPGM2 in subsystem SBS2. Spooled output for these prestart jobs is saved for normal processing by the spooling writer. The jobs have 50 seconds to perform any cleanup routines, after which they are immediately ended.

Error messages

*ESCAPE Messages

CPF0922
End Prestart Jobs command not allowed now.
CPF101C
Not authorized to device &1.
CPF1083
Prestart jobs already are ending controlled.
CPF1084
Prestart jobs are already ending immediately.
CPF1227
No authority has been granted to use command.
CPF1317
No response from subsystem for job &3/&2/&1.
CPF1351
Function check occurred in subsystem for job &3/&2/&1.
CPF1834
Prestart job entry for program &1 in &2 does not exist.
CPF9820
Not authorized to use library &1.