Work with Active Jobs (WRKACTJOB) is a familiar command that's been around since the AS/400 called itself a S/38. As such, we don't think about WRKACTJOB too much. Like a contented spouse in a well-established marriage, AS/400 professionals tend to take WRKACTJOB for granted. We only use those features that we're familiar with, the comfortable ones, never seeing everything that's there and never realizing the other qualities WRKACTJOB brings to the table.
The purpose of this article is to take a second look at WRKACTJOB and see what else is there besides what we've become accustomed to. By the time I'm finished, you'll have a better grasp of how to use this command to understand and manage your system more effectively.
The Purpose of WRKACTJOB
Before I start, it might be useful to look at what WRKACTJOB is and what it does. A sample printout from a WRKACTJOB screen is shown in 1. Simply put, WRKACTJOB gives you performance and status statistics for the jobs running on your AS/400. It allows you to view and modify your active jobs to improve throughput and to balance your system. It is a valuable tool because it breaks down your system performance by individual job. This breakdown allows you to identify problem jobs and to adjust your system configuration so your AS/400 can continue to run smoothly.
Before I start, it might be useful to look at what WRKACTJOB is and what it does. A sample printout from a WRKACTJOB screen is shown in Figure 1. Simply put, WRKACTJOB gives you performance and status statistics for the jobs running on your AS/400. It allows you to view and modify your active jobs to improve throughput and to balance your system. It is a valuable tool because it breaks down your system performance by individual job. This breakdown allows you to identify problem jobs and to adjust your system configuration so your AS/400 can continue to run smoothly.
Like its distant cousin, Work with System Status (WRKSYSSTS), WRKACTJOB can provide performance information as a snapshot (what is happening at this very moment?) or over an elapsed time period (what has happened since the last time I ran this command?). You can use it to troubleshoot problems that are occurring now or to obtain short-term averages on what the system is up to.
WRKACTJOB specializes in giving you job information; it offers very little in the way of overall system information. The few system statistics it does provide, however, are worth the price of admission. Right at the top of the display are three numbers that can be valuable if your system is suffering from performance problems?Elapsed Time, CPU %, and Active Jobs. These numbers provide the backdrop for all the other information on the screen. Without them, individual job statistics are meaningless.
Elapsed Time is the most important field on the screen. It refers to the amount of time that has passed between the time you started measuring job performance/status with WRKACTJOB and the current time. All the information shown on this screen is collected and averaged over the amount of time specified in this field. This tells you whether the statistics are a snapshot or a short-term trend. You can reset WRKACTJOB to zero seconds elapsed time by pressing the F13 key.
CPU % is the total average percentage of CPU used during the Elapsed Time. It's a quick-look total system parameter that tells you whether your system is in trouble or gliding along smoothly. For example, if you run WRKACTJOB over a five-minute elapsed time period and see the CPU % is 99.5 percent for that entire time, you might conclude your system is in trouble. However, if your system is running at 99.5 percent over a ten-second interval, you might want to reset the statistics and see if the computer continues to run at that high rate. The high percentage may have been a temporary burst in processor demand that will not continue. The key point here is that WRKACTJOB can examine your system over any time period you want.
Active Jobs is the current number of active jobs in your system. IBM defines an active job as a running job. This field includes both system and user jobs. It's a good eyeball number for looking at your current system load.
Parameters on WRKACTJOB
If you type in WRKACTJOB and press the F4 key to prompt for parameters, you'll see a screen similar to 2. This is where most people stop with WRKACTJOB, with the decision to display information on the screen or send it out to a printer.
If you type in WRKACTJOB and press the F4 key to prompt for parameters, you'll see a screen similar to Figure 2. This is where most people stop with WRKACTJOB, with the decision to display information on the screen or send it out to a printer.
However, if you press the F10 key for additional parameters, a different group of fields appears on the screen. These parameters are shown in the bottom half of 3 under the Additional Parameters title. They control whether the system statistics should be reset to zero, what jobs should be included or excluded on the screen, and the sequence in which the information is presented. These parameters are one key to refining your WRKACTJOB screen so that it only shows you the information you want to view and filters out the rest. Let's look at each of these functions in turn.
However, if you press the F10 key for additional parameters, a different group of fields appears on the screen. These parameters are shown in the bottom half of Figure 3 under the Additional Parameters title. They control whether the system statistics should be reset to zero, what jobs should be included or excluded on the screen, and the sequence in which the information is presented. These parameters are one key to refining your WRKACTJOB screen so that it only shows you the information you want to view and filters out the rest. Let's look at each of these functions in turn.
WRKACTJOB Time Intervals
The Reset parameter is available as a command line parameter and as an option on the WRKACTJOB screen. The purpose of Reset is simple. It tells OS/400 whether you want to reset all the statistics on the WRKACTJOB screen to zero or extend the analysis from the last time you ran WRKACTJOB. It also resets the elapsed time field to zero seconds. Using Reset, you can toggle between looking at your average system statistics and looking at a snapshot.
You reset your statistics by specifying RESET(*YES) on the command line or by pressing F13 on the WRKACTJOB screen. The default parameter is *NO, meaning WRKACTJOB should extend out the statistical averages since the last time you ran the command. To reset the statistics from the command line, type in the following prompt:
WRKACTJOB RESET(*YES)
Reset should be used intelligently. As mentioned above, you can get a snapshot of your job performance or take an average. However, you probably do not want to make major changes to your system based on one set of readings taken over five seconds. The sluggishness you see may be a result of a one-time event that has ended, and you may want to look at average readings over a slightly longer period, say two to five minutes. However, if you never reset your WRKACTJOB screen, you may be looking at averages over too long a time period. For analyzing current trends, there isn't much value in looking at job performance over a three hour period. All the statistics may be obscured, and you won't be able to tell anything at all about what is or isn't happening.
Including and Excluding Jobs
WRKACTJOB offers four parameters that let you view slices of your AS/400 performance rather than the whole system. This is useful when you only want to view jobs in a specific subsystem, jobs that use more than a certain percentage of CPU time, jobs that suffer from poor response time, or jobs of a certain name or type. By using these parameters, you can narrow down your search for a misbehaving or malfunctioning job.
The Subsystem (SBS) parameter tells WRKACTJOB to only include specific subsystems in your display. If you only want to look at your interactive jobs, you could type in the following command:
WRKACTJOB SBS(QINTER)
If you want to look at multiple subsystems, you can type in a list of the subsystems to show. To look at QINTER and QBATCH at the same time, type this command:
WRKACTJOB SBS(QINTER QBATCH)
To view jobs that are consuming more than a certain minimum percentage of CPU time, you can use the CPU Percent Limit (CPUPCTLMT) parameter. The default value is *NONE, meaning that all jobs are shown. For example, to find all jobs using more than five percent of the CPU, you could type in the following:
WRKACTJOB CPUPCTLMT(5.0)
This is useful for quickly finding jobs that are abusing your CPU.
If you're looking at communication parameters and you want to find jobs that have a high response time, you can use the Response Time Limit (RSPLMT) parameter. The default value is zero seconds, which tells WRKACTJOB to display all jobs, but you can reset this parameter to only show jobs that exceed the response time limit you have set. Limits can be defined down to a tenth of a second, and you can set the limit as low as one-tenth of a second or as high as 999.9 seconds.
The JOB parameter (new in V3R1) allows you to subset the WRKACTJOB screen by job name or job type. You can enter a specific or generic job name that you want to view. In this case, only jobs that meet that name criteria will be displayed. System jobs and subsystem monitors are not included in the results. The value *SYS causes only system jobs to be displayed. If you specify *SYS for the JOB parameter, you must also take the default value of *ALL for the subsystem (SBS) parameter. Specifying *SBS for the JOB parameter causes only subsystem monitors to be displayed. This provides you with a way to determine which subsystems are active.
Most of these parameters are not exclusive of each other. You can use them in combination. The important thing to remember is that they are available to help you narrow down your search in finding system problems.
A New WRKACTJOB Order
The only parameter on the WRKACTJOB command that I haven't discussed so far is the Sequence (SEQ) field. This field allows you to resequence the display to show the active jobs in an order that will improve your understanding of what's going on in your system. The WRKACTJOB default shows you the jobs in subsystem (*SBS) order. With other options you can display jobs sorted by amount of auxiliary I/O, CPU percentage, amount of CPU time since the job started, contents of the function field, number of operator interactions, job name alphabetically, system storage pool, job priority, average response time, status, type, or user.
With this parameter, the information on the WRKACTJOB screen becomes malleable. You can display it in a number of formats. If you use the Sequence parameter with the other three parameters, you can not only narrowly define the information you want to see, but order it in a way that reflects how you want to see it.
You can also resequence your job information from within the WRKACTJOB screen by using the F16 key. Want to resequence by job name? Move the cursor under the word Job in the Subsystem/Job heading and press F16. Want to display by CPU %? Move the cursor under CPU % and press F16. This is an easy way to resequence jobs on the fly.
Job Manipulation
In addition to massaging the way data is presented with WRKACTJOB, you can also manipulate the jobs you are looking at right on the screen. You manipulate a job by moving the cursor in front of it and selecting one of the job options listed on the screen. Most of us have used WRKACTJOB options to change a job (option 2), hold it (3), end it (4), release it (6), display its messages (7), or work with its spooled files (8). There are, however, a few more options you may not have thought about using.
With option 13, you can disconnect a job from the AS/400. When you disconnect a job, the status of the job is stored and the display screen is forced back to user sign-on. The job is no longer active on the system, but it will resume activity at the point at which it was disconnected when you sign in again. This option can be a security aid; use it to return a machine to sign-on when a user walks away from his desk leaving sensitive information unattended.
Another little-used feature is option 9, Exclude. By typing option 9 in front of a job, you remove it from the WRKACTJOB screen. This removal is temporary (until you run the WRKACTJOB command again) and has no effect on the job; it only affects the display.
Other Views
Certain function keys within the WRKACTJOB screen change the information you see and the way it is presented. Want to view all the users that have started a second session by using the System-Request-1 key? That's easy. Press the F14 key (Include) in WRKACTJOB to display all the jobs on your AS/400 that are in System-Request status, are disconnected, or are part of a group job. This is a handy tool to determine which users may need additional sessions. After you've finished viewing this information, you can press F14 again to hide those inactive sessions.
Want to stretch your WRKACTJOB screen so it displays more data? Use the F21 key to hide the instructions and job manipulation options. Pressing F21 adds several lines of WRKACTJOB information to your screen so you can see more at one time. This is handy for dial-in users who must contend with screens that may not refresh quickly on Page Up or Page Down commands.
Want to jump to your WRKSYSSTS screen to look at your page faults? Press F15 to start up the WRKSYSSTS command. When you're ready to come back to WRKACTJOB, press F15 to run WRKACTJOB or press F3 or F12 to exit WRKSYSSTS and return to the WRKACTJOB screen.
Still Taking WRKACTJOB for Granted?
As you can see, you can display a lot of information in a variety of formats on the WRKACTJOB screen. So the next time you absent-mindedly type in WRKACTJOB, think about all the things it can do for you, and maybe you'll understand your system a little better.
Joe Hertvik is a freelance writer and a system administrator for a manufacturing company outside of Chicago.
LATEST COMMENTS
MC Press Online