When accessing AS/400 DB keyed files from C++, the key values are combined into a string. Strings are terminated in C++ by the presence of hex '00'. Since hex '00' can occur normally in a packed decimal field, the key value is truncated prematurely. The solution: Create a logical file that redefines the packed fields as zoned decimal. The keyed file problem goes away AND then need to translate to and from packed decimal goes away. This is really slick for programmers who have been down this path.