Skip to content

Instantly share code, notes, and snippets.

@bdietz400
Created January 15, 2020 18:58
Show Gist options
  • Save bdietz400/1288e0fa0edac3060c264286857039f0 to your computer and use it in GitHub Desktop.
Save bdietz400/1288e0fa0edac3060c264286857039f0 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