At 03:43 PM 5/15/2007, Dan wrote:
>I want to get something along the following
>
>compute tmp = data(3, 4).
>
>I want to assign a variable to have the answer that the 3rd
>participant put down as the answer to my 4th question.
>
>I know that SPSS usually runs in a row-by-row basis, so I'm trying to
>figure out how to break out of that essentially, so that I can grab
>data from wherever on my database and use it, almost like an excel
>sheet.
I'm NOT trying to give you a full answer, here.
You're right that SPSS runs row by row. If you need to treat the file
as a random-access array, you can read it into one or more matrices in
the MATRIX facility. ("One or more", because you'll have to have
numeric and string variables in separate matrices. Or, read only the
variables you're going to be using, work with those, write it back out,
and merge.)
So that's an approach, but it's not easy or natural. (It'll also be
inefficient or impossible with the largest files, but these days a file
has to be pretty large for that to happen.)
However, you may able to solve your problem in more idiomatic SPSS. I
can't help with that, without a better idea what you're looking for.
You say you want
>compute tmp = data(3, 4).
Where should 'tmp' then be put? It's a variable, so it's identified by
its name; but, in what SPSS record, or case?
More broadly, can you give an idea what data you have, and a
specification for what you want to compute and add to it?
-Good wishes and good luck,
Richard