Return Codes

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
Note: The return code is labeled ERRORLEVEL in the output report for a process run in a Windows environment, and EXITCODE for a process run in a UNIX or Linux environment.

The following list explains the possible return codes:

0
No errors
4
In all of the requests, the highest return code was Informational.
8
In all of the requests, the highest return code was Warning.
12
In all of the requests, the highest return code was Fatal.
16
There was a syntax error on the command line. A pop-up window also displays, unless you specified /Quiet+.
24
Cannot open the file specified in the Output= parameter.
28
Cannot load pstlocal.cfg. (See the Installation and Configuration Guide for more information.)

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