This is just another case of using a HoH to do the equivalent of an sql "join" on two tables. You should be familiar with the approach by now, so there's no need for folks here to write the code for you again.
(Of course, you can also restructure the data into RDB tables and use sql to do the join -- same result, and same response: a suitable solution has already been posted at the monastery within the last few days, and it's just a matter of turning the crank.)
(update: I mention HoH because I assume that the two input files contain data for more than one individual -- the first-layer hash keys are individual ID's and the second-layer keys are the field names and values for the data pertaining to each individual.)