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

st: Formatted date embedded in log filename

Subject   st: Formatted date embedded in log filename
Date   Thu, 5 May 2005 10:44:00 -0500

Dear Sata-listers --

I usually embed dates in the filenames of my logs. I do so using the
macro $S_DATE, which, say the date were 1/31/2000, it write it as
31jan200. Lately, I've been want to change this format to, 01.31.2000,
for directory sorting purposes. Using the following expression, I can
create a macro with the desired format:

.local date string(date(c(current_date), "dmy"), "%dN.D.Y")
.di `date'

Where I'm having trouble is with embedding this macro into the filename
of my log file. The following command complains:

.log using "logs\cr`date'", replace
invalid 'dmy'

Any syntax guru have any ideas?

Martin Rio

Linux is user friendly. It's just very particular about who it's friends are.
*   For searches and help try:

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