I use this SQL query to list jobs / JOBPs that have never run.
Original Message:
Sent: Jul 05, 2024 09:32 AM
From: Daryl Brown
Subject: Script to get the job list which is older and not active.
The EH table lists objects that are still active / not deactivated, so you'll need to start with a query from the AH table (all statistics) and remove those entries that exist in the EH table (active statistics).
Try this:
-- columns = client #, object name, object type, run#, start time (UTC), end time (UTC)
select OH_Client, OH_Name, oh_otype, ah_idnr, ah_timestamp12 ah_timestamp4
from OH,AH
where oh_idnr=ah_oh_idnr
and ah_idnr not in (select eh_ah_idnr from eh)
and oh_otype = 'JOBS'
and ah_timestamp4 < '20240101'
order by 1,3,6
You'll want to modify the date part of the query as needed.
Original Message:
Sent: Jul 04, 2024 06:37 AM
From: Siddharth V
Subject: Script to get the job list which is older and not active.
Hi Bernhard,
We need the data for last one year containing all inactive jobs present in all client.
select OH_Client, oh_otype, OH_Name, OH_Crdate, OH_Moddate,
(select MAX(AH_TImestamp4) from AH where AH_OH_Idnr = OH_idnr) as LastRun,
(select EH_Status from EH where EH_OH_Idnr = OH_idnr ) as ObjectStatus
from OH
where OH_Deleteflag = 0
and OH_Idnr > 100000
and EH_Status = 1900 ---- Here we are trying to print the status of job which are active or ended ok.
and oh_otype = 'JOBS'
order by 1,6,3 asc
Please modify the script as per your knowledge, so that we can get the data only for the inactive jobs.
Thanks,
Siddharth
Original Message:
Sent: Jul 04, 2024 04:33 AM
From: Bernhard Flegel
Subject: Script to get the job list which is older and not active.
Hello Shubham,
here is a oracle sql-statement which lists all jobs with the date of the last run and creationdate older then 20240101... maybe it is a beginning for you:
alter SESSION set NLS_DATE_FORMAT = 'YYYYMMDD' ;
select OH_Client, oh_otype, OH_Name, OH_Crdate, OH_Moddate,
(select MAX(AH_TImestamp4) from AH where AH_OH_Idnr = OH_idnr) as LastRun
from OH
where OH_Deleteflag = 0
and OH_Idnr > 100000
-- objecttype
and oh_otype = 'JOBS'
-- object-creationdate
and oh_crdate < '20240101'
order by 1,6,3 asc;
Best regards
Bernhard
Original Message:
Sent: Jul 03, 2024 02:46 PM
From: Shubham Kumar
Subject: Script to get the job list which is older and not active.
Hi All,
Could you please advise on how to create a script that retrieves a list of older and inactive jobs?
I really appreciate any help you can provide.
Thanks,
Shubham Kumar