A little announcement. A lot to explore.

Happy learning!

Explore lessons, including SAS & R programs and practice data.

Search lessons

Type at least 3 characters to see matching lessons.

Open SAS ↗Open R ↗
← SASnRJoin Datasets Using SQL

Introduction

  • Joining subject-level data (ADSL) onto event-level data (ADAE, ADLB) is one of the most frequent operations in clinical programming — we need treatment group, demographics, or flags on every record.
  • SAS uses PROC SQL with LEFT JOIN, INNER JOIN, or FULL JOIN. R uses dplyr’s left_join() family or base R’s merge().
  • This lesson demonstrates all three join types on a small ADSL + ADAE pair, showing which records survive in each case.
  • After running, we compare row counts across the three join types to confirm the expected behaviour.

Join Datasets Using SQL