Created On:  27 March 2012

Problem:

While compiling COBOL code with embedded SQL statements with COBSQL, Visual Studio JIT Debugger pops up with a message "Unhandled win32 exception occurred in procob.exe [2432]". The number in the [ ] keeps changing each time the error message is popping up.

Resolution:

The exception actually occurs when the source code contains hex ‘1A’:

123456   05    DFHERROR  PICTURE X   VALUE  IS  ''.
were the above literal or the value between '' is actually hex ‘1A’

In the Net Express editor, the above line will be displayed in two lines as shown below:

123456   05    DFHERROR  PICTURE X   VALUE  IS  '
'.
Hex '1A' is in fact an end of file mark. In Notepad, this character is displayed as a box, which is commonly used for displaying non-printable characters.

This end of file mark is the real cause of the exception for procob.exe. Taking hex '1A' out causes the exception not to occur anymore.

As workaround for the example above, the data definition can be modified to the following:

123456   05    DFHERROR  PICTURE X   VALUE  IS  X'1A'.

Incident #2544809