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

st: RE: Re: two questions about matrix operations

From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: two questions about matrix operations
Date   Thu, 6 Jan 2005 10:45:06 -0000

There is nothing wrong with the block of code shown. The problem is certainly with your use of multiple files.

Presumably you have a line like

use `file'

somewhere in your code - you need to make this 

use `file', clear

because Stata is refusing to open the next file as changes to the currently open file would be lost.

[email protected]

-----Original Message-----

foreach var of varlist A-D{
	count if `var' == 0
	local i = r(N)
	local sum = `sum' + `i'
di `sum'

But this time, after numbers of zeros for each variable and 
total sum of zeros are vertically shown, following error 
messages appear:
# The same messages are shown after running the statements 
pertaining to the 2nd question.

no; data in memory would be lost

Actually, I try to process multiple dta files using

foreach file in mat1982 mat1983 mat1984{

in the same do file, which might have provoked these messages.

*   For searches and help try:

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