The /OUTPUT function uses an argument to direct processing output to the specified file. In addition, it returns a code, based on the success or failure of the process.
In a batch file, you can direct the processing that follows the PR0CMND processing, using the return code, in the following statement:
IF ERRORLEVEL n GOTO x
The following list explains the possible return codes:
Since the return code value is evaluated as equal to or greater than, query each ERRORLEVEL in reverse order:
PR0CMND /R TYPE=EXTRACT REQUEST=identifier.name
IF ERRORLEVEL 24 GOTO Badout
IF ERRORLEVEL 16 GOTO Syntax
IF ERRORLEVEL 12 GOTO Fatal
IF ERRORLEVEL 8 GOTO Warning
IF ERRORLEVEL 4 GOTO Info
For example:
Badout
echo The Output File could not be opened.
GOTO End
...
:End