Tips and Techniques: Subsetting WRKACTJOB

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

The Work with Active Jobs (WRKACTJOB) command has been around forever, and I'm sure most--if not all--of you have used it. But did you know that you can actually subset the data you view with that command? You can.

If you simply type WRKACTJOB and press Enter, you get a screen that shows the list of all the active jobs for each subsystem on the machine. Prompting WRKACTJOB gives you the display shown in Figure 1, which doesn't offer any indication that there are any more options to the command. But there are.


http://www.mcpressonline.com/articles/images/2002/SubsettingWRKACTJOB01190500.jpg

Figure 1: The basic WRKACTJOB command doesn't reveal the options you can choose from. (Click images to enlarge.)

Just press the infamous F10, and the command prompt will show you the additional, hidden parameters as illustrated in Figure 2:


http://www.mcpressonline.com/articles/images/2002/SubsettingWRKACTJOB01190501.jpg

Figure 2: Pressing F10 reveals many hidden parameters.

If you're like me, you like to see the parameter's keyword, so a quick F11 is issued to switch the display to the following:


http://www.mcpressonline.com/articles/images/2002/SubsettingWRKACTJOB01190502.jpg

Figure 3: F11 adds your keywords.

What a surprise, more options! You can subset the WRKACTJOB display by subsystem name, job name, and system usage. In addition, you can initially sequence the display by any of the columns displayed by the command (similar to pressing F16/shift+F4 on the column while the display is visible).

The two parameters I used most are the Subsystem (SBS) and Job name (JOB) parameters. For example, if I want to look at all the Apache Web server jobs running on my system, I can issue the following command:

WRKACTJOB JOB(APACHE*)

You can use the JOB and SBS parameters to subset the display so that you see only what you want to see. This cuts down on all the paging up and down through the list.

One final note about WRKACTJOB: Once the display is visible, you'll notice that the traditional "position to" function key is missing. Instead, IBM implemented a search facility so you can position to anything on the display. To get to the Find prompt, run the WRKACTJOB command and press the F7 key to display the screen shown in Figure 4.


http://www.mcpressonline.com/articles/images/2002/SubsettingWRKACTJOB01190503.jpg

Figure 4: Use the F7 key in place of the traditional "position to" key.

So there you go. There's more to WRKACTJOB than just issuing the command and using the page up/down keys to search for the job you're interested in.

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.

BOB COZZI

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.


MC Press books written by Robert Cozzi available now on the MC Press Bookstore.

RPG TnT RPG TnT
Get this jam-packed resource of quick, easy-to-implement RPG tips!
List Price $65.00

Now On Sale

The Modern RPG IV Language The Modern RPG IV Language
Cozzi on everything RPG! What more could you want?
List Price $99.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • 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.

  • 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

  • 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: