Keywords A Not-So-Short SAS Tutorial, C, C++, Java, MINITAB, Perl, Python, R, SLR, SPLUS, SPSS, SRS, Simple Random Sampling, expected value, mean, regression, simple linear regression, variance
Copyright Information All rights reserved by the author of this article.
Some of the images in this article may have different copyright licenses.
Please follow the URLs of the images for detailed information about their
specific copyright licenses.
Contact
webmasters for more information
on copyright issues.
1 Who should read this tutorial?
This tutorial is for people with considerable experience in at least one programming language,
be it C , C++ , Java , Perl , Python , etc.
2 What is SAS?
SAS is short for Statistical Analysis System. It was designed by SAS software . It's been around since 1976, almost thirty years.
During the thirty years, SAS has been enjoying a great success. To this day, it is the most widely used statistical software package in this world,
with about 31k sites running SAS as of 2005. Possible alternatives are R ,SPLUS , MINITAB , SPSS ,etc.
3 What is SAS from an experienced programmer's point of view?
If your work is somewhat related to statistics, you probably have heard about SAS a million times. It is successful, it's sofisticated,
even the installation package occupies almost a dozen CD's. However, trust me, as an experienced programmer, do not be overwhelmed by SAS.
To an expienced programmer, SAS *programing* itself is a tIny tiny piece of cake. In short, as you will find out, SAS is just
a very high level dummy's batch processing language, which allows you to define and process data.
However, notice that I said the *programming* part is darn easy, apparently, you are going to have a hard time if you know nothing about statistics.
For example, do these terms ring a bell?
mean , expected value ,variance ,Simple Random Sampling or SRS , regression including
simple linear regression or SLR ...
If the answer is no, you'd better take a statistics course first, or rather work with a statistician.
4 Hello World
4.1 Check to make sure that you have SAS installed
4.2 Start SAS software
It might not look exactly like this one, but basically you will see three windows, which you can customize through
the view menu:
The Editor window where you can create/edit your SAS program
The Log windows for log messages.
The Output windows where you can find SAS results
4.3 Try it out
Type or copy the following code into the Editor window and press the "submit" button (the icon which looks
like a person running).
/**
* SAS code for HelloWorld Demonstration
**/
/* section 0, header section: setting global options */
options linesize=80;
title 'HelloWorld;
/* section 1, data definition section: the data we are going to manipulate*/
data helloWorldData;
input y @@;
datalines;
17.9 18.4 14.1 15.8
;
/* keyword data is followed by the name of the data to be processed, note that SAS is case INSENSITIVE,
the input keyword tells SAS names of the variables, @@ here means multiple inputs per line.
Without @@, only the first data item will be read.
Then follows data input, line by line. The data input keyword used to be called cards in the old days,
you get the idea :-) */
/* section 2: data manipulation section: processing the data defined above */
proc means data=helloWorldData all;
var y;
/*run the means SAS pre-defined proc, on data helloWorldData, and show all supported statistics,
the var keyword this tells SAS that the name of the variable to be analyzed */
run;
/* if you programmed BASIC a littile bit in the old days, you'll know
this means go ahead and do it */
quit;
/* this is optional, this tells SAS to end here */
See? it's that easy.
5 What more do you need to know
The hello world example is simple, but it showed you the way to go, What more do you need to know?
What kind of options can you set?
How do you define data
How many SAS pre-defined procedures are there? How do you use them
Of course, as you might see now, it's easy for an experienced programmer to
program SAS: SAS is like the grandpa of today's major programming languages,
it reminds your of BASIC from the early 80's, you find it really easy to understand
the basic ideas in SAS programming. However, to become an experienced SAS programmer,
you need to know a lot more about SAS data definition, SAS procedures, and many
other SAS packages that we never talked about in this article. In one word:
to get your hands on SAS, really easy; to become a SAS guru, there is a long way to go.
Further reading: A Not-So-Short SAS Tutorial
Too Bad example and tutorial. I was tald nothing fron this persentation.
--------------------------------------
In comment #1, HelloWorld wrote:
Too Bad example and tutorial. I was tald nothing fron this persentation.
That's what hellow world was for? Seems like there's another tutorial: http://www.djvoo.net/d/A%20Not-So-Short%20SAS%20Tutorial
That's what hellow world was for? Seems like there's another tutorial: http://www.djvoo.net/d/A%20Not-So-Short%20SAS%20Tutorial
--------------------------------------
In comment #1, HelloWorld wrote:
Too Bad example and tutorial. I was tald nothing fron this persentation.