We have received a file that was created on an IBM system using the IBM CPYTOPCD command, Translation table = *NONE, Format of PC data =*NOTEXT. Our information indicates that this command copies a system database file to a PC Document. The file is created on a QSYS file system on an I Series IBM. The output file is iin EBCDIC and containes TEXT, ZONED, and PACKED data, mixed in each record. We are able to convert the TEXT and ZONED data just fine but can not get accurate data out of the PACKED data.
The PACKED data is defined in the file layout document as PACKED 9 2
We define the data as PIC S9(7)V9(2) COMP-3. in our input record and as PIC S9(7)V9(2) SIGN TRAILING SEPARATE.
In the PROCEDURE section, we do the following: ADD "PACKED ITEM NAME" TO ZERO GIVING "TEXT ITEM NAME"
We get a "good" number and sign but the number is not correct.
An example: Display of "PACKED ITEM NAME" = 27??6.71, Display of "TEXT ITEM NAME" = 2856.71. The expected value is: 2078.73.
How to convert Packed decimal to text
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.



