Date: Tue, 18 Oct 2005 07:51:36 -0500
Reply-To: "Peck, Jon" <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <email@example.com>
Subject: Re: R: Data Values Vs. Data Labels
Content-Type: text/plain; charset="us-ascii"
Value labels in SPSS 14 can be 120 bytes long (equivalent to 120 characters in western scripts). In prior versions, the limit is 60 bytes.
Even 120 bytes is pretty unwieldy for display purposes, though. As an alternative, you can use the new variable attributes to associate arbitrarily long strings with variables or data files. The new commands
support these assignments, which are saved with the data.
The values of these attributes are displayed via DISPLAY DICTIONARY, and they can be accessed programmatically with the new BEGIN PROGRAM capability.
At the SPSS Directions conference in November (http://www.spss.com/spssdirections), I will show a use of these to record the formula for a variable and to recalculate it programmatically to update the values for new data. The module for this can also be downloaded from the new SPSS Code Center
It requires the programmability support to be installed and, of course, SPSS 14.
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Luca Meyer
Sent: Tuesday, October 18, 2005 2:36 AM
Subject: [SPSSX-L] R: Data Values Vs. Data Labels
In SPSS 14 is the label lenght always limited to 255 chars? Or can be
somehow set to longer values?
Mr. Luca MEYER
Survey research, data analysis & more: http://www.lucameyer.com/
Tel: +390122854456 - Fax: +390122854837 - Mobile: + 393394950021
"If you can't feed a hundred people, then feed just one." - Mother Teresa -
> -----Messaggio originale-----
> Da: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] Per
> conto di Richard Ristow
> Inviato: sabato 15 ottobre 2005 8.31
> A: SPSSX-L@LISTSERV.UGA.EDU
> Oggetto: Re: Data Values Vs. Data Labels
> At 11:50 AM 10/13/2005, Peck, Jon wrote:
> >SPSS 14 to the rescue. It contains a new transformation function
> >Valuelabel(x) that returns the label for the current value of the
> >variable x.
> Yay! Hurray! Blessings! Wow! THANK YOU!
> >So you can easily create a new string variable containing
> the labels.
> >For example, string xlabel(a120).
> >compute xlabel = valuelabel(x).
> >The function returns an empty string if the value has no
> label, so if
> >there are unlabeled values, something like this would work: string
> >xlabel(a120). compute xlabel = valuelabel(x).
> >IF xlabel = '' xlabel = string(x, F8.2).
> >Jon Peck
> >SPSS, Inc.
> >-----Original Message-----
> >From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]
> On Behalf
> >Of Richard Ristow
> >Sent: Thursday, October 13, 2005 2:51 AM
> >To: SPSSX-L@LISTSERV.UGA.EDU
> >Subject: Re: [SPSSX-L] Data Values Vs. Data Labels
> >At 12:51 AM 10/13/2005, Bob Ingleby wrote:
> > >I have many large data files in SPSS *.sav files that I
> want to make
> > >available to MS Excel. I've noted in SPSS's 'Save Data As'
> > >functionality the ability to save the data as an Excel spreadsheet
> > and
> > >a checkbox to choose to save value 'labels' instead of data values.
> > >
> > >Given that the *.sav file contains the 'lookup' for data
> values and
> > >the respective labels, it would seem logical that there is
> a way to
> > >replace the data values with the data labels, but I haven't been
> > able
> > >to find it. Does it exist and if so, what is it?
> >I'm afraid that logic didn't win this one. I've griped,
> myself, because
> >there are other, even simpler, cases where you'd want to
> display value
> >labels rather than just the values: for example, LIST output.
> >A helpful step would be a format that would display a value as its
> >associated label. Use that format with the STRING function,
> and you're
> >pretty well there. What can I say? SPSS, Inc., didn't think it was a
> >good idea.
> > >The only method that I have to work around this problem is
> to write
> > >long, repetitive syntax to overwrite the data values with their
> > >respective data labels. This works but is a maintenance nightmare.
> > I'm
> > >looking for ways around this problem.
> >Here are two, both with drawbacks:
> >A. if you have the VALUE LABELS statement, not just the .SAV
> file, it's
> >pretty easy to edit it into a RECODE statement that will write the
> >associated labels to a new variable.
> >B. If you have SPSS 14, it sounds like there is much better access to
> >the data dictionary. You could probably generate the above RECODE
> >statements automatically.
> >Wish I could give you better. It would make sense...
> >-Good luck,
> > Richard Ristow
> > >If I had the technical specification of an SPSS *.sav file I could
> > >probably write a utility to parse the file and carry out the
> > >conversion. Does anyone have the technical specification
> for the SPSS
> > >*.sav
> > file.
> > >
> > >Any suggestions would be appreciated.
> > >
> > >Thanks in advance,
> > >
> > >Bob.