A subsystem is a single, predefined operating environment through which the system coordinates the work flow and resource use. The system can contain several subsystems, all operating independently of each other. Subsystems manage resources. The run-time characteristics of a subsystem are defined in an object called a subsystem description. Subsystem enable better performance tuning.
A subsystem description is a system object that includes general definitions and storage pool definitions.
The general definitions includes subsystem name, description and maximum number of jobs to run in the subsystem.
Storage pool attributes determine how the subsystem uses memory for work, where work can enter the subsystem, how much work the subsystem can handle, how much main storage (memory) will be used, and how quickly jobs in the subsystem can run.
To create a simple subsystem, we need four elements:
* A subsystem description that describes the overall working environment of the subsystem, including the number of jobs it can run at one time and the OS/400 storage pools the subsystem uses
* A job queue, where OS/400 submits jobs that are meant to run in the subsystem
* A class object that describes the runtime attributes of jobs entering this subsystem
* One or more routing entries that tell the subsystem how to process incoming requests
To perform the first step for our own subsystem, creating the subsystem description, use CRTSBSD command. To create a MTHEND subsystem, the CRTSBSD command might look like this:
Eg: CRTSBSD SBSD(QGPL/MTHEND)
The second subsystem creation task is to make a unique OS/400 job queue where jobs can be queued up waiting to be processed in your new subsystem. Job queues are created by using the Create Job Queue (CRTJOBQ) command. To create a MTHEND job queue, the CRTJOBQ command might look like this:
Eg: CRTJOBQ JOBQ(QGPL/MTHEND)
Once the job queue is created, it's a simple matter to attach it to your subsystem by using the Add Job Queue Entry (ADDJOBQE) command, as follows:
Eg: ADDJOBQE SBSD(QGPL/MTHEND)
Our third step is to use the Create Class (CRTCLS) command to create a class object that describes the run priority, time slice, or purge attributes for jobs running in this subsystem. Use the following command:
Eg: CRTCLS CLS(QGPL/MTHEND)
Our fourth step is to create a routing entry that tells OS/400 what to do with incoming requests for subsystem MTHEND (through a Submit Job, or SBMJOB, command for batch processing). In our case, we merely want the subsystem to invoke the command processor (QCMD) to run any command contained in incoming jobs. To do this, we use the Add Routing Entry (ADDRTGE) command, as follows:
Eg: ADDRTGE SBSD(QGPL/MTHEND)
The default subsystems are
1. QCTL - Controlling Subsytem, this subsystem will always be up as soon as the system is started.
2. QINTER - All interactive jobs will run in QINTER subsytem.
3. QBATCH - All batch jobs will run in QBATCH subsystem.
4. QCMN - All communication jobs will run in QCMN subsystem.
5. QSPL - QSPL handles spooled file jobs, including placing files or jobs into disk storage for later processing or printing.
6. QSYSWRK - QSYSWRK coordinates system functions that are started automatically at system startup and when the system comes out of restricted state.
7. QSERVER - This is the file server subsystem. All server jobs will run in this subsystem.
8. QUSRWRK - This is the user work subsystem. It executes prestart jobs and jobs that are started by servers to do work on behalf of a user.
A subsystem description is a system object that includes general definitions and storage pool definitions.
The general definitions includes subsystem name, description and maximum number of jobs to run in the subsystem.
Storage pool attributes determine how the subsystem uses memory for work, where work can enter the subsystem, how much work the subsystem can handle, how much main storage (memory) will be used, and how quickly jobs in the subsystem can run.
To create a simple subsystem, we need four elements:
* A subsystem description that describes the overall working environment of the subsystem, including the number of jobs it can run at one time and the OS/400 storage pools the subsystem uses
* A job queue, where OS/400 submits jobs that are meant to run in the subsystem
* A class object that describes the runtime attributes of jobs entering this subsystem
* One or more routing entries that tell the subsystem how to process incoming requests
To perform the first step for our own subsystem, creating the subsystem description, use CRTSBSD command. To create a MTHEND subsystem, the CRTSBSD command might look like this:
Eg: CRTSBSD SBSD(QGPL/MTHEND)
The second subsystem creation task is to make a unique OS/400 job queue where jobs can be queued up waiting to be processed in your new subsystem. Job queues are created by using the Create Job Queue (CRTJOBQ) command. To create a MTHEND job queue, the CRTJOBQ command might look like this:
Eg: CRTJOBQ JOBQ(QGPL/MTHEND)
Once the job queue is created, it's a simple matter to attach it to your subsystem by using the Add Job Queue Entry (ADDJOBQE) command, as follows:
Eg: ADDJOBQE SBSD(QGPL/MTHEND)
Our third step is to use the Create Class (CRTCLS) command to create a class object that describes the run priority, time slice, or purge attributes for jobs running in this subsystem. Use the following command:
Eg: CRTCLS CLS(QGPL/MTHEND)
Our fourth step is to create a routing entry that tells OS/400 what to do with incoming requests for subsystem MTHEND (through a Submit Job, or SBMJOB, command for batch processing). In our case, we merely want the subsystem to invoke the command processor (QCMD) to run any command contained in incoming jobs. To do this, we use the Add Routing Entry (ADDRTGE) command, as follows:
Eg: ADDRTGE SBSD(QGPL/MTHEND)
THE FOLLOWING IS A LIST OF SUBSYSTEM RELATED COMMANDS:
- To start a subsystem, use the Start Subsystem (STRSBS) command.
- To end a subsystem, use the End Subsystem (ENDSBS) command.
- To delete a subsystem description, use the Delete Subsystem Description (DLTSBSD) command. To use the DLTSBSD command, the subsystem cannot be active.
- To change subsystem description, use Change Subsystem Description (CHGSBSD) command.
- To display subsystem description, use Display Subsystem Description (DSPSBSD) command.
- To start a subsystem using BRMS, use STRSBSBRM command.
- To work with subsystems, use WRKSBS command.
- To work with subsystem description, use WRKSBSD command.
- To work with subsystem jobs, use WRKSBSJOB command
The default subsystems are
1. QCTL - Controlling Subsytem, this subsystem will always be up as soon as the system is started.
2. QINTER - All interactive jobs will run in QINTER subsytem.
3. QBATCH - All batch jobs will run in QBATCH subsystem.
4. QCMN - All communication jobs will run in QCMN subsystem.
5. QSPL - QSPL handles spooled file jobs, including placing files or jobs into disk storage for later processing or printing.
6. QSYSWRK - QSYSWRK coordinates system functions that are started automatically at system startup and when the system comes out of restricted state.
7. QSERVER - This is the file server subsystem. All server jobs will run in this subsystem.
8. QUSRWRK - This is the user work subsystem. It executes prestart jobs and jobs that are started by servers to do work on behalf of a user.