in reply to Re^4: Perl Unpack Cobol Binary File and Fields
in thread Perl Unpack Cobol Binary File and Fields

This suggests that every field is just 2 bytes wide and you have two dummy bytes at the start of your record. Because I get 2020 when I look at the next two bytes as a 16-bit word:

my $data1 = unpack 'n', substr( $str, 2,2 ); my $data2 = unpack 'n', substr( $str, 4,2 );

The data itself looks plausible but are you really sure that you are looking at the correct record?

Replies are listed 'Best First'.
Re^6: Perl Unpack Cobol Binary File and Fields
by dbarkho14 (Novice) on May 04, 2020 at 21:08 UTC

    yes I was looking at the wrong record. Now that I am looking at the correct one, first rec has 431 and 2020 as expected. I should be able to take it from here. Thanks so much for help!