Example 3.7 Matching Observations Randomly

Goal

Randomly pair observations from two data sets until a good match is found. Create a new data set that contains the results of the match. Update the value of a variable in the data set considered the master data set with information that was obtained in the match with the other data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsMODIFY statement, NOBS= and POINT= options REPLACE statement Random number function RANUNI CEIL function

Input Data Sets

Data set ENGINEERS has the available hours for seven engineers. It is the master data set. Data set ENG_PROJECTS contains a list of six engineering projects and the hours to complete on the project. It is the transaction ...

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.