Unicode data

The FM/Db2 editor handles character data stored in Unicode differently to data stored in EBCDIC or ASCII. The differences are summarized here.

FM/Db2 normally retrieves character data from Db2® with automatic conversion to the CCSID of the FM/Db2 plan, normally CCSID 37. This is US EBCDIC; other EBCDIC CCSIDs may also be used.

When FM/Db2 retrieves character data stored in Unicode (within Db2®), this automatic data conversion does not occur. The FM/Db2 editor processes the character data internally in native Unicode format. This means that, prior to display on the terminal, the data is converted from Unicode to the CCSID of the terminal. This may result in conversion errors when a Unicode character has no corresponding code point in the CCSID of the terminal. Any characters that cannot be converted are shown on the display as periods, indicating an unconverted character. When data displayed (and possibly changed) on the terminal is processed, it is converted from the CCSID of the terminal into Unicode, prior to submission to Db2®. This conversion will always be successful, since Unicode includes code points for all characters in commonly used CCSIDs.

Data corruption is possible when the displayed data includes a period indicating an unconverted Unicode character, and the data for the column is changed by overtyping. Any periods in the modified data are converted to the Unicode equivalent. Therefore, if the period represents an unconverted Unicode character, that character will be corrupted by the change. When character data is displayed in hexadecimal mode, the hexadecimal characters normally represent the encoding for the displayed character in the CCSID of the terminal. For example, 'A' is represented by 'C1'x in EBCDIC. When the character data is for a Unicode-encoded column, the hexadecimal characters represent the native Unicode data, not the encoding of the displayed character in the CCSID of the terminal. For example, 'A' is represented by '41'x when Unicode data is being displayed.

You can also make changes to the data in a column stored in Unicode by turning hexadecimal display on (HEX ON command) and overtyping the hexadecimal characters directly. When you do this, you should use the Unicode representation of any character, not the terminal's CCSID representation.

Assuming the target column is character data stored within Db2® in Unicode, the FIND, CHANGE, and EXCLUDE commands operate like this:
  • Strings such as 'ABC' are converted to Unicode prior to any search or change occurring.
  • Hexadecimal strings such as '414243'x are not converted to Unicode prior to any search or change occurring. Therefore F 'ABC' and F '414243'x are equivalent commands when the target column contains Unicode data, but not when the target column contains EBCDIC data.