Previous PageNext Page

Failure of the simple one-to-one Merge
For example, if the data sets were in a different order the results would be different.

Proc Sort data=GenYear out=SortGY;
     BY Subj;
TITLE 'Like Example 3 in C&P Chapter 3';
Data Survey12;
     Merge SortGY HtWt;
Proc Print Data=SortGY;
     ID Subj; Title2 'SortGY';
Proc Print Data=HtWt;
     ID Subj; Title2 'HtWt';
Proc Print;
     ID Subj; Title2 'Survey12 ?';

The output:

Like Example 3 in C&P Chapter 3
SortGY
SUBJ    GENDER    YEAR

  1       M        91
  5       F        92
  7       F        90
  8       M        91
  9       M        93

Like Example 3 in C&P Chapter 3
HtWt
SUBJ    HEIGHT    WEIGHT

  1        68       155
  7        72       205
  9        66       120
  5       102        63
  8       250        70

Like Example 3 in C&P Chapter 3
Survey12 ?
SUBJ    GENDER    YEAR    HEIGHT    WEIGHT

  1       M        91        68       155
  7       F        92        72       205
  9       F        90        66       120
  5       M        91       102        63
  8       M        93       250        70

Previous PageTable Of ContentsNext Page