Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: use tempfile

From   "Lythgoe, Dan" <>
To   "''" <>
Subject   st: use tempfile
Date   Tue, 19 Jun 2012 13:24:53 +0000

Dear Statalist,

Apologies in advance for such a simple question but I am struggling with this one. I want to -use- a temporary file stored using -tempfile- if an argument is true(/false), but am clearly missing something as I can't seem to get STATA to -use- the temporary file:

local arg "yes"

tempfile tempresults
	gen X = 1
save "`tempresults'"

if "`arg'" == "no" {
	restore, preserve
else {
	use `tempresults', clear

Any assistance would be greatly appreciated.

Many thanks
Dan Lythgoe

*   For searches and help try:

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