Skip to content

Instantly share code, notes, and snippets.

@richardschoen
Forked from bdietz400/Active jobs in MSGW
Created November 1, 2023 21:29
Show Gist options
  • Save richardschoen/fc6d2100a9a0e69917fe89ba11b9d872 to your computer and use it in GitHub Desktop.
Save richardschoen/fc6d2100a9a0e69917fe89ba11b9d872 to your computer and use it in GitHub Desktop.
-- category: Bryan.Dietz
-- description: Jobs in msgw(wrkactjob)
SELECT Job_Name
,Subsystem
,Function_Type CONCAT '-' CONCAT Function AS "Function"
,Job_Status
,(SELECT Message_Text
FROM TABLE (Qsys2.Joblog_Info(I.Job_Name)) A
ORDER BY Ordinal_Position DESC
FETCH First 1 ROW ONLY) AS Joblog_Info
FROM TABLE ( Qsys2.Active_Job_Info( ) ) I
WHERE
Job_Status = 'MSGW'
and
job_name not like '%/ROBOT%' -- filter out ROBOT jobs that are always in MSGW
ORDER BY Subsystem
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment