We all know that a key advantage to IBM i is the work management capabilities, in particular the ability to segregate work into different subsystems. One of the more challenging areas for this, however, has been prestart server jobs. By default, these prestart jobs run in the QUSRWRK subsystem. You can configure the subsystem in which these prestart server jobs run by routing the requests based upon the client IP address, but that’s often not sufficient. Many requests may come from one IP address, or perhaps you would like to segregate work based upon some other criteria – for example, the requesting user profile.
Until recently, your options were limited. However, with two new IBM i Services provided at the IBM i 7.1 TR10 and IBM i 7.2 TR2 timeframe, you now have another way to route your work.
Like several of my recent blogs, this function is provided via an IBM i Service. You need to have the required level of the Db2 group PTF installed – level 34 for 7.1 or level 5 for 7.2. This support is in the base operating system for releases 7.3 and later.
There are two IBM i Services that provide this function:
This service allows you to configure the QZDASOSINIT (DB) or QRWTSRVR (DDM/DRDA) server jobs such that the work is routed to different subsystems based upon the requesting user profile.
By default, these server jobs will run in QUSRWRK. They also support routing work by the client IP address from which the work request originates. This new support allows you to route the work based upon the user profile.
You will need to create the subsystem description for where you want the work to run, along with all the related objects (job queue, job queue entry, class, prestart job entries). You then use this new service, which is a procedure that you call, to specify the mapping of the requesting user profile to the desired subsystem.
You invoke it as follows:
CALL QSYS2.SET_SERVER_SBS_ROUTING('DAWN', 'QZDASOINIT', 'DAWNMAY')
The above procedure will result in database work requests that run in the QZDASOINIT jobs for user profile DMAY to be routed to the subsystem DAWNMAY.
Note that this is an SQL procedure so you cannot just call it from the command line. You need to use RUN SQL scripts or something similar to run it.
This service simply allows you to retrieve the configuration you have created with the SET_SERVER_SBS_ROUTING service. Using RUN SQL scripts for example, you can execute the following:
SELECT * FROM QSYS2.SERVER_SBS_ROUTING;
Using my example from above, this service returns the configuration I set up to route QZDASOINIT requests for the various DAWN* user profiles to the DAWNMAY subsystem:
After you have done your configuration and set up the subsystem routing, a quick look with WRKACTJOB will show your jobs running in the specified subsystem. In the screen capture below, I did a WRKACTJOB SBS(DAWNMAY), which shows my database requests are indeed running in my own subsystem (along with other various work).
With these TCP/IP Services, you now have another way to manage your work requests and take advantage of IBM i work management capabilities.
This blog post was edited for currency on April 14, 2020.
This blog post was originally published on IBMSystemsMag.com and is reproduced here by permission of IBM Systems Media.