I have a strange problem: a simple add files command does not add all
cases to the system file, although the frequency table reports all cases. Is there a problem with this syntax? add files file='c:\bsl\ellen.sav' / file='c:\bsl\britt.sav' / file='c:\bsl\kristin.sav'. des var=all. save out='c:\bsl\sum3.sav'. What happens is that the resulting file - sum3.sav - contains only the cases from the last file. Move the file specifications, and the file gets a new set of cases, from the last file only. The user who owns the files tried it first with the GUI (12.0.2), before I ran the above syntax on 12.0.2 and 14.0.2. But the really scary part is that the table from des var=all reports all the cases! And yes, i have tried it also with "cache on". A solution, anyone? Yours, -- Nils-Eivind Naas IT Manager Institute for Social Research Munthes gate 31, N-0260, Oslo, Norway |
ADD FILES only seems to work when adding 2 files together, not multiples.
Very inconvenient. Oh well. Raynauld offers some workarounds on his website but it would be nice if there was an easier way to simply stack 3 or 4 files with reverting to a script or a macro. http://www.spsstools.net/SampleSyntax.htm#WorkingWithManyFiles See options 1 and 2 *************************************************************************************************************************************************************** Mark A. Davenport Ph.D. Senior Research Analyst Office of Institutional Research The University of North Carolina at Greensboro 336.256.0395 [hidden email] 'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962) Nils-Eivind Naas <[hidden email]> Sent by: "SPSSX(r) Discussion" <[hidden email]> 11/16/2006 10:06 AM Please respond to Nils-Eivind Naas <[hidden email]> To [hidden email] cc Subject add files does not add I have a strange problem: a simple add files command does not add all cases to the system file, although the frequency table reports all cases. Is there a problem with this syntax? add files file='c:\bsl\ellen.sav' / file='c:\bsl\britt.sav' / file='c:\bsl\kristin.sav'. des var=all. save out='c:\bsl\sum3.sav'. What happens is that the resulting file - sum3.sav - contains only the cases from the last file. Move the file specifications, and the file gets a new set of cases, from the last file only. The user who owns the files tried it first with the GUI (12.0.2), before I ran the above syntax on 12.0.2 and 14.0.2. But the really scary part is that the table from des var=all reports all the cases! And yes, i have tried it also with "cache on". A solution, anyone? Yours, -- Nils-Eivind Naas IT Manager Institute for Social Research Munthes gate 31, N-0260, Oslo, Norway |
In reply to this post by Nils-Eivind Naas-2
What version of SPSS are you using? We have been using Add files with
multiple files for quite some time. From the SPSS help... ADD FILES combines cases from 2 up to 50 SPSS-format data files by concatenating or interleaving cases. Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP Sent: Thursday, November 16, 2006 11:31 AM To: [hidden email] Subject: Re: [SPSSX-L] add files does not add ADD FILES only seems to work when adding 2 files together, not multiples. Very inconvenient. Oh well. Raynauld offers some workarounds on his website but it would be nice if there was an easier way to simply stack 3 or 4 files with reverting to a script or a macro. http://www.spsstools.net/SampleSyntax.htm#WorkingWithManyFiles See options 1 and 2 ************************************************************************ ************************************************************************ *************** Mark A. Davenport Ph.D. Senior Research Analyst Office of Institutional Research The University of North Carolina at Greensboro 336.256.0395 [hidden email] 'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962) Nils-Eivind Naas <[hidden email]> Sent by: "SPSSX(r) Discussion" <[hidden email]> 11/16/2006 10:06 AM Please respond to Nils-Eivind Naas <[hidden email]> To [hidden email] cc Subject add files does not add I have a strange problem: a simple add files command does not add all cases to the system file, although the frequency table reports all cases. Is there a problem with this syntax? add files file='c:\bsl\ellen.sav' / file='c:\bsl\britt.sav' / file='c:\bsl\kristin.sav'. des var=all. save out='c:\bsl\sum3.sav'. What happens is that the resulting file - sum3.sav - contains only the cases from the last file. Move the file specifications, and the file gets a new set of cases, from the last file only. The user who owns the files tried it first with the GUI (12.0.2), before I ran the above syntax on 12.0.2 and 14.0.2. But the really scary part is that the table from des var=all reports all the cases! And yes, i have tried it also with "cache on". A solution, anyone? Yours, -- Nils-Eivind Naas IT Manager Institute for Social Research Munthes gate 31, N-0260, Oslo, Norway PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. |
Never mind. I am an idiot. When one cuts and pastes within syntax, one
must remove the periods. I am so embarrassed. Nils, I found my problem, don't now why you are having a problem. The following syntax returns 1 long file concatenated from 4 smaller files. The sum counts of the smaller file add up to the sum count of the final file so I am capturing all cases. ADD FILES /FILE='C:\Crate and Barrel\CB Response File 200607280.sav' /FILE='C:\Crate and Barrel\CB Response File 200608250.sav' /FILE='C:\Crate and Barrel\CB Response File 200609290.sav' /FILE='C:\Crate and Barrel\CB Response File 200610270.sav'. EXECUTE. Mine works just fine now and yours doesn't look much different. add files file='c:\bsl\ellen.sav' / file='c:\bsl\britt.sav' / file='c:\bsl\kristin.sav'. des var=all. save out='c:\bsl\sum3.sav'. *************************************************************************************************************************************************************** Mark A. Davenport Ph.D. Senior Research Analyst Office of Institutional Research The University of North Carolina at Greensboro 336.256.0395 [hidden email] 'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962) Melissa Ives <[hidden email]> Sent by: "SPSSX(r) Discussion" <[hidden email]> 11/16/2006 12:37 PM Please respond to Melissa Ives <[hidden email]> To [hidden email] cc Subject Re: add files does not add What version of SPSS are you using? We have been using Add files with multiple files for quite some time. From the SPSS help... ADD FILES combines cases from 2 up to 50 SPSS-format data files by concatenating or interleaving cases. Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP Sent: Thursday, November 16, 2006 11:31 AM To: [hidden email] Subject: Re: [SPSSX-L] add files does not add ADD FILES only seems to work when adding 2 files together, not multiples. Very inconvenient. Oh well. Raynauld offers some workarounds on his website but it would be nice if there was an easier way to simply stack 3 or 4 files with reverting to a script or a macro. http://www.spsstools.net/SampleSyntax.htm#WorkingWithManyFiles See options 1 and 2 ************************************************************************ ************************************************************************ *************** Mark A. Davenport Ph.D. Senior Research Analyst Office of Institutional Research The University of North Carolina at Greensboro 336.256.0395 [hidden email] 'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962) Nils-Eivind Naas <[hidden email]> Sent by: "SPSSX(r) Discussion" <[hidden email]> 11/16/2006 10:06 AM Please respond to Nils-Eivind Naas <[hidden email]> To [hidden email] cc Subject add files does not add I have a strange problem: a simple add files command does not add all cases to the system file, although the frequency table reports all cases. Is there a problem with this syntax? add files file='c:\bsl\ellen.sav' / file='c:\bsl\britt.sav' / file='c:\bsl\kristin.sav'. des var=all. save out='c:\bsl\sum3.sav'. What happens is that the resulting file - sum3.sav - contains only the cases from the last file. Move the file specifications, and the file gets a new set of cases, from the last file only. The user who owns the files tried it first with the GUI (12.0.2), before I ran the above syntax on 12.0.2 and 14.0.2. But the really scary part is that the table from des var=all reports all the cases! And yes, i have tried it also with "cache on". A solution, anyone? Yours, -- Nils-Eivind Naas IT Manager Institute for Social Research Munthes gate 31, N-0260, Oslo, Norway PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. |
In reply to this post by Nils-Eivind Naas-2
On 16 Nov 2006 at 13:33, Mark A Davenport MADAVENP wrote:
> Never mind. I am an idiot. When one cuts and pastes within syntax, one > must remove the periods. > > I am so embarrassed. Well it turns out _I_ am the idiot :-) > Nils, I found my problem, don't now why you are having a problem. > > Mine works just fine now and yours doesn't look much different. So does mine :-( > add files > file='c:\bsl\ellen.sav' / > file='c:\bsl\britt.sav' / > file='c:\bsl\kristin.sav'. > des var=all. > save out='c:\bsl\sum3.sav'. I overlooked the obvious: the files to be merged contained lots of blank lines, with sysmis in all variables, so when added, it seemed that only the last file was included (insert sheepish grin here). So, a line with Select if before the save command did the trick. (It is not always that 35 years' user experience is of any help :-)) -- nen -- Nils-Eivind Naas IT Manager Institute for Social Research Munthes gate 31, N-0260, Oslo, Norway |
Free forum by Nabble | Edit this page |