CSULB_STAT475_handout2

CSULB_STAT475_handout2 - STAT 475 Chapters 1-2 BASIC...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 475 Chapters 1-2 BASIC CONCEPTS AND DEFINITIONS There are two basic steps in every SAS program: a DATA step and a PROC (procedure) step. A DATA step begins with the keyword DATA. A PROC step begins with the keyword PROC. Each step consists of statements. A SAS statement has two important characteristics: it typically begins with SAS keyword (that is, a reserved word) and it always ends with a semicolon (;) . For example, the following DATA step data exercise1; input ID $ Age ActLevel $ Sex $; cards; 2810 61 MOD F 2804 38 HIGH F 2807 42 LOW M 2816 26 HIGH M 2833 32 MOD F 2823 29 HIGH M ; consists of DATA statement data exercise1; INPUT statement input ID $ Age ActLevel $ Sex $; CARDS statement cards; and DATA ENTRY statement 2810 61 MOD F 2804 38 HIGH F 2807 42 LOW M 2816 26 HIGH M 2833 32 MOD F 2823 29 HIGH M ; The following PROC step proc print data=exercise1; run; consists of 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
PROC PRINT statement proc print data=exercise1; RUN statement run; Exercise. How many steps and how many statements are executed when the program below is processed? data exercise3; infile 'H:\exercise.dat '; input ID $ Age ActLevel $ Sex $; run; proc sort data=exercise3; by id; run; proc print data=exercise3; run; ************************************************************ SAS LIBRARIES Every SAS file is stored in SAS library . The library named Work is a temporary library, where files are stored until the end of SAS session. Once SAS window is closed, the files from this library are deleted. All libraries with names other than Work are permanent libraries, where files are available during subsequent SAS sessions, and are stored until deleted by programmer. Exercise. Run the code below and verify that the data file is stored in the library Work. Check that it is a temporary library.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2011 for the course STAT 475 taught by Professor Olgak during the Fall '11 term at CSU Long Beach.

Page1 / 7

CSULB_STAT475_handout2 - STAT 475 Chapters 1-2 BASIC...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online