Skip to content

Instantly share code, notes, and snippets.

View sriedmue79's full-sized avatar

Steve Riedmueller sriedmue79

View GitHub Profile
@sriedmue79
sriedmue79 / Active Jobs.sql
Last active November 13, 2023 19:39
IBM i - Various uses for the ACTIVE_JOB_INFO() table function
---------------------------------------------------------------------
-- Description: Various uses for the ACTIVE_JOB_INFO() table function
---------------------------------------------------------------------
--Description: check whether a job (by job name) is currently active in a particular subsystem
SELECT JOB_NAME
FROM TABLE ( QSYS2.ACTIVE_JOB_INFO( JOB_NAME_FILTER => :JobName,
SUBSYSTEM_LIST_FILTER => :SubsystemName ) );
--Description: Jobs in a subsystem that are in a specific status