Hi I am a beginner in Stata.

I have one panel dataset, and I want to do the following:

To look up a value of index, let's call it "index" within my dataset based on two criteria, the countrycode does not equal to 3 and the year is equal to the year in the current row.
To illustrate, I exectued the code
Code:
 separate china_penetration_ind, by(countrycode)
And my data for china_penetration_ind has been split. But I want them to be in the same row.
I wonder how can I do the following:
if countrycode==DE, replace china_penetration_indUK==china_penetration_indUK (for the values in those row whichcountrycode!=DE by matching year and nace), My dataset looks like the following. In summary, I want chinapeindDK to be in the same row with chinapeindDE by matching "nace" and "year"
Array
Thanks in advance