Data Step Basics

Contents Index <<Browse<< >>Browse>>


ALL data MUST be put into a SAS data set before that data can be analyzed by SAS. The data step is used to construct a SAS data set which will be further analyzed using SAS procedures (procs).

Here is an example of a simple data step. These lines would be typed in the program editor window.

data first;		/* SAS data set is called "first" */
input name $ age;	/* Data set has 2 variables "name" and "age" */
cards;			/* The actual data follows */
john 12			/* Here is the actual data.*/
jane 11			/* The data lines do NOT end with */
jack 13			/* semicolons!!!		*/
amy  10
run;			/* Execute these statements now. */

Each line of data is referred to as a data card or a data record.

Here (conceptually) is the data set first as SAS sees it:

OBS NAME  AGE
1   john  12
2   jane  11
3   jack  13
4   amy   10

The SAS internal variable OBS is not user accessable.


Contents Index <<Browse<< >>Browse>>

Copyright © 1997 by Jerry Alan Veeh. All rights reserved.