Explore and Modify the Data

After you create a library, you can view the data before creating a data source to use in SAS Enterprise Miner. For example, consider the situation where you want to create another variable to summarize the values of multiple variables.
Perform the following steps to view available SAS data files and create a new SAS data file that you will use as a data source.
  1. Select View then select Explorer from the main menu.
    The Explorer window appears.
  2. Select Mylib in the SAS Libraries tree.
    The contents of the Mylib library appear, and include the three files Engdict, Vaerext, and Vaer_abbrev.
  3. Double-click Vaerext.
    The contents of the Vaerext file appears in a new window.
  4. Scroll to the right to view the available variable names that appear as column headings.
    Notice the following variables:
    • DISABLE — a binary variable that has a value of ‘Y’ if there was a disability
    • DIED — a binary variable that has a value of ‘Y’ if there was a death
    • ER_VISIT — a binary variable that has a value of ‘Y’ if there was an emergency room visit
    • HOSPITAL — a binary variable that has a value of ‘Y’ if there was a hospitalization
    Consider that we want to create a new data set, vaerext_serious, that includes a binary variable serious that has a value of ‘Y’ if there was disability, death, emergency room visit, or hospitalization, and a value of ‘N’ otherwise.
  5. Close the MYLIB.VAEREXT window.
  6. Select the project name Vaccine Adverse Events to display the project Properties Panel.
  7. Click Selector Button for the Project Start Code property.
    The Project Start Code dialog box appears.
  8. Enter the following code on the Code tab after the LIBNAME statement you previously added to create the mylib library:
    data mylib.vaerext_serious;
       set mylib.vaerext;
       if DISABLE='Y' or DIED='Y' or ER_VISIT='Y' or HOSPITAL='Y' then serious='Y'; 
       else serious='N';
    run;
    This code creates a new SAS file, vaerext_serious from the vaerext file in the mylib library, adds a variable serious, and assigns it a value of Y or N, depending on the value of the DISABLE, DIED, ER_VISIT, and HOSPITAL variables.
  9. Click Run Now.
  10. Click OK.
  11. Select View then select Explorer from the main menu.
    The Explorer window appears.
  12. Select Mylib in the SAS Libraries tree.
    Notice that the Mylib library now contains a new entry for the file Vaerext_serious.
  13. Double-click Vaerext_serious.
    The contents of the Vaerext_serious file appears in a new window.
  14. Scroll all the way to the right to see the new column serious.
  15. Close the MYLIB.VAEREXT_SERIOUS window.
  16. Close the Explorer window.