Even Better
Print just the Male's Height and Weight.
Again, why build a data set when you don't have to?
Title 'More efficient: Males only'; Proc Print Data=library.Survey12 (KEEP= Gender Subj Height Weight); WHERE Gender = 'M'; ID Subj; Var Height Weight;
Only the variables that are needed are brought into Proc Print (using KEEP=).
Only the observations that are needed are brought into Proc Print (using WHERE).
Only the variables of interest are printed (using the VAR statement).