TechTalk: Active Job Checking

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

From: David Babashanian To: All

On the S/36, it is possible to have the system check for the presence of a specific active job. Is there an AS/400 command to perform this same function?

From: Ernie Malaga To: David Babashanian

No, there is no way to do that. Practically every S/36 programmer that converts to the AS/400 has asked that question, but so far there haven't been any solutions that don't require changing the way your CL programs work.

If you want to determine if program X is running, the best thing you can do is change program X so that it allocates an existing data area X for exclusive use (*EXCL), and deallocates it when the program ends. If any other program needs to know if program X is running, it can attempt to allocate data area X; if the allocation fails, it's because program X is still running.

There's a problem with this approach, however: it requires you to change your programs just so that you can test for this condition. I've asked MI programmers if they can think of a way to provide this function on the AS/400, but so far there haven't been any takers.

Editor's Note: Other BBS users suggested using techniques that run the WRKUSRJOB command to *PRINT and capture the output with QUSRTOOL's CVTWRKUSR. This technique, however, only reveals the names of the jobs that are running-not the names of the programs running in each job. One would then have to run DSPJOB OPTION(*PGMSTK) for each job listed by WRKUSRJOB, again sending the output to *PRINT and capturing it.

Although this technique does provide a list of programs that are running in the system, it takes far too long (especially when running on the low-end AS/400s) to be of any practical value-many of the programs listed as active could have ended by the time the final output is obtained or, what's possibly worse, other programs could have become active.

What we need is an MI program that retrieves this information from whatever internal-and infernal-reference tables are maintained by OS/400. If anyone has developed such an MI program, we would love to publish it.

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: