How do I read a series whose name is a reserved word?
Posted: Thu Nov 05, 2015 4:19 pm
For example, this code:
returns an error:
presumably because -i- is a reserved keyword. Similarly, this code
outputs:
Assuming I diagnosed the problem correctly, is there a way around this, besides importing the data into Excel, CSV, etc. and reading it into RATS without referring to the name directly?
Since this is an external data source, I can't simply rename the series in the file.
Code: Select all
open haver "C:\Haver\USECON"
data(format = haver) 1970:1 2015:2 i
close haver
Code: Select all
## IO30. There is no series CONSTANT on the file
Code: Select all
compute lbl = "i"
open haver "C:\Haver\USECON"
data(format = haver) 1970:1 2015:2 %s(lbl)
close haver
Code: Select all
## SX22. Expected Type INTEGER, Got SERIES[REAL] Instead
Since this is an external data source, I can't simply rename the series in the file.