set lines 200
set pages 3000

SET FEEDBACK   OFF
SET DEFINE   On
DEFINE schema = ''
COLUMN schema_val NOPRINT NEW_VALUE schema
SELECT '&&1' schema_val FROM dual;

DEFINE jobn = ''
COLUMN jobn_val NOPRINT NEW_VALUE jobn
SELECT '&&2' jobn_val FROM dual;

column owner format a15
column job_name format a30
column state format a9
column repeat_interval format a20
column JOB_CLASS format a30
column ELAP_MIN format 9999
column NEXT_RUN_DATE format a17
column run format 9999
column fail format 9999


select owner,job_name,enabled,state,substr(repeat_interval,6,100) repeat_interval,JOB_CLASS,
extract(day from 24*60*LAST_RUN_DURATION) ELAP_MIN,to_char(NEXT_RUN_DATE,'ddmmyyyy hh24:mi:ss') NEXT_RUN_DATE, run_count run
from dba_scheduler_jobs
where owner like upper('%&schema%')
and job_name like upper('%&jobn%')
order by JOB_CLASS,owner,job_name;

undefine &&1
undefine schema

undefine &&2
undefine jobn
