How to get full length warning messages in attachment
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
How to get full length warning messages in attachment
Hi all,
We wrote a routine to retrieve the log to a file and in our sequence job we used mailnotification to get alerts incase of job failure or warnings.We would be able to get the logs as an attachment to the mail properly but when we look at the attachment we are not able to see the full length warning message in the Log file, it is showing like this
"Lc_Tfm_Mfs_Process.Trn_Mfs_Exp_Rate_Maint: At row 1, link "txn_mfs_exp_rate_maintenance" (...)"
When we double click on warning in director it shows full warning like this
"Lc_Tfm_Mfs_Process.Trn_Mfs_Exp_Rate_Maint: At row 1, link "txn_mfs_exp_rate_maintenance" Inserted value too large for column, row rejected."
Could you please suggect us how to get the full length warning message as stated above.
We wrote a routine to retrieve the log to a file and in our sequence job we used mailnotification to get alerts incase of job failure or warnings.We would be able to get the logs as an attachment to the mail properly but when we look at the attachment we are not able to see the full length warning message in the Log file, it is showing like this
"Lc_Tfm_Mfs_Process.Trn_Mfs_Exp_Rate_Maint: At row 1, link "txn_mfs_exp_rate_maintenance" (...)"
When we double click on warning in director it shows full warning like this
"Lc_Tfm_Mfs_Process.Trn_Mfs_Exp_Rate_Maint: At row 1, link "txn_mfs_exp_rate_maintenance" Inserted value too large for column, row rejected."
Could you please suggect us how to get the full length warning message as stated above.
Plot No – B4, Jeevan Akshyay apts
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
Hi,
Here is the routine we used
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
BusinessDay = Date()
*CurrentTime= Oconv (Time(), "MTS")
CurrentTime= Int( Time() )
CurrentDateTime= Oconv (BusinessDay, "DY[4]") : Oconv (BusinessDay, "DM[2]"): Oconv (BusinessDay, "DD[2]") :"_": CurrentTime ;
Tommorow = Oconv(Date()+1, "D-YMD[4,2,2]")
EventType = ''
Answer = ''
LogMessage = ''
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
LogMessage:=TimeStamp:" ":EventMessage: char(10)
End
Until Str=""
Repeat
** FileName = CurrentDateTime:"_": JobName : ".txt"
FileName = JobName : ".txt"
Openpath PathName to t.fvar then
write LogMessage to t.fvar, FileName
else
call DSLogWarn("Failed to write file ":FileName:" to directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
end
else
call DSLogWarn("Failed to open directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
Call DSLogInfo ("Created Log File ": PathName : "/" : FileName:" status=":Status(), "RetrieveLogToFile")
Answer=LogMessage
GoTo EndFunction ;
ExitFunction:
Answer=LogMessage
GoTo EndFunction ;
EndFunction:
ErrCode = DSDetachJob(JobHandle)
Ans=Answer
Even when we test the routine it gives the truncate warning message in display.
Any suggestions please.
Here is the routine we used
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
BusinessDay = Date()
*CurrentTime= Oconv (Time(), "MTS")
CurrentTime= Int( Time() )
CurrentDateTime= Oconv (BusinessDay, "DY[4]") : Oconv (BusinessDay, "DM[2]"): Oconv (BusinessDay, "DD[2]") :"_": CurrentTime ;
Tommorow = Oconv(Date()+1, "D-YMD[4,2,2]")
EventType = ''
Answer = ''
LogMessage = ''
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
LogMessage:=TimeStamp:" ":EventMessage: char(10)
End
Until Str=""
Repeat
** FileName = CurrentDateTime:"_": JobName : ".txt"
FileName = JobName : ".txt"
Openpath PathName to t.fvar then
write LogMessage to t.fvar, FileName
else
call DSLogWarn("Failed to write file ":FileName:" to directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
end
else
call DSLogWarn("Failed to open directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
Call DSLogInfo ("Created Log File ": PathName : "/" : FileName:" status=":Status(), "RetrieveLogToFile")
Answer=LogMessage
GoTo EndFunction ;
ExitFunction:
Answer=LogMessage
GoTo EndFunction ;
EndFunction:
ErrCode = DSDetachJob(JobHandle)
Ans=Answer
Even when we test the routine it gives the truncate warning message in display.
Any suggestions please.
Plot No – B4, Jeevan Akshyay apts
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
Hi,
Here is the routine we used
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
BusinessDay = Date()
*CurrentTime= Oconv (Time(), "MTS")
CurrentTime= Int( Time() )
CurrentDateTime= Oconv (BusinessDay, "DY[4]") : Oconv (BusinessDay, "DM[2]"): Oconv (BusinessDay, "DD[2]") :"_": CurrentTime ;
Tommorow = Oconv(Date()+1, "D-YMD[4,2,2]")
EventType = ''
Answer = ''
LogMessage = ''
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
LogMessage:=TimeStamp:" ":EventMessage: char(10)
End
Until Str=""
Repeat
** FileName = CurrentDateTime:"_": JobName : ".txt"
FileName = JobName : ".txt"
Openpath PathName to t.fvar then
write LogMessage to t.fvar, FileName
else
call DSLogWarn("Failed to write file ":FileName:" to directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
end
else
call DSLogWarn("Failed to open directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
Call DSLogInfo ("Created Log File ": PathName : "/" : FileName:" status=":Status(), "RetrieveLogToFile")
Answer=LogMessage
GoTo EndFunction ;
ExitFunction:
Answer=LogMessage
GoTo EndFunction ;
EndFunction:
ErrCode = DSDetachJob(JobHandle)
Ans=Answer
Even when we test the routine it gives the truncate warning message in display.
Any suggestions please.
Here is the routine we used
ThisJobName= DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
If ThisJobName<>JobName Then
JobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
End Else
JobHandle=DSJ.ME
End
StartDate = DSGetJobInfo (JobHandle, DSJ.JOBSTARTTIMESTAMP)
BusinessDay = Date()
*CurrentTime= Oconv (Time(), "MTS")
CurrentTime= Int( Time() )
CurrentDateTime= Oconv (BusinessDay, "DY[4]") : Oconv (BusinessDay, "DM[2]"): Oconv (BusinessDay, "DD[2]") :"_": CurrentTime ;
Tommorow = Oconv(Date()+1, "D-YMD[4,2,2]")
EventType = ''
Answer = ''
LogMessage = ''
SummaryArray = DSGetLogSummary(JobHandle,EventType,StartDate,"9999-12-31", 0)
NLines=0
Loop
Str = Field(SummaryArray,@FM,NLines+1)
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
TimeStamp=Field(Str,"\",2)
EventMessage=Field(Str,"\",6)
LogMessage:=TimeStamp:" ":EventMessage: char(10)
End
Until Str=""
Repeat
** FileName = CurrentDateTime:"_": JobName : ".txt"
FileName = JobName : ".txt"
Openpath PathName to t.fvar then
write LogMessage to t.fvar, FileName
else
call DSLogWarn("Failed to write file ":FileName:" to directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
end
else
call DSLogWarn("Failed to open directory ":PathName, "RetrieveLogToFile")
GoTo ExitFunction ;
end
Call DSLogInfo ("Created Log File ": PathName : "/" : FileName:" status=":Status(), "RetrieveLogToFile")
Answer=LogMessage
GoTo EndFunction ;
ExitFunction:
Answer=LogMessage
GoTo EndFunction ;
EndFunction:
ErrCode = DSDetachJob(JobHandle)
Ans=Answer
Even when we test the routine it gives the truncate warning message in display.
Any suggestions please.
Plot No – B4, Jeevan Akshyay apts
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
Hi ArndW,
Thanks for all your inputs,
We would be able to get the full length warning but in between we are getting some junk characters(<FD>) as well the log is not in proper display,as it is giving all the "Environment variable settings: (...)" Whatever present inside this too,it won't be a big issue but i feel this log as an attachment would be very long.
Inside the loop we added like this
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
logMsg=DSGetLogEntry(JobHandle,EventId)
TimeStamp=Field(Str,"\",2)
EvntMsg=Field(logMsg,"\",4).
Could you please suggest us how could we rectify this.
Thanks for all your inputs,
We would be able to get the full length warning but in between we are getting some junk characters(<FD>) as well the log is not in proper display,as it is giving all the "Environment variable settings: (...)" Whatever present inside this too,it won't be a big issue but i feel this log as an attachment would be very long.
Inside the loop we added like this
If Str<>"" Then
NLines=NLines+1
EventId=Field(Str,"\",1)
logMsg=DSGetLogEntry(JobHandle,EventId)
TimeStamp=Field(Str,"\",2)
EvntMsg=Field(logMsg,"\",4).
Could you please suggest us how could we rectify this.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Spend some time learning about dynamic arrays in DataStage BASIC programming. All multi-line log entries are dynamic arrays. In particular, the dynamic array delimiter characters, such as 0xFD, are not junk. 0xFD is (contrary to what Arnd assumed) a "value mark" character, which is represented by the @VM system variable. You can convert this to space with
Code: Select all
Convert(@VM, " ", TheString)
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.
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am