I am loogin at implementing a generic process of error handling on all the IML scripts we run in our company. Ideally, it would be something like this:
%LET IsIMLError = 0; /* flag that is set to 1 in case if an error */
proc iml;
OnError do; /* is this somehow possible? */
%LET IsIMLError = 1;
write_error_to_text_file; /* pseudo-code */
ABORT;
end;
/* IML code goes here*/
quit;
The idea is to always trigger the error handling section whenever an error appears, no matter the nature of the error. Right now I can't figure out if the 'OnError' event exists in SAS/IML (or something with similar functionality). Any hints?