For an overview of the SAS package, its survey functions and links to further sources of help click here. Some SAS set-ups use front ends such as enterprise guide. This will involve a different way of accessing the survey procedures. But the y are definitely still there if you have the standard package SAS STAT licenced.
In order to run SAS you need to be in an environment where you have a licensed version of the package installed.
This introduction uses the data from exemplar 1, but is relevant to any exemplar
(1) To run this exemplar you will need the SAS data set (ex1.sas7bat) and the SAS program code (ex1.sas). You should download them both to a directory on your computer.
(2) Makea directory on your LOCAL hard drive where you will store the data for the exemplars eg mySASstuff/exemp1 and place them there.(3) Now you need to start SAS before you can run the exemplar there are two ways to do this:-
Either :- Click on the SAS icon on your desktop (if you have one) |
Or:- Go to a start menu and find the SAS program from the list. It is usually under 'The SAS system' submenu. If you don't find it and you think you have SAS installed, you may need to find it from your program files.
|
You should now see the SAS user interface that looks like this with 3 windows. If it does not look like this then go to the Window menu and try things like "tile horizontally".
The EDITOR window is where you will be placing the program code with SAS commands. Try to use the SAS enhanced editor (the icon has a little blue cross in the top RHS above the running man). If not go to -> view ->enhanced editor'
The LOG window tells you if your SAS commands have worked.
The OUTPUT window is where your results will appear
The panels on the left enable you to find all your different SAS data sets and to review your results (this one is hidden here).
You can open data sets from the explorer panel and view their contents. SAS data sets are stored in libraries that map to the directories on your computer.
(4) Now read in the SAS program for the exemplar. Go to the editor (program) window and open the data file that you have stored on your computer. You will see that some code appears in Green. These are comments usually identified by lines that start with * and end with ; or are inclosed between "/*" and "*/"..
(5) The first thing you need to do is to tell SAS where your data are located. You will see the first NOT GREEN line starts with the SAS command LIBNAME (SAS is not case sensitive).
Change the part in quotes to the name of the directory on your computer where the SAS data set for exemplar 1 is stored. e.g peas/sas/data/
Highlight that line of code and run (submit) it to SAS by either menu ->run and then SUBMIT, or by clicking on the running man at the top row of icons.
Check that this has worked by reading the log file
(6) Read in formats by highlighting the next bit of code from PROC FORMAT; to RUN. Submit this and check that it has worked. This is some information about variable labels that SAS needs for the exemplar 1 data set.
(7) You can now view the data for the exemplar by going to the libraries left hand panel, clicking on the library you want and then the data set.
(8) Now you can go back to the SAS editor and carry on running the exemplar by highlighting and submitting code from the program (Editor) window. You will find that you get output in the OUTPUT window.