Re: [R] read.spss 'error reading system-file header'
Thank you for your answer. I did try this but got similar errors. I tried all the other spss-specific formats with same result. A way to get access to the data is: save in sas-xport format (though all labels are lost) then save in another sas-format and asking spss to also save value labels in a sas-format file which can then be edited to extract both value labels and variable labels. These methods are quite laborious and quite complicated, though, and you need access to spss. Ulrich Keller wrote: Question 2: Try saving the data as an SPSS portable file. I never had trouble reading these in R. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] read.spss 'error reading system-file header'
Thank you Michael I think you point to the real cause of the problem. I solved my own immediate problem by using StatTransfer to transfer from sav to sav. My real concern is that the read.spss() function will become obsolete. Most of the data I have received in the last year have had those problems (and increasingly so), now they have become so serious that the import process fails all together. Therefore I believe it is important to do something about Michael Bibo wrote: I don't know if this is relevant in your particular case, but the error messages you quote are precisely what you get if the SPSS .sav file has been created with the SPSS Data Entry product. If this is the case, it is covered by section 3.1 of the R Data Import/Export document. If that is the problem, and if you don't have access to SPSS Data Entry, I could do a data export for you. If I can help, please respond on both my work email (below) and [EMAIL PROTECTED], as I'm not sure which one I would see first. Michael Bibo Research Officer Projects and Research Service West Moreton Community Health Services West Moreton Health Service District Queensland Health [EMAIL PROTECTED] Ph. +61 7 3817 2400 P.O. Box 878 Ipswich, 4305 Australia This e-mail, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost if you receive it and you are not the intended recipient(s), or if it is transmitted/ received in error. Any unauthorised use, alteration, disclosure, distribution or review of this e-mail is prohibited. It may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this e-mail in error, you are asked to immediately notify the sender by telephone or by return e-mail. You should also delete this e-mail message and destroy any hard copies produced. * This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/ received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] read.spss 'error reading system-file header'
On Thu, 3 Aug 2006, Finn Sand? wrote: My real concern is that the read.spss() function will become obsolete. Most of the data I have received in the last year have had those problems (and increasingly so), now they have become so serious that the import process fails all together. Therefore I believe it is important to do something about Well, we would be happy if someone did something about it. It still reads all the files it used to read (which includes all the SPSS files I have ever encountered in my work). As has been pointed out several times, PSPP now has newer code to read SPSS files than the code in the foreign package, and that could be adapted. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] read.spss 'error reading system-file header'
Finn Sandø fs at fs-analyse.dk writes: When I try to import an spss sav file with read.spss() I am getting the following error 'Error in read.spss(X:\\.sav) : error reading system-file header' and the import process is aborted. I have tried in v. 2.3.0 and 2.3.1 The sav-file loads without problems in spss v14 I have tried saving in older spss v7 but are getting the same result. The read.spss() has other errors (the 'Unrecognized record type 7, subtype 7 encountered in system file') but it does not seem to have any impact. These are also the error messages you get when the .sav file in question was created with the SPSS Data Entry product. If that is the case, then it is covered by section 3.1 of the R Data Import/Export document. Michael __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] read.spss 'error reading system-file header'
Question 2: Try saving the data as an SPSS portable file. I never had trouble reading these in R. Finn Sandø wrote: When I try to import an spss sav file with read.spss() I am getting the following error 'Error in read.spss(X:\\.sav) : error reading system-file header' and the import process is aborted. I have tried in v. 2.3.0 and 2.3.1 The sav-file loads without problems in spss v14 I have tried saving in older spss v7 but are getting the same result. The read.spss() has other errors (the 'Unrecognized record type 7, subtype 7 encountered in system file') but it does not seem to have any impact. This leads me to thinking that the spss.read() slowly is growing out of date which would be sad. So question 1: Does anyone know if these problems are going to be solved? I know the read.spss() function is build on the PSPP project so maybe it takes someone with c-knowledge to do something about it. If someone is going to work on the problem I will be happy to help by testing and providing problematic test-files. Question 2 Is there some way to import spss-sav files in this case other than save in a non-spss format? Regards FS __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] read.spss Error reading system-file header
Hi Jake, I had and still have got the same problem. There were two columns in the data frame which contain just missing values. When I deleted those the impord seemed to work, but there is still a warning message. Warning message: C:\test.sav: Unrecognized record type 7, subtype 13 encountered in system file. Jake Wegelin wrote: Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not merely a size problem. I have no difficulty opening the file in SPSS. I also have no trouble getting read.spss to read a dummy SPSS file with 5 rows and 173 columns, where each entry was randomly sampled from c(letters, LETTERS). / library(foreign) / / junk-read.spss(indata/z2EXvideo.sav) / Error in read.spss(indata/z2EXvideo.sav) : Error reading system-file header. In addition: Warning message: indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. Thanks for any information Jake Wegelin / version / __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: Re: [R] read.spss Error reading system-file header
Bj?rn Stollenwerk [EMAIL PROTECTED] wrote: I had and still have got the same problem. There were two columns in the data frame which contain just missing values. When I deleted those the impord seemed to work, but there is still a warning message. Warning message: C:\test.sav: Unrecognized record type 7, subtype 13 encountered in system file. This warning message has been discussed a few times. It occurs when read.spss reads a file from SPSS 12.0 or higher. Beginning with SPSS 12 the file format was changed to accommodate long variable names. It seems logical that SPSS added a record to their file format to hold the long variable names, while keeping the short (eight character) variable names to be compatible with older versions. The read.spss function has not been updated. It reads the short names, ignores the long names, and produces the warning you cite. There does not seem to be any error in reading the data, other than the warning and continued use of short variable names. I brought this up more than a year ago, just after SPSS 12 was released. I e-mailed the author (Saikat DebRoy) of the read.spss function, but did not get a response, I don't know if he got the message. It would be nice to update the function to read the longer variable names and be rid of the warning. Harold __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: Re: [R] read.spss Error reading system-file header
On Tue, 26 Oct 2004, Baize, Harold wrote: Bj?rn Stollenwerk [EMAIL PROTECTED] wrote: I had and still have got the same problem. There were two columns in the data frame which contain just missing values. When I deleted those the impord seemed to work, but there is still a warning message. Warning message: C:\test.sav: Unrecognized record type 7, subtype 13 encountered in system file. This warning message has been discussed a few times. It occurs when read.spss reads a file from SPSS 12.0 or higher. Beginning with SPSS 12 the file format was changed to accommodate long variable names. It seems logical that SPSS added a record to their file format to hold the long variable names, while keeping the short (eight character) variable names to be compatible with older versions. The read.spss function has not been updated. It reads the short names, ignores the long names, and produces the warning you cite. There does not seem to be any error in reading the data, other than the warning and continued use of short variable names. I brought this up more than a year ago, just after SPSS 12 was released. I e-mailed the author (Saikat DebRoy) of the read.spss function, but did not get a response, I don't know if he got the message. It would be nice to update the function to read the longer variable names and be rid of the warning. Please send your patch to the maintainer (R-core, not Saikat DebRoy, if you read the DESCRIPTION file). (If you were not offering to do this, please don't volunteer other people to do work for you.) -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.spss Error reading system-file header
Jake - The error message and warnign message shown below say something is wrong with this file's SPSS system-file header. If you are really able to open this one in SPSS, do so, change maybe a column name or row name or two, and save it again under a different file name. See if read.spss() chokes on the new version too. Caution - I'm just guessing, here, but it's something to try. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Jacob Wegelin wrote: Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not merely a size problem. I have no difficulty opening the file in SPSS. I also have no trouble getting read.spss to read a dummy SPSS file with 5 rows and 173 columns, where each entry was randomly sampled from c(letters, LETTERS). library(foreign) junk-read.spss(indata/z2EXvideo.sav) Error in read.spss(indata/z2EXvideo.sav) : Error reading system-file header. In addition: Warning message: indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. Thanks for any information Jake Wegelin version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor8.0 year 2003 month10 day 08 language R __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] read.spss Error reading system-file header
Jake - Very puzzling that a freshly-written copy of the file gives the same problem. As to your second question, my recollection is that read.spss() will be in package 'foreign'. The absolute reference is the source code itself, and this is often quite readable, whether it's commented or not. Ah . . . in order to see the source, you need to go back to CRAN sometimes and download a source version, even though you have no intention of re-compiling it yourself. That's highly recommended for questions of this sort. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Jacob Wegelin wrote: Tom, Thanks very much for your swift reply. I did change some of the column names, eliminating all names with a pound sign in them, and got the same problem. I guess I could change all the column and row names. It would be nice to know what exactly read.spss needs, though! Thanks again Jake On Tue, 4 Nov 2003, Thomas W Blackwell wrote: Jake - The error message and warnign message shown below say something is wrong with this file's SPSS system-file header. If you are really able to open this one in SPSS, do so, change maybe a column name or row name or two, and save it again under a different file name. See if read.spss() chokes on the new version too. Caution - I'm just guessing, here, but it's something to try. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Jacob Wegelin wrote: Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not merely a size problem. I have no difficulty opening the file in SPSS. I also have no trouble getting read.spss to read a dummy SPSS file with 5 rows and 173 columns, where each entry was randomly sampled from c(letters, LETTERS). library(foreign) junk-read.spss(indata/z2EXvideo.sav) Error in read.spss(indata/z2EXvideo.sav) : Error reading system-file header. In addition: Warning message: indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. Thanks for any information Jake Wegelin version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor8.0 year 2003 month10 day 08 language R __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] read.spss Error reading system-file header
David Baird has created a free data conversion utility called dataload. See http://www.vsn-intl.com/genstat/downloads/dataload.htm It can translate SPSS files into other formats including several that are readable by R (including csv and rda). I don't use SPSS myself but I have used dataload succesfully with Excel files. (This is the same utility that was mentioned on the list recently in connection with SAS.) --- Date: Tue, 4 Nov 2003 15:58:02 -0800 (PST) From: Jacob Wegelin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] read.spss Error reading system-file header Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not merely a size problem. I have no difficulty opening the file in SPSS. I also have no trouble getting read.spss to read a dummy SPSS file with 5 rows and 173 columns, where each entry was randomly sampled from c(letters, LETTERS). library(foreign) junk-read.spss(indata/z2EXvideo.sav) Error in read.spss(indata/z2EXvideo.sav) : Error reading system-file header. In addition: Warning message: indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. Thanks for any information Jake Wegelin version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 8.0 year 2003 month 10 day 08 language R ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] read.spss Error reading system-file header
On Tue, 4 Nov 2003, Jacob Wegelin wrote: Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? I don't think this is known. The read.spss code is taken from code in PSPP, which was going to be a GNU implementation of SPSS. Judging from some of the comments in the code, at least part of the format was worked out from files, not documented. I haven't run across any problems in using it to read SPSS .sav files, but most of the ones I have tried were created by the same people and don't represent independent confirmations. -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] read.spss Error reading system-file header
Thank you for your responses. Here's the workaround. In SPSS, I saved the file EXvideo.sav as Excel. Still in SPSS, I read in this Excel file, and saved it under a new name, EXvideo-SPSStoExceltoSPSS.sav, as an SPSS file. This file I was able to read into R with no problem, using read.spss. The dataload utility was able to convert some other SPSS files to xls, but not EXvideo.sav. Jake On Tue, 4 Nov 2003, Thomas Lumley wrote: On Tue, 4 Nov 2003, Jacob Wegelin wrote: Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? I don't think this is known. The read.spss code is taken from code in PSPP, which was going to be a GNU implementation of SPSS. Judging from some of the comments in the code, at least part of the format was worked out from files, not documented. I haven't run across any problems in using it to read SPSS .sav files, but most of the ones I have tried were created by the same people and don't represent independent confirmations. -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] read.spss Error reading system-file header
Sorry, but there was an error in the link that I posted below. It should have been http://www.vsn-intl.com/genstat/downloads/datald.htm --- Date: Tue, 4 Nov 2003 19:54:06 -0500 From: Gabor Grothendieck [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [R] read.spss Error reading system-file header David Baird has created a free data conversion utility called dataload. See http://www.vsn-intl.com/genstat/downloads/dataload.htm It can translate SPSS files into other formats including several that are readable by R (including csv and rda). I don't use SPSS myself but I have used dataload succesfully with Excel files. (This is the same utility that was mentioned on the list recently in connection with SAS.) --- Date: Tue, 4 Nov 2003 15:58:02 -0800 (PST) From: Jacob Wegelin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] read.spss Error reading system-file header Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or clean an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not merely a size problem. I have no difficulty opening the file in SPSS. I also have no trouble getting read.spss to read a dummy SPSS file with 5 rows and 173 columns, where each entry was randomly sampled from c(letters, LETTERS). library(foreign) junk-read.spss(indata/z2EXvideo.sav) Error in read.spss(indata/z2EXvideo.sav) : Error reading system-file header. In addition: Warning message: indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. Thanks for any information Jake Wegelin version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 8.0 year 2003 month 10 day 08 language R ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help