Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extracting metadata from sav files

547 views
Skip to first unread message

nikos

unread,
Jan 15, 2007, 12:14:00 PM1/15/07
to
Hello,

I want to create an application which reads spss .sav files and
extracts the metadata (data dictionary) without having to use the spss
program. By searching the web I found that one could use the
spssio32.dll to do that.

What I would like to know is if there are easier ways to perform this
task and if not could someone give me some pointers to example
programs? Ideally I would prefer examples in python or ruby.

Thanks

Ben Pfaff

unread,
Jan 15, 2007, 1:08:46 PM1/15/07
to
"nikos" <nbogia...@gmail.com> writes:

> What I would like to know is if there are easier ways to perform this
> task and if not could someone give me some pointers to example
> programs? Ideally I would prefer examples in python or ruby.

GNU PSPP and GNU R can read SPSS data files. PSPP uses SPSS
syntax; R uses S syntax.
--
Ben Pfaff
email: b...@cs.stanford.edu
web: http://benpfaff.org

nikos

unread,
Jan 15, 2007, 1:37:15 PM1/15/07
to
On Jan 15, 8:08 pm, Ben Pfaff <b...@cs.stanford.edu> wrote:
> GNU PSPP and GNU R can read SPSS data files. PSPP uses SPSS
> syntax; R uses S syntax.

Thanks for the quick reply Ben,

I am afraid I have not formulated my question correctly. I would like
to extract the data without any user interaction, entirely
programmaticaly. The sav files will be uploaded to a web site and I
want to extract the metadata from them and store it in a database. Can
these programs run in batch mode and export the data to a text or xml
format? If not, is my only other option to use the dll?

Thanks

Ben Pfaff

unread,
Jan 15, 2007, 1:44:38 PM1/15/07
to
"nikos" <nbogia...@gmail.com> writes:

> On Jan 15, 8:08 pm, Ben Pfaff <b...@cs.stanford.edu> wrote:
>> GNU PSPP and GNU R can read SPSS data files. PSPP uses SPSS
>> syntax; R uses S syntax.
>

> I am afraid I have not formulated my question correctly. I would like
> to extract the data without any user interaction, entirely
> programmaticaly. The sav files will be uploaded to a web site and I
> want to extract the metadata from them and store it in a database. Can
> these programs run in batch mode and export the data to a text or xml
> format? If not, is my only other option to use the dll?

PSPP can run in batch mode and export the data to a text format
using, say, the SYSFILE INFO command. The text format is not
particularly well-suited for programmatic interpretation,
however, which might make this option inconvenient.

R can also run in batch mode. I'm afraid I don't know what kinds
of output it offers or whether it can give full access to .sav
file metadata; all I know is the bare fact that it understands
.sav files.

JKPeck

unread,
Jan 16, 2007, 8:16:30 AM1/16/07
to
Bear in mind that the SPSS sav file evolves over time. While it
remains backwards compatible, new features such as long variable names,
long strings, variable and file attributes, character encoding,
enhanced multiple response sets, and others have been added in recent
versions. More are planned for SPSS 16.

If you use the i/o dll, you can keep your application stable and take
advantage of new features. If you read the binary format directly or
use an application that does not keep up to date, your output will not
reflect new features.
The last time I looked, the R SPSS file reader was quite far behind in
supporting new features. I can't speak for PSPP.

HTH,
Jon Peck
SPSS

nikos

unread,
Jan 16, 2007, 2:11:03 PM1/16/07
to
Thank you both for your help,

It seems that the best solution is to use the dll after all. I will try
to use it however I still have the problem that I can't find any python
or ruby examples. I've googled but nothing came up. The best I could
find was a C# wrapper for the dll but I'm not familiar with that
language. Could you please give me some pointers to any useful
information?

Ben Pfaff

unread,
Jan 16, 2007, 2:18:00 PM1/16/07
to
"JKPeck" <JKP...@gmail.com> writes:

> The last time I looked, the R SPSS file reader was quite far behind in
> supporting new features. I can't speak for PSPP.

The PSPP developers are happy to help out anyone who has trouble
reading SPSS files, of any version, in PSPP. We welcome bug
reports at bug-...@gnu.org or http://sv.gnu.org/p/pspp

Neila

unread,
Jan 20, 2007, 4:09:35 PM1/20/07
to
nikos ,
spssio32.dll would be the way to do this (w/o SPSS on machine).
Have fun with the value labels ;-))))
I wrote a VB wrapper (contact me directly for licensing info!)
Neila
0 new messages