Routine Variable Limitation
Posted: Wed Aug 16, 2006 9:01 am
We have the following bit of code as part of a routine
**********************************************************
writeJobLogToFile:
v_jobLogFileName = v_FileNamePrefix : '_JobLog.txt'
v_maxEventID = DSGetNewestLogId ( v_jobHandle, DSJ.LOGANY)
if ((v_maxEventID <= 0) or (v_maxEventID = DSJE.BADTYPE)) then
v_logSummary = ""
call DSLogWarn("Error Accessing Max Event ID for JobLog", c_routineName)
end
else
v_logSummary = DSGetLogSummary ( v_jobHandle, DSJ.LOGANY, DSJobStartTimestamp, "" , c_maxLogLines)
end
* Loop to get each Job Log Event Detail and concatenate into v_logText
v_logText = 'Event Timestamp\User\Event Type\Event Details'
v_eventDetail = ''
i = 1
v_eventID = Field(v_logSummary<i>, '\', 1)
Loop While v_eventID<>''
v_eventDetail = DSGetLogEntry (v_jobHandle, v_eventID)
if v_eventDetail = DSJE.BADVALUE then
call DSLogWarn("Error Accessing Event ID ":v_eventID, c_routineName)
Exit
end
else
v_logText := CHAR(10) : Exchange(Exchange(v_eventDetail, '0D', 'FF'), '0A', 'FF')
end
i = i+1
v_eventID = Field(v_logSummary<i>, '\', 1)
Repeat
Openpath v_logFolder to t.fvar2 then
write v_logText to t.fvar2, v_jobLogFileName else
call DSLogWarn("Failed to write file ":v_jobLogFileName:" to directory ":v_logFolder, c_routineName)
GoTo ExitWriteJobLogToFile
end
end
else
call DSLogWarn("Failed to open directory ":v_logFolder, c_routineName)
GoTo ExitWriteJobLogToFile
end
close t.fvar2
ExitWriteJobLogToFile:
Return
**********************************************************
As you see in this we concate all the event messages into one variable v_logText . We came across a warning in the DS Log that is more than varchar(2000). Whenever we get this message this routine is aborting.
Was wondering if it is beacuse the concatenated value has exceeded the size that this variable can hold.
Any suggestions pls.
Katz
**********************************************************
writeJobLogToFile:
v_jobLogFileName = v_FileNamePrefix : '_JobLog.txt'
v_maxEventID = DSGetNewestLogId ( v_jobHandle, DSJ.LOGANY)
if ((v_maxEventID <= 0) or (v_maxEventID = DSJE.BADTYPE)) then
v_logSummary = ""
call DSLogWarn("Error Accessing Max Event ID for JobLog", c_routineName)
end
else
v_logSummary = DSGetLogSummary ( v_jobHandle, DSJ.LOGANY, DSJobStartTimestamp, "" , c_maxLogLines)
end
* Loop to get each Job Log Event Detail and concatenate into v_logText
v_logText = 'Event Timestamp\User\Event Type\Event Details'
v_eventDetail = ''
i = 1
v_eventID = Field(v_logSummary<i>, '\', 1)
Loop While v_eventID<>''
v_eventDetail = DSGetLogEntry (v_jobHandle, v_eventID)
if v_eventDetail = DSJE.BADVALUE then
call DSLogWarn("Error Accessing Event ID ":v_eventID, c_routineName)
Exit
end
else
v_logText := CHAR(10) : Exchange(Exchange(v_eventDetail, '0D', 'FF'), '0A', 'FF')
end
i = i+1
v_eventID = Field(v_logSummary<i>, '\', 1)
Repeat
Openpath v_logFolder to t.fvar2 then
write v_logText to t.fvar2, v_jobLogFileName else
call DSLogWarn("Failed to write file ":v_jobLogFileName:" to directory ":v_logFolder, c_routineName)
GoTo ExitWriteJobLogToFile
end
end
else
call DSLogWarn("Failed to open directory ":v_logFolder, c_routineName)
GoTo ExitWriteJobLogToFile
end
close t.fvar2
ExitWriteJobLogToFile:
Return
**********************************************************
As you see in this we concate all the event messages into one variable v_logText . We came across a warning in the DS Log that is more than varchar(2000). Whenever we get this message this routine is aborting.
Was wondering if it is beacuse the concatenated value has exceeded the size that this variable can hold.
Any suggestions pls.
Katz