RECODE Variable Value Labels

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

RECODE Variable Value Labels

Joseph A Youngblood
Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Jon K Peck
I am baffled by your question.  What do you mean by "recoding or renaming variable value labels"?

If you are looking for a way to select variables based on their metadata properties, there are ways to do that, but we need first to know more about what you want to accomplish.
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Joseph A Youngblood <[hidden email]>
To:        [hidden email],
Date:        03/30/2013 03:52 PM
Subject:        [SPSSX-L] RECODE Variable Value Labels
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Joseph A Youngblood

Sorry for the confusion.  I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc).   Below is a short section of syntax I have been writing but this is for only 19 variables.  The entire syntax string will be incredibly long.  I was wondering whether there was another way to name all  variables that have identical values, see above.

 

In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.

 

VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow

    W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe

    W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'

3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.

 

Regards,

 

Joseph A. Youngblood

Director of Research

 

 

From: Jon K Peck [mailto:[hidden email]]
Sent: Saturday, March 30, 2013 3:20 PM
To: Joseph A Youngblood
Cc: [hidden email]
Subject: Re: [SPSSX-L] RECODE Variable Value Labels

 

I am baffled by your question.  What do you mean by "recoding or renaming variable value labels"?

If you are looking for a way to select variables based on their metadata properties, there are ways to do that, but we need first to know more about what you want to accomplish.
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Joseph A Youngblood <[hidden email]>
To:        [hidden email],
Date:        03/30/2013 03:52 PM
Subject:        [SPSSX-L] RECODE Variable Value Labels
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Jon K Peck
If all you want to do is to examine the text of each value label and make substitutions, this is easy to do with a small Python program.  It could loop over all the variables, inspect the value label specifications and do what you want.  If you want to go this way, you need to install the Python Essentials from the  SPSS Community website (www.ibm.com/developerworks/spssdevcentral), and I can  help you with the code.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        "Joseph A. Youngblood" <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS,
Cc:        <[hidden email]>
Date:        03/30/2013 04:30 PM
Subject:        RE: [SPSSX-L] RECODE Variable Value Labels




Sorry for the confusion.  I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc).   Below is a short section of syntax I have been writing but this is for only 19 variables.  The entire syntax string will be incredibly long.  I was wondering whether there was another way to name all  variables that have identical values, see above.
 
In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.
 
VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow
    W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe
    W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'
3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.
 
Regards,
 
Joseph A. Youngblood
Director of Research
 
 
From: Jon K Peck [mailto:peck@...]
Sent:
Saturday, March 30, 2013 3:20 PM
To:
Joseph A Youngblood
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] RECODE Variable Value Labels

 
I am baffled by your question.  What do you mean by "recoding or renaming variable value labels"?

If you are looking for a way to select variables based on their metadata properties, there are ways to do that, but we need first to know more about what you want to accomplish.
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM

peck@...
phone: 720-342-5621





From:        
Joseph A Youngblood <Joseph.youngblood@...>
To:        
[hidden email],
Date:        
03/30/2013 03:52 PM
Subject:        
[SPSSX-L] RECODE Variable Value Labels
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>





Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to

LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Jarrod Teo-2
In reply to this post by Joseph A Youngblood
Hi Joseph,

I am resending the email just in case you dont received it.

Warmest Regards
Jarrod Teo
(Also known as Dorraj Oet)


From: [hidden email]
To: [hidden email]; [hidden email]
Subject: RE: RECODE Variable Value Labels
Date: Sun, 31 Mar 2013 05:47:08 +0000

Hi Joseph,

Do you know SPSS macro?

I had this problem before so this is what I do. I built a macro for value label. This means that whenever I call the !dowork macro, it will do a value label for me. !1 is a blank space in the macro so that I can choose to fill that up later.

**********Start of SPSS Command************.

*Macro body.

define !dowork (!pos !token(1)).

val lab !1 '1' 'Extremely Unimportant' 
'2' 'Somewhat Unimportant'

'3' 'Unimportant' 

'4' 'Neither Unimportant nor Important' 

'5' 'Somewhat Important' 

'6' 'Important' 

'7' 'Extremely Important'.


!enddefine.

***Macro call***.

!dowork W1CFaithImage.
!dowork W1ImpBUnique.

**********End of SPSS Command************.

Now if you think that you will need to do a lot of typing, just copy the whole list of variables from SPSS variable view and do a concatenation in excel to form the !dowork W1CFaithImage. 

I had attached a sample for you to have a look. 

Please note that I have no access to SPSS so I cant test out the macro so I hope this helps.

Warmest Regards
Jarrod Teo
(Also Known as Dorraj Oet)


Date: Sat, 30 Mar 2013 15:28:38 -0700
From: [hidden email]
Subject: Re: RECODE Variable Value Labels
To: [hidden email]

Sorry for the confusion.  I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc).   Below is a short section of syntax I have been writing but this is for only 19 variables.  The entire syntax string will be incredibly long.  I was wondering whether there was another way to name all  variables that have identical values, see above.

 

In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.

 

VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow

    W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe

    W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'

3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.

 

Regards,

 

Joseph A. Youngblood

Director of Research

 

 

From: Jon K Peck [mailto:[hidden email]]
Sent: Saturday, March 30, 2013 3:20 PM
To: Joseph A Youngblood
Cc: [hidden email]
Subject: Re: [SPSSX-L] RECODE Variable Value Labels

 

I am baffled by your question.  What do you mean by "recoding or renaming variable value labels"?

If you are looking for a way to select variables based on their metadata properties, there are ways to do that, but we need first to know more about what you want to accomplish.
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Joseph A Youngblood <[hidden email]>
To:        [hidden email],
Date:        03/30/2013 03:52 PM
Subject:        [SPSSX-L] RECODE Variable Value Labels
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Art Kendall
In reply to this post by Joseph A Youngblood
Are you trying to "reflect" some of the items in a summative scale? 
Art Kendall
Social Research Consultants
On 3/30/2013 6:31 PM, Joseph A Youngblood [via SPSSX Discussion] wrote:

Sorry for the confusion.  I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc).   Below is a short section of syntax I have been writing but this is for only 19 variables.  The entire syntax string will be incredibly long.  I was wondering whether there was another way to name all  variables that have identical values, see above.

 

In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.

 

VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow

    W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe

    W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'

3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.

 

Regards,

 

Joseph A. Youngblood

Director of Research

 

 

From: Jon K Peck [mailto:[hidden email]]
Sent: Saturday, March 30, 2013 3:20 PM
To: Joseph A Youngblood
Cc: [hidden email]
Subject: Re: [SPSSX-L] RECODE Variable Value Labels

 

I am baffled by your question.  What do you mean by "recoding or renaming variable value labels"?

If you are looking for a way to select variables based on their metadata properties, there are ways to do that, but we need first to know more about what you want to accomplish.
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Joseph A Youngblood <[hidden email]>
To:        [hidden email],
Date:        03/30/2013 03:52 PM
Subject:        [SPSSX-L] RECODE Variable Value Labels
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi Everyone,

Is there an efficient method for recoding or renaming variable value labels,
perhaps by identifying all VARs that meet criteria for recode rather than
identifying each variable, or range of variables?  The dataset has nearly 1800
variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
VAR30) (VAR63 TO VAR124) etc.

Thank you,

Joseph Youngblood
Director of Research
SSI

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD




If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/RECODE-Variable-Value-Labels-tp5719204p5719206.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

Albert-Jan Roskam
Hi,

Maybe this is too obvious, but are you aware of the TO convention? Provided that the (thousands of) variables are contiguous, this:


VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow
� � � � W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe
� � � � W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'
3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.


... could be written as:


VALUE LABELS W1CFaithImage TO W1HappyChildhd

�  1 'Extremely Unimportant'

�  2 'Somewhat Unimportant'
�  3 'Unimportant'

�  4 'Neither Unimportant nor Important'

�  5 'Somewhat Important'

�  6 'Important'

�  7 'Extremely Important'.

or if that does not work, you could use Python to "recode" value labels (untested):

import spssaux
for v in spssaux.VariableDict():
� � �  newValueLabels = {}
� � �  for value, label in v.ValueLabels.items():
� � � � � � �  if " important" in label.lower():
� � � � � � � � � � �  label = " unimportant"
� � � � � � �  else:
� � � � � � � � � � �  label = "big time important"
� � � � � � �  newValueLabels[value] = label
� � �  v.ValueLabels = newValueLabels

� Regards,
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a
fresh water system, and public health, what have the Romans ever done for us?



