HomeContact
How to delete labels and formats from SAS variables?
February 20, 2021
1 min

To delete labels and formats from SAS variables, use the PROC DATASET  procedure and attrib statement. Consider the example dataset ex with label and formats applied.

data ex;
a=10.3;
b=20.5;
attrib a format=dollar10.2 label='VARIABLE A' b format=dollar10.2
label='VARIABLE B';
run;```
<p id="jCtlHkk">![How to delete labels and formats form a variable?](../../assets/2021/02/img_603078f6bf0d6.png)</p>
To delete a variable label and format, use the PROC DATASETS procedure as below.
```sas
proc datasets lib=work memtype=data;
modify ex;
attrib a label=' ';
attrib a format='';
run;
quit;
ods select Variables;
proc contents data=ex;
run;
ods select default;```
<p id="GjdkHdc">![How to delete labels and formats form a variable?](../../assets/2021/02/img_603079e147b53.png)</p>
To delete labels and formats from all the variables replace the attrib statement as below.
```sasattrib _all_ label=' ';
attrib _all_ format='';```
export const _frontmatter = {"title":"How to delete labels and formats from SAS variables?","slug":"delete-labels-and-formats","date":"2021-02-20T08:30:45","modified":"2021-07-30T14:33:08","excerpt":"To delete labels and format from a variable, use the PROC DATASET  procedure and attrib statement.","author":"Subhro","authorSlug":"subhroster","categories":["SAS PROGRAMS"],"tags":[],"wordpressId":8606,"wordpressLink":"https://www.9to5sas.com/delete-labels-and-formats/","featuredImage":8611,"type":"post"}

Share


© 2025 9to5sas
AboutContactPrivacyTerms