Work Active Jobs using SQL

The IBM Service (formerly "SQL Services") named ACTIVE_JOB_INFO returns information about active jobs. While I don't use it directly too often, I do use it via a surrogate interface I created named ACTJOB_LIST.

My ACTJOB_LIST table function wraps ACTIVE_JOB_INFO that links with JOBLOG_INFO and my own SPOOLED_LIST table function to create a more complete dataset. It leverages these functions to return the number of SPOOLED files a job has produced, and the Last Command or Function the job has run. Also if you're on V7R2 it parses out the 3-part qualified job name into its component parts (job name, number, and user). All this produces a listing that is more interesting to IBM i Admins.

While all of this is well and good, I took it one step further, I created a bunch of SQL Views over my primary Subsystem Descriptions so I can get a "Work active jobs"-like results for a given subsystem. For example if I query the QINTER view, I see the following:

QINTER via the ACTJOB_LIST UDTF and View

Since it is a View, regardless of the IBM i release level, I can browse any of my managed partitions. All I need to do is prefix the view schema (library) with the partition identification or "3-part name", like this:

select * from chicago.sqltools.Qinter;        

Since, obviously, SQL Tools is installed on all the partitions I manage, I have no problem monitoring activity on these remote partitions; some of which are literally on the other side of the world.

I've included Views for QINTER, QBACH, QUSRNOMAX, and QHTTPSVR but users can simply extract the source code for any of these views and create one for their own custom subsystem name(s).

Try it out yourself. Download and install SQL Tools for IBM i today. Just visit: https://www.SQLiQuery.com/SQLTools

If you have any questions, just drop me a DM or send an email to the email link on the website.

That's all there is to it.


Celia María Martínez Vázquez

Responsable Desarrollo Sistemas Vegalsa-Eroski

1 年

I don't have any library called sqltools. Is it posible to get that information on another table? Thanks

回复

要查看或添加评论,请登录

Bob Cozzi的更多文章

  • Using my READSPLF SQL Function

    Using my READSPLF SQL Function

    A SQL Table Function to Directly Read IBM i Spooled Files Managing spooled files on IBM i has always been a critical…

    7 条评论
  • Example SQL iQuery Script for IBM i

    Example SQL iQuery Script for IBM i

    Since releasing SQL iQuery for the IBM i operating system, my customers have primarily been using a very cool feature…

    3 条评论
  • Reading Source File Members Using SQL

    Reading Source File Members Using SQL

    With the introduction of my SQL Tools product several years ago, I created a number of "READ" SQL functions that…

    1 条评论
  • IBM i SQL Function Adoption Rate

    IBM i SQL Function Adoption Rate

    IBM i Developers have long relied on various interfaces and tools to navigate system functions, but many remain unaware…

    3 条评论
  • SQL iQuery for Web Config Directives

    SQL iQuery for Web Config Directives

    Last time I showed how to use the no-charge SQL iQuery for Web product to create a simple File Inquiry web app for the…

    1 条评论
  • HTML/Browser Apps for IBM i

    HTML/Browser Apps for IBM i

    There have been myriad methods for creating HTML browser enabled applications that use IBM i database files. For the…

    12 条评论
  • SQL iQuery is Free (tell your friends)

    SQL iQuery is Free (tell your friends)

    Challenges of Pricing Software in the IBM i Ecosystem In the dynamic arena of technology services and software support…

    9 条评论
  • IBM i SQL UDTF: SYSINFO

    IBM i SQL UDTF: SYSINFO

    I had a post about a simple SQL Function I created that gives me everything I need to know about the physical Power…

  • Reading Stuff using SQL for IBM i

    Reading Stuff using SQL for IBM i

    My SQL Tools licensed program (product) has 4 so called read functions. These functions allow users to retrieve data…

    1 条评论
  • Add it Up in RPG

    Add it Up in RPG

    One of the features that has been re-introduced to RPG over the decades is the myriad methods to perform an ADD…

    17 条评论

社区洞察

其他会员也浏览了