>________________________________
> From: Art Kendall <[hidden email]>
>To: [hidden email]
>Sent: Sunday, March 31, 2013 6:31 PM
>Subject: Re: [SPSSX-L] RECODE Variable Value Labels
>
>
>Are you trying to "reflect" some of the items in a summative scale?�
>
>Art Kendall
Social Research Consultants
On 3/30/2013 6:31 PM, Joseph A Youngblood [via SPSSX Discussion] wrote:

>
>Sorry for the confusion.�  I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc). � � Below is a short section of syntax I have been writing but this is for only 19 variables.�  The entire syntax string will be incredibly long.�  I was wondering whether there was another way to name all � variables that have identical values, see above.
>>�
>>In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.
>>�
>>VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow
>>� � � � W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe
>>� � � � W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'
>>3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.
>>�
>>Regards,
>>�
>>Joseph A. Youngblood
>>Director of Research
>>�
>>�
>>From:Jon K Peck [mailto:[hidden email]]
>>Sent: Saturday, March 30, 2013 3:20 PM
>>To: Joseph A Youngblood
>>Cc: [hidden email]
>>Subject: Re: [SPSSX-L] RECODE Variable Value Labels
>>�
>>I am baffled by your question. � What do you mean by "recoding or renaming variable value labels"?
>>
>>If you are looking for a way to select variables based on
� � � � � � � � � � � � their metadata properties, there are ways to do that, but we
� � � � � � � � � � � � need first to know more about what you want to accomplish.

>>Jon Peck (no "h") aka Kim
>>Senior Software Engineer, IBM
>>[hidden email]
>>phone: 720-342-5621
>>
>>
>>
>>
>>From: �  �  �  � Joseph A Youngblood <[hidden email]>
>>To: �  �  �  � [hidden email],
>>Date: �  �  �  � 03/30/2013 03:52 PM
>>Subject: �  �  �  � [SPSSX-L] RECODE Variable Value Labels
>>Sent by: �  �  �  � "SPSSX(r) Discussion" <[hidden email]>
>>
>>________________________________
>>
>>
>>
>>
>>Hi Everyone,
>>
>>Is there an efficient method for recoding or renaming variable value labels,
>>perhaps by identifying all VARs that meet criteria for recode rather than
>>identifying each variable, or range of variables? � The dataset has nearly 1800
>>variables, the synatax is rediculuously long, even using range e.g. )VAR1 TO
>>VAR30) (VAR63 TO VAR124) etc.
>>
>>Thank you,
>>
>>Joseph Youngblood
>>Director of Research
>>SSI
>>
>>=====================
>>To manage your subscription to SPSSX-L, send a message to
>>[hidden email] (not to SPSSX-L), with no body text except the
>>command. To leave the list, send the command
>>SIGNOFF SPSSX-L
>>For a list of commands to manage subscriptions, send the command
>>INFO REFCARD
>>
>>
>>
>>>>________________________________
>>
>>If you reply to this email, your message will be added to the discussion below:http://spssx-discussion.1045642.n5.nabble.com/RECODE-Variable-Value-Labels-tp5719204p5719206.html
>>To start a new topic under SPSSX Discussion, email [hidden email]
>>To unsubscribe from SPSSX Discussion, click here.
>>NAML
>
>Art Kendall
>Social Research Consultants
>>________________________________
> View this message in context: Re: RECODE Variable Value Labels
>Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
>
>� ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: RECODE Variable Value Labels

ViAnn Beadle
Another thought is to use the paste button from the Variables window (Utilities>Variables) to paste the variable names in the VALUE LABELS syntax.  You can see the current variable and value labels while moving through the list of variables (using cursor keys) in the file to find sets of those you want to relabel.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Albert-Jan Roskam
Sent: Monday, April 01, 2013 11:40 AM
To: [hidden email]
Subject: Re: RECODE Variable Value Labels

Hi,

Maybe this is too obvious, but are you aware of the TO convention? Provided that the (thousands of) variables are contiguous, this:


VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow         W1ImpActPotent W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe         W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'
3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.


... could be written as:


VALUE LABELS W1CFaithImage TO W1HappyChildhd

   1 'Extremely Unimportant'

   2 'Somewhat Unimportant'
   3 'Unimportant'

   4 'Neither Unimportant nor Important'

   5 'Somewhat Important'

   6 'Important'

   7 'Extremely Important'.

or if that does not work, you could use Python to "recode" value labels (untested):

