Sometimes it's the simple tools -- like OS/400's green-screen Work with Active Jobs (WRKACTJOB) -- that you take for granted. WRKACTJOB's a lot older than many readers on this list and -- because of that longevity -- it contains some useful features that can be handy in different situations. Let's take a minute and look at three fun things our old friend WRKACTJOB can do:
1.WRKACTJOB can sequence active job data in one of three ways:
a. By using the F16 Key to sort by User, CPU %, Status, or any other of its reported columns.
b. By subsetting active jobs using the F20 key.
c. By specifying additional parameters when you enter the WRKACTJOB command.
WRKACTJOB allows you to sort data by any of its reported columns simply by clicking your cursor on the column you want to sort on and pressing the F16 key. So if you wanted to find out which jobs are currently using the most CPU, click on the CPU % column and press F16, and WRKACTJOB will resort your data by the CPU percentage each job is currently using.
Conversely, if you wanted to sort by user name, click on the User column and press F16 again. Alternatively, you can press the F20 key to select subsets of your WRKACTJOB data in which you can sequence the data in up to 15 ways. Also, by using the Subset Active Jobs panel that appears when you press F20, you can subset job data from certain subsystems or by certain types of job data (all WRKACTJOB entries, subsystem entries, system entries, or all entries that are performing above a minimum processing time or minimum response time). So you can segment and chop up your WRKACTJOB in many different ways. You can also use the same subsetting functions found in the Subset Active Jobs panel as parameters off the WRKACTJOB command by prompting WRKACTJOB from the command line and pressing the F10 key to enter additional parameters.
2. WRKACTJOB can search for a specific job by using F7 - Sometimes all you really want to use WRKACTJOB for is to find a certain job to see how much CPU it's using, check its job log, or to end or change the job. Manual job searching can become tedious when you have a big iSeries 400 that may be running hundreds of server or interactive jobs. To find a particular needle in an OS/400 haystack, press F7 inside WRKACTJOB and type in the string you want to search for, as well as the WRKACTJOB column you want to search for the string in (*SBS for subsystem, *JOB for job, *USER for user, etc). Press ENTER after specifying the search info and OS/400 will take you to the first WRKACTJOB entry that matches your search criteria. If you then press the F8 key, WRKACTJOB will take you to next match or let you know when there are no more matches.
3. WRKACTJOB can automatically refresh WRKACTJOB information - Pressing F19 on the WRKACTJOB screen puts the screen into automatic refresh mode, where the statistics are updated automatically without having to press the F5=Refresh key. This feature is especially handy if you first sort the data by CPU percentage before placing the screen into auto-refresh, so that you can automatically see which jobs are using the highest CPU percentage over time. But there's a trick here. The refresh time on the screen is set by the WRKACTJOB automatic refresh interval parameter (INTERVAL). The INTERVAL parameter is recorded in seconds. By default--INTERVAL is set to an initial value of 300 seconds (five minutes). If you want to set the refresh time to a different value, you can call WRKACTJOB with a lower INTERVAL setting. To set your automatic refresh interval to five seconds, for example, you would enter the WRKACTJOB command in the following way:
It's also important to understand that 300 seconds is the default value only until you put in an INTERVAL value of your own. After you enter your first INTERVAL value, WRKACTJOB will automatically set the automatic refresh interval to the previous value it was set at (an INTERVAL setting of *PRV) unless you enter a new value.
While you can also perform automatic screen refresh with the Work with System Activity (WRKSYSACT) command, many people may prefer to use WRKACTJOB because it provides some different information than WRKSYSACT (in particular, WRKACTJOB displays all jobs and subsystems while WRKSYSACT displays data only for jobs or tasks that are currently active on the system). There are some advantages and disadvantages to using each command and you should choose the system reporting function that best meets your needs.
And there are more options you can access through WRKACTJOB if you just dig into it a little bit. So don't be afraid to visit an old friend every once in a while. You might just learn something.
About the author: Joe Hertvik is an IT professional and freelance writer who has been working with OS/400 since the days of the System/38 in the mid-1980s. Joe can be reached at firstname.lastname@example.org.
- Proper way to end WRKACTJOB
Most iSeries 400 users don't use the correct procedure to end the WRKACTJOB command. Read this tip to see what this member suggests.
- What file is the job waiting on?
Do you ever have a batch or interactive job go to a status of LCKW on the WRKACTJOB screen (and the user's session mysteriously "locks up" in a "deadly embrace")? How can you tell what job has the lock on the file needed by the job in question so you can take action? Check out this tip to find out.
- .snSEamCCeaq^0@.ee84639>Managing the iSeries Discussion Forum: Post your questions, and get answers from other iSeries systems managers and administrators as well as search400 experts.
- Search400's Best Web Links on Systems Management