capture log close
log using hw1.lastname.firstname.log
// code
log close- Copy and paste the above
.dofile structure into your.dofile - Save it as
hw1.lastname.firstname.do
- Done! (See section 1 above)
You'd not yet covered the quietly command at the time, but here's how to go about it:
quietly {
// the rest of your do-file content, indented
}Putting it all together:
qui {
capture log close
log using hw1.lastname.firstname.log
//settings
global dataset "https://jhustata.github.io/book/_downloads/884b9e06eb29f89b1b87da4eab39775d/hw1.txt"
set timeout1 1000
// code
import delimited $dataset, clear
noisily di "Question 1: There are `c(N)' records in the dataset"
log close
}
Read more about set timeout