Lab01_Fall2011 - EXST 7003 Lab 01 Fall 2011 EXST 7003, Lab...

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

View Full Document Right Arrow Icon
EXST 7003 Lab 01 Fall 2011 EXST 7003, Lab 01: Introduction to the SAS Data Step, and Basic Procs and Options Week 2: August 29 - September 2 DUE: September 6 (Section 1) or September 9 (Section 2 and 3) The Program The program which will be utilized in this lab, which each student will individually write, refer to, and answer questions about, is provided below. This program is discussed herein, and will be presented during lab. /*This is a comment. It may go anywhere in a SAS program, and is enclosed by matching slash/asterisk keystrokes (shown here). These can and should be used liberally throughout programs.*/ dm 'log;clear;output;clear'; OPTIONS nodate nocenter pageno=1; Title1 'First SAS Program'; DATA one; INPUT Name $ b c; DATALINES; Billy 2.7 30 Jillian 36.4 120 Sam 33 12.5 David 15.92 40.6 James 24.6 37.8 John 48.25 32.1 Lucas 40.2 22.5 Tom 23.5 65.0 Grace 55.4 12.3 Lisa 37.0 78.4 RUN; ODS RTF FILE='C:\Documents and Settings\PAWS_ID\output01.doc'; PROC CONTENTS data=one; RUN; PROC SORT data=one out=set1; BY Name; RUN; PROC PRINT data=one; Title2 'Print of unsorted data'; RUN; PROC PRINT data=set1; Title2 'Print of sorted data'; RUN; ODS RTF CLOSE; QUIT; 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
EXST 7003 Lab 01 Fall 2011 SAS data sets and the Data Step SAS data sets consist of two components; the descriptor (or header) portion, and the data portion. The descriptor portion contains general information about the SAS data set, including data set name and number of observations; variable attributes such as name, type, length, position, informat, format, label. This structure is governed by the INPUT statement, specified within the SAS Data Step, and is recalled (or displayed in the output) via the SAS procedure PROC CONTENTS. The data portion contains the data to be analyzed, and MUST be organized such that each row in the data set comprises a single record or observation within the data record, and each column consists of a single datum per record for each variable defined by the INPUT statement. It is important to note that each record’s data must be kept in identical order as specified in the variable list, which in turn comprises the INPUT statement. The data portion of a SAS data set is recalled (or displayed in the output) via the SAS procedure PROC PRINT. In other words, if I have a data set to analyze, which includes data on each person’s shoe size, height, weight, as well as each person’s name, I must organize my data such that each person’s data is organized into mutually-exclusive rows (each person, or record, having its own row), and each person’s name, shoe size, height, and weight are organized in each of those rows into mutually-exclusive columns where the rows are ordered to match the order of the INPUT statement. For this lab, an extremely basic method of data entry and Data Step form are utilized; that
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.

Page1 / 5

Lab01_Fall2011 - EXST 7003 Lab 01 Fall 2011 EXST 7003, Lab...

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