Determines whether an exception occurred during a method call.
Category: | Exception |
Applies to: | Java object |
specifies the name of the Java object.
specifies the exception status that is returned.
Tip | The status value that is returned by Java is of type DOUBLE, which corresponds to a SAS numeric data value. |
/* Java code */ public class a { public void m() throws NullPointerException { throw new NullPointerException(); } }
/* DATA step code */
data _null_;
length e 8;
dcl javaobj j('a');
rc = j.callvoidmethod('m');
/* Check for exception. Value is returned in variable 'e' */
rc = j.exceptioncheck(e);
if (e) then
put 'exception';
else
put 'no exception';
run;
exception