HOME Module List Site Index About This Site glossary" Resources Innovative Technology Center UT Statistics Courses
Using SAS Choose Design ANOVA Compare Means Regression Examples
Using SAS Using SAS: Table of Contents

Accessing data
From within SAS

If your dataset is reasonably small, for example, less than 100 observations and fewer than 10 variables (columns), then the most convenient way to access your data is to copy it into your SAS program.

To copy your data into SAS:

      Open your data file (format of file doesn't matter: could be a spreadsheet, text file, etc.).

      Make sure that each row is an observation and each column is a variable. This is the standard layout expected by most statistical programs (as in illustration at right).

      Highlight the data values and copy (Ctrl-C).

      Open a new SAS Editor Window (File New Program; Ctrl-N) and paste (Ctrl-V).

      Alternatively, you can type your data directly into the SAS Editor Window.

      Always be sure to save your work: Ctrl-S.

Important points about your data set

SAS statements to read the data:

SAS needs to be told three things: a SAS name for the dataset, names for each of your variables, and any special format for those variables. These are accomplished with two SAS statements:

      The DATA statement starts this process by naming the dataset, for example DATA one;

      SAS statements always start with a keyword and end with a semicolon.

      The INPUT statement names the variables and describes how they should be read in.

      Finally, a DATALINES statement tells SAS that the data values follow.

\\\6 or 7 Examples (snagits)

Related Topics:                                                                                                     Using SAS: Table of Contents
Overview
From within a SAS program
From Excel
Accessing data from text files
    tab delimited files
    comma delimited files
PROC Import problems

Home | Contact us | Module list & summary | Glossary/Terms | About this site | Stats courses | Links | Index