sas

data step

getting data with data setp

data newclass(keep=first_name sex weight yearborn);
  set sashelp.class(drop=height rename=(name=first_name));
  yearborn=year(date())-age;
  if yearborn >2002;
run;

Data specifies the target data set. Keep option specifies columns to print to target.

Set specifies source data set. Drop specifies columns not to take. Rename renames name to first_name.

Yearborn is a calculated implicit numeric variable (column).

Filter and implicit output data with if for pupils born after 2002.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow