O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 8.8 Adding Observations to a Data Set Based on the Value of a Variable

Goal

Add a specific number of observations to a data set based on the value of one of its variables.

Example Features

Featured StepDATA step
Featured Step Options and StatementsOUTPUT statement

Input Data Set

Data set NEWSOFTWARE contains the project steps and step duration for a new software installation.

         NEWSOFTWARE

 Obs    task          totaldays
  1     install            1
  2     benchmarks         2
  3     review 1           2
  4     parallel           5
  5     review 2           3
  6     complete           1

Resulting Data Set

Output 8.8 NEWSOFTWAREDAILY Data Set

 Example 8.8 NEWSOFTWAREDAILY Data Set Created with DATA Step Obs workdate task totaldays taskday 1 Monday, Mar 1, 2010 install 1 1 2 Tuesday, Mar 2, 2010 benchmarks 2 1 3 Wednesday, Mar 3, 2010 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required