ENDPJ (End Prestart Jobs)
Purpose
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 may be waiting for a request or may already be associated with a request. Spooled files associated with the jobs being ended can also be deleted 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.
Restriction: This command is restricted to a user with job control special authority.
Required Parameters
- SBS
- Specifies the name of the active subsystem that contains the prestart job entry. Specify the name of the subsystem.
- PGM
- Specifies the qualified name of the program for the prestart job entry.
The name of the program can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
program-name: Specify the name of the program for the prestart job entry.
Optional Parameters
- OPTION
- Specifies that the job is either ended in a controlled manner, which lets the application program perform end-of-job processing, or is ended immediately. In either case, the system performs certain job cleanup processing.
*CNTRLD: The job is ended in a controlled manner. This allows the program to perform cleanup (end-of-job processing).
Note: If a controlled end is issued against a job that is suspended because of a Hold Job (HLDJOB) command, a system request option 1, Transfer Secondary Job (TFRSECJOB) command, or Transfer Group Job (TFRGRPJOB) command, the delay time does not start until the job is active. *IMMED: The job is ended immediately. This option may cause undesirable results (for example, if data has been partially updated) and should be used only after a controlled end has been attempted unsuccessfully.
Note: Ending a prestart job with the *IMMED option does not immediately remove the job from the system. The system starts to perform end-of-job cleanup even though the immediate option is specified. This cleanup can be very brief or last several minutes. Functions performed during end-of-job cleanup can include:
- Closing of database files
- Spooling of the job log to an output queue
- End-of-job processing of OS/400 system internal objects
- Displaying the end-of-job display (for interactive jobs)
- DELAY
- Specifies the time (in seconds) allowed for the program to complete end-of-job processing during a controlled end. This parameter is not used if OPTION(*IMMED) is specified. If the cleanup is not complete before the end of the delay time, the job is immediately ended. (Only end-of-job processing is performed.)
30: Up to 30 seconds of delay time is allowed for cleanup before the job is ended.
delay-time: Specify the maximum delay time (in seconds) before the job is ended. Valid values range from 1 through 999999 seconds. For additional information on ending an end-of-file delay job, refer to the EOFDLY parameter in the Override Database File (OVRDBF) command description.
- SPLFILE
- Specifies whether spooled files created by the job are retained for normal processing by a writer or are deleted.
*NO: The spooled files created by the job 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 files created by the job being ended are deleted. The job log is not deleted.
- LOGLMT
- 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 is ended. This option is particularly useful when a job is ended and its message queue contains an excessive number of entries.
If this command is used to change the message logging limit while the messages for the ended job are being written to the spooled file, and if the new limit is greater than the number written at the time the command is entered, messages continue to be written until the new limit is reached. If the new limit is less than the number of messages already written to the spooled file, a message indicating that the limit is reached is immediately put in the spooled file as the last entry, and the rest of the messages on the queue are ignored. If the limit is set to zero before any messages are written to the spooled file, no job log is produced for the ended job.
*SAME: The value does not change.
*NOMAX: There is no limit on the number of messages being logged. Messages on each job message queue are written to the log of each job.
maximum-logged-entries: Specify the maximum number of messages being written to the job log for each job. This value is the maximum if it is entered before the job log contains that many messages. Otherwise, the limit merely stops the process of writing any more messages to the job log. If zero is specified before any messages are written to the log, no job log is produced.
Examples for ENDPJ
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 for ENDPJ
*ESCAPE Messages
- CPF0922
- End Prestart Jobs command not allowed now.
- 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.