Highlighted
Absent Member.
Absent Member.
660 views

Question about compiler returning error level

[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
0 Likes
1 Reply
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Question about compiler returning error level

I recommend that you use the -w compile option to suppress the warnings, rather than rely on ERROR_LEVEL.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.