ENDSYS (End System)
Purpose
The End System (ENDSYS) command ends most activity on the system and leaves the system in a condition in which only the console is active in the controlling subsystem. This is normally done so that the programs to diagnose equipment problems can be run. This condition is called the restricted state and is required for operations like SAVSYS or RCLSTG.
If two jobs are active in the controlling subsystem at the console (through the use of the system request key), neither of the jobs is forced to end. The ENDSYS command cannot complete running until the user ends one of the jobs (either by signing off in one job or by canceling one job from the other).
All active subsystems are notified that an end system operation is in process. No new jobs or routing steps can be accepted by the subsystems. The ENDSYS command also specifies what happens to all active work.
Interactive jobs that are transferred to a job queue by the Transfer Job (TFRJOB) command are ended as part of subsystem ending. If an initial program load (IPL) occurs while either a batch or interactive job is on a job queue (because of the TFRJOB command), that job is removed from the job queue during IPL and its job log is produced.
Restriction:
This command can be entered only in an interactive job in the controlling subsystem. To use this command, the user must have job control (*JOBCTL) authority. This command is not allowed in a pass-through job or in a work station function job.
Optional Parameters
- OPTION
- Specifies whether all active jobs are ended in a controlled manner (which lets the application programs perform end of processing) or immediately. In either case, the system performs certain job cleanup functions.
*CNTRLD: The job is ended in a controlled manner. This allows the program to perform cleanup (end-of-job processing).
*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.
- DELAY
- Specifies the amount of time (in seconds) that the controlled end operation is allowed. If this amount of time is exceeded and the end operation is not complete, any jobs still being processed are ended immediately, except for those running long-running system instructions.
*NOLIMIT: The amount of time to complete a controlled end operation is not limited.
delay-time: Specify the number of seconds in which the end operation is completed. Valid values range from 1 through 99999 seconds.
- ENDSBSOPT
- Specifies the options to take when ending the active subsystems. In general, specifying these options will improve the performance of the ENDSYS command. Each option has certain side effects that you need to analyze before using that option.
This parameter has no effect on jobs that are already in the ending status.
*DFT: The subsystems will end with no special ending options.
- Joblogs will be produced.
- The run priority will not change.
- The timeslice value will not change.
*NOJOBLOG: No joblogs will be created for jobs that are ended due to this command being invoked. This includes subsystem monitor jobs and all user jobs in the subsystem. This option can significantly reduce the amount of time necessary to complete the ENDSYS command. However, if a problem occurs in a job, there will be no joblog to record the problem, which may make problem diagnosis difficult or impossible.
*CHGPTY: The CPU priority of jobs that are ending is changed to a higher value (worse priority). The remaining active jobs on the system may have better performance when *CHGPTY is specified. However, jobs that are ending may take longer to finish. This option is ignored if the subsystem is ending controlled. But if the DELAY time limit expires, this option will take affect immediately.
*CHGTSL: The timeslice of jobs that are ending is changed to a lower value. The remaining active jobs on the system may have better performance when *CHGTSL is specified. However, jobs that are ending may take longer to finish. This option is ignored if the subsystem is ending controlled. But if the DELAY time limit expires, this option will take affect immediately.
- CONFIRM
- Specifies whether the request should be confirmed before the system is ended.
*ENVVAR: The value in environment variable QIBM_ENDSYS_CONFIRM is used to determine whether the request should be confirmed. If the value is set to *YES or *NO, the action described below for that value is taken. If the environment variable is not defined or not set to one of these values, then there is no confirmation.
*YES: A confirmation panel is displayed when the ENDSYS command is issued.
*NO: There is no confirmation when the ENDSYS command is issued.>
Examples for ENDSYS
Example 1: Ending System Activity
ENDSYSThis command ends the system activity after all active jobs in the system are allowed to perform their own end of processes. The amount of time the end can take is not limited.
Example 2: Ending System Activity After Jobs are Ended
ENDSYS OPTION(*IMMED)This command ends system activity after all active jobs are immediately ended.
Error messages for ENDSYS
*ESCAPE Messages
- CPF1001
- Wait time expired for system response.
- CPF1017
- ENDSYS not allowed when console powered or varied off.
- CPF1032
- System ending with *CNTRLD option.
- CPF1033
- System ending with *IMMED option.
- CPF1034
- All subsystems ending with *CNTRLD option.
- CPF1035
- Subsystems ending with *IMMED option.
- CPF1036
- System powering down with *CNTRLD option.
- CPF1037
- System powering down with *IMMED option.
- CPF1038
- No authority to use command.
- CPF1051
- Command can only be run in controlling subsystem.
- CPF1082
- Controlling subsystem already ending to single job.
- CPF1091
- Function check occurred in system arbiter.