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

st: Re: split, combine and verify datafile(s)

From   "Katsuhide Isa" <>
Subject   st: Re: split, combine and verify datafile(s)
Date   Mon, 20 Jun 2005 22:21:40 +0900


Thank you for your quick and detailed suggestion.
And I'm sorry for my late reply.

As you say, I still don't fully understand how to use 
-tempfile-, and your instruction is of much help.
Following your advice, I re-modified the codes and it ran 

Besides, as you point out, I surely brought unnecessary 
complications to the codes by using a macro as part of the 
tempfile name.  
Instead, I simplfied the codes as below:

foreach file in sysdsn32 sysdsn33 sysdsn34 {
	use `file'
	sort patid
	tempfile temp
	save "`temp'", replace
	use sysdsn31
	sort patid
	capture drop _merge
	merge patid using "`temp'"
	save sysdsn31, replace

And it also ran successfully.

There seems no handy command in Stata to verify the 
consistency of two files.
# though commands to verify the consistency of two 
variables exist.
Maybe using -summarize- etc. before/after splitting the 
datafile is the easiest way to do so.

*   For searches and help try:

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