i have to convert all the data in file to EBCDIC with packed decimal format.
all the data in the file is in simple text format.
As per my knowledge we will need to convert the ASCII to EBCDIC Cp1047 or some other format first and then apply “packed decimal” logic/code.(may be i am wrong)
the converted format should be like "C3 C5 40 F0 C9 F8"(i.e. EBCDIC packed decimal format)
Packed Decimal (Comp3 in Cobol)
Do you have a Cobol Copybook ???, if you do, see JRecord Question. JRecord also has
Alternatives to JRecord are
Note: I am the author of JRecord
Converting a number to Packed Decimal is pretty easy and there are a number of ways to do it
Convert to String
one option is
Java Code to convert an integer to Packed-Decimal
Similar Question
How to convert unpacked decimal back to COMP-3?