prg1c05 - 1 Chapter 5: Reading SAS Data Sets 5.1...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Chapter 5: Reading SAS Data Sets 5.1 Introduction to Reading Data 5.2 Using SAS Data as Input 5.3 Subsetting Observations and Variables 5.4 Adding Permanent Attributes 2 Chapter 5: Reading SAS Data Sets 5.1 Introduction to Reading Data 5.1 Introduction to Reading Data 5.2 Using SAS Data as Input 5.3 Subsetting Observations and Variables 5.4 Adding Permanent Attributes 3 Objectives Define the concept of reading from a data source to create a SAS data set. Define the business scenario that will be used when reading from a SAS data set, an Excel worksheet, and a raw data file. 3 4 Business Scenario An existing data source contains information on Orion Star sales employees from Australia and the United States. A new SAS data set needs to be created that contains a subset of this existing data source. This new SAS data set must contain the following: only the employees from Australia who are Sales Representatives the employee's first name, last name, salary, job title, and hired date labels and formats in the descriptor portion 4 5 Business Scenario 5 Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files 6 Business Scenario 6 Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files data ; infile ; input ; ... run; libname ; data ; set ; ... run; libname ; data ; set ; ... run; 7 8 5.01 Multiple Answer Poll Which types of files will you read into SAS? a. SAS data sets b. Excel worksheets c. raw data files d. other e. not sure 8 9 Chapter 5: Reading SAS Data Sets 5.1 Introduction to Reading Data 5.2 Using SAS Data as Input 5.2 Using SAS Data as Input 5.3 Subsetting Observations and Variables 5.4 Adding Permanent Attributes 10 Objectives Use the DATA step to create a SAS data set from an existing SAS data set. 10 11 Business Scenario 11 Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files 12 Business Scenario 12 Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files data ; infile ; input ; ... run; libname ; data ; set ; ... run; libname ; data ; set ; ... run; 13 Business Scenario Syntax Use the following statements to complete the scenario: 13 LIBNAME libref ' SAS-data-library ' ; DATA output-SAS-data-set ; SET input-SAS-data-set ; WHERE where-expression ; KEEP variable-list ; LABEL variable = ' label ' variable = ' label ' variable = ' label ' ; FORMAT variable(s) format ; RUN; LIBNAME libref ' SAS-data-library ' ; DATA output-SAS-data-set ; SET input-SAS-data-set ; WHERE where-expression ; KEEP variable-list ; LABEL variable = ' label ' variable = ' label ' variable = ' label ' ; FORMAT variable(s) format ; RUN; continued... 14 Business Scenario Syntax Use the following statements to complete the scenario: 14 LIBNAME libref ' SAS-data-library ' ; DATA output-SAS-data-set ; SET input-SAS-data-set ; WHERE where-expression ; KEEP variable-list ; LABEL variable = ' label ' variable = ' label ' variable = ' label ' ; FORMAT variable(s)...
View Full Document

This note was uploaded on 02/20/2012 for the course STAT 506 taught by Professor Staff during the Fall '08 term at Purdue.

Page1 / 94

prg1c05 - 1 Chapter 5: Reading SAS Data Sets 5.1...

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

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