The numeric of length 8 is not 8 digits. It's 8 bytes to store a floating point number, so the INPUT function should use all 20 characters to get the entire number (your INPUT(...,8.) just takes the first 8 columns of the character variable and makes it a number.)
The PUT function left justifies the character string in the output. Your original character variable may be right justified. LEFT can be used to address that for the comparison.
The last consideration is the precision of the numeric representation. Your operating system guide will tell you the largest number that can be represented exactly as an integer in 8 bytes. If your char var is has 20 digits in it, you may have lost information in your numeric version. If you have lost precision, you are in deep trouble, an exact match can't be done.