Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Simple question about sorted datasets


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Simple question about sorted datasets
Date   Thu, 30 Sep 2004 18:04:41 -0400

sysuse auto
local sby : sortedby
di "`sby'"

On Thu, 30 Sep 2004 21:43:14 +0100 (BST), Mark Schaffer
<[email protected]> wrote:
> At least, it looks like a simple question, but I can't find the answer.
> 
> I want a program to be able to find out if the dataset in memory is
> sorted.  If possible, I also want it to be able to find out what the sort
> variables are.  But I don't want the dataset to get sorted in the process.
> 
> -tsset- saves the panel and time variables in macros, but it will
> automatically resort the data.  (This is documented.  -tsreport- will also
> automatically resort the data, but this isn't mentioned in the manual or
> the online help.)
> 
> -desc- reports the sort variables on screen, at the end of the report.
> Curiously, it will save them in a macro only when describing a dataset in
> a file, e.g., -desc using filename-.  It will not save the sort variables
> in a macro when describing a dataset in memory.
> 
> I suspect this is an easy one and I've missed something, but it isn't for
> lack of trying - I tried the manuals and the other usual places.  I don't
> want to resort to something hacky, like -capture-ing a command that
> requires the data to be sorted and seeing if an error code is returned.
> 
> Can someone help?
> 
> Cheers,
> Mark
> 
> ________________________________________________________________
> 
> DISCLAIMER:
> 
> This e-mail and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom it is addressed.  If you are not the intended recipient
> you are prohibited from using any of the information contained
> in this e-mail.  In such a case, please destroy all copies in
> your possession and notify the sender by reply e-mail.  Heriot
> Watt University does not accept liability or responsibility
> for changes made to this e-mail after it was sent, or for
> viruses transmitted through this e-mail.  Opinions, comments,
> conclusions and other information in this e-mail that do not
> relate to the official business of Heriot Watt University are
> not endorsed by it.
> ________________________________________________________________
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 



-- 
Stas Kolenikov
http://stas.kolenikov.name
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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