There are two ways of answering this question. The first option is to use the command drop to remove each variable in the data set except the variable you created in question 6 (newvar in our example). To do this you would type:
drop clustnum hhid pcode mcode pers_res
The above commands would remove the variables listed (clustnum hhid pcode mcode pers_res) from the data set. To remove all variables except newvar from the data set you would need to include every variable name in the list following the drop command.
The second option is to use the command keep. The keep command drops all variables from the data set except those listed after the command. Thus to answer the question, the command you would use is:
keep newvar
The above command drops every variable from the data set except newvar.