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.2label='VARIABLE B';run;```<p id="jCtlHkk"></p>To delete a variable label and format, use the PROC DATASETS procedure as below.```sasproc 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"></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"}