IBM Support

ACS Data Transfer of Packed Decimal Data

Troubleshooting


Problem

Access Client Solutions (ACS) Data Transfer to a text file does not format packed (decimal) fields the same way that older clients did.

Resolving The Problem

Data transfer utilities that handle the conversion of numeric fields to character numeric columns must also account for the sign and decimal point. In a text file format where the columns are a fixed width in the PC text file, that means that for whole number (integers), the field in the PC file must be one character wider than the precision of the numeric column. And for real numbers (numbers with a decimal), the character representation has to include a decimal separator which is not actually present in a packed or zoned field, it is implied by the external description. So a character numeric value in a text file must be one character larger than the precision of an integer to account for a sign. Similarly, for real numbers, it must be two characters larger than the precision of the number to account for the sign and the decimal separator. This is what the Access Client Solutions (ACS) data transfer function does.

The older IBM i Access for Windows client incorrectly handled zoned and packed values differently. It handled zoned (numeric) values as described above but if the number was stored as a packed value and the precision was an even number, it would add an extra leading space. This isn't necessary or correct but since the product worked this way for many years, it is not going to be changed. The correction was put into the newer ACS client.

If you would like to get the old behavior where you have an extra space before the sign with packed numbers that have an even precision value, you can modify your select statement to add that space.

For example, I have a table defined with the following DDL:

CREATE TABLE NUMBERS (F1 NUMERIC (10,0), F2 DECIMAL (10,0), F3 DECIMAL (11,0))

The F2 column is a packed (numeric) with an even precision (10). If I download the data in this file to an ASCII Text format using the older Access for Windows client, it will make F1 11 characters wide, and both F2 and F3 12 characters wide. I can modify the equivalent ACS transfer by clicking on the 'Data Options' button and select a single space enclosed in quotes as a column between F1 and F2:


Data Options Dialog showing the select clause.

The result will be a text file with the same (incorrect) format as the Access for Windows client creates.

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

Document Information

Modified date:
18 December 2019

UID

nas8N1021775