Date: Tue, 13 Mar 2012 09:09:37 -0400
Reply-To: "Bibel, Daniel (POL)" <daniel.bibel@state.ma.us>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Bibel, Daniel (POL)" <daniel.bibel@state.ma.us>
Subject: Question about spssaux2 and V20
In-Reply-To: <OF036A805E.14217473-ON8725798D.00108C99-8725798D.00127391@us.ibm.com>
Content-Type: multipart/alternative;
I've just installed a trial version of V20 and come across a piece of
code that doesn't work as it did in V18.
I have a file with monthly data from agencies. I want to split the
files by variable ('agency') and save the output into separate Excel
files. I've installed the Python essentials and copied the spssaux2.py
file from the c:\python26 directory into the c:\python27 directory.
The code that worked previously is:
>begin program.
>import spss, spssaux2
>cmd = "SAVE TRANSLATE
OUTFILE='U:/cru_data/SummaryReports/monthly0011/%(splitvalue)s.xls'
/TYPE=XLS /VERSION=8 /replace /fieldnames /replace "
>spssaux2.generalizedSplit('Agency', cmd)
>end program.
The output I get now is like this:
begin program.
import spss, spssaux2
cmd = "SAVE TRANSLATE
OUTFILE='U:/cru_data/SummaryReports/monthly0011/%(splitvalue)s.xls'
/TYPE=XLS /VERSION=8 /replace /fieldnames /replace "
spssaux2.generalizedSplit('Agency', cmd)
end program.
SPLIT: Agency = Abington
>Error # 9016 in column 28. Text:
U:/cru_data/SummaryReports/monthly0011/"Abington".xls >The file
specification is invalid, and the output file cannot be opened.
>Execution of this command stops.
Any suggestions greatly appreciated!
Dan Bibel
Massachusetts State Police
[text/html]