SAS for True Beginners Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay here's a quick introduction to getting started with SAS the first thing we'll do is of course open the program so we see this icon here you may have it on your Start menu here's mine and so SAS opens up and asked us if we want to do a tour you're welcome to do that of course but I don't want to do the tour let's move right into working with it I'll maximize it and the first thing you want to do to get started in SAS is go to the library area right right click on it use the right click on your mouse and press new and what we're going to do is create a new library in which to save the files that we would like to keep there to libraries we'll see in a minute that we're going to be working with one is called the work library or folder and the other is called the SAS data although we can name it anything we wanted to you know you could call it you know SAS giraffe if you please but the path is hold on one second let me just create a new folder here I'm going to call this my new SAS data and what's going to happen is so if we look at this the mind you SAS data folder I'll double click on this and press ok I'll confirm that my folder is listed up here if it's not I probably didn't double click on the folder so what's going to happen is when we're writing our program if we if we want something saved permanently a data set that we create saved permanently we're going to put SAS data we're going to make reference to SAS data and tell SAS hey save it in this library and when we do that it's going to write our data set that we've created to the folder that I just selected so you can select any folder you wish and that's where SAS is going to drop your data sets that you want saved permanently this will make more sense in a minute so we double click on the libraries and we can see the SAS data folder there's nothing in it which makes sense we just created it and then here's that work folder I was talking about and indeed this one you know has nothing in it um so the work folder as I said is that's the default that's where our files are going to be saved if we don't make any reference in our code to SAS data so this is the Explorer window and I would like for you to get very familiar with it it's really important as we'll see as we move on in our lessons but this is also you know when you get into to the Explorer window at least when I was starting out sometimes I would get stuck and not realize how to get how to navigate around it but it's very easy there's always this up one level button and provided that I have clicked and activated the Explorer window I just go up and for me when I go back to this it's like going to the home page if you will with these libraries and I see computer and this is what how I know to navigate so in a you know by the time that we're done we'll have lots of data sets and things in these two folders and to give you an idea what that might look like and to point out that this folder here our library has all kinds of datasets that come as part of sass and so let's take a look at what a real data set looks like I double clicked on cars and sass brings up what I think is a really neat way to view the data it's nice and organized it reminds me of Excel if you're familiar with that program but you know I can this is a great way once again this will make more sense once we start make it creating our own data sets but this is how best to go in and confirm that your data was written in there properly for example as we look at these you know these dollar signs on we'll see later that you can goof up when you're pulling dollar denominated data in and they're different here's this is called a character variable where you know the Acura MDX as opposed to thirty six thousand two hundred you know MDX is character data and again you just want to make sure that that gets in in the way that you intended and this is the way to do that through this window here one important thing once you've inspected the data and let me do this again just to show you so we were in this library and we clicked on this this is called a data set what I'm holding now you want to make sure that you close it if you instead minimize it and it's down here in this bar when you run your SAS code later on it you'll get error messages and it's impossible to figure out why so make sure that you close it and recognize you know if you want to take another look at your data you just go back and do that again so we're in a folder this is the sass help folder and Explorer and so we'll go back up to as I say kind of our comfort zone now this is the that that was one of four things to pay attention to when you're working with sass and learning how to use it the other two seem the other three when does that you want to pay attention to one is the editor and that's where my cursor is blinking now this is where we'll be doing our sass work and it's in order to demonstrate what I mean by that let's create our first little program here I'm going to call this data Sox and I'll explain how to do programming in the next videos the videos that follow up I'm inputting the variables x and y and this is a little statement that says hey data is going to be following here and this is these are just numbers I'm pulling out of my head to show you what it's like to work with these windows loose and that's a good mistake to make enter semicolon will see that semicolons are very important in size so now I've just create what I'm doing here is I'm asking sass to create a new data set and I want it called Sox and since I did not put SAS data and reference this as a library SAS is going to assume what I mean is to save it in the work temporary work folder so this and this are the are equivalent statements so to run it we'll get in the habit of highlighting the code that we want to run and you can right click and press submit selection or which is what I like to do it's a little bit faster for me but you can also press this little guy submit the little guy running the marathon so I did that and now this shows you the importance or yeah the importance of what's called the log when the log window tells you how it went basically for your code did it work did you get any and it just as a name and plot you know suggest log it tells you what happened so it says the data set were sought the docs work dot socks has three observations in two variables this tells me that it saved the data set successfully I don't have any error messages so that's a good sign but let's confirm that it got in there oh look there's socks our first little set of data and so you can see we were successful that's what we wanted to have happen nothing strange about that we'll close this and let's take a look to understand what the log does for us at what happens if we have a mistake here this is something major foot upon SAS I put a comma rather than a semicolon so we're expecting that in the log thing is going to be all kinds of mayhem it's gonna yell at us basically look at this yes errors all over the place no data lines or in file statement the SAS system stopped processing this stuff because of errors may be incomplete warning you know just general all kinds of danger look at these the error codes most often are in this maroon color so things have gone well if you see mostly blue and things are gone badly if you see this marine with maroon color so let's let's fix that and we'll put that back to a semicolon run it again just to show you actually let's let's call this Sox two and change our data just a little bit just to show you how easy it is we'll be doing a lot of just altering code that we've already written as we're learning SAS and let me show you something else too a lot of times you know it can be confusing to realize what we're working with so I like to go in here very often and do control new and get myself a fresh workspace and the log so that I know when I run this code down here I'm right-clicking I know now that you know what shows up in the log is only talking about the work that I've just completed not not errors from the pass so you can see in my work folder I've got socks too is here and we just dropped a lot one of the what's called observations which we dropped the third observations from our little input statement here so that tells you something about the log and I'm running out of time here so I think I'm going to stop it now we'll resume in the next session
Info
Channel: Wilton Graves
Views: 603,153
Rating: 4.8153844 out of 5
Keywords: SAS, Log, Libraries, Editor, Beginners (Award-Winning Work), SAS Beginners, Statistics, SAS Tutorial
Id: rc-ed_0pG3o
Channel Id: undefined
Length: 10min 2sec (602 seconds)
Published: Thu Oct 27 2011
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.