Hi
I m designing a job where i wann fetch the source data if its got updated after last run of the same job.
hence i m looking for the last run's timestamp, so can i get last's runtime of same job in current run?
plz guide
job's previous run time
Moderators: chulett, rschirm, roy
If you are calling it from dsjob function, you can as well use
Code: Select all
dsjob -jobinfo $Project $Job | grep 'Last Run Time'
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
If you want the timestamp in YYYY-MM-DD hh:nn:ss format then run the following
Code: Select all
dsjob -report <<PROJECTNAME>> <<JobName>> | grep -w "Job end time" | awk -F"\=" '{print $2}'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Because you're doing this in a job sequence before the job starts, you can simply request the job start timestamp in a Routine activity.
Code: Select all
FUNCTION GetJobStart(TheJobName)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
hJob = DSAttachJob(TheJobName, DSJ.ERRNONE)
Ans = DSGetJobInfo(hJob, DSJ.JOBSTARTTIMESTAMP)
If Ans = DSJE.BADHANDLE Then Ans = @NULL
ErrCode = DSDetachJob(hJob)
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.