Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: identify all variables with dates

From   "Philip Ryan" <>
To   <>
Subject   st: RE: identify all variables with dates
Date   Wed, 3 Mar 2010 12:53:09 +1030

One way is to use the  has(format <pattern>)  option  on the -ds- command.
There is an example in the help file under "advanced options".  You can
subsequently retrieve the variable names from the r(varlist) macro (do a
-return list- after the -ds- command).

Of course this method assumes you have formatted your dates appropriately.
Without formatting, to Stata a "date" is just a number with no special


Philip Ryan
University of Adelaide 

-----Original Message-----
[] On Behalf Of raoul reulen
Sent: Wednesday, 3 March 2010 11:20 AM
Subject: st: identify all variables with dates


Is there a way to identify all variables in a dataset that contain
dates and then store the relevant variable names in a local? I am
looking for something like the "ds" command.


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index