help required in routine
Moderators: chulett, rschirm, roy
Craig,
As per the documentation i understand that,
DSGetNewestLogId returns the recent event id.
so, while traversing backwards how to find the limit to which we need to traverse.if we give 1 it will traverse till the log of the first run.
i really don't know how to find the recent starting id.
I am still delving into the documentation
Please help me.
As per the documentation i understand that,
Code: Select all
EventId is an integer that identifies the specific log event for which details are
required. This is obtained using the DSGetNewestLogId function.
so, while traversing backwards how to find the limit to which we need to traverse.if we give 1 it will traverse till the log of the first run.
i really don't know how to find the recent starting id.
I am still delving into the documentation
Please help me.
pandeeswaran
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you're reading the detail of each event anyway, simply exit the loop after you encounter the "job starting" event.
But you still haven't really told us (in English) what you're trying to accomplish. That is, a specification for the routine, and where you intend to use it.
But you still haven't really told us (in English) what you're trying to accomplish. That is, a specification for the routine, and where you intend to use it.
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.
In case you are still looking for some documentation.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Ray,ray.wurlod wrote:If you're reading the detail of each event anyway, simply exit the loop after you encounter the "job starting" event.
I am struggling to find the job starting event.
Is there any built in functions available for finding the starting event id?
i have a parallel job in job activity.Once the job gets aborted , i need to mail the log information via routine.
That's what i am trying to achieve.
Thanks
pandeeswaran
Sorry Craig!!
My understanding is:
I am running the routine once the job gets aborted.
So using DSGetNewestLogId() ,i can get the newest log id.i.e last event.
e.g:job123 abrted.
now i need to go to previous entry .
in the loop i am traversing backwards.
So how to find the recent start event id, so that i can exit from the loop,
One of the way i am thinking is..before job activity stage, i need to find the recent event id first.so after the job run, i will loop between current_recent_event id to last_recent_event_id+1
Am i correct?
My understanding is:
I am running the routine once the job gets aborted.
So using DSGetNewestLogId() ,i can get the newest log id.i.e last event.
e.g:job123 abrted.
now i need to go to previous entry .
in the loop i am traversing backwards.
So how to find the recent start event id, so that i can exit from the loop,
One of the way i am thinking is..before job activity stage, i need to find the recent event id first.so after the job run, i will loop between current_recent_event id to last_recent_event_id+1
Am i correct?
pandeeswaran
i have tried the below code:
but it throws the below errors:
Am i missing anything?
Thanks
Code: Select all
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
iLatestLogID = DSGetNewestLogId(hJob, DSJ.LOGFATAL)
IdList = DSGetLogEventIds (hJob,0,'F')
For iEventID = iLatestLogID To IdList<1> Step -1
vEventDetail<-1> = DSGetLogEntry(hJob, iEventID)
next iEventID
Ans = vEventDetail
Code: Select all
0015 IdList = DSGetLogEventIds (hJob,0,'F')
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'DSGetLogEventIds' never dimensioned.
2 Errors detected, No Object Code Produced.
Thanks
pandeeswaran
In the documentation, it's given as
Thats what i have followed in my code.
Code: Select all
IdList = DSGetLogEventIds (JobHandle, RunNumber, EventTypeFilter)
Code: Select all
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
IdList = DSGetLogEventIds (hJob,0,'F')
pandeeswaran
In the documentation I linked, it's given as:
So the "List" of returned IDs is one of the function arguments, the "int" it shows holds the returned status of the function call.
Code: Select all
int DSGetLogEventIds(
DSJOB JobHandle
,
int RunNumber,
char *
Filter,
char **
List
);
See if that helps.Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token: Description
DSJE_BADHANDLE: Invalid job handle.
DSJE_BADTYPE: Invalid Filter value.
DSJE_BADVALUE: Invalid RunNumber value.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Craig,
I don't think the syntax is incorrect.
i am getting the same error even if i specify the 4th argument.
i have tried the below code with reference to the post:
viewtopic.php?t=123872&highlight=DSGetLogEventIds
But i am getting the same error.
I don't think the syntax is incorrect.
i am getting the same error even if i specify the 4th argument.
i have tried the below code with reference to the post:
viewtopic.php?t=123872&highlight=DSGetLogEventIds
Code: Select all
IdList=Ereplace(DSGetLogEventIds(hJob, 0, 'F') , \"\\\" , @FM, 1)
pandeeswaran
Of course there is a way and it's what I've been harping on you about from the beginning. Read the documentation I linked to which starts you off right at that function. Examine the nine different valid values for the EventType argument. You've stubbornly been sticking with DSJ_LOGANY when there are eight others to choose from, including DSJ_LOGSTARTED.pandeesh wrote:So, is there any equivalent function available in 7.x for finding recent starting event id? i don't think we can get the recent starting event via DSGetNewestLogID. Because it returns the last event of the recent run
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers