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

st: RE: System Macros

From   "Newson, Roger B" <>
To   "''" <>
Subject   st: RE: System Macros
Date   Wed, 29 Jul 2009 16:15:07 +0100

You do not say which version of Stata you are using. However, in the more recent versions of Stata, the job of these system macros is mostly done by the -creturn- results. Anderstand it, the system macros are preserved mostly so that old programs will still work. If you are writing any new programs, then you should use the -creturn- results.

For instance, if you have a line in a program like

display "Log file opened on $S_DATE at $S_TIME";

then you should ideally replace it with a line like

display "Log file opened on `c(current_date)' at `c(current_time)'";

which produces the same output. To find more about -creturn- results, type, in Stata,

whelp creturn

and the on-line help will give you a list of definitions of all creturn results. To view their current values, type

creturn list

I hope this helps.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: [] On Behalf Of User Stata
Sent: 29 July 2009 13:55
Subject: st: System Macros

Dear Users,

   i am new to this software, please forgive my narive questions

   the truth is that i cannot find helps for some system variables
like $S_DATE, $S_TIME. I guess there are many more certain variables
but where can i find a list?


Chuntao Li
Chinese Academy of Finance and Development
Central University of Finance and Economics
Beijing, China
*   For searches and help try:

*   For searches and help try:

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