• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Programming Expert

Solving All of Your Programming Headaches

  • HTML
  • JavaScript
  • jQuery
  • PHP
  • Python
  • SAS
  • VBA
  • About
You are here: Home / SAS / SAS Remove Labels from Dataset with PROC DATASETS

SAS Remove Labels from Dataset with PROC DATASETS

April 26, 2022 Leave a Comment

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.

Other Articles You'll Also Like:

  • 1.  Multiple Condition If Statements in SAS Macro Language
  • 2.  SAS rand – Generate Random Numbers in a SAS Data Step
  • 3.  SAS left() Function – Left Align Character Variables in Data Step
  • 4.  intcx SAS – Find Time Periods Between Two Dates in SAS Data Step
  • 5.  SAS if then else – Write Conditional Expressions for Multiple Conditions
  • 6.  Do Loop in SAS Macro Language
  • 7.  SAS _n_ – How to Use the Automatic Variable _n_ in a Data Step
  • 8.  catx SAS – Concatenate String Variables with Delimiter in SAS Data Step
  • 9.  SAS scan Function – Return nth Word from Character String
  • 10.  Remove Specific Character from String in SAS

About The Programming Expert

The Programming Expert is a compilation of a programmer’s findings in the world of software development, website creation, and automation of processes.

Programming allows us to create amazing applications which make our work more efficient, repeatable and accurate.

At the end of the day, we want to be able to just push a button and let the code do it’s magic.

You can read more about us on our about page.

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

About The Programming Expert

the programming expert main image

The Programming Expert is a compilation of hundreds of code snippets to help you find solutions to your problems in Python, JavaScript, PHP, HTML, SAS, and more.

Search

Learn Coding from Experts on Udemy

Looking to boost your skills and learn how to become a programming expert?

Check out the links below to view Udemy courses for learning to program in the following languages:

Copyright © 2022 · The Programming Expert · About · Privacy Policy