atomic mass and mass number are not at all related eventhough they are numerically equal (approximately) in most of the cases.
For example the atomic mass of carbon is 12u and mass number of carbon is also 12.
But the atomic mass of is defined as the relative mass of one atom with reference to 1/12 of carbon-12 atom. So it is the ratio between the mass of an atom and mass of one carbon atom. It can have value as whole number or fraction.
Mass number is defined as the sum of number of protons in the neutrons. As this is the sum of number of particles it should always have whole number value and fractional value is not possible here.