My requirement is i have an input file on which at column 22 & 23 i have a character data , but when writing into the output file it should be written in its equivalent decimal format.
If value = 'PA' then the EBCDIC representation of the two characters PA is $D7 and $C1 (in hexadecimal representation)$D7C1 converted to decimal is 55233 which is the value that will be written in output file in place of PA.
Can anyone tell me how to go about it ???
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
From your description, this doesn?t sound like character data. What I believe you have is binary data stored in a PIC X(2) field. Redefine the two bytes as PIC 9(4) COMP. You can then move the redefined field to wherever you want.
You can store 0 - 65535 in a PIC 9(4) COMP field and
-32767 to +32767 in a PIC S9(4) COMP field.