I just discovered that DSJ.JOBELAPSED return 0 when a job start before midnight and end after.
It bother me a little so i wrote this :
Code: Select all
* Gestion du passage de Minuit (pas de l'execution sur plusieurs jour)
JobStart=DSGetJobInfo(Action <ActionOrder, ParallelOrderWait, COL_HANDLE>,DSJ.JOBSTARTTIMESTAMP)
JobEnd=DSGetJobInfo(Action <ActionOrder, ParallelOrderWait, COL_HANDLE>, DSJ.JOBLASTTIMESTAMP)
DayJobStart=Iconv(Field(JobStart," ",1),"D-YMD[4,2,2,")
DayJobEnd=Iconv(Field(JobEnd," ",1),"D-YMD[4,2,2,")
NbDay=DayJobEnd-DayJobStart
HMJobStart=Iconv(Field(JobStart," ",2),"MTS")
HMJobEnd=Iconv(Field(JobEnd," ",2),"MTS")
if NbDay=0 then
TempExec=HMJobEnd-HMJobStart
end
else
Midnight=Iconv("23:59:59","MTS")
HMJobStart=Midnight-HMJobStart
TempExec=HMJobEnd+HMJobStart
end
TempExec=Oconv(TempExec,"MTS")