Introduction to Subsystem
The subsystem is the one where jobs run. There are several systems supplied by IBM i subsystems that run different types of jobs.
Subsystem description actually tells how much and where the jobs enter a subsystem and which resource the subsystem allocates for that job.
Subsystems used for server jobs
The server jobs are configured to run in different subsystems depending upon their function. The following is the list of subsystems used for the server jobs.
- QSYSWRK: All the daemon jobs run in this subsystem.
- QUSRWRK: In this subsystem, server jobs run for the servers Network Print, Remote command, and Program call, Central, Data Queue, Signon, and Database.
- QSERVER: In this subsystem, the file server, database server daemon jobs run.
Subsystem supplied by IBM
- QBASE (controlling subsystem): It supports Interactive, Batch, and Communication Jobs. It has an autostart job that automatically starts the QSERVER, QSPL, and QUSRWRK subsystems.
- QSERVER: It is a file server subsystem.
- QSPL: It is a spool subsystem that supports reader and writer jobs.
- QSYSWRK: It is a system work subsystem. It gets started automatically at the time of system startup.
- QUSRWRK: It is a user work subsystem. It contains jobs that are started by servers to perform functions for users.
- QCTL (controlling subsystem): It has an autostart job that automatically starts the QINTER, QBATCH, QCMN, QUSRWRK, QSERVER, and QSPL subsystems.
- QINTER: It supports Interactive Jobs.
- QBATCH: It supports batch jobs.
- QCMN: It supports communication jobs excluding TCP/IP jobs.
How to create AS400 Subsystem?
To create our own subsystem to run interactive/batch jobs we need to create basic items. After that, we can start or end the subsystem.
- Subsystem Description
- Job Queue
- Class Object
- Routing Entries
Let's discuss the above items.
Create Subsystem Description (CRTSBSD)
CRTSBSD SBSD(library_Name/Subsystem_Name) POOLS((1 *BASE)) MAXJOBS(10) TEXT('Created Test Subsystem')
The subsystem will run in pool 1 and use *BASE as main memory storage and 10 jobs can be present inside the subsystem at one time.
Create Job Queue (CRTJOBQ)
CRTJOBQ JOBQ(Library_Name/JobQueue_Name) TEXT('Created Test Job Queue')
Add Job Queue Entry (ADDJOBQE)Once the JOBQ is created, We need to attach the JOBQ to subsystem.
ADDJOBQE SBSD(Library_Name/Subsystem_Name) JOBQ(Library_Name/JobQueue_Name) MAXACT(5)
MAXACT parameter tells that the maximum number of jobs that can be processed at a time inside this JOBQ.
Create Class (CRTCLS)
CRTCLS CLS(Library_Name/Class_Name) RUNPTY(40)
Class defines the run time attributes such as Run priority, Time Slice, Default wait time, Maximum temporary storage, etc.
Add Routing Entry (ADDRTGE)
ADDRTGE SBSD(Library_Name/Subsystem_Name) SEQNBR(50) CMPVAL(TEST) PGM(Library_Name/Program_Name) CLS(Library_Name/Class_Name)
This command will add routing entry 50 to the subsystem description in the library(Library_Name/Subsystem_Name). To use routing entry 50, the routing data must start with the character string TEST starting in position 1. Any number of routing steps can be activated through this entry at any one time. The program in the library (Library_Name/Program_Name) is to run in storage pool 1 by using class in the library(Library_Name/Class_Name).
Additional Steps for Starting and Ending Subsystem
Start Subsystem (STRSBS)
Once the Subsystem is started, it can be used to submit the jobs.
End Subsystem (ENDSBS):
The subsystem can be ended by using the ENDSBS command.
Work with Subsystem (WRKSBS)
To work with subsystems we can use WRKSBS command on command line.
Work with Subsystems System: PUB400 Type options, press Enter. 4=End subsystem 5=Display subsystem description 8=Work with subsystem jobs Total -----------Subsystem Pools------------ Opt Subsystem Storage (M) 1 2 3 4 5 6 7 8 9 10 #SYSLOAD 0,00 2 QBATCH 0,00 2 QBATCH2 0,00 2 QBATCH3 0,00 2 QCMN 0,00 2 QCTL 0,00 2 QHTTPSVR 0,00 2 QINTER 0,00 2 3 QINTER2 0,00 2 3 QSERVER 0,00 2 QSPL 0,00 2 4 QSYSWRK 0,00 2 QUSRWRK 0,00 2 RZKHWORK 0,00 2 Parameters or command ===> F3=Exit F5=Refresh F11=Display system data F12=Cancel F14=Work with system status Already at top of area.