What is the purpose of the Attack stat for a unit with no melee weapons?
All models have a close combat weapon in addition to the listed equipment (described in page 183 of the 8th Edition Core Rule Book). It is Strength: User, AP: 0, Damage: 1.

I think this is supposed to represent fighters using their fists, guns as clubs, body slams and any small knives etc they carry.

Some people have been taking advantage of this for units (like helbrutes) that have a bonus for having two melee weapons. It also allows models with weapons like power fists (2x strength, good AP, -1 to hit rolls) to use a different attack against targets where the power fists abilities would be wasted.