SAS OnlineTutorback||next

Try It! Merge the sorted data sets Theater.Repertory, Theater.Company, and Theater.Finance.

Creating HTML output? Read this first.

  1. Print the data sets Theater.Repertory, Theater.Company, and Theater.Finance and see how the data is sorted. Look over the data carefully, checking for potential problems such as

    • variables that have the same name but that represent different data
    • common variables that have the same data but different attributes (such as length or type).

  2. Copy the program below and paste it into the Program Editor window (or issue the command copy sashelp.oltutor..source).

    data finrep;
       merge theater.repertory
             theater.finance 
             theater.company;
       by ssn;
    run;
    

    Modify the program as necessary to create an output data set containing all variables and observations from the input data sets.

    Submit the program and view log messages about the DATA step. Finrep should contain 17 observations and 10 variables.

  3. Print Finrep and scroll through the output. Does the new data set contain all data from the input data sets?

    Return here and select Next.

Solution

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA.
All rights reserved.

Terms of Use & Legal Information | Privacy Statement