SAS program
Econometrics 673 Fall 2017 Homework #2 Due Monday, September 25, 2017
Reading Data into SAS
The purpose of this homework is to use SAS to read data from a delimited data file. From the class website, download the “msa income data.csv” data file. If you open this file using Windows “Notebook,” the first few rows should look like the following:
Note that the first data values starts on line 6, and the last line of data is line 388 (followed by notes). Each data line starts with the variable “Fips” which is a code for the geographic area and should be read as a character variable. The “Area” variable is a description of the geographic are (character, obviously) and should be set to a length of 80 characters. Following the “Area” variable, are 16 annual observations of per capita GDP for the years 2001-2016 (numeric values separated by a comma). Your task is to write a SAS program that reads this data using INFILE and INPUT statements and writes it into a permanent SAS dataset named “ECMT_673_HW2_DATA” Your program should include a LIBNAME statement for purposes of writing the permanent SAS dataset. You want to read the data into a “panel” type format where the “Fips” and “Area” variables are repeated for each of the 16 years so that for each unique “Fips” – “Area” value, there are 16 observations of the GDP variable, and a variable for Year, such as the following:
…more data lines. Turn in a printed copy of your SAS program and the SAS LOG file. I do not need a copy of the dataset. Hint: Look at Chapters 2 and 3 in the Base SAS “Course Notes” regarding using multiple input statements with “line holders” and OUTPUT statements to control processing.