Viewing Active Jobs on the IBM i

The system value QACTJOB sets the initial number of active jobs for which memory is allocated during IPL. To view this value, enter DSPSYSVAL SYSVAL(QACTJOB).

To view the CPU usage of individual jobs, we bring up the Work with Active Jobs screen by entering the command WRKACTJOB. The Work with Active Jobs screen shows what jobs are currently active. The Work with Active Jobs screen lists the jobs are running on the system, and enables us to change, hold or end the jobs or associated subsystems.

There are several types of active jobs, including autostart jobs, ASJ, batch jobs, BCH, batch immediate jobs, BCI, interactive jobs, INT, prestart jobs, PJ, subsystem monitor jobs, SBS, and system jobs, SYS. In the Work with Active Jobs screen we can see these codes listed in the Type column.

In the Status column, we can see a number of different status codes, the most common of which are CNDW, DEQW, EVTW, RUN, SELW, SIGW, and TIMW. The CNDW status means that the job is waiting for the handle-based conditions. The DEQW status means that the job is waiting for the completion of a dequeue operation. The EVTW status means that the job is waiting for an event. The SELW status means that the job is in a select wait. The SIGW status means that the job is waiting for a signal. The TIMW status means that the job is waiting for a time interval to end.

The WRKACTJOB command’s SBS parameter enables us to view the jobs from a particular subsystem. For instance, to view all the jobs currently running in the QSERVER subsystem, we run the command WRKACTJOB SBS(QSERVER). The QSERVER subsystem is for file-serving work. File server jobs and the database host server daemon job, QZDASRVSD, run in this subsystem.

The Work with User Jobs command, WRKUSRJOB, displays jobs by user profile name, and the Work with Subsystem Jobs command, WRKSBSJOB, displays jobs by subsystem name.

We can use the Work with User Jobs command, WRKUSRJOB, to segregate jobs that a particular user is running, no matter what status they have. Entering WRKUSRJOB without a parameter lists all of our jobs that are currently running or that have ended.  The Status column displays the status of our various jobs. If the Status is OUTQ, then the job is on an output queue. A job on the output queue typically has been completed. Type ‘5’ next to the desired entry and press Enter to see the Work with Job screen for that particular job. Entering the command WRKUSRJOB USER(*ALL) displays all of the jobs for all of the users, and entering the command WRKUSRJOB USER(*ALL) STATUS(*ACTIVE) displays all of the active jobs for all of the users on the system.

We can use the Work with Subsystem Jobs command, WRKSBSJOB, to segregate the jobs that are executing on a particular subsystem. For example, to view all jobs running in subsystem QBASE, we would issue the command WRKSBSJOB SBS(QBASE). This displays a list of active jobs in the subsystem QBASE; we can enter ‘5’ next to any of the listed jobs to work with it in greater detail.

You can view the runtime attributes of a job by running the Work with Job command, WRKJOB. Entering the command WRKJOB JOB(QTCPIP) will display a list of all jobs named QTCPIP. Entering 5 next to the job will take us to the Work with Job screen for that job. QTCIP normally runs in the QSYSWRK subsystem, and is the TCP/IP base program that must be running for any TCP/IP services to be used.

Entering the command WRKJOB JOB(QPWFSERVSD) will display a list of jobs named QPWFSERVSD. The QPWFSERVSD job is a Client Access server job, specifically the job running the file server daemon. Entering ‘1’ next to the job will bring up the Work with Job screen; at the top of this screen are the three elements that make up a job name on the IBM i: the name, the user, and the system-assigned job number. There is a menu of further options below. Entering ‘1’ here will show us the job status attributes.

The Display Job command, DSPJOB, shows information about a job that is in the system, irrespective of whether it is active or inactive. The default for the DSPJOB command is to display the current job, which is our interactive session. Entering ‘1’ at the Display Job screen will show the job status attributes for the selected job.

Network based backup for IBM i and iSeries systems:

Viewing Active Jobs on the IBM i

Viewing Objects

An object is an encapsulated abstraction of an entity, with encapsulated here implying that there is a specified interface for interacting with or using the object. For example, a ‘person’ object would accept input via the five senses, and a ‘shovel’ object would best be utilized through its handle, which is its primary interface. In the IBM i context, an object is named unit on which commands may be executed. Almost everything on the IBM i is an object.

Intrinsic to objects are the various object types. On the IBM i, different objects have different types. All objects are categorized by type. A library, type *LIB, is an object used to group related objects. Programs, type *PGM, are objects used for executed modules. Commands are objects as well; they have a type of *CMD and are stored in the system library.

When we create an object we can give it a name, but the object type is determined by the command used to create it. Most CL commands can only be used for objects of a specific type, although there are a few that can work with any type of object.

The Work with Objects command, WRKOBJ, shows us a list of objects from one or more libraries. The Work with Objects command has one required parameter, OBJ. We can specify *ALL for the OBJ parameter to view all objects in the libraries in our library list. To view all the objects in our current library, we issue the command WRKOBJ OBJ(*CURLIB/*ALL).  To view all the objects in library QSYS2, we issue the command WRKOBJ OBJ(QSYS2/*ALL). To view all of the objects in user libraries, meaning almost all of the libraries that do not start with ‘Q’, we enter the command WRKOBJ OBJ(*ALLUSR/*ALL). Finally, to view all of the objects on the system, we run the command WRKOBJ OBJ(*ALL/*ALL).

All objects have descriptions and we can view the description of an object from with the Work with Objects list screen by entering an 8 next to the object we wish to view and pressing Enter.

We can use the OBJTYPE parameter to indicate the object type we wish to view. For example, to display all of the programs stored in library QSYS, we would issue the command WKROBJ OBJ(QSYS/*ALL) OBJTYPE(*PGM).

The Display Object Description command, DSPOBJD, can be used to view the names and attributes of specific objects within libraries as well as the names and attributes of the libraries themselves. The main advantage of the Display Object Description command, DSPJOBD, over the Work with Objects command, WRKOBJ, is that the output from DSPJOBD can be sent to a file to view later, and the command can be executed in a batch program.

We can enter in the command DSPOBJD and then press F4 to prompt the command. The DSPOBJD command has two required parameters, OBJ and OBJTYPE. For example, to display the object description for the QBASE subsystem job queue, enter DSPOBJD OBJ(QGPL/QBASE) OBJTYPE(*JOBQ). This will take us to to the Display Object Description – Basic screen, which provides us with a list of objects matching the parameters. In this instance, there is one single object, since we provided a qualified name for the object and indicated the object type.

However, the DSPOBJD command can also be used to generate a list of multiple objects. For example, if we wanted to view all objects named QSYSOPR in library QSYS, we would issue the command DSPOBJD OBJ(QSYS/QSYSOPR) OBJTYPE(*ALL). Entering this command should list two different objects, the user profile for QSYSOPR and the message queue associated with that user profile.

The DETAIL parameter can be used to specify the level of information we wish to view. The three options for the DETAIL parameter are *BASIC, *FULL, and *SERVICE. A full attribute display shows all the attributes associated with an object, while the service attribute display shows information regarding saves, restores, and system information. To get the full attribute display for the QSYSOPR message queue, we enter the command DSPOBJD OBJ(QSYS/QSYSOPR) OBJTYPE(*MSGQ) DETAIL(*FULL).

Wanting to get the most out of your IBM i investment? Take a look at, the friendly IBM backup solution.

Viewing Objects