DSGetNewestLogId

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

DSGetNewestLogId

Post by palmeal »

I am using DSGetNewestLogid (in conjunction with DSGetLogEntry) for DSJ.LogStarted and this returns the latest "control" type from the Director Log. This is as stated in the BASIC manuals.

I expected this to return the start time of the Server Job in question but unfortunatley for me the row returned is for an abort (as it is the latest occurence of type "control" - event type 5). Inspecting the Director Log shows two entries of type "control" - the start time of the server job and the abort for the job.

I know that this is the way that DSGetNewestLogId works but is there any way of going back to the next again message so that I can pull out the actual start time of the Server Job ?
If this can't be done using these functions is the only alternative DSGetLogSummary ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Palmeal,

Isn't using the DSGetJobInfo function with the mnemonic key DSJ.JOBSTARTTIMESTAMP easier and more direct than looking into the log files?
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

Cheers Arnd

I'm also pulling out control types info/warning/fatal - this is related to the thread where our Company does not support Job Sequences. In order for me to use the Job Sequences to be supported I'm having to pull out the log information from a Server Job on failure hence the commands I am using.

viewtopic.php?t=92923&highlight=job+seq ... +supported

If I can use other commands such as DSGetJobInfo to obtain the same information then I'm all ears.
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

I've built in your suggestion Arnd for the start time and it works as you said - I'll keep the GetNewestLogId for warnings and fatal messages as I need to get the exact log messages.
Is there anyway to get the Job Finished time so that I could pass this and the start time as values into DSGetLogSummary ?
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

I've had a play at creatinf a finish time and am using the TIMEDATE() function. It doesn't matter if this is a few seconds ahead of when the Server Job finished.
I already have the DSJ.STARTTIMESTAMP value so I only need the finish datetime. Unfortunately TIMEDATE() returns the date as hh:mm:ss dd mmm yyyy and DSGetLogSummary requires YYYY-MM-DD hh:mm:ss.

Using Substrings (and an if end else for Jan then 01, Feb then 02 etc) I have managed to create the required value in the format required.

This is all works fine but is there a more aesthetic/simplistic way of generating the finish date ?

I am putting this to rest now unless/until a better method is posted.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Palmeal - the DSGetJobInfo also has a DSJ.JOBLASTTIMESTAMP for the finish time of the last run.
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

Thanks Arnd - guess I'm a poor reader - I did go through the options - thread closed !!!!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No problem - I wouldn't have found it unless I actually used it, either.
Post Reply