Creating a SAS data set using scripts in the editor window
Step 0) Open SAS
Step 1) Place SAS commands in the editor window.
For example, these commands
load the womenpower data on the book's CD
data womenpower;
input name $ age company $ position $;
datalines;
Fiorina 45 Hewlett-Packard CEO
Miller 46 Citigroup CFO
Meekr 40 MorganStanley Dir
Lazarus 52 Ogilvy&Mather CEO
;;;;
- "data womenpower;" creates a sas data set called womenpower.
You should change "womenpower" to a name that describes your data.
- "input name $ age company $ position $;" gives a list of the variables names. There
should be one variable name for every column in the data set and character (i.e., not numbers)
variable should be followed by a "$" to tell SAS the type of varible to create.
- "datalines;" tells SAS where the data begins.
- "Fiorina 45 Hewlett-Packard CEO" is the first line of data.
I've only give a subset here. You should copy and paste the entire data set
just as it appears on the CD.
Step 2) Submit the SAS commands
- Use the mouse to highlight the commands in the editor window
you wish to submit (or simply select all, control-A).
- Sumbit the commands by clicking run/sumbit or by clicking the
"running man" icon on the top of the SAS window.
Step 3) Check the results
- The log file should read "The data set WORK.WOMENPOWER has 50 observations and 4 variables".