Page 1 of 1

Newest Log

Posted: Wed Nov 05, 2003 3:12 am
by peterh
Hello,

I'm trying to get last log event. The problem is that job is multi instance and all instances are running concurrently and when I used following piece of code:
EventId = DSGetNewestLogId(DSJ.ME,DSJ.LOGANY)
LastLog = DSGetLogEntry(DSJ.ME,EventId)

time to time (accidentally) I have got LastLog from the different instance.
I know that the log is common for all instances. Is there some way how to get this information for the corresponding instance?

Thanks

Peter

Posted: Wed Nov 05, 2003 4:37 am
by Amos.Rosmarin
Do you use an routine to run this code or job control ?
It's better if you got in hand the real job handle instead of DSJ.ME.

The other option I see is to get the newest log id and then loop backward until you encounter the job.invocation you are looking for.

You can get the job and invocation name from the DS macros.


HTH,
Amos

Posted: Wed Nov 05, 2003 4:47 am
by peterh
Thanks, Amos.
Code is used in job controler. I'm going to try second option - search the backwards.

Peter