Example 5.1 Adding Values to All Observations in a Data Set

Goal

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