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

Re: st: saving file

From   "Carole J. Wilson" <>
Subject   Re: st: saving file
Date   Thu, 12 Jul 2007 12:40:54 -0500

There is probably something easier, but
try the following :

tokenize $S_TIME, parse(:)
save "toto_ $S_ DATE (`1'_`3'_`5')"

You can change the punctuation around the time as you see fit
and whether you need the seconds `5'.


      Carole J. Wilson
University of Texas at Dallas
School of Economic, Political,
     and Policy Sciences
     Phone: 972.883.4957
      Fax: 972.883.6571

On 7/12/07, Abdel Rahmen El Lahga <> wrote:
I would like to save file with date and time in file name, but I have
some trouble.
for eg:
sysuse auto,
save "toto$S_DATE.dta"
Stata is ok and i obtain
file toto12 Jul 2007.dta saved
But when I type
save "toto_$S_DATE_$S_TIME.dta"
Stata gives the following message
file toto_19:04:26.dta could not be opened
any help?

AbdelRahmen El Lahga
*   For searches and help try:

*   For searches and help try:

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