• 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
  • Ruby
  • 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.  SAS tranwrd() Function – Replace Characters in Strings in SAS Data Step
  • 2.  SAS compress – Remove Whitespace and Characters from String
  • 3.  PROC Format – Create User-Defined Formats for Variables in SAS
  • 4.  SAS strip – Remove All Leading and Trailing Blanks from String Variable
  • 5.  SAS select when – Evaluating Character Values for Conditional Processing
  • 6.  Get Last Observation of SAS Dataset with end=
  • 7.  SAS intnx – Add or Subtract Time from Date Variables in SAS Data Step
  • 8.  mod Function in SAS – Find Remainder of 2 Numbers After Division
  • 9.  Identifying Duplicates in SAS with PROC SORT dupout Option
  • 10.  SAS Power Function – Exponentiate Numbers with ** in a Data Step

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

Welcome to The Programming Expert. We are a group of US-based programming professionals who have helped companies build, maintain, and improve everything from simple websites to large-scale projects.

We built The Programming Expert to help you solve your programming problems with useful coding methods and functions in various programming languages.

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 © 2023 · The Programming Expert · About · Privacy Policy