Hi Community,
There's something I can't recognize. Let me try to summarize.
Our team monitors jobs 24/7. In active jobs, if there is a "preconditions check history" condition and the job is in the "waiting for preconditions" status, sometimes team members may overlook it or miss it due to distraction. As a result, the job history condition "it's too old" message may appear repeatedly, and they may get stuck there. They mentioned that among hundreds of jobs, this type of situation can occasionally be missed. The team is requesting whether you could provide us with a list of such delayed jobs. So , I started writing sql query to provide the job list that will provide this type of condition.
.
.
.
Lets Assume we have a flow name this "JOBP.VALID.FLOW1" and first job named "DENEME_UNIX.VALID1" in preconditions this.

.
and contolled repedately because sometimes team members may overlook it or miss it due to distraction . so we want to catch that jobs and send a list !!!

=============
SQL Logic:
.
here is the list of status 'Waiting for Precondition"
select eh_ah_idnr , eh_client, eh_name , eh_status
from automic.eh
where EH_Status = '1703' -- '1703', 'Waiting for Preconditions'

.
here is the precondition tab report content but... strange part There are only inserted value values in "report content". there is no complete sentence.
select * from RT
where rt_ah_idnr='180923691'

.
There are only inserted value values in "report content". there is no complete sentence. keeps the full sentence as txt in temp in the server because the job is active.
i could not find a way to understand that the message is really "it is too old". then when i looked carefully, i saw that it always wrote the same ID ( in the "RT_MSGNR" column and i caught it with this ID condition but I'm adding a condition by guessing :D But what I want to ask is do we have a table or information where the sentences corresponding to these IDs are kept on RT_MSGNR ?
.
RT_MSGNR = 913003
IF since 0 days 10:00 (hh:mm) AGENT_DOWN has ended with ENDED_OK_OR_INACTIV
.
RT_MSGNR = 21306
False: Statistic record found (RunID: xxxxx ), but it is too old (end time: 2025-07-02 16:14:44)
The query is below.
SELECT
EH.EH_AH_IDNR,
EH.EH_CLIENT,
EH.EH_NAME,
EH.EH_STATUS , decode(EH.EH_STATUS, '1703','Waiting for Preconditions' ) status , 'False: Statistic record found, but it is too old' as PreCon_Comment
FROM
AUTOMIC.EH EH
WHERE
EH.EH_STATUS = '1703' -- '1703', 'Waiting for Preconditions'
AND EXISTS (
SELECT 1
FROM AUTOMIC.RT RT
WHERE
RT.RT_AH_IDNR = EH.EH_AH_IDNR
AND RT.RT_TYPE = 'PRCO'
AND RT.RT_MSGNR IN (913003, 21306)
)

Thanks.
------------------------------
Olgun Onur Ozmen
https://www.linkedin.com/in/olgunonurozmen/
------------------------------