Colleagues,
I'm importaing some data that I would like to store some data via the tempfile in order to merge with the master data set that I'm working on. The extract of the code is available below:
As illustrated above Stata returns an error when attempting to process the tempfile command:
Naturally, it should be:
I would delete this post but this option does not appear to be available.
I'm importaing some data that I would like to store some data via the tempfile in order to merge with the master data set that I'm working on. The extract of the code is available below:
Code:
/* Source the postcode latitude and longitude data */ preserve copy "http://www.freemaptools.com/download/full-postcodes/postcodes.zip" /// postcodes.zip, replace unzipfile postcodes.zip, replace import delimited using "postcodes.csv", clear varnames(1) clonevar PostalCode = postcode tempfile "`temp2'" save "`temp2'" restore merge m:1 PostalCode using "`temp2'", keepusing(latitude longitude) /// generate(mrg_pclatlon) keep(match)
Code:
. /* Source the postcode latitude and longitude data */ . preserve . copy "http://www.freemaptools.com/download/full-postcodes/postcodes.zip" /// > postcodes.zip, replace . unzipfile postcodes.zip, replace inflating: postcodes.csv successfully unzipped postcodes.zip to current directory . import delimited using "postcodes.csv", clear varnames(1) (4 vars, 1703528 obs) . clonevar PostalCode = postcode . tempfile "`temp2'" _" invalid name r(198); end of do-file
Naturally, it should be:
Code:
tempfile temp2 save "`temp2'"