Event Type From DSGetLogEntry
Posted: Mon May 30, 2005 4:26 am
I am using DSGetLogEntry to pull back Server Job information from the Director Log and am noticing some extra characters being returned - I'm hoping that there is a simple explanation for this.
The (abbreviated) code I have is as follows:
MAXREJ = 0
getsummary = DSGetLogSummary(JobHandle, DSJ.LOGANY, started, finished, MAXREJ )
RejInfoId = getsummary<1>
RejInfo = DSGetLogEntry(JobHandle, substrings(RejInfoId,1,4))
event_type = Substrings(RejInfo,Index(RejInfo ,'\',2) +1, (Index
(RejInfo ,'\',3) - (Index(RejInfo ,'\',2) +1)))
BEGIN CASE
CASE event_type= "1"
event_typet3 = "INFO"
CASE event_type= "2"
event_type= "WARNING"
CASE event_type= "3"
event_type= "FATAL"
CASE event_type = "5"
event_type= "CONTROL"
CASE event_type = "7"
event_type= "RUNJOB"
END CASE
I then write the event_type to both a file and the Director Log. The code does translate a 1 to INFO, 2 to WARNING etc some of the time. Other times I am getting the correct event type + extra characters. See below - a 5 is returned but then loads of spaces and then a "t".
"job_seq5..JobControl (EVENT TYPE): 5
t"
If I amend
CASE event_type = "5"
event_type= "CONTROL"
to
CASE substrings(event_type1,1 = "5"
event_type= "CONTROL"
then I still get the same message as above.
Another example is :
"job_seq5..JobControl (EVENT TYPE): 1
e
n
/
a
p
l
l
0
1
t
/
/
l
/
a
E
d
p
S
o
I
/
r"
Has anyone come across this before and if so how do I get around this. The code does bring back what I required slightly more than half of the time.
The (abbreviated) code I have is as follows:
MAXREJ = 0
getsummary = DSGetLogSummary(JobHandle, DSJ.LOGANY, started, finished, MAXREJ )
RejInfoId = getsummary<1>
RejInfo = DSGetLogEntry(JobHandle, substrings(RejInfoId,1,4))
event_type = Substrings(RejInfo,Index(RejInfo ,'\',2) +1, (Index
(RejInfo ,'\',3) - (Index(RejInfo ,'\',2) +1)))
BEGIN CASE
CASE event_type= "1"
event_typet3 = "INFO"
CASE event_type= "2"
event_type= "WARNING"
CASE event_type= "3"
event_type= "FATAL"
CASE event_type = "5"
event_type= "CONTROL"
CASE event_type = "7"
event_type= "RUNJOB"
END CASE
I then write the event_type to both a file and the Director Log. The code does translate a 1 to INFO, 2 to WARNING etc some of the time. Other times I am getting the correct event type + extra characters. See below - a 5 is returned but then loads of spaces and then a "t".
"job_seq5..JobControl (EVENT TYPE): 5
t"
If I amend
CASE event_type = "5"
event_type= "CONTROL"
to
CASE substrings(event_type1,1 = "5"
event_type= "CONTROL"
then I still get the same message as above.
Another example is :
"job_seq5..JobControl (EVENT TYPE): 1
e
n
/
a
p
l
l
0
1
t
/
/
l
/
a
E
d
p
S
o
I
/
r"
Has anyone come across this before and if so how do I get around this. The code does bring back what I required slightly more than half of the time.