Very very very beginner SAS!

Ranked #6,723 in Education, #155,475 overall

SAS for beginners

SAS Institute is a company that creates statistical programming software centered around coding instructions rather than pointing and clicking. The program SAS allows high-powered statistical analyses by typing syntax documents to tell the program how to analyze and manage your dataset.

When I very first started teaching myself SAS, I had a heck of a time figuring out how to open a data file. In STATA and SPSS, you go to File and open a dataset. However, SAS doesn't do it that way. I begin by explaining some very basic features of SAS to get you started. I also provide links to websites that have more syntax instruction for free.

A lot of government agencies and companies use the SAS program, so if you're learning statistics, I recommend you learn how to use this powerful program!

Bookmark Widget

Add this to your lens »

Bookmark and Share

Finding your data

assigning libraries

The way you point SAS to your data is by LIBNAME or FILENAME statements. It doesn't know where your data are unless you tell it. So let's say I have a folder in my C drive called MYDATA. SAS looks at it as a library that you create:

LIBNAME mydata "C:\MYDATA";

I named it "mydata." So I can now use it in my data files this way:

PROC FREQ DATA=mydata.datafile;
TABLES myvariables*myothervariables;
RUN;

This runs a crosstab of "myvariables" by "myothervariables" and these variables are in my data file called "datafile" located in the folder that SAS points to by calling it "mydata."

Explorer and Libraries

a little more info

LibrariesThe explorer and results boxes to the left of the SAS screen. It looks like the image here. "Libraries" will display the LIBNAME directories you designate with LIBNAME statements. If you click on your directory in the explorer, you will see SAS files from this folder.

The WORK directory is the default. If you don't designate one, that is where your data go.

The tab at the bottom that says "Results" will show a table of contents for your output.

THE resource you need

The Little SAS Book is a resource any serious SAS programmer has on hand. You might be able to find it at your library too, but having your own copy allows you to make notes and dog ear pages that you want to use. This is a good resource to help study for SAS Certification! Many SAS books are on the market, but this is considered the big one. Older versions are cheaper than the newest one and usually coding doesn't change much.
Loading

View

Log and outputIf you accidentally close your OUTPUT or LOG windows, you can go to VIEW to make them show up again.

This is also where you can bring back the EXPLORER and RESULTS tabs to the left if you close them.

There are many examples of code for free on the internet, as well as websites and forums with trouble-solving tips.

File

type=textIf you click NEW, you'll open a new window of the type of window you have in the front. If you're looking at your LOG and you click NEW, you will erase your log or erase and close a saved log. The same goes for your OUTPUT. However, your PROGRAM EDITOR will bring up a new window and not erase your hard work.

Here you can also save your data, import data, export data, and print your foremost window. If you want to print your output, click on your OUTPUT window and click PRINT in the FILE menu.

A sample of great stats-related posters!

And one t-shirt - click on the images for more stats in your life

Statistics on Coffee Consumption Statistics on Tea Consumption Men Checking the Statistics on the Race Horses
Attitude - Statistics

Next steps....

SAS starter kit
UCLA resource to start learning SAS.
Learn to use and code SAS
UCLA website resource. Also has other statistical programs.
SAS 9.2 Reference
Syntax info from SAS.

SAS Help

Your resource for syntax

SAS helpThe HELP menu in SAS is a super resource. I use it all the time to remind me of any exact syntax wording and to search for any options I might want. You have a favorites tab also to save anything you use often. I have special output display syntax and text functions saved, for example. I don't use either very often, but they are so handy!

Amazing Shortcuts Unique to SAS

  • Convert text to UPPER CASE: CTRL + SHIFT + U
  • Convert text to lower case: CTRL + SHIFT + L
  • Comment out selection: CTRL + /
  • Undo comment: CTRL + SHIFT + /

Amazing Shortcuts For PCs

  • ************ Save: CTRL + S ***************** Use often!
  • Move cursor one word: CTRL + arrow key
  • Highlight one letter: SHIFT + arrow key
  • Highlight one word: SHIFT+ CTRL + arrow key
  • Highlight one line: SHIFT + END from the start of the line or SHIFT + HOME from the end of the line
  • Copy highlighted text: CTRL + C
  • Paste highlighted text: CTRL + V
  • Cut highlighted text: CTRL + X
  • Undo: CTRL + Z
  • Redo: CTRL + Y

"SAS" off!

  • Thomas_Hwang Dec 20, 2011 @ 6:37 pm | delete
    great intro to SAS. Think I've only seen SAS and STATA in big organizations... but i personally like R a lot (for the flexibility)
  • stockysister Dec 20, 2011 @ 10:27 pm | delete
    I know a lot of people who like R. I've never used it though.

Other StockySister Lenses

Loading

by

stockysister

Hello! I'm a statistician who loves to run, lift weights, and be outdoors. I have a special interest in fitness and like to share what I've learned. I... more »

Feeling creative? Create a Lens!