Configuring and maintaining a subsystem description on the system i require quite some effort in terms of figuring out exactly how the many subsystem entry types should be dealt with. A subsystem description includes subsystem entries of many different types, such as autostart job, prestart job, workstation name and type, job queue, routing and communication entries. When creating a subsystem description the most appealing option is therefore often to copy an existing subsystem description and subsequently modify it to meet your actual needs.
While the Work with Subsystem Description (WRKSBSD) command allows you to see all the subsystem entries currently associated with the subsystem, there's no way to manipulate these entries directly using this command. In stead you have to evoke a variety of add, change and remove commands for the specific subsystem entry type(s) that you need to perform some type of action against. This means entering all the information by hand, including the subsystem name and library. This approach is of course more error prone and time consuming than using list options supporting the pre-selection of already known command parameters. To alleviate this shortcoming I decided to provide Work with commands for the different subsystem entry types.
I've previously created a couple of subsystem entry commands for other purposes than the practical ones specifically pursued here, Adding to these an array of new subsystem entry commands, it is my intention in this article series to cover all subsystem entry types, and eventually to also provide a new Work with Subsystem Entries (WRKSBSE) command to front-end all these new commands. The first new command presented today is the Work with Job Queue Entries, the command prompt for which you see below:
Work Job Queue Entries (WRKJOBQE)
Type choices, press Enter.
Subsystem . . . . . . . . . . . Name
Library . . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB A help text panel group provides all the details on the command and its single parameter. Running the WRKJOBQE command against the QBATCH subsystem in library QSYS produces a list panel, similar to the one below:
Work with Job Queue Entries WYNDHAMW
29-01-10 18:36:24
Subsystem . . . : QBATCH Subsystem status : *ACTIVE
Library . . . : QSYS Max active jobs : *NOMAX
Type options, press Enter.
2=Change 3=Hold 4=Remove 5=Work with job queue jobs 6=Release
Seq Job Max Current Jobs
Opt Nbr Queue Library Status Jobs Active On queue
10 QBATCH QGPL *RLS 1 0 0
20 QS36EVOKE QGPL *RLS *NOMAX 0 0
50 QTXTSRCH QGPL *RLS *NOMAX 0 0
Bottom
Parameters or command
===>
F3=Exit F4=Prompt F5=Refresh F6=Add job queue entry F9=Retrieve
F11=Display max F12=Cancel F21=Print list
You'll find cursor sensitive online help text to explain each part of the above list panel. In addition to the native job queue commands offered as list options in the panel, there's also a Work with Job Queue Jobs (WRKJOBQJOB) command of my own invention. Selecting option 5 for one or more of the listed job queues will take you to a display having the following appearance:
Work with Job Queue Jobs WYNDHAMW
29-01-10 18:36:43
Job queue . . . : QBATCH Job queue status : RLS
Library . . . : QGPL Subsystem . . . : NOVABATCH
Type options, press Enter.
2=Change 3=Hold 4=End 5=Work with 6=Release 8=Spooled files
Current Job Entered Submitted
Opt Job User Type Pty ----Status----- Time By
QDFTJOBD DRIEHL BCH 5 ACTIVE RUN 19:30:23 DRIEHL
RUNQRY CARSTEN BCH 5 JOBQ RLS 19:35:47 CARSTEN
Bottom
Parameters or command
===>
F3=Exit F5=Refresh F6=Hold job queue F10=Work with subsystem jobs
F11=Display job origin F12=Cancel F21=Print list F24=More keys
The list panel will show you all the jobs that originated in the selected job queue, whether currently being active or still waiting on the job queue. This is quite useful in order to get an overview of the order and correlation of the jobs being processed out of the job queue in question. You also have a number of job related commands at your disposal, making it a bit easier to re-sequence the jobs currently waiting, or perform any other sort of work management activity against these jobs.
The Work with Job Queue Job command was originally presented as part of an article series in the Programming Tips Newsletter covering the Work Management APIs. That article can be seen here.
The final subsystem entry command included with today's article is the Work with Routing Entries (WRKRTGE) command:
Work with Routing Entries (WRKRTGE)
Type choices, press Enter.
Subsystem . . . . . . . . . . . Name
Library . . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Again, you have a simple input parameter providing the qualified subsystem name of the subsystem for which to list the routing entries. And, as usual, an online help text is providing the detail of the command and its parameter. Running the WRKRTGE command on my system against subsystem QBATCH in library QGPL leads to the following list panel being displayed.
Work with Routing Entries WYNDHAMW
29-01-10 18:35:47
Subsystem . . . : QBATCH Subsystem status : *ACTIVE
Library . . . : QSYS
Type options, press Enter.
2=Change 3=Copy 4=Remove
Seq Start
Opt Nbr Program Library Compare value Pos.
15 QCMD QSYS QIGC 1
300 QCMD QSYS QS36EVOKE 1
700 QCL QSYS QCMD38 1
9999 QCMD QSYS *ANY 0
Bottom
Parameters or command
===>
F3=Exit F4=Prompt F5=Refresh F6=Add routing entry F9=Retrieve
F11=View 2 F12=Cancel F21=Print list F24=More keys
For the listed routing entries, in addition to the initial routing entry attributes being shown, employing function key F11 will take you to two alternate views including the remaining routing entry attributes. The native routing entry commands allowing you to change, copy (add) and remove the listed entries are available as list options. Finally, cursor sensitive online help text is included to explain the various parts of the list panel. The Work with Routing Entries command previously appeared in the Programming Tips Newsletter article APIs by Example: Retrieve Subsystem Entries API which can be found here.
The following sources are involved in creating the WRKRTGE, WRKJOBQE and WRKJOBQJOB commands:
CBX9951 -- RPGLE -- Work with Routing Entries - CCP CBX9951E -- RPGLE -- Work with Routing Entries - UIM Exit Program CBX9951H -- PNLGRP -- Work with Routing Entries - Help CBX9951P -- PNLGRP -- Work with Routing Entries - Panel Group CBX9951V -- RPGLE -- Work with Routing Entries - VCP CBX9951X -- CMD -- Work with Routing Entries CBX9952 -- RPGLE -- Work with Job Queue Entries - CCP CBX9952E -- RPGLE -- Work with Job Queue Entries - UIM Exit Program CBX9952H -- PNLGRP -- Work with Job Queue Entries - Help CBX9952P -- PNLGRP -- Work with Job Queue Entries - Panel Group CBX9952V -- RPGLE -- Work with Job Queue Entries - VCP CBX9952X -- CMD -- Work with Job Queue Entries CBX9953 -- RPGLE -- Work with Job Queue Jobs - CCP CBX9953E -- RPGLE -- Work with Job Queue Jobs - UIM Exit Program CBX9953H -- PNLGRP -- Work with Job Queue Jobs - Help CBX9953P -- PNLGRP -- Work with Job Queue Jobs - Panel Group CBX9953V -- RPGLE -- Work with Job Queue Jobs - VCP CBX9953X -- CMD -- Work with Job Queue Jobs CBX9951M -- CLP -- Work with Routing Entries - Build command CBX9952M -- CLP -- Work with Job Queue Entries - Build command CBX9953M -- CLP -- Work with Job Queue Jobs - Build command
To create all above objects, compile and run CBX9951M, CBX9952M and CBX9953M, following the instructions in each source header. As always, you'll also find compilation instructions in the respective source headers.
Click here to download all of the source code for these commands.