Base SAS Programming – Day 5

Merging Data Sets and other options

  1. Merge: (Synonymous to Joins)
    • Datasets can be merged using Data step only, using Merge statement
    • There must be a common variable (Primary id) between the two (or more) datasets being  merged
    • The datasets being merged MUST be SORTED  by the primary id before being merged
    • Types of Merge
      • Inner Merge (no condition) – All observations of the datasets are merged.
      • Exact Merge (x=1 and y = 1) – Only the common observations between the datasets are merged.
      • Right Inner Merge(y = 1) – Only the observations of Right side dataset
      • Left inner Merge(x=1) – Only the observations of Left side dataset
      • Outer Merge(x=1 or y =1) – Only uncommon observations between the datasets
      • Right Outer(x=0 and y=1) – Only uncommon observations of right side dataset
      • Left Outer(x=1 and y = 0) – Only uncommon observations of Left side dataset
  2. Proc Means: Other options and statements
    • By and Class statements to sub-group statistics
    • Output Out statement to save the result into a dataset


3 thoughts on “Base SAS Programming – Day 5

  1. If Google SEO were a chicken and your site were an egg, which will come first.
    And finally, you should let the option defined as “Enhanced image search” your Google Webmaster Central account.
    The right suggestion I am able to provide you is
    usually to write your posts for people and never the search engines.

  2. I Was hoping if there is anyway that we can get the datasets that Ms.Uma used for the PROC MEANS part.
    It would be very helpful if there was a repository for these as well.
    Thank you

  3. Description under “Base SAS Programming – Day 5” for outer merge is incorrect, I guess. Should be “Outer Merge(x=0 or y =0) – Only uncommon observations between the datasets” instead of “Outer Merge(x=1 or y =1) – Only uncommon observations between the datasets”.

Leave a Reply

Your email address will not be published.