Won't it be a solution to your problem ?
Function Checkerror(fnName)
Checkerror = False
Dim strmsg ' As String
Dim errNum ' As Long
If Err.Number 0 Then
strmsg = "Error #" & Hex(Err.Number) & vbCrLf & "In Function " & fnName & vbCrLf & Err.Description
'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
Checkerror = True
End If
End Function
NB : For the complete vbs instruction see :
http://support.sas.com/forums/thread.jspa?threadID=9182&tstart=0
Message was edited by: Fab.from.be