Now you're mentioning more variables that need to be averaged...
This is extensible:
proc summary data=have nway;
class country;
var gdp; /*<= put all of the variables you want averaged */
output out=summary mean=;
run;
This will give a data set with one record per country, value for country and the means of all of the variables that you specify on the VAR line. And the way this code works the name of the variable stays the same.
... View more