SAS OnlineTutorback||next

Try It! Rename variables in Work.Adsort and Work.Strsort.

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 variable Date appears only once in the data set.
    data sasuser.merged;
       merge work.adsort work.strsort;
       by id;
    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.

  2. Recall the program. Add a data set option to rename the variable Date in Work.Adsort to AdmitDate. Add another data set option to rename the variable Date in Work.Strsort to VisitDate.

  3. Resubmit the program and view log messages about the DATA step. Scroll through the output. Note that both renamed variables now appear in the data set.

    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