SAS tour 1. It is important to see how to get data "into" SAS. So look at the easiest way first: put the data IN the sas program. I put a test program called "babyData.sas" in my SAS working example code directory. Download that, open it in the SAS program editor, add some more lines of data just for fun, and then run the PROC MEANS and PROC GPLOT statements. When you run that, look at the LOG window for error messages. Look at the Output window for, hmm, I forget what's in there. A separate graphic window should come up too. See? Now, in SAS for the PC, there is an interactive thing on the left called "Explorer". It shows data libraries, and if you open the "libraries" button with a double click, you should see some folders. The "Work" folder is the place where it is storing your temporary datasets in sas format. Open work, doubleclick on your dataset and see what you see! If you don't see something, make a note! Once the gplot output shows, try to save a picture of the image as a file. Choose File/export as image. For god's sake, don't choose bmp format. Choose gif for a picture format and/or choose epsi or ps for a format that many document preparation programs can incorporate. If you save a gif or jpeg format picture, use a graphic editor like irfanview to open up the picture, cut or color it, do whatever you want. Just convince yourself you did create a picture. Gplot output can be customized in a million ways, to control the plotting character, the axis labels, and so forth. I'm not an expert, but if I look in the SAS manuals online on lark, I can find examples that do what I like. I urge you to look there! In the editor, change PROC GPLOT statement and PROC PLOT, and look in the output window. Do you see a difference? 2. Next consider how to create new variables and do recodes. In my example code directory, I have 2 pretty big fully functional programs. One is called "crime.sas" (there's a readme for it) and there is "bank.sas". You can download/run those if you want. But study the data steps! Look at the recode lines, which come BEFORE the cards statement. I don't know why, they just do! So take your copy of babyData1 and create some new variables, make a dummy variable, create a new variable that uses a mathematical function of one or more x's. You can do things like myNewV1 = 3*x1; or myNewV2 = log(x2); or if (x1 > 3) then myNewV3 = 0; else myNewV3=1; So just create some new variables, recode some stuff. If you want to set something as missing, set a variable equal to a period. As in (I'm using the word "eq" for equals) if (x2 EQ 99) then x2=. ; That makes x2 missing when the original value was 99. So put in some phony number in your data, then take it out that way, and compare the plots before and after. 3. If your data is a big file, you don't want it in the middle of your program. THere are 2 options. Use the INFILE statement to grab the data from a file. That's described in the Little SAS Guide. I've got an example of its usage in the baseball directory. The key thing is to see that I give the file name in single quotes. That works if the data file is in the same directory as your sas file. As the book explains, it is necessary to give the full path to the data file, you know, something like 'd:\myStuff\ps707\crimedata\' or whatever. Another option is this cool thing Dave Brichoux found out last year. If you have the sas statements that create data step and it works fine, you can save that stuff in a separate file and then use an include statement, that grabs that whole file and copies it all into your current program. For example, if you look at this example code: http://lark.cc.ku.edu/~pauljohn/SASClass/ExampleCode/loess1.sas You should see this one: %include 'bank.sas'; So take either route to separate your data in babyData1.sas from your sas code. 4. Learn how to get a frequency distribution out of SAS. I usually just use PROC FREQ. They have a manual on that. :) 5. In SAS, PROC FREQ is also used to create crosstabulation tables. 6. If you are interested, there is proc chart for making nice looking histograms and bar charts. Again, there is an online manual on lark. Spend a little time digging around in those docs. At the end of this, I want you to give me a) a scatterplot, b) a printed out copy of a sas program that does some recodes and creates some new variables, c) the sas program that you use in part 3. d) your choice of a crosstabulation, a frequency distribution, or a chart. Special things to note: "Clear All" under Edit. See a way to save your sas programs? See a way to save a data set in the special sas format? See a way to reload it? (this is a hard one, look for the keyword "libname").