You can use this library from CodePlex, but you will have to modify it a bit to work with spssio64.dll, which is included in the I / O module. In the SpssThinWrapper.cs file SpssThinWrapper.cs you need to modify the imported DLL. You will also have to change some entry points. To get the entry point names in a 64-bit DLL, you need to run dumpbin /exports spssio64.dll . If you do this, you will see that the 64-bit and 32-bit entry points are basically the same, except that some of the 32-bit ones have an @ sign and a number after them, while none of the 64-bit ones. Modify all of these files along with the DLL in the DllImport attribute. For instance:
[DllImport("spssio32.dll", EntryPoint=" spssCloseAppend@4 ", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)] public static extern ReturnCode spssCloseAppend(int handle);
becomes
[DllImport("spssio64.dll", EntryPoint = "spssCloseAppend", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern ReturnCode spssCloseAppend(int handle);
etc.
After that, you will want to make sure that you are using the correct DLLs. Copy spssio64.dll, icudt32.dll, icuin32.dll and icuuc32.dll from the win64 folder of the I / O module to the Resources folder from the SPSS.NET library from CodePlex. This will overwrite existing 32-bit DLLs, so if you need both 32-bit and 64-bit, you will have to do something else, but it looks like you just need 64-bit, so this should work.
As an example of how easy it is to create .sav with this library:
using (SpssDataDocument spssDoc = SpssDataDocument.Create("test.sav")) { SpssVariable v = new SpssNumericVariable(); v.Name = "gender"; v.Label = "What is your gender?"; v.ValueLabels.Add(1, "Male"); v.ValueLabels.Add(2, "Female"); doc.Variables.Add(v); doc.CommitDictionary(); SpssCase c = doc.Cases.New(); c["gender"] = 1; c.Commit(); }
The library handles all spss * calls for you and ensures that they are in the correct order and thatβs all.