Skip to main content

Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

I am not sure why this is happening if all of your source is saved as UTF-8.

You may want to clean the projects and then rebuild them and see if that helps.

Since the message indicates that the main program is using Western European can you please try to set the directive RUNTIME-ENCODING"OEM" in the project and see what happens?


Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

After putting RUNTIME-ENCODING"OEM" in the shared assembly I get the expected error:

Additional information: 198     Load failure [Program has an incompatible codepage dependency

"ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage OEM United States

but the main program "ASP.logon_aspx" is using Western European (Windows)

Please see documentation for more information.]

It switched from UTF-8 to OEM.


Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

After putting RUNTIME-ENCODING"OEM" in the shared assembly I get the expected error:

Additional information: 198     Load failure [Program has an incompatible codepage dependency

"ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage OEM United States

but the main program "ASP.logon_aspx" is using Western European (Windows)

Please see documentation for more information.]

It switched from UTF-8 to OEM.


Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

Please also try RUNTIME-ENCODING"ANSI"


Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

RUNTIME-ENCODING"ANSI" got it to run. But isn't this setting overriding the encoding set in File\\Advanced Save Options?

It had to be set to UTF-8 (per a previous forum entry here) to get past an issue with hexadecimal values. Will this cause issues with that particular situation?


Another error:

An exception of type 'MicroFocus.COBOL.COBOLRuntimeException' occurred in MicroFocus.COBOL.Runtime.dll but was not handled in user code

Additional information: 198     Load failure [Program has an incompatible codepage dependency
 "ClassLibrary1.GET_ENVIRONMENT_VARIABLE" is using codepage Unicode (UTF-8)
 but the main program "ASP.logon_aspx" is using Western European (Windows)
 Please see documentation for more information.]

I have opened LOGON.aspx in Visual Studio, selected Advanced Save Options in the File menu, and changed the character set to UTF-8. this was also done to all other cbl files in the solution. I also set the compiler directive SOURCE-ENCODING"UTF8" in the project. I am still getting the error on ASP.LOGON_aspx, which I am assuming is the generated aspx page.

I am using the default asp.net server with Visual Studio 2010, if that helps.

These directives tell the run-time system which code page should be used when interpreting the characters stored within PIC X fields in your programs.

Normally the code page to use would be determined by the code page of the source program itself.

If you are making calls between programs and the code pages of their source programs are different the run-time needs to know which code page should be used to interpret characters above X"7F" because these differ depending on the code page.

If you are not not using characters above X"7F" in PIC X fields then this will not be an issue.

We had you add SOURCE-ENCODING"UTF8" to your projects previously because you had certain hex literals in your programs that were above X"7F" and this was causing the compiler to flag these programs as OEM. Since they were being called by programs that were actually stored as UTF-8 files this caused the run-time error 198. Setting SOURCE-ENCODING"UTF8" told the compiler not to flag these programs as OEM so the run-time error would not occur.

Since now you are getting an error that the main program is using ANSI and the others are using UTF-8, I decided to try the other approach which is to override the RUNTIME-ENCODING"ANSI" so that the run-time system would treat all characters as ANSI codeset.

As long as you don't actually use characters above X"7F in your PIC X fields and they are not being passed between the programs then it really shouldn't matter which directives you use to get this to work.

It is not clear why you are getting the error that you are now experiencing.

I would recommend that you open up a support incident with customer care and place my name in the description and we can take a closer look at what is going on here.

BTW, we have changed the behavior of the compiler so that these hex literals will not cause the programs to be flagged at compile time. Only true characters above X"7F" embedded in value clauses will cause this flag to occur.

This change will be available in Visual COBOL 2.2 update 2.