Eventually, I would like to loop over about 5 years of data. Variable names differ by year, so I'm trying to make my "keep" statement conditional on the file being from a certain year. Here's a simplified version of my code:
I'm getting the error: "variable GEOID not found". However, I don't want it to try to execute the keep statement if the year is not 2010 or beyond.
Thanks!
Code:
foreach yr in 2000 { import excel "S:\Stations\tracts_`yr'.xls", firstrow clear keep GEOID Shape_Area if `yr'>2009 }
Thanks!
Comment