Problem:
You may have a requirement to store data and retrieve data in EBCDIC format on Windows using Net Express.
Resolution:
By default data is stored in ASCII format in Net Express but it can be stored and processed in EBCDIC. However there is a difference in the way signed numeric data is stored and displayed between ASCII and EBCDIC. Subsequently, this data may not be displayed as expected in reports, especially signed decimal fields.
ASCII will store and display the value 24 as that - 24, where EBDIC will store it in EBCDIC format and display it as 2D.
Negative 24 would be displayed as 2t in ASCII and 2M in EBCDIC.
To change this behavior, set the CHARSET"EBCDIC" compiler directive.
Attached is a sample program to illustrate how this works.
Create a project for this and run the program. Comment out or uncomment CHARSET"EBCDIC" to change the behaviour.
Also, have a look at the actual data file written out (eg via Wordpad, Notepad or the Data File Editor etc) and see the difference between how it is stored.