import spssaux
for v in spssaux.VariableDict():
       newValueLabels = {}
       for value, label in v.ValueLabels.items():
               if " important" in label.lower():
                       label = " unimportant"
               else:
                       label = "big time important"
               newValueLabels[value] = label        v.ValueLabels = newValueLabels     Regards, Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?



>________________________________
> From: Art Kendall <[hidden email]>
>To: [hidden email]
>Sent: Sunday, March 31, 2013 6:31 PM
>Subject: Re: [SPSSX-L] RECODE Variable Value Labels
>
>
>Are you trying to "reflect" some of the items in a summative scale?
>
>Art Kendall
Social Research Consultants
On 3/30/2013 6:31 PM, Joseph A Youngblood [via SPSSX Discussion] wrote:

>
>Sorry for the confusion.   I have nearly 1000 variables that I need to change the value labels (i.e., 1 = Extremely Important, 2 = Somewhat Important etc).     Below is a short section of syntax I have been writing but this is for only 19 variables.   The entire syntax string will be incredibly long.   I was wondering whether there was another way to name all   variables that have identical values, see above.
>>
>>In other words, is the a command or syntax that I can stipulate something to the effect of, if variable value label is “1=Extremely Important” change to “1= Extremely Unimportant”.
>>
>>VALUE LABELS W1CFaithImage W1ImpBUnique W1ImpStandOut W1ImpRecogOt
>>W1ImpRecogSe W1ImpCultPSty W1ImpNvrFollow         W1ImpActPotent
>>W1ImpHvUnqExp W1ImpofTravel W1ImpHvTech W1ImpGetMyW W1ImpBeRight W1ImpRespctMe         W1ImpResptRgts W1ImpBeControl W1ImpMkMisPub W1ImpBgMisPvt W1HappyChildhd 1 'Extremely Unimportant' 2 'Somewhat Unimportant'
>>3 'Unimportant' 4 'Neither Unimportant nor Important' 5 'Somewhat Important' 6 'Important' 7 'Extremely Important'.
>>
>>Regards,
>>
>>Joseph A. Youngblood
>>Director of Research
>>
>>
>>From:Jon K Peck [mailto:[hidden email]]
>>Sent: Saturday, March 30, 2013 3:20 PM
>>To: Joseph A Youngblood
>>Cc: [hidden email]
>>Subject: Re: [SPSSX-L] RECODE Variable Value Labels   I am baffled by
>>your question.   What do you mean by "recoding or renaming variable value labels"?
>>
>>If you are looking for a way to select variables based on
                        their metadata properties, there are ways to do that, but we                         need first to know more about what you want to accomplish.

>>Jon Peck (no "h") aka Kim
>>Senior Software Engineer, IBM
>>[hidden email]
>>phone: 720-342-5621
>>
>>
>>
>>
>>From:            Joseph A Youngblood <[hidden email]>
>>To:            [hidden email],
>>Date:            03/30/2013 03:52 PM
>>Subject:            [SPSSX-L] RECODE Variable Value Labels Sent by:
>>        "SPSSX(r) Discussion" <[hidden email]>
>>
>>________________________________
>>
>>
>>
>>
>>Hi Everyone,
>>
>>Is there an efficient method for recoding or renaming variable value
>>labels, perhaps by identifying all VARs that meet criteria for recode
>>rather than identifying each variable, or range of variables?   The
>>dataset has nearly 1800 variables, the synatax is rediculuously long,
>>even using range e.g. )VAR1 TO
>>VAR30) (VAR63 TO VAR124) etc.
>>
>>Thank you,
>>
>>Joseph Youngblood
>>Director of Research
>>SSI
>>
>>=====================
>>To manage your subscription to SPSSX-L, send a message to [hidden
>>email] (not to SPSSX-L), with no body text except the command. To
>>leave the list, send the command SIGNOFF SPSSX-L For a list of
>>commands to manage subscriptions, send the command INFO REFCARD
>>
>>
>>
>>>>________________________________
>>
>>If you reply to this email, your message will be added to the
>>discussion
>>below:http://spssx-discussion.1045642.n5.nabble.com/RECODE-Variable-Va
>>lue-Labels-tp5719204p5719206.html
>>To start a new topic under SPSSX Discussion, email [hidden email] To
>>unsubscribe from SPSSX Discussion, click here.
>>NAML
>
>Art Kendall
>Social Research Consultants
>>________________________________
> View this message in context: Re: RECODE Variable Value Labels Sent
>from the SPSSX Discussion mailing list archive at Nabble.com.
>
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD