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 ...

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.