BeOptimized - Tips and Tricks

SAS data step in a nutshell

The SAS data step is the most important step of a SAS program and corresponds to the step where the data are created. This tips and tricks guides you on the major statements of this step allowing you to create data in the best way.

Details

In SAS, almost all the data manipulation can be done. This flexibility is possible thanks to the data step, a piece of SAS code allowing you to create and manipulate data ! In this tips and tricks, we will see the main statements of this step allowing you to access, manipulate and create data:

  • Create dataset with datalines,
  • Read and create several datasets,
  • Control the variables using the KEEP and DROP statements,
  • Filter data using the where statement,
  • Create new variable with the assignment statement,
  • Create variable conditionally with the if then else logic and case when logic.
  • Use functions in filters or in variable creation,

We will also see how we can add label, specify the type, the length and add format to the variables.

Prerequisites

You don't have experience in SAS and would like to be introduced to the data step programming language.


Go back to your selection


This site uses cookies. .

By continuing to browse the site you are agreeing to our use of cookies. Review our cookies information for more details.