Creating New Value Labels that Include Variable Name from List

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Creating New Value Labels that Include Variable Name from List

cco14
Hello,

  I’m attempting to write syntax in SPSS that will give new value labels to
a list of about 70 variables in the following format:

Value Labels
*variable*
0 ‘No_*variable name*’
1 ‘Yes_*variable name*’

I’m doing this because I later create a custom table of frequencies that I
then do an OMS Export with and these value labels will later become variable
names. I’m sure this is possible, I just don’t have the skills to figure it
out.

This is my sad attempt which is definitely not working as is:

Define !renameValues (vlist = !charend('/'))
!do !var !in (!vlist)
!let !nolabel = !concat("No_", !var)
!let  !yeslabel = !concat("Yes_", !var)
value labels
!var
0 !quote(!nolabel)
1 !quote(!yeslabel)
!doend
!enddefine.
!renameValues vlist = !variables.

(!variables is a pre-defined list I created using a SPSSINC SELECT VARIABLES
and a pattern search.)

Any help would be so appreciated!





--
Sent from: http://spssx-discussion.1045642.n5.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