March 19, 2012, 07:00 PM
RamanathanCapturing error message
Hi All,
Is there a way to capture error messages to a variable or is there any predefined error message variables in iWay data management console?
March 23, 2012, 11:26 AM
KerryHi Ramanathan,
From our iWay people: The error code can be captured in &FOCERRNUM. Please try and see if it helps.
Cheers,
Kerry
March 23, 2012, 02:11 PM
Ramanathanquote:
Originally posted by Kerry:
Hi Ramanathan,
From our iWay people: The error code can be captured in &FOCERRNUM. Please try and see if it helps.
Cheers,
Kerry
Hi Kerry,
Thanks for your reply.
I tried this already, it captures only the error number and not the error description.
Please let me know how to capture the whole error description.
Thanks
Ramanathan
March 27, 2012, 12:38 PM
ClifI can't think of any way to do that at run time, but after a data flow you submitted has completed you could retrieve the message(s) from the log. Change the WHERE condition as needed.
-DEFAULT &MSGCODE=''
-DEFAULT &MESSAGE=''
SQL
SELECT
T1.MSGCODE ,
T1.MESSAGE
FROM
etllog T1
WHERE
T1.REQ_NAME = '&FLOW' AND
T1.MSGCODE = '(FOC' || CHAR(&ERRNUM ) || ')' ;
TABLE
ON TABLE HOLD AS MESSAGES FORMAT ALPHA
END
-RUN
-REPEAT :LOOP &LINES TIMES
-READFILE MESSAGES
-TYPE &MSGCODE &MESSAGE
-:LOOP
-CLOSE
May 02, 2012, 01:19 PM
jjoyceHi Ramanathan,
I found this thread as I was looking to do something similar in a DataMigrator job. I'm sending an email to my ticketing system when a DM job fails so that it will automattically create a work request and I wanted to include the error message in the body of the email.
I was able to make this work by setting a variable using the system function FEXERR, ie. &&ERRMSG = FEXERR(&RET_CODE,'A72').
Its not the full error description that you'd see with '? n' but better than just the error number.
Hope this helps!