Prev: How to estimate Weibull distribution parameter
Next: how to obtain level2 and level3 residual separately in a three level Mixed model
From: Alex_DPC on 23 Mar 2010 13:13 Hi all, I wonder if anyone has experience with exporting national characters from SAS (sas7bdat) to SPSS (sav). Here's my problem: * I have a UTF-8 encoded SAS file (sas7bdat) * I export this file to SPSS (sav) using PROC EXPORT * When I re-import the file to SAS everything's just fine, but when I open it in SPSS, national characters are destroyed. I know that there's an SPSS option "Unicode" and have set it to "Yes". When I create a "Unicode" file including national characters with SPSS itself, close it and reopen it, everything is displayed fine. Now the reason could be that the file is not properly exported from SAS or that SPSS doesn't read it properly. Any ideas? Thanks! Alex
From: andre on 26 Mar 2010 11:25 Alex the problem is rising more and more. i have studied the new Stattransfer (10) and encounter the utf encoding at every corner but solved. For export to Spss STT is exporting a utf file in any case and of course, your Spss (18) must be regulated before on utf yes as it is impossible to change it while a table is open. Direct Import by Spss of a sas table seems to ok except the enerving of personal formats this is why STT is needed The direct Export to SAS from Spss(18) is with a surprise in the proc format code file There are no value names!!! With STT 10, exporting to sas seems also working good even in Sas 9.2.2 the note about a recognizing of an utf file mention that a conversion was made. why does proc export act so because there is no encoding option in the proc export. What i have not tried : under a chinese pc with an dbyte encoding sas localized trying to export to a chinese version of ibm-spss ! ;-) HTH Andre On 23 mar, 18:13, Alex_DPC <alexander.k...(a)iea-dpc.de> wrote: > Hi all, > > I wonder if anyone has experience with exporting national characters > from SAS (sas7bdat) to SPSS (sav). Here's my problem: > * I have a UTF-8 encoded SAS file (sas7bdat) > * I export this file to SPSS (sav) using PROC EXPORT > * When I re-import the file to SAS everything's just fine, but when > I open it in SPSS, national characters are destroyed. > > I know that there's an SPSS option "Unicode" and have set it to "Yes". > When I create a "Unicode" file including national characters with SPSS > itself, close it and reopen it, everything is displayed fine. > > Now the reason could be that the file is not properly exported from > SAS or that SPSS doesn't read it properly. Any ideas? > > Thanks! > Alex
From: Alex_DPC on 29 Mar 2010 10:35 On Mar 26, 5:25 pm, andre <wie...(a)ined.fr> wrote: > Alex > the problem is rising more and more. > i have studied the new Stattransfer (10) and encounter the utf > encoding at every corner but solved. > For export to Spss STT is exporting a utf file in any case > and of course, your Spss (18) must be regulated before on utf yes as > it is impossible > to change it while a table is open. > > Direct Import by Spss of a sas table seems to ok except the enerving > of personal formats > this is why STT is needed > > The direct Export to SAS from Spss(18) is with a surprise in the proc > format code file > There are no value names!!! > > With STT 10, exporting to sas seems also working good > even in Sas 9.2.2 the note about a recognizing of an utf file mention > that > a conversion was made. > > why does proc export act so because there is no encoding option > in the proc export. > > What i have not tried : under a chinese pc with an dbyte encoding sas > localized > trying to export to a chinese version of ibm-spss ! ;-) > > HTH > Andre > > On 23 mar, 18:13, Alex_DPC <alexander.k...(a)iea-dpc.de> wrote: > > > Hi all, > > > I wonder if anyone has experience with exporting national characters > > from SAS (sas7bdat) to SPSS (sav). Here's my problem: > > * I have a UTF-8 encoded SAS file (sas7bdat) > > * I export this file to SPSS (sav) using PROC EXPORT > > * When I re-import the file to SAS everything's just fine, but when > > I open it in SPSS, national characters are destroyed. > > > I know that there's an SPSS option "Unicode" and have set it to "Yes". > > When I create a "Unicode" file including national characters with SPSS > > itself, close it and reopen it, everything is displayed fine. > > > Now the reason could be that the file is not properly exported from > > SAS or that SPSS doesn't read it properly. Any ideas? > > > Thanks! > > Alex > > André, Thanks a lot for your reply. Interesting that this works with Stattransfer. Unfortunately I can't really use it to solve my problem, because this functionality is part of a bigger SAS batch program. I have contacted SPSS support and was told that the SPSS file, which SAS writes contains the proper data, but the encoding is not properly marked as UTF-8. To me this looks like a bug in PROC EXPORT. Now I'm waiting for a reply from SAS support. If you're interested, I can post it here. BTW, the import of a UTF-8 encoded sas7bdat file into SPSS 18.01 does not work for me. The program crashes. SPSS support could not explain this, but as always I was told that everything would work way better in the next release... Cheers, Alex
From: Alex_DPC on 13 Apr 2010 05:50
On Mar 29, 4:35 pm, Alex_DPC <alexander.k...(a)iea-dpc.de> wrote: > On Mar 26, 5:25 pm, andre <wie...(a)ined.fr> wrote: > > > > > Alex > > the problem is rising more and more. > > i have studied the new Stattransfer (10) and encounter the utf > > encoding at every corner but solved. > > For export to Spss STT is exporting a utf file in any case > > and of course, your Spss (18) must be regulated before on utf yes as > > it is impossible > > to change it while a table is open. > > > Direct Import by Spss of a sas table seems to ok except the enerving > > of personal formats > > this is why STT is needed > > > The direct Export to SAS from Spss(18) is with a surprise in the proc > > format code file > > There are no value names!!! > > > With STT 10, exporting to sas seems also working good > > even in Sas 9.2.2 the note about a recognizing of an utf file mention > > that > > a conversion was made. > > > why does proc export act so because there is no encoding option > > in the proc export. > > > What i have not tried : under a chinese pc with an dbyte encoding sas > > localized > > trying to export to a chinese version of ibm-spss ! ;-) > > > HTH > > Andre > > > On 23 mar, 18:13, Alex_DPC <alexander.k...(a)iea-dpc.de> wrote: > > > > Hi all, > > > > I wonder if anyone has experience with exporting national characters > > > from SAS (sas7bdat) to SPSS (sav). Here's my problem: > > > * I have a UTF-8 encoded SAS file (sas7bdat) > > > * I export this file to SPSS (sav) using PROC EXPORT > > > * When I re-import the file to SAS everything's just fine, but when > > > I open it in SPSS, national characters are destroyed. > > > > I know that there's an SPSS option "Unicode" and have set it to "Yes".. > > > When I create a "Unicode" file including national characters with SPSS > > > itself, close it and reopen it, everything is displayed fine. > > > > Now the reason could be that the file is not properly exported from > > > SAS or that SPSS doesn't read it properly. Any ideas? > > > > Thanks! > > > Alex > > André, > > Thanks a lot for your reply. Interesting that this works with > Stattransfer. Unfortunately I can't really use it to solve my problem, > because this functionality is part of a bigger SAS batch program. > I have contacted SPSS support and was told that the SPSS file, which > SAS writes contains the proper data, but the encoding is not properly > marked as UTF-8. To me this looks like a bug in PROC EXPORT. > Now I'm waiting for a reply from SAS support. If you're interested, I > can post it here. > > BTW, the import of a UTF-8 encoded sas7bdat file into SPSS 18.01 does > not work for me. The program crashes. SPSS support could not explain > this, but as always I was told that everything would work way better > in the next release... > > Cheers, > Alex Just in case somebody runs into the same problem: there is indeed a bug in PROC EXPORT. The encoding marker in the SPSS file is not properly set. An 'Enhancement Defect' was filed and this will be solved in a forthcoming release. I decided to work around the problem now by exporting to another format (MS Access maybe) and importing that into SPSS. Annoying but possible. For the future I will definitely look into Stattransfer as I just heard it also has powerful scripting capabilities. Best, Alex |