質問

I have a submit /r; block in IML. 95% of the time, things run correctly. The other times there is an ERROR in R.

My log shows

ERROR: R: <whatever the error message is>

When an error occurs, the outputs are not available. Is there a way to trap or detect the first error so I do not attempt to pull outputs that don't exist?

役に立ちましたか?

解決

Use the ok option in submit statement (ref). Later in the code, you can handle the error based on the value of the variable that stores the information from ok.

submit / R ok = isOK;
  * Do stuff;
endsubmit;

if isOK then do;
  * Handle the no error case;
end;
else
  * handle the error case;

It does not appear that you can capture the error message itself, unless you write the R script to return some error code instead of failing.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top