HomeHow To

How to delete labels and formats from SAS variables?1 min read

Like Tweet Pin it Share Share Email

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;

How to delete labels and formats form a variable?

To delete a variable label and format, use the PROC DATASETS procedure as below.

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;

 

How to delete labels and formats form a variable?

To delete labels and formats from all the variables replace the attrib statement as below.

attrib _all_ label=' ';
attrib _all_ format='';

 

Also, Read

  1. Ten Quick Uses of Proc Datasets
  2. Using Proc Contents to describe SAS datasets

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.