

Working with SAS datasets The DATA step in SAS provides a very complete set of mathematical and logical instructions for creating new variables from your observed data. The typical work flow is to read the data into SAS (see Accessing data), then use additional DATA steps to rearrange the data. This flow is illustrated by: DATA One is created by reading in one observation for two variables. Then DATA Two is created by copying One with the SET statement, and creating a new variable ZZ which is the sum of the original two variables. Some commonly used manipulations are listed here. Constants, variable names, and SAS functions can be used to describe any equation to create the new variable on the left side of the equation. y=LOG(x); y=EXP(x); y=LOG10(x); y = 10**x; y = (2*x5)/(6+1); y = 2*x5/6+1; y = SIN(x); y=ARSIN(x); IF y=10 THEN x=SQRT(7); IF y IN(10,11,12) THEN x=y/2; y = MEAN (OF x1 x2 x3); y = RANUNI(0); Generally SAS language follows the expected mathematical conventions, but look at the full documentation when in doubt.
Related Topics: Using SAS: Table of Contents 
Home  Contact us  Module list & summary  Glossary/Terms  About this site  Stats courses  Links  Index 