Exercise_Week5_Answer - MATH2871 DATA MANAGEMENT FOR...

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

View Full Document Right Arrow Icon
MATH2871 DATA MANAGEMENT FOR STATISTICAL ANALYSIS SEMESTER 2, 2010 Lab exercise Week5 1. Reading a Comma-Delimited Raw Data File. a. Open p107e01. Add the appropriate LENGTH, INFILE and INPUT statements to read the comma-delimited raw data file named, newemps.csv . Partial Raw Data File b. The following variables should be read into the program data vector: Name Type Length First Character 12 Last Character 18 Title Character 25 Salary Numeric 8 c. Submit the program to create the following PROC PRINT report (First 5 of 71 observations) Obs First Last Title Salary 1 Satyakam Denny Sales Rep. II 26780 2 Monica Kletschkus Sales Rep. IV 30890 3 Kevin Lyon Sales Rep. I 26955 4 Petrea Soltau Sales Rep. II 27440 Satyakam,Denny,Sales Rep. II,26780 Monica,Kletschkus,Sales Rep. IV,30890 Kevin,Lyon,Sales Rep. I,26955 Petrea,Soltau,Sales Rep. II,27440 Marina,Iyengar,Sales Rep. III,29715 data work.NewEmployees; length First $ 12 Last $ 18 Title $ 25 Salary 8 ; infile 'newemps.csv' dlm=','; input First $ Last $ Title $ Salary ; run ; proc print data=work.NewEmployees; run ;
Background image of page 1

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

View Full Document Right Arrow Icon
2. Reading a Space-Delimited Raw Data File with Spaces in Data Values a. Write a DATA step to create a new data set named Work.us_customers by reading the space-delimited raw data file named, custus.dat. Partial Raw Data File The following variables should be created in the data set Work.us_customers : Name Type Length Name Character 20 ID Numeric 8 Gender Character 1 BirthDate Numeric 8 Age Numeric 8 AgeGroup Character 12 NOTE: In the raw data, the names are enclosed in quotation marks. Delimiters within the value should be treated as character data. Option
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

Exercise_Week5_Answer - MATH2871 DATA MANAGEMENT FOR...

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