I have data that stored in the format using datatype called "Sign Embedded"
Sign Embedded
This data is similar to numeric character data, however, the sign will be embedded in the rightmost byte of the field.
that's what HELP
said but I have no idea how to convert this to normal numeric char data
I have some examples of these data here
2698388x = -26983888
1665289w = -16652897
19200p = -192000
72119v = -721196
This is bitwise operation...I guess,but I don't know the exact algorithm.
I would appreciate if someone can help me figure this out :)
ps.this data is generated by COBOL program (though....doesn't matter)
This is the Zoned decimal Format used by some Ascii Cobol compilers (Fujitsu, GNU-Cobol etc).
In a recent answer I provided java code for both mainframe and PC cobol compilers.
basically the last digit holds the sign and
The last or low nyble (4 bits) always give the decimal value, the first or high nyble give the sign.
I am not sure wether the negative numbers are represented by upper or lower case letters, would need to test.
Some compilers might not used the positive values.
Also in Cobol Zoned decimal, the decimal point is not stored, it is assumed
So you Must have the COBOL copybook; It would be better to decode in Cobol or use a commercial package.
Most Open-Source Cobol interface packages concentrate on Mainframe EBCDIC Cobol. If java is an option
Note: I am the author of JRecord.
To decode the number the code could be
alternatively
always converts a character to a number in the range of 0 to 10 for both ebcdic or ascii numbers / zoned-decimal