@chaatak :
Good advice, but I would tweak your program just a little. If the only goal is to retrieve and report the label of a variable, then there is no need to read every observation (or any observation at all) from data set ONE. After all, if ONE had one million observations, there is no need to issue the CALL label and CALL symput 1mm times. Yes, in your sample dataset, this not a problem.
But as a defensive measure you could just change the "set one:" statement to:
set one (obs=1);
I did say you don't even have to read one observation, because another option is:
if 0 then set one;
For this task, it won't be any more efficient than the "(obs=1)" approach, but it's a good device for reminder yourself that this data step is about meta-data, not data.
... View more