Skip to main content

Program runs with a return code=0, but errorlevel equals 3

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

The program, calling a sub program multiple times, runs successfully with the return code=0 before stop run.  However, the error level check in bat file returns 3.  

Resolution:

You need to use the "returning" keyword on the goback, or stop run statement, to ensure the return-code is appropriately passed :

For example:

IF RETURN-CODE = 0

    GOBACK RETURNING 0

or:

STOP RUN RETURNING RETURN-CODE

Old KB# 7006