To remove all labels from a SAS data you can use PROC DATASETS to remove all labels using the MODIFY statement and ATTRIB option.

proc datasets lib=work;
    modify example_dataset;
        attrib _all_ label='';
run;

If you want to remove the label of just one variable, you can just specify that variable after ATTRIB.

proc datasets lib=work;
    modify example_dataset;
        attrib var1 label='';
run;

When working with SAS datasets, the ability to change the information about variables, such as labels and formats, is valuable.

It’s possible you may want to remove all labels from the variables in a SAS dataset. Luckily, it’s very easy to do.

PROC DATASETS allows you to modify many different pieces of information regarding SAS datasets in your workspace.

You can use PROC DATASETS to remove all labels from the variables in your dataset.

With the help of the MODIFY statement and ATTRIB option, you can remove the labels from your SAS dataset.

Below is a simple example showing how you can remove labels from a SAS dataset.

proc datasets lib=work;
    modify example_dataset;
        attrib _all_ label='';
run;

If you want to remove the label of just one variable, you can just specify that variable after ATTRIB.

proc datasets lib=work;
    modify example_dataset;
        attrib var1 label='';
run;

Removing all Formats from a Dataset in SAS with PROC DATASETS

In the same way as above, you can easily remove all of the formats from the variables in your dataset.

Below is a simple example of how you can remove all of the formats from the variables in SAS.

proc datasets lib=work;
    modify example_dataset;
        attrib _all_ format='';
run;

If you want to remove the format of just one variable, you can just specify that variable after ATTRIB.

proc datasets lib=work;
    modify example_dataset;
        attrib var1 format='';
run;

Hopefully this article has been useful for you to learn how to remove labels from variables in SAS.

Categorized in:

SAS,

Last Update: March 13, 2024