Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: ado file help

From   Nick Cox <>
Subject   Re: st: ado file help
Date   Tue, 14 Aug 2012 16:23:00 +0100

Quite. -varname- or -varlist- in a -syntax- statement refers to an
existing variable; if what you supply is not the name of an existing
variable, that is an error. That will be inevitable if there are no
data in memory.

If you need to supply such a name, you must supply it in some other
way. I thought that the main purpose of this program was to read in
data and that -odbc- takes care of that for you.


On Tue, Aug 14, 2012 at 4:15 PM, tashi lama <> wrote:
> Works like a magic. Thanx guys. There is a slight problem however. If I were to extend this and include varlist in the syntax,
> ......
> syntax [varlist], STARTdate(str) ENDdate(str) BROKERid(numeric) GRAPHtype(str)
> obdc load, exec("select date(read_date), count(*) from readership where source_id==`brokerid' and date(read_date) between '`startdate'' and '`enddate'' group by date(read_date)")
> .......
> end
> and when I call
> dd var1, startdate("2011-01-01") enddate("2011-01-20") broker(6429)
> stata isn't happy and returns "no variables defined". It makes kind of sense syntax command doesn't see any data since it is defined before generating dataset. However, I need to define syntax, options  to generate dataset in first place. Any idea how to solve this?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index