• 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 Formats from Dataset with PROC DATASETS

SAS Remove Formats from Dataset with PROC DATASETS

April 26, 2022 Leave a Comment

To remove all formats from a SAS data you can use PROC DATASETS to remove all formats using the MODIFY statement and ATTRIB option.

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;

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 formats 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 formats from the variables in your dataset.

With the help of the MODIFY statement and ATTRIB option, you can remove the formats from your SAS dataset.

Below is a simple example showing how you can remove formats from a SAS dataset.

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;

Removing all Labels from a Dataset in SAS with PROC DATASETS

In the same way as above, you can easily remove all of the labels from the variables in your dataset.

Below is a simple example of how you can remove all of the labels from the variables in SAS.

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;

Hopefully this article has been useful for you to learn how to remove formats from variables in SAS.

Other Articles You'll Also Like:

  • 1.  Do Loop in SAS Macro Language
  • 2.  SAS intnx – Add or Subtract Time from Date Variables in SAS Data Step
  • 3.  SAS Dollar Format – Formatting Numbers as Dollars in SAS Dataset
  • 4.  Get Substring from Right in SAS
  • 5.  SAS scan Function – Return nth Word from Character String
  • 6.  Get Last Observation of SAS Dataset with end=
  • 7.  yyyy-mm-dd Date Format in SAS
  • 8.  SAS trim – Remove All Trailing Blanks from String Variable in Data Step
  • 9.  SAS left() Function – Left Align Character Variables in Data Step
  • 10.  SAS Not In – How to Check if Variable is Not in List of Values

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