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.
-
Select
View Explorer from the main menu.
The
Explorer window
appears.
-
Select
Mylib in
the SAS Libraries tree.
The contents of the
Mylib library appear, and include the three files
Engdict
,
Vaerext
,
and
Vaer_abbrev
.
-
The contents of the
Vaerext
file
appears in a new window.
-
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.
-
Close the
MYLIB.VAEREXT
window.
-
Select the project name
Vaccine
Adverse Events to display the project Properties Panel.
-
Click
for the
Project Start Code property.
The
Project
Start Code dialog box appears.
-
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.
-
-
-
Select
View Explorer from the main menu.
The
Explorer window
appears.
-
Select
Mylib in
the SAS Libraries tree.
Notice that the Mylib
library now contains a new entry for the file
Vaerext_serious
.
-
Double-click
Vaerext_serious
.
The contents of the
Vaerext_serious
file
appears in a new window.
-
Scroll all the way to
the right to see the new column
serious.
-
Close the
MYLIB.VAEREXT_SERIOUS
window.
-
Close the
Explorer window.