11.07.2015 Views

[U] User's Guide

[U] User's Guide

[U] User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

178 [ U ] 15 Saving and printing output—log files. translate session.smcl session.logfile session.log already existsr(602);If the file does already exist and you wish to overwrite the existing copy, you can specify the replaceoption:. translate session.smcl session.log, replaceSee [R] translate for more information.If you prefer, you can skip the SMCL and create ASCII text logs directly, either by specifying thatyou want the log in text format,. log using session, textor by specifying that the file to be created be a .log file:. log using session.log15.1.2 Appending to an existing logStata never lets you accidentally write over an existing log file. If you have an existing log fileand you want to continue logging, you have three choices:• create a new log file• append the new log onto the existing log file by typing log using logname, append• replace the existing log file by typing log using logname, replaceFor example, if you have an existing log file named session.smcl, you might type. log using session, appendto append the new log to the end of the existing log file, session.smcl.15.1.3 Temporarily suspending and resuming loggingOnce you have started logging your session, you can turn logging on and off. When you turnlogging off, Stata temporarily stops recording your session but leaves the log file open. When youturn logging back on, Stata continues to record your session, appending the additional record to theend of the file.Say that the first time something interesting happens, you type log using results (or click onLog and open results.smcl). You then retype the command that produced the interesting result (ordouble-click on the command in the Review window, or use the PgUp key to retrieve the command;see [U] 10 Keyboard use). You now have a copy of the interesting result saved in the log file.You are now reasonably sure that nothing interesting will occur, at least for a while. Rather thantype log close, however, you type log off, or you click on Log and choose Suspend. From nowon, nothing goes into the file. The next time something interesting happens, you type log on (orclick on Log and choose Resume) and reissue the (interesting) command. After that, you type logoff. You keep working like this—toggling the log on and off.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!