[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: querying format for programming

From   Maarten buis <>
Subject   Re: st: querying format for programming
Date   Thu, 6 Mar 2008 13:50:58 +0000 (GMT)

--- "E. Paul Wileyto" <> wrote:

> I need to convert the new date/time format (%tc) to the old standard 
> (%td).  However, I need to make sure I don't apply the conversion to 
> non-%tc formats.  (Bad things happen.)  Is there a function that
> queries a variable and returns the format (so that I can capture it
> as a macro)?

First, did you know that you can save files in Stata8/9 format using
the -saveold- command?

Second, you can get a list of all variables with a certain format, to
be specified by you, using the -ds- command, see: -help ds-.

Third, you can get the format of a variable in a macro using extended
macro functions (in particular the extended macro function called 
-format-), see -help extended_fcn-.

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Sent from Yahoo! Mail.
The World's Favourite Email
*   For searches and help try:

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