Monday, October 28, 2013

DATA step

What is Data Step?

Definition: It typically takes data, processes it, and creates a SAS data set. It starts with data keyword and ends with run statement.


Applications: It is used to create new variables within a data set.

Scenario: Assuming your existing data set (employee) contains three variables: Employee, Department, Salary. You intend to make copy of this data set (employeearchive) and store it as archive, then following data step can be used:

Sample Code:
data work.employeearchive ;
set work.employee;
run; 



Notes:


  • All data step statements end with semi-colon ;
  • Comments can be inserted by placing text within asterisk and semi-colon.
           * This is comment ;

No comments:

Post a Comment