Unit 1-7 slides st

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: ut-SAS-data-set; only one can be INFILE 'raw-data-file-name'; INPUT specifications; infile infile 's:\workshop\sales.csv'; where to get the data what's inside in file UNIX The physical name is the name that the operating environment uses to access the file. 9 infile '/users/userid/sales.csv'; z/OS (OS/390) <additional SAS statements> RUN; infile '.workshop.rawdata(sales)'; 10 The INPUT Statement 7.01 Multiple Answer Poll The INPUT statement describes the arrangement of values in the raw data file and assigns input values to the corresponding SAS variables. Which types of raw data files do you read? a. b. c. d. e. DATA output-SAS-data-set; INFILE 'raw-data-file-name'; INPUT specifications; <additional SAS statements> RUN; delimited raw data files raw data files aligned in columns other none not sure The following are input specifications: column input formatted input list input 11 12 2 List Input Delimiter To read with list input, data values must be separated with a delimiter can be in standard or nonstandard form. A space (blank) is the default delimiter. The DLM= option can be added to the INFILE statement to specify an alternate delimiter. Partial sales.csv DATA output-SAS-data-set; INFILE 'raw-data-file-name' DLM='delimiter'; INPUT specifications; <additional SAS statements> RUN; 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 14 14 13 Standard and Nonstandard Data List Input for Standard Data Standard data is data that SAS can read without any special instructions. List input specification: INPUT variable <$>; Examples of standard numeric data: 58 -23 67.23 00.99 5.67E5 1.2E-2 Variables must be specified in the order that they appear in the raw data file, left to right. $ indicates to store a variable value as a character value rather than as a numeric value. The default length for character and numeric variables is eight bytes. the default length is enough for numeric variables Nonstandard data is any data that SAS cannot read without a special instruction. Examples of nonstandard numeric data: 5,823 (23) $67.23 01/12/1999 12MAY2006 15 16 List Input for Standard Data Business Scenario Create a temporary SAS data set named Work.subset3 from the delimited raw data file named 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,Ng...
View Full Document

This document was uploaded on 02/25/2014 for the course STAT 410 at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online