Example 3.5 Combining Multiple Tables When the Matching Column Has Different Attributes

Goal

Combine multiple tables where the matching column has different attributes such as length and can be stored as either numeric or character.

Example Features

Featured StepPROC SQL
Featured Step Options and StatementsFULL OUTER JOIN COALESCE function Subquery
Related TechniquePROC SORT and DATA step match-merge

Input Tables

Table WEBCLASSES contains information about six classes. Table CLASS_UPDATES contains updates on some of the classes in WEBCLASSES, and it includes new classes. Table WEBCLASS_SCHEDULE contains scheduling information for classes and their section in fall 2009.

Column CLASSID is in common among the three tables. However, it is defined ...

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.