SAS OnlineTutorback||next

Try It! Merge the sorted data sets Work.Adsort and Work.Strsort and select variables.

Creating HTML output? Read this first.

  1. Copy the program below and paste it into the Program Editor window (or issue the command copy sashelp.oltutor..source). Then submit the program. In the output, notice that the data set contains 16 variables.

data sasuser.merged;
   merge work.adsort
     (rename=(date=AdmitDate) in=inad)
      work.strsort
     (rename=(date=VisitDate) in=instr);
   by id;
   if inad and instr;
run;
proc print data=sasuser.merged;
run;

NOTE: Work.Adsort and Work.Strsort were created in a previous practice. If you haven't created these data sets, return to the practice and create them before proceeding here.

  1. Recall the program. Add two data set options to drop the variables Height and Weight from Work.Adsort and keep only the variables ID, Tolerance, and Date from Work.Strsort.

  2. Resubmit the program and view log messages about the DATA step. Did the program execute successfully? Scroll through the output. Does the new data set contain 9 variables?

    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