1. Reading a Comma-Delimited Raw Data File
a. Open p108e01. Add the appropriate LENGTH, INFILE, and INPUT statements to read the comma-delimited raw data file, which can be named as follows:
|
Windows |
“&pathnewemps.csv” |
Partial Raw Data File
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
b. Read the following fields from the raw data file:
|
Name |
Type |
Length |
|
First |
Character |
12 |
|
Last |
Character |
18 |
|
Title |
Character |
25 |
|
Salary |
Numeric |
8 |
c. Submit the program to create the report below. The results should contain 71 observations.
Partial PROC PRINT Output
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
5 Marina Iyengar Sales Rep. III 29715
Part IV-Reading Raw Data
1. Reading Nonstandard Data from a Comma-Delimited Raw Data File
a. Open p108e04. Add the appropriate LENGTH, INFILE, and INPUT statements to read
the comma-delimited raw data file, which can be named as follows:
|
Windows |
“&pathcustca.csv” |
|
UNIX |
“&path/custca.csv” |
|
z/OS (OS/390) |
“&path..rawdata(custca)” |
Partial Raw Data File
Bill,Cuddy,11171,M,16/10/1986,21,15-30 years
Susan,Krasowski,17023,F,09/07/1959,48,46-60 years
Andreas,Rennie,26148,M,18/07/1934,73,61-75 years
Lauren,Krasowski,46966,F,24/10/1986,21,15-30 years
Lauren,Marx,54655,F,18/08/1969,38,31-45 years
Read the following fields:
|
Name |
Type |
Length |
|
First |
Character |
20 |
|
Last |
Character |
20 |
|
ID |
Numeric |
8 |
|
Gender |
Character |
1 |
|
BirthDate |
Numeric |
8 |
|
Age |
Numeric |
8 |
|
AgeGroup |
Character |
12 |
b. Use FORMAT and DROP statements in the DATA step to create a data set that results in the report below when it is displayed with a PROC PRINT step. Include an appropriate title. The results should contain 15 observations.
Partial PROC PRINT Output
Canadian Customers
Birth
Obs First Last Gender AgeGroup Date
1 Bill Cuddy M 15-30 years OCT1986
2 Susan Krasowski F 46-60 years JUL1959
3 Andreas Rennie M 61-75 years JUL1934
4 Lauren Krasowski F 15-30 years OCT1986
5 Lauren Marx F 31-45 years AUG1969


0 comments