Skip to main content

What is a return code of 128 from STOP RUN/GOBACK?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

What is a return code of 128 from STOP RUN/GOBACK?

Resolution:

If a program simply terminates with a STOP RUN or GOBACK then the value returned to ERRORLEVEL is undefined.  Basically it could be anything from an OS value through to a piece of uninitialized memory.

When using ERRORLEVEL with a COBOL program then it is necessary to explicitly control/set it within the program code.  For example:

     ...

     move 12 to return-code.

     stop run.

or

     ...

     stop run returning 12 size 4.

or

     ...

     move 12 to return-code.

     goback.

or

     ...

     goback returning 12 size 4.

Old KB# 5192

0 replies

Be the first to reply!