Never mind. Went to kix help.

If EXIT is followed by a numeric expression, then @ERROR is set to the value of that expression and you can check it in the calling script or batch file.