data _null_; dcl javaobj j ('Example10', 'foobar.file'); length s $1000; j.callStringMethod ('getExceptionMessage', s); if s ne '' then do; put "Exception message from java"; i = 1; do while (scan (s,i,'0a'x) ne ''); l = scan (s,i,'0a'x); i+1; put l; end; end; run;