"It's all coming back to me now."
05 FIELD1 PIC 9(5) VALUE 0 BINARY.
05 FIELD2 PIC 9(4) VALUE 0 BINARY.
05 FIELD3 PIC 9(4) VALUE 0 BINARY.
05 FIELD4 PIC 9(8) VALUE 0 BINARY.
05 FIELD5 PIC 9(4) VALUE 0 BINARY.
05 FIELD6 PIC S9(04) VALUE 0 COMP.
05 FILED7 PIC S9(15)V99 VALUE 0 COMP-3.
05 FIELD8 PIC S9(15)V99 VALUE 0 COMP-3.
Your data should consist of big-endian
data as follows:
FIELD1, FIELD4 four unsigned bytes, binary.
FIELD2, FIELD3, FIELD5 two unsigned bytes each, binary.
DATA.FIELD6 two bytes, binary, but two's complement signed.
DATA.FIELD7-FIELD8 nine-byte fields consisting of seventeen binary-coded-decimal (BCD) digits (four bits = "one nybble" each) followed by a sign-indicator in the rightmost "nybble" as described above. The rightmost two digits are implicitly understood to be right of the decimal point.
I am not immediately aware of any Perl package which will directly handle "BCD representation." Although I do, of course, expect that Many Monks will promptly correct me on this point! Because, "this being Perl, surely it must be there."
Edited: Thanks for pointing out what I originally had missed – that FIELD4 requires to be a four-byte field.