bugPSPP - Bugs: bug #47253, syntax - DECIMAL=COMMA is not...

 
 

bug #47253: syntax - DECIMAL=COMMA is not honored DATA LIST command

Submitter:  Friedrich Beckmann <beckmanf>
Submitted:  Thu 25 Feb 2016 10:25:21 AM UTC
   
 
Category:  Syntax Parser Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  Before 0.10.0
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 01 Mar 2016 06:41:26 PM UTC, comment #5: 

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.

John Darrington <jmd>
Group administrator
Tue 01 Mar 2016 09:09:39 AM UTC, comment #4: 

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

Friedrich Beckmann <beckmanf>
Group Member
Tue 01 Mar 2016 08:30:38 AM UTC, comment #3: 

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.)

Friedrich Beckmann <beckmanf>
Group Member
Tue 01 Mar 2016 08:24:33 AM UTC, comment #2: 

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:


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.)


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.

Friedrich Beckmann <beckmanf>
Group Member
Sat 27 Feb 2016 11:06:16 PM UTC, comment #1: 

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.


Ben Pfaff <blp>
Group administrator
Thu 25 Feb 2016 10:25:21 AM UTC, original submission:  

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.



Friedrich Beckmann <beckmanf>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #36456:  0001-syntax-DECIMAL-COMMA-is-not-honored-in-DATA-LIST-com.patch added by beckmanf (2KiB - application/octet-stream - This is the corrected patch that was already proposed in bug #47139.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by jmd (Updated the item)
  • -email is unavailable- added by beckmanf (Submitted the item)
  •  

    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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-01 jmd StatusNone Fixed
        Open/ClosedOpen Closed
    2016-02-26 jmd ReleaseNone Before 0.10.0
    2016-02-25 beckmanf Attached File- Added 0001-syntax-DECIMAL-COMMA-is-not-honored-in-DATA-LIST-com.patch, #36456

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code