Quantcast
Viewing all articles
Browse latest Browse all 4356

RE: Hexadecimal VALUE in a Website

I am assuming that the error message that you are receiving is a RTS 198 or some error about a Code Page conflict, is that correct?

The problem would occur because the web site itself (the .aspx file) is stored as UTF-8 containing the BOM (EF BB BF) at the start of the file and the program that you are attempting to call is stored as an OEM format like ANSI or some other non-UTF-8 codeset.

When compiling the program the compiler assumes that all source files are in OEM format unless this BOM is found and then it is determined to be UTF-8 and the compiler sets a flag within the compiled program so that the run-time system knows which codeset should be used in the program.

The compiler also scans the programs for any PIC X fields with VALUE clauses that may contain characters that may not be compatible between different codesets. If such a character is found then the compiler will set a flag so that the run-time system can check that only a program with a compatible codeset can call this program.

This is what the compiler is doing when it comes across your hex literal. It is treating it as an incompatible character because its value is > X"7F".

There are a couple of workarounds to this issue.

1. Open up your program source in Visual Studio and then under File-->Advanced Save change the encoding to be UTF-8 and then save the file.

2. Set the directive SOURCE-ENCODING"UTF8" in the project properties for the COBOL program with the X"FF" in it. (note: this directive cannot be set directly in the source program)

This topic is covered in the product documentation under Code Page Conflicts in .NET code.

Thanks.


Viewing all articles
Browse latest Browse all 4356

Trending Articles