prg1c07 - Chapter 7 Reading Delimited Raw Data Files 7.1...

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

View Full Document Right Arrow Icon
1 Chapter 7: Reading Delimited Raw Data Files 7.1 Using Standard Delimited Data as Input 7.2 Using Nonstandard Delimited Data as Input
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 Chapter 7: Reading Delimited Raw Data Files 7.1 Using Standard Delimited Data as Input 7.1 Using Standard Delimited Data as Input 7.2 Using Nonstandard Delimited Data as Input
Background image of page 2
3 Objectives Use the DATA step to create a SAS data set from a delimited raw data file. Examine the compilation and execution phases of the DATA step when reading a raw data file. Explicitly define the length of a variable by using the LENGTH statement.
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 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
Background image of page 4
5 Business Scenario Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files
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 Business Scenario Reading SAS Data Sets Reading Excel Worksheets Reading Delimited Raw Data Files data ; infile ; input ; ... run; libname ; data ; set ; ... run; libname ; data ; set ; ... run;
Background image of page 6
7 sales.csv Partial sales.csv 120102,Tom,Zhou,M,108255,Sales Manager,AU,11AUG1969,06/01/1989 120103,Wilson,Dawes,M,87975,Sales Manager,AU,22JAN1949,01/01/1974 120121,Irenie,Elvish,F,26600,Sales Rep. II,AU,02AUG1944,01/01/1974 120122,Christina,Ngan,F,27475,Sales Rep. II,AU,27JUL1954,07/01/1978 120123,Kimiko,Hotstone,F,26190,Sales Rep. I,AU,28SEP1964,10/01/1985 120124,Lucian,Daymond,M,26480,Sales Rep. I,AU,13MAY1959,03/01/1979 120125,Fong,Hofmeister,M,32040,Sales Rep. IV,AU,06DEC1954,03/01/1979 120126,Satyakam,Denny,M,26780,Sales Rep. II,AU,20SEP1988,08/01/2006 120127,Sharryn,Clarkson,F,28100,Sales Rep. II,AU,04JAN1979,11/01/1998 120128,Monica,Kletschkus,F,30890,Sales Rep. IV,AU,14JUL1986,11/01/2006 120129,Alvin,Roebuck,M,30070,Sales Rep. III,AU,22NOV1964,10/01/1985 120130,Kevin,Lyon,M,26955,Sales Rep. I,AU,14DEC1984,05/01/2006 120131,Marinus,Surawski,M,26910,Sales Rep. I,AU,25SEP1979,01/01/2003 120132,Fancine,Kaiser,F,28525,Sales Rep. III,AU,05APR1949,10/01/1978 120133,Petrea,Soltau,F,27440,Sales Rep. II,AU,22APR1986,10/01/2006 120134,Sian,Shannan,M,28015,Sales Rep. II,AU,06JUN1949,01/01/1974 120135,Alexei,Platts,M,32490,Sales Rep. IV,AU,26JAN1969,10/01/1997 comma delimited
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 Business Scenario Syntax Use the following statements to complete the scenario: DATA output-SAS-data-set ; LENGTH variable(s) $ length ; INFILE ' raw-data-file-name ' ; INPUT specifications ; KEEP variable-list ; LABEL variable = ' label ' variable = ' label ' variable = ' label ' ; FORMAT variable(s) format ; RUN; DATA output-SAS-data-set ; LENGTH variable(s) $ length ; INFILE ' raw-data-file-name ' ; INPUT specifications ; KEEP variable-list ; LABEL variable = ' label ' variable = ' label ' variable = ' label ' ; FORMAT variable(s) format ; RUN;
Background image of page 8
9 The DATA Statement (Review) The DATA statement begins a DATA step and provides the name of the SAS data set being created.
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the 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 / 104

prg1c07 - Chapter 7 Reading Delimited Raw Data Files 7.1...

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

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