Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC) Threadsafe: No |
Parameters Examples Error messages |
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 done so that the operator can do things like backing up the system or loading new programs. This condition is called the restricted state and is required for operations like saving the system or reclaiming storage. If two jobs are active in the controlling subsystem at the console, neither of the jobs is forced to end. The ENDSYS command cannot complete running until you end one of the jobs (either by signing off in one job or by ending 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. This 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 workstation function job.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
OPTION | How to end | *CNTRLD, *IMMED | Optional, Positional 1 |
DELAY | Controlled end delay time | 0-99999, *NOLIMIT | Optional |
ENDSBSOPT | End subsystem option | Single values: *DFT Other values (up to 3 repetitions): *NOJOBLOG, *CHGPTY, *CHGTSL |
Optional |
CONFIRM | Confirm | *ENVVAR, *YES, *NO | Optional |
Top |
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.
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.
Top |
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 instructions.
Top |
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.
Top |
Specifies whether the request should be confirmed before the system is ended.
Top |
Example 1: Ending System Activity
ENDSYS
This 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.
Top |
*ESCAPE Messages
Top |