Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forstie/f857c494175cca509f0f9017c5b56c5d to your computer and use it in GitHub Desktop.
Save forstie/f857c494175cca509f0f9017c5b56c5d to your computer and use it in GitHub Desktop.
How do you manage your job queues? Do you have caps on the maximum active jobs? Here's a technique for studying this topic....
-- Resources:
-- https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzajq/rzajqudfactivejobinfo.htm
-- https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzajq/rzajqviewjobqueueinfo.htm
-- Review job queues, from a percent of capacity consumed perspective
select maximum_active_jobs,
active_jobs,
dec(dec(active_jobs, 19, 2) / dec(maximum_active_jobs, 19, 2), 19, 2) as jobq_percent_consumed,
job_queue_name, job_queue_library, job_queue_status, number_of_jobs,
subsystem_name, subsystem_library_name, sequence_number, held_jobs, released_jobs, scheduled_jobs, text_description,
operator_controlled
from qsys2.job_queue_info
where active_jobs is not null and maximum_active_jobs > 0
order by dec(dec(active_jobs, 19, 2) / dec(maximum_active_jobs, 19, 2), 19, 2) desc;
-- Review job queues that are over 75% capacity full
with busy_jqs (jql, jq, sbs) as (
select job_queue_library, job_queue_name, subsystem_name
from qsys2.job_queue_info
where active_jobs is not null
and maximum_active_jobs > 0
and dec(dec(active_jobs, 19, 2) / dec(maximum_active_jobs, 19, 2), 19, 2) > 0.75
order by dec(dec(active_jobs, 19, 2) / dec(maximum_active_jobs, 19, 2), 19, 2) desc)
select busy_jqs.*, z.*
from busy_jqs, lateral (
select *
from table (
qsys2.active_job_info(
subsystem_list_filter => sbs, detailed_info => 'ALL')
)
where job_queue_library = jql
and job_queue = jq
) z;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment