Pages

Monday, August 5, 2013

Widgets

Varnum option in Proc contents

Generally when you create a sas dataset by using proc contents on a sas dataset, the output data set is sorted in ascending order by name by default. But if you want to arrange the observations in a same order as the order of columns you can use varnum option in proc contents.
Proc contents data = xyz out = abc varnum;   run;
It creates another column in dataset 'abc' called varnum which numbers the variable name in order which the variable have in data set 'xyz'. The you can sort dataset abc by varnum to get the dataset 'abc' observations arranged in order of the columns in dataset 'xyz'.           

Generally when you create a sas dataset by using proc contents on a sas dataset, the output data set is sorted in ascending order by name by default. But if you want to arrange the observations in a same order as the order of columns you can use varnum option in proc contents.
Proc contents data = xyz out = abc varnum;   run;
It creates another column in dataset 'abc' called varnum which numbers the variable name in order which the variable have in data set 'xyz'. The you can sort dataset abc by varnum to get the dataset 'abc' observations arranged in order of the columns in dataset 'xyz'.                     

No comments:

Post a Comment