To remove all formats from a SAS data you can use PROC DATASETS to remove all formats using the MODIFY statement and ATTRIB option.
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;
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 formats 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 formats from the variables in your dataset.
With the help of the MODIFY statement and ATTRIB option, you can remove the formats from your SAS dataset.
Below is a simple example showing how you can remove formats from a SAS dataset.
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;
Removing all Labels from a Dataset in SAS with PROC DATASETS
In the same way as above, you can easily remove all of the labels from the variables in your dataset.
Below is a simple example of how you can remove all of the labels from the variables in SAS.
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;
Hopefully this article has been useful for you to learn how to remove formats from variables in SAS.