Formatting Data in SAS

Posted on Nov 17, 2009 in Computer Science

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **

Data Formatting

  1. To add labels to a variable, You can use the statement label to add labels to a variable in SAS. And it doesn't matter whether you use the quotation marks for the label string or not.

  2. The label statement in SAS is somehow similar to the format procedure. The difference is that label explains the name of variables while format explains the value of variables.

  3. To quickly remove all labels

proc datasets library=mylib nolist;
    modify mydataset;
    attrib _all_ label='';
quit;
  1. There are times in SAS when you simply want to remove all the formats from a dataset. This can be done in one line in a data step.
data unformatted;
    set formatted;
    format _all_;
run;