Termination code
If you want to use a reference to a termination code in your batch file, do the following:
To use such a reference in a Windows batch file, write %errorlevel% in the batch file.
To use such a reference in a UNIX Bourne shell script, write $? in the shell script.
To use such a reference in a UNIX C shell script, write $status in the shell script.
A reference to a termination code is used in the following example of a Windows batch file. If this batch file executes and the Export Tool returns the termination code 1 or 3, the command prompt displays a message that indicates the set subcommand fails.
java -classpath "./lib/JSanExport.jar;./lib/JSanRmiApiEx.jar;./lib/JSanRmiServerUx.jar" -Xmx536870912 -Dmd.command=command.txt -Dmd.logpath=log sanproject.getmondat.RJMdMain<CR+LF> if %errorlevel%==1 echo THE SET SUBCOMMAND FAILED<CR+LF> if %errorlevel%==3 echo THE SET SUBCOMMAND FAILED<CR+LF> pause<CR+LF>
In the previous scripts, <CR+LF> indicates the end of a command line.