To read binary format in file, for example here date, which was declare with PIC 9(9) binary, first we need to open the file. Below is the example of value in the file:
Type “hex on” in the command line to view the data in hex format. Since the date is declared as PIC 9(9), length used in the file is (9+1)/2 = 4. Tips: To view the column number, just type “cols”, and to remove the column number, type “res”. In example above, date 20100126 is now happen to be 0132B41E in hex format. Tips: To read hex value, start from left to right, read from up to bottom, and then next column, up to bottom until the end of data length.
If you know the data position but in hex format, how do you convert it into numeric/decimal format? The easiest way is to use this calculator in the internet:
Convert hex to decimal: http://easycalculation.com/hex-converter.php
If you intend to modify the data with the value you want, for example, from 20100126 to 20100127, you can use the following online calculator for this purpose:
Convert decimal to hex: http://easycalculation.com/decimal-converter.php
In this example, to change 20100126 to 20100127, you only need to change character “E” to “F” in the file.