In class G airspace knowing who is providing a service to a particular aircraft is very useful. Most units that operate outside the protection of controlled airspace have their own allocated block of squawks, which can be found here;
http://www.ead.eurocontrol.int/eadba...2015-05-28.pdf (scroll to page ENR 1.6-8).
Flights that remain within controlled airspace may well retain one code for the duration of the flight, but as they are remaining within a known traffic environment the controlling authority is known, as the airspace will be allocated to a known agency.