Skip to main content

Question about compiler returning error level

  • April 28, 2011
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 22 April 2011]

Hi, we use a batch to compile our cobol programs, that in addition to compile it also does some other operations and checks. After the compilation we do some copies only if it doesn't exist a generated error file; the problem is that error files are also generated when the compiler only raise warnings (we string some numeric 78 level).

In windows 7 we observed that the windows variable ERROR_LEVEL is 0 when all is well done, 1 when any warning is raised and 2 when errors are raised; i don't find anything about the returning error level in the documentation, so do we can rely on this variable to perform our check in the batch or this is not a granted feature?

Thank you

1 reply

[Migrated content. Thread originally posted on 22 April 2011]

Hi, we use a batch to compile our cobol programs, that in addition to compile it also does some other operations and checks. After the compilation we do some copies only if it doesn't exist a generated error file; the problem is that error files are also generated when the compiler only raise warnings (we string some numeric 78 level).

In windows 7 we observed that the windows variable ERROR_LEVEL is 0 when all is well done, 1 when any warning is raised and 2 when errors are raised; i don't find anything about the returning error level in the documentation, so do we can rely on this variable to perform our check in the batch or this is not a granted feature?

Thank you
I recommend that you use the -w compile option to suppress the warnings, rather than rely on ERROR_LEVEL.