Example 5.1 Adding Values to All Observations in a Data Set


Combine summary statistics that are saved in a single observation in one data set with all observations in another data set. Compute new variables based on the values of the summary and detail information.

Example Features

Featured StepDATA step
Featured Step Options and StatementsIF _N_=1 statement
Related TechniquePROC SQL, Cartesian product
A Closer LookUnderstanding How the DATA Step Adds Values from an Observation in One Data Set to All Observations in Another

Input Data Sets

The first 10 of 200 observations in STUDENTS are listed.

PROC MEANS created data set OVERALL by analyzing variable SCORE in data set STUDENTS. The 10th percentile and 25th percentile statistics for SCORE ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.