SQL to find any interactive jobs
Quick SQL query (SQL400) to find any interactive jobs that are waiting for a reply to an inquiry message:
SELECT
X1.JOB_NAME, X1.AUTHORIZATION_NAME, X3.program_name, X3.program_library_name
FROM (select job_name, authorization_name from TABLE(QSYS2.ACTIVE_JOB_INFO(
SUBSYSTEM_LIST_FILTER => 'QINTER')) x0 where x0.job_status = 'DSPW')
AS X1,
LATERAL
(select * from table(qsys2.stack_info(x1.job_name)) x2
where x2.entry_type = 'OPM' order by ordinal_position desc limit 1 )
AS x3
where (x3.program_name = 'QDMACCIN') and (x3.program_library_name = 'QSYS')
SELECT
X1.JOB_NAME, X1.AUTHORIZATION_NAME, X3.program_name, X3.program_library_name
FROM (select job_name, authorization_name from TABLE(QSYS2.ACTIVE_JOB_INFO(
SUBSYSTEM_LIST_FILTER => 'QINTER')) x0 where x0.job_status = 'DSPW')
AS X1,
LATERAL
(select * from table(qsys2.stack_info(x1.job_name)) x2
where x2.entry_type = 'OPM' order by ordinal_position desc limit 1 )
AS x3
where (x3.program_name = 'QDMACCIN') and (x3.program_library_name = 'QSYS')
No comments:
Post a Comment