Hmmmmmmmmmm ....
It seems that a few peoples have forgotten their COBOL Core skills
It's nothing to do with BCD or Packed Decimal.
It's to do with the declaration for the sign.
Because there is no sign declaraction on the field (S9(9)V99 VALUE 0), the
compiler (or the program) defaults come in to play. It would appear that the
compiler (or program) default is SIGN OVERPUNCHED TRAILING.
This means that the high nibble of the last byte has been 'overpunched' with
the sign indicator.
One option would be to ask the COBOL programmer to change the definition for
the 'dump' file so that the field is defined as S9(9)V99 SIGN SEPERATE
TRAILING VALUE 0. If he can do that for you then the output will be
00000189224+ or 00000189224- as appropriate.
If that is not an option then you need to read the value (11 characters) as
a string then change the last character and set the sign as per the
following:
If the last character is '{' or 'A' thru 'I' then the value is positive.
If the last character is '}' or 'J' thru 'R' then the value is negative.
If the last character is '{' or '}' then replace it with '0'.
If the last character is 'A' or 'J' then replace it with '1'.
If the last character is 'B' or 'K' then replace it with '2'.
If the last character is 'C' or 'L' then replace it with '3'.
If the last character is 'D' or 'M' then replace it with '4'.
If the last character is 'E' or 'N' then replace it with '5'.
If the last character is 'F' or 'O' then replace it with '6'.
If the last character is 'G' or 'P' then replace it with '7'.
If the last character is 'H' or 'Q' then replace it with '8'.
If the last character is 'I' or 'R' then replace it with '9'.
FYI,
the EDCDIC values for characters '0' thru '9' are 0xF0 thru 0xF9
respectively
the EDCDIC values for characters '{' thru 'I' are 0xC0 thru 0xC9
respectively
the EDCDIC values for characters '}' thru 'R' are 0xD0 thru 0xD9
respectively
Notice the correlation.
For overpunched signs (trailing) the last byte is overpunched with the
corresponding character from the 'C' column for a positive value or the 'D'
column for a negative value.
For overpunched signs (leading) it is the first byte that is overpunched.
If the sign was leading your value in the dumpfile would read '{0000189224'.