bugPSPP - Bugs: bug #30705, Decimal point and locale bugs in...

 
 

bug #30705: Decimal point and locale bugs in data parsing

Submitter:  Ben Pfaff <blp>
Submitted:  Sun 08 Aug 2010 10:28:36 PM UTC
   
 
Category:  Syntax Parser Severity:  5 - Average
Status:  Invalid Assigned to:  None
Open/Closed:  Closed Release:  Before 0.8.0
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Nov 2012 05:44:13 AM UTC, comment #1: 

I think that this is behaving as it should, even if the behavior is confusing.

In pt_BR.utf8, the default decimal point is a comma.  That explains the errors for 10.3 and 10.2.

However, the DATA LIST default freefield delimiter is always a comma, regardless of whether the decimal point is a dot or a comma.  This means that 10,3 10,2 is four fields, not two.  To get two fields, you need quotation marks: "10,3" "10,2".

I don't think there's a bug here, but if SPSS behaves differently then please explain what it does and reopen the bug.

Ben Pfaff <blp>
Group administrator
Sun 08 Aug 2010 10:28:36 PM UTC, original submission:  

From: Michel Boaventura <michel@michelboaventura.com>

> The bellow syntax, from npar-sign, is behaving in a strange way.
>
> For instance, if I run: pspp syntax.sps, I get:
>
> test.sps:10: aviso: (colunas 1-0, F campo)Número seguido por
> lixo. (warning,number followed by garbage)
> test.sps:10: aviso: (colunas 6-5, F campo)Número seguido por
> lixo. (warning,number followed by garbage)
>
> The default locale on my GNU/Linux is pt_BR.utf8. If I change it to
> only pt_BR or remove the
> "set format = F9.3", everything works fine.
>
> syntax:
>
> set format = F9.3.
>
> data list notable list /age height rank .
> begin data.
> 10 12 11
> 12 13 13
> 13 14 12
> 12 12 10
> 9   9 10
> 10.3 10.2 12
> end data.


From: John Darrington <john@darrington.wattle.id.au>

> I can confirm similar behaviour.   However if I add "SET DECIMAL=DOT." to
> the topy of the syntex, then i works ok.
> However, when I change the "."s to ","s in the BEGIN DATA block, the numbers
> don't get parsed, contrary to what I would have expected.


Ben Pfaff <blp>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Submitted the item)
  • -email is unavailable- added by blp (reporter)
  •  

    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
    2012-11-27 blp StatusNone Invalid
        Open/ClosedOpen Closed
    2011-05-14 blp ReleaseNone Before 0.8.0
    2010-08-08 blp Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code