bugPSPP - Bugs: bug #41863, "Only" the first 255 of...


bug #41863: "Only" the first 255 of 256 characters of a variable label are read by pspp

Submitter:  Andre Müller <andrem>
Submitted:  Thu 13 Mar 2014 05:22:02 PM UTC
Category:  System/Portable File I/O Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Thu 20 Mar 2014 12:29:50 PM UTC, comment #7: 

Yep, the fresh build does the job smoothly.
So, now this is properly fixed.

Andre Müller <andrem>
Wed 19 Mar 2014 03:51:14 AM UTC, comment #6: 

> I tried the current nightly build
> and it still cuts the variable labels after 255 characters,
> so I can see no change.

Foolishly, I made the change without testing it, so of course it didn't work ;-)

I've now tested it with ZA4813.sav, found the problem, and fixed it.  Please try tomorrow morning's build.

Ben Pfaff <blp>
Group administrator
Tue 18 Mar 2014 01:56:29 PM UTC, comment #5: 

I tried the current nightly build
and it still cuts the variable labels after 255 characters,
so I can see no change.

Is the fix supposed to be in there?
I tried both exporting to .csv and viewing the data in psppire.

Andre Müller <andrem>
Mon 17 Mar 2014 01:40:59 PM UTC, comment #4: 

Thanks a lot, I will try this out.

I also found the 256 chars strange, given
a 255 byte limit, but that's not the first
off by one error I found in SPSS docs vs. reality.

Now, for the way longer label (as in 327 chars),
I do suspect the rather crude unicode handling
(and a missing check) may be responsible for
this. I remember reading that for unicode,
SPSS triples all field lengths.
This may lead to accepting entries well beyond
the spec.

Andre Müller <andrem>
Sun 16 Mar 2014 05:23:46 PM UTC, comment #3: 

I checked in a patch that enables longer labels.

Ben Pfaff <blp>
Group administrator
Sun 16 Mar 2014 04:39:14 PM UTC, comment #2: 

The SPSS 22 manual says that variable labels have a 255-byte limit, which is why I've previously resisted increasing the limit.  But since you say you have a file with 327-byte labels, I guess that I can increase it.

Ben Pfaff <blp>
Group administrator
Fri 14 Mar 2014 02:43:06 PM UTC, comment #1: 

I should amend this:
I found a more recent dataset,
and more recent SPSS versions can carry more than
256 characters in a label, I found up to 327 characters used.

The pspp export cuts these after 255 characters as well.
So that does not really look like an off by one error
after all.

So to rephrase:
PSPP uses only the first 255 characters
of a value label. Quite often, the value labels are longer;
SPSS used to have a 256 character limit, but that has been
increased since. It would be nice if PSPP could handle >255 characters.

Andre Müller <andrem>
Thu 13 Mar 2014 05:22:02 PM UTC, original submission:  

PSPP only reads 255 characters of a variable label from sav files.
The label can be up to 256 characters long.
So, this smells like an off by one error.
I found half a dozen instances of this, so this behaviour
looks consistent at a glance.

The character misses both looking at the entry in the psppire gui and the "DISPLAY DICTIONARY" output.

An example dataset is here (needs registration):

The entry maxing out is in variable d4a (index 65).

Andre Müller <andrem>


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

Attach Files:

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 (Posted a comment)
  • -email is unavailable- added by andrem (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-16 blp StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-e652.
    Corresponding source code