IBM Support

Why are trailing zeros removed from decimal values?

Question & Answer


Question

Why are trailing zeros removed from decimal values with ACS Data Transfer .CSV format?

Answer

The numeric value of a decimal with trailing zeros is the same no matter how many zeros exist after the real number.
Some older versions of IBM i Access for Windows would preserve these zeros.
IBM Access Client Solutions CSV transfer type does not, unless Details -> Advanced -> Pad Numeric Fields has been selected. However, this option might cause other undesired changes to the PC data file layout.

An alternative to using ACS Data Transfer would be CPYTOIMPF. For example:
 ===> CPYTOIMPF FROMFILE(MyLibrary/MyFile) TOSTMF('/home/myUSRPRF/MyFile.csv') STMFCCSID(*PCASCII) RCDDLM(*CRLF)
The above command will preserve the trailing zeros in decimals.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

More support for:
IBM i

Software version:
All Versions

Operating system(s):
IBM i

Document number:
960616

Modified date:
18 December 2019

UID

ibm10960616

Manage My Notification Subscriptions