24
Sun, Nov
1 New Articles

Reintroducing WRKACTJOB

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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.

Reintroducing WRKACTJOB

Figure 1: A Sample WRKACTJOB Screen


Reintroducing WRKACTJOB

Figure 2: The WRKACTJOB Default Prompt


Reintroducing WRKACTJOB

Figure 3: The WRKACTJOB Prompt with Additional Parameters


BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: