Now, Get RPG Codes in all three formats only on this website on every RPGLE related programming article.

Fixed, /Free and Fully Free RPG

AS400 Subsystem

AS400 Subsystem
AS400 Subsystem, subsystem,how to create subsystem, what is susbsystem, ibmi subsystem,Subsystem example,IBM supplied Subsystems,IBM supplied Subsystems example,QBASE,QSPL,QCTL,QINTER,QBATCH,QCMN,QSPL,QSPL,Work with System Status,WRKSYSSTS,work with system status,System pool,,Create Subsystem description,CRTSBSD,Create Job queue,CRTJOBQ,System pool size,IBM supplied pools,Procedure to create subsystem,how to create subsystem,Steps of creating the subsystem,Steps to create the subsystemintroduction,about,what is,what,create,Subsystem example,IBM supplied Subsystems,IBM supplied Subsystems example,QBASE,QSPL,QCTL,QINTER,QBATCH,QCMN,QSPL,QSPL,Work with System Status,WRKSYSSTS,work with system status,System pool,,Create Subsystem description,CRTSBSD,
AS400 Subsystem

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.

  1. QSYSWRK: All the daemon jobs run in this subsystem.
  2. QUSRWRK: In this subsystem, server jobs run for the servers Network Print, Remote command, and Program call, Central, Data Queue, Signon, and Database.
  3. QSERVER: In this subsystem, the file server, database server daemon jobs run.

Subsystem supplied by IBM

  1. QBASE (controlling subsystem): It supports Interactive, Batch, and Communication Jobs. It has an autostart job that automatically starts the QSERVER, QSPL, and QUSRWRK subsystems.
  2. QSERVER: It is a file server subsystem.
  3. QSPL: It is a spool subsystem that supports reader and writer jobs.
  4. QSYSWRK: It is a system work subsystem. It gets started automatically at the time of system startup.
  5. QUSRWRK: It is a user work subsystem. It contains jobs that are started by servers to perform functions for users.
  6. QCTL (controlling subsystem): It has an autostart job that automatically starts the QINTER, QBATCH, QCMN, QUSRWRK, QSERVER, and QSPL subsystems.
  7. QINTER: It supports Interactive Jobs.
  8. QBATCH: It supports batch jobs.
  9. 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.

  1. Subsystem Description
  2. Job Queue
  3. Class Object
  4. Routing Entries

Let's discuss the above items.

Create Subsystem Description (CRTSBSD)

CRTSBSD SBSD(library_Name/Subsystem_Name)          
        POOLS((1 *BASE))                
        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)

STRSBS SBSD(Library_Name/Subsystem_Name)

Once the Subsystem is started, it can be used to submit the jobs.

End Subsystem (ENDSBS):

ENDSBS SBSD(Subsystem_Name)

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.                                                        

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain