Statalist


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

Re: st: AW: compare files, vars only


From   Johannes Geyer <JGeyer@diw.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: compare files, vars only
Date   Thu, 19 Feb 2009 17:46:15 +0100

owner-statalist@hsphsun2.harvard.edu schrieb am 19/02/2009 17:39:52:

> All--
> Loading the whole dataset may hog memory, but
>  use in 1 using...
> works fine, as shown in my previous post.  -describe- would be
> preferable, since it does not load the data in memory at all, but it
> does not save a list of variables, and _describe is built-in, hence
> not hackable.

But it does save the list of variables in a local macro, if you choose the 
option [varlist] - or am I missing a point? The problem is - as Martin 
suggested - that this local macro is limited to a low number of characters 
(244) which might not be enough in many occasions.

Johannes


  It would be possible to write a program that loads no
> data and gets all the variable lists, either by parsing the output of
> _describe using -file- commands, or as is Sergiy's wont, via a direct
> file-access approach.  But it wouldn't be nice if there were a Mata
> command to get a view onto a dataset not in memory?
> 
> On Thu, Feb 19, 2009 at 11:24 AM, Johannes Geyer <JGeyer@diw.de> wrote:
> > what about:
> >
> >  *************
> >  clear*
> >  sysuse auto, clear
> >  drop  gear_ratio displacement
> >  save newauto, replace
> >  sysuse auto, clear
> >  qui ds
> >  loc first `r(varlist)'
> >
> >  des using auto, varlist
> >
> >  loc second `r(varlist)'
> >  loc diff: list first - second
> >  di in red "Differences: `diff'"
> >  *************
> >
> > -describe- does not need to load the dataset which may be of interest 
here
> >
> >
> > Johannes
> >
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index