Problem solve Get help with specific problems with your technologies, process and projects.

Packed numbers in DB2 key fields from C++

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.


Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close