Previous PageNext Page

Concatenating data sets
The simplest form of combining two data sets with the same variables but different observations is called concatenation.
Following after the creation of the LIBRARY.SURVEY1 permanent data set, the following job creates a second data set and concatenates the two together.

LIBNAME Library '/bios524/classlib';
DATA SURVEY2;
   INPUT SUBJ GENDER :$1. HEIGHT WEIGHT YEAR;
DATALINES;
5 F 63 102 92
8 M 70 250 91
DATA Library.SURVEY12;
   Set Library.Survey1 Survey2;
Proc Print;
   ID SUBJ;
   Title 'Like Example 2 in C&P';
Run;

Produces the following output:

Like Example 2 in C&P

SUBJ    GENDER    HEIGHT    WEIGHT    YEAR

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

Previous PageTable Of ContentsNext Page