Thanks for the help Allin,
That was just my own lack of understanding of how to use that command. So now, thanks to your help, I have it working. The ODBC command executes and it pulls 217 observations, which is the same number I would expect from running the sql query in query analyzer. However, now that it's in gretl, when I try to view the dat I get an "maxbufftemp: no valid values" error, however, when I look at the data in query analyzer It's there (example piece of data from query analyzer: 39.900"
Thanks,
Chris
The syntax here is "obs-format=fmt". That is, an equals sign
On Tue, 2 Feb 2010, Chris wrote:
> I'm having some trouble getting data into gretl through ODBC. I have a
> fairly large sql statement, so I'm importing it from a file. When I run the
> data command I get an error and it halts. Here's the command script:
> nulldata 160
> setobs 5 2001:1 --time-series
> open dsn=guestCalgary user=####### password=##### --odbc
> string QRY1 = readfile("C:/gretl/maxbufftemp.txt")
> data maxbufftemp obs-format-"%d" @QRY1 --odbc
>
> gives me this error:
> gretl version 1.8.7
> Current session: 2010-02-02 14:34
> ? nulldata 160
> periodicity: 1, maxobs: 160,
> observations range: 1-160
> ? setobs 5 2001:1 --time-series
> Full data range: 2001 - 2160 (n = 160)
>
> ? open dsn=guestCalgary user=##### password=#### --odbc
> Connected to ODBC data source 'guestCalgary'
> ? string QRY1 = readfile("C:/gretl/maxbufftemp.txt")
> Replaced string QRY1
> ? data maxbufftemp obs-format-"%d" @QRY1 --odbc
>
> Error executing script: halting
> > data maxbufftemp obs-format-"%d" @QRY1 --odbc
rather than a hyphen/dash comes after "obs-format".
One question about your dates setup:
This is rather unusual. With frequency 5 one would expect daily
setobs 5 2001:1 --time
data, and therefore something like
setobs 5 2001/01/02
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users