Unit_2_Working_with__SAS_data - Introduction to SAS...

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

View Full Document Right Arrow Icon
1 Introduction to SAS Programming STSCI501 – Fall 2007 Simona Despa Cornell Statistical Consulting Unit (CSCU)
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Part 2 Working with SAS data Overview Reading data into SAS: Excel, ASCII, or SAS data sets SAS Import Wizard SAS Data Steps Proc Import Use of SAS explorer for data sets created
Background image of page 2
3 Data Types 1. Raw Data - Internal raw data: data are typed directly into the SAS program Works well with small amounts of data - External raw data files : data are external to SAS - referred to as text, ASCII, sequential or flat files
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Data Types 2. Other software data files - Microsoft Excel, Lotus, dBase, Microsoft Access and JMP files can be imported into SAS using the Import Wizard; - SAS/ACCESS allows reading other software’s data files directly; data files are not converted to SAS data sets - external data are represented as if it is native to SAS - Stat/Transfer or DBMD/Copy are software translation packages that can convert data from other software data to SAS data sets
Background image of page 4
5 Methods for Getting Data into SAS Data step method Proc Import method Point-and-Click method (Import Wizard)
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Getting Your Data into SAS The data step is most flexible when your data are in raw files (ASCII, text, sequential or flat files) The Import Wizard and Proc Import are convenient methods for specific data files
Background image of page 6
7 Getting Your Data into SAS A raw data file has no program associated with it or is associated with a simple editor like Microsoft Notepad A spreadsheet file is not a raw data file EXTERNAL raw data files: data are in an external raw data file use INPUT and INFILE useful with larger files INTERNAL raw data: Data are typed directly into your SAS program use INPUT and DATALINES
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 SAS Statements for Reading DATA INPUT: - used to read data; - describes the arrangement of values in the input records and assigns values to SAS variables INFILE : where the data file is located DATALINES: tells SAS where to find the data internally (the data follow) Example: data one; infile “c:\temp\example1”; input a b c $; run;
Background image of page 8
9 The Data Step Method A. Reading internal data B. Reading external data /* Reading internal data into SAS */ data one; data two; Input x y z $; infile “c:\temp\example1”; datalines; Input x y z $; 1 2 a Run; 2 5 b ; run; Specify file that contains the data Read data and create 3 variables
Background image of page 9

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

View Full DocumentRight Arrow Icon
Types of Data Raw data in Standard format: - standard numeric data: contain numerals, decimal points, minus sign, E scientific notation - Examples: Raw data separated by spaces or FREE FORMAT data Raw data arranged in Columns or FIXED FORMAT data Raw data NOT in Standard format: Dates, numbers with embedded commas or dollar signs. (1,000,200).
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2008 for the course STSCI 5010 taught by Professor Bunge during the Fall '07 term at Cornell University (Engineering School).

Page1 / 40

Unit_2_Working_with__SAS_data - Introduction to SAS...

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

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