Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None Problem Fixed
So it seems that SPSS does remove the comma from the separator list when DECIMAL = COMMA.
I've therefore pushed this patch along with some documentation.
Fabian Zoltan tested this on SPSS. It seems that SPSS indeed honors the DECIMAL=COMMA setting and there is currently a discrepancy between pspp and spss.
======= Email on -email is unavailable- from 1.3.2016 =======
Please find below the output (SPSS v22). I have also attached the output of psppire 0.8.5.
Cheers, Zoltan
SET DECIMAL=COMMA. DATA LIST LIST /A *. BEGIN DATA 1 2 3 3,5 3 4 5 6,5 7 END DATA
LIST /FORMAT=NUMBERED.
List Notes Output Created 01-MAR-2016 09:53:04 Comments Input Filter <none> Weight <none> Split File <none> N of Rows in Working Data File 9 Syntax LIST /FORMAT=NUMBERED. Resources Processor Time 00:00:00,00 Elapsed Time 00:00:00,00
A
1 1,00 2 2,00 3 3,00 4 3,50 5 3,00 6 4,00 7 5,00 8 6,50 9 7,00
Number of cases read: 9 Number of cases listed: 9
The note from the manual was:
Note: For default numeric (F) format and scientific notation (E) format, the decimal indicator of the input data must match the IBM® SPSS® Statistics locale decimal indicator (period or comma). Use SHOW DECIMAL to display the current decimal indicator and SET DECIMAL to set the decimal indicator. (Comma and Dollar formats only recognize a period as the decimal indicator, and Dot format only recognizes the comma as the decimal indicator.)
Hi Ben,
thanks for looking into this. I do not have SPSS, so I cannot try and compare the behavior. The syntax you provided in comment #1 works for me, i.e. the 3,5 are read in without error message.
But I found the following:
http://www-01.ibm.com/support/knowledgecenter/#!/SSLVMB_20.0.0/com.ibm.spss.statistics.help/syn_data_list.htm
which says:
So from my understanding the DOT and COMMA formats define the decimal indicator already in the syntax, while the default notation uses the default indicator set by the locale or command. The DOT syntax would otherwise make no sense, right?
But maybe somebody with SPSS could try this.
I see the problem and why the patch fixes it.
However, I don't know what SPSS actually does. The documentation for DATA LIST LIST doesn't say that SET DECIMAL=COMMA causes commas to be ignored as separators. How does SPSS treat the syntax you provided? If it behaves the same as PSPP, then I think we should not apply the patch. Instead, we should document the behavior and suggest the use of quotation marks; for example, the following behaves as you probably expect:
SET DECIMAL=COMMA. DATA LIST LIST /A *. BEGIN DATA 1 2 3 "3,5" 3 4 5 "6,5" 7 END DATA LIST /FORMAT=NUMBERED.
When using a german locale or using explicit SET DECIMAL=COMMA, any numbers with a comma as decimal points like 3,5 are not read as decimal numbers with the DATA LIST command. Instead an error message is produced.
This bug was discussed in bug #47139 and also a patch was attached. This patch had some syntax errors, but the idea fixed this bug. I will attach the corrected patch.
To see the problem use:
SET DECIMAL=COMMA. DATA LIST LIST /A *. BEGIN DATA 1 2 3 3,5 3 4 5 6,5 7 END DATA LIST /FORMAT=NUMBERED.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9