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

Latin Square Design

Start     4 of 10

4 Create program statements to read in the data

You now have the raw data in the Editor Window.

Next, you need some statements (instructions) in your SAS program to enable SAS to read the data (to know that it is data). The instructions differ depending on your Specialized Features, because the variables in the dataset change. If you are using your own dataset, use the supplied statements but replace and add variable names with your own, as needed to match your data columns (names must follow the rules in the Hint below).
 What is?

(1) Click your Specialized Feature below (gray box at left)
Note that "None" is a valid choice that will also provide statements (i.e., you have no specialized features).
     (2) Copy the statements in that pop window
     (3) Paste them into SAS before the data values in the
Editor Window.

  Specialized Features
  Replication & Sampling
  Replication & Covariate
  Sampling & Covariate
  Replication & Sampling    & Covariate

If using your own data, modify the
INPUT statement to indicate your variable names. You may copy-and-paste these from your data file into the INPUT statement, if convenient (just make sure there is a space between variable names).

Note, in the "gray box pop-ups" and in the SAS image below, the data name "one" was used; you can choose any name you wish. Names must follow the rules in the Hint below.

The $ symbol in the INPUT statement indicates that the preceding variable will read in text, instead of numerical values.

Put a semicolon on the line following the data, then these two statements.


Your program now looks something like this (click for larger image).

The program and data depends on your design and specialized features.
Note the period for missing data values and the semicolon on line following data.

Be sure to delete any header text that you may have inadvertently pasted (such as a row of variable names). Variable names are specified by the INPUT statement as noted above, rather than in the dataset itself. Text with the yellow background in SAS should be data only.

(need help using SAS?)

next >> ( Step 5: Run SAS program to read data )

  H I N T S :
  The $ symbol in the INPUT statement indicates that the preceding variable will read in text, instead of numerical values.
  Variable names in SAS can be up to 32 characters long; must start with a letter; and should not contain special characters like . ' ()+-/@#.  You can use an underscore to separate words, like My_Name.
  In this web guide, several of the terms in SAS statements are hot-linked for more info. E.g., INPUT in pop-ups.
  You can use underscores in variable names to make them more readable, like Weight_Gain.

  SAS is not case-sensitive but it is case-aware. We use blue text to signify SAS statements and ALL CAPS
      IN BLUE

  Punctuation in SAS program statements has to be correct for the SAS program to run correctly.

  Copy-and-pasting SAS statements from module into your SAS program rather than typing them yourself
     assures that punctuation will be correct. Typing statements in, though, does give you practice with SAS punctuation.

  Note that columns of data in the Editor Window do not need to line up. A single space between columns is sufficient.

  Remember: SAVE YOUR PROGRAM occasionally. With cursor in Editor Window, hit Ctrl-S.

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