Dear Listers, I am running V21 on a 64-bit Win 7 machine, and running a monthly routine that produces a text file. For the first time, it now shows a weird symbol in the first column of output file. Here is the key syntax: WRITE OUTFILE='C:/SAF/SandF_Mkt_Share_District_data.dat' / PERIOD "," DISTRICT "," PACKID "," NETSHIP "," INVENTORY "," DISPENSED "," RETURNS "," PURCHASES "," CATEGORY "," CNAME.  1/2002 ,EA, 13, .00000, 64437.94683, 787.38559, .00000, .00000,1,CANINE 1/2002 ,EA, 15, 1238.59136, 106517.34469, 3935.47965, .00000, 1256.87826,1,CANINE 1/2002 ,EA, 16, 3830.48804, 90417.64838, 12591.98887, .00000, 3832.77252,1,CANINE For those of you seeing this as plain text, it might not be visible. Again, the routine has run without such an incident since inception. Many thanks in advance, Bob Walker Surveys & Forecasts, LLC |
That is a BOM - byte order mark, that indicates
that the characters are encoded in Unicode UTF-8. If you open the
file in, say, Notepad, you won't see that initial string, because it is
meant to be displayed but is intended as information for the receiving
app. IIRC, if you are not in Unicode mode, you won't get that prefix.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Bob Walker <[hidden email]> To: [hidden email] Date: 10/03/2012 08:45 PM Subject: [SPSSX-L] Odd Symbol Sent by: "SPSSX(r) Discussion" <[hidden email]> Dear Listers, I am running V21 on a 64-bit Win 7 machine, and running a monthly routine that produces a text file. For the first time, it now shows a weird symbol in the first column of output file. Here is the key syntax: WRITE OUTFILE='C:/SAF/SandF_Mkt_Share_District_data.dat' / PERIOD "," DISTRICT "," PACKID "," NETSHIP "," INVENTORY "," DISPENSED "," RETURNS "," PURCHASES "," CATEGORY "," CNAME.  1/2002 ,EA, 13, .00000, 64437.94683, 787.38559, .00000, .00000,1,CANINE 1/2002 ,EA, 15, 1238.59136, 106517.34469, 3935.47965, .00000, 1256.87826,1,CANINE 1/2002 ,EA, 16, 3830.48804, 90417.64838, 12591.98887, .00000, 3832.77252,1,CANINE For those of you seeing this as plain text, it might not be visible. Again, the routine has run without such an incident since inception. Many thanks in advance, Bob Walker Surveys & Forecasts, LLC www.safllc.com |
Thank you Jon, as it has caused quite a fuss for my client receiving that flat file! Pardon my ignorance, but (a) why has this suddenly started to occur, as I did not explicitly set characters to Unicode UTF-8, and thus the BOM is a new development, and (b) it appears that with V21, the default setting is UNICODE=ON. I assume that I must now invoke SET UNICODE = OFF? Thanks, Bob Walker Surveys & Forecasts, LLC From: Jon K Peck [mailto:[hidden email]] That is a BOM - byte order mark, that indicates that the characters are encoded in Unicode UTF-8. If you open the file in, say, Notepad, you won't see that initial string, because it is meant to be displayed but is intended as information for the receiving app. IIRC, if you are not in Unicode mode, you won't get that prefix.
|
When you first launched V21, you were presented
with an alert that explained that Unicode was now the default setting and
referred to a help topic that went into more detail. You can revert
to code page mode by changing a preference in Edit > Options or you
can issue SET UNICODE OFF. Unicode is the character set used by most
major software now as it can handle any of the world's writing systems,
but there are still systems in use that do not understand it, and practice
is still evolving. Microsoft Office has been Unicode based for over
a decade. SPSS introduced Unicode support with version 16, and we
continue to refine system behavior in that mode.
HTH, Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Bob Walker <[hidden email]> To: [hidden email] Date: 10/03/2012 09:48 PM Subject: Re: [SPSSX-L] Odd Symbol Sent by: "SPSSX(r) Discussion" <[hidden email]> Thank you Jon, as it has caused quite a fuss for my client receiving that flat file! Pardon my ignorance, but (a) why has this suddenly started to occur, as I did not explicitly set characters to Unicode UTF-8, and thus the BOM is a new development, and (b) it appears that with V21, the default setting is UNICODE=ON. I assume that I must now invoke SET UNICODE = OFF? Thanks, Bob Walker Surveys & Forecasts, LLC www.safllc.com From: Jon K Peck [mailto:peck@...] Sent: Wednesday, October 03, 2012 11:29 PM To: Bob Walker Cc: [hidden email] Subject: Re: [SPSSX-L] Odd Symbol That is a BOM - byte order mark, that indicates that the characters are encoded in Unicode UTF-8. If you open the file in, say, Notepad, you won't see that initial string, because it is meant to be displayed but is intended as information for the receiving app. IIRC, if you are not in Unicode mode, you won't get that prefix. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM peck@... new phone: 720-342-5621 From: Bob Walker <rww@...> To: [hidden email] Date: 10/03/2012 08:45 PM Subject: [SPSSX-L] Odd Symbol Sent by: "SPSSX(r) Discussion" <[hidden email]> Dear Listers, I am running V21 on a 64-bit Win 7 machine, and running a monthly routine that produces a text file. For the first time, it now shows a weird symbol in the first column of output file. Here is the key syntax: WRITE OUTFILE='C:/SAF/SandF_Mkt_Share_District_data.dat' / PERIOD "," DISTRICT "," PACKID "," NETSHIP "," INVENTORY "," DISPENSED "," RETURNS "," PURCHASES "," CATEGORY "," CNAME.  1/2002 ,EA, 13, .00000, 64437.94683, 787.38559, .00000, .00000,1,CANINE 1/2002 ,EA, 15, 1238.59136, 106517.34469, 3935.47965, .00000, 1256.87826,1,CANINE 1/2002 ,EA, 16, 3830.48804, 90417.64838, 12591.98887, .00000, 3832.77252,1,CANINE For those of you seeing this as plain text, it might not be visible. Again, the routine has run without such an incident since inception. Many thanks in advance, Bob Walker Surveys & Forecasts, LLC www.safllc.com |
Free forum by Nabble | Edit this page |