Quantcast

How to change variable names in SPSS if you have many variables

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to change variable names in SPSS if you have many variables

Juris Breidaks
I wanted to write one macros which can change variable names so variable
name

Now variables                     Variables after macros
ievedums_pvn_2004M06              ievedums_1
ievedums_pvn_2004M07              ievedums_2
ievedums_pvn_2004M08              ievedums_3
ievedums_pvn_2004M09              ievedums_4
ievedums_pvn_2004M10              ievedums_5
ievedums_pvn_2004M11              ievedums_6
ievedums_pvn_2004M12              ievedums_7

ievedums_pvn_2005M01              ievedums_8
ievedums_pvn_2005M02              ievedums_9
ievedums_pvn_2005M03              ievedums_10
ievedums_pvn_2005M04              ievedums_11
ievedums_pvn_2005M05              ievedums_12
ievedums_pvn_2005M06              ievedums_13
ievedums_pvn_2005M07              ievedums_14
ievedums_pvn_2005M08              ievedums_15
ievedums_pvn_2005M09              ievedums_16
ievedums_pvn_2005M10              ievedums_17
ievedums_pvn_2005M11              ievedums_18
ievedums_pvn_2005M12              ievedums_19

ievedums_pvn_2006M01              ievedums_20
ievedums_pvn_2006M02              ievedums_21
ievedums_pvn_2006M03              ievedums_22
ievedums_pvn_2006M04              ievedums_23
ievedums_pvn_2006M05              ievedums_24
ievedums_pvn_2006M06              ievedums_25
ievedums_pvn_2006M07              ievedums_26
ievedums_pvn_2006M08              ievedums_27
ievedums_pvn_2006M09              ievedums_28
ievedums_pvn_2006M10              ievedums_29
ievedums_pvn_2006M11              ievedums_30
ievedums_pvn_2006M12              ievedums_31

ievedums_pvn_2007M01              ievedums_32
ievedums_pvn_2007M02              ievedums_33
ievedums_pvn_2007M03              ievedums_34
ievedums_pvn_2007M04              ievedums_35
ievedums_pvn_2007M05              ievedums_36
ievedums_pvn_2007M06              ievedums_37
ievedums_pvn_2007M07              ievedums_38
ievedums_pvn_2007M08              ievedums_39
ievedums_pvn_2007M09              ievedums_40
ievedums_pvn_2007M10              ievedums_41
ievedums_pvn_2007M11              ievedums_42
ievedums_pvn_2007M12              ievedums_43

ievedums_pvn_2008M01              ievedums_44
ievedums_pvn_2008M02              ievedums_45
ievedums_pvn_2008M03              ievedums_46
ievedums_pvn_2008M04              ievedums_47
ievedums_pvn_2008M05              ievedums_48
ievedums_pvn_2008M06              ievedums_49
ievedums_pvn_2008M07              ievedums_50
ievedums_pvn_2008M08              ievedums_51
ievedums_pvn_2008M09              ievedums_52
ievedums_pvn_2008M10              ievedums_53
ievedums_pvn_2008M11              ievedums_54
ievedums_pvn_2008M12              ievedums_55

=====================
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
|  
Report Content as Inappropriate

Re: How to change variable names in SPSS if you have many variables

Jason Burke
Try:

RENAME VARIABLES (ievedums_pvn_2004M06 TO ievedums_pvn_2008M12  =
ievedums_1 TO ievedums_55) .

This assumes that the variables that you wish to rename are contiguous
(next to one another).

HTH,


Jason


On Tue, Jan 6, 2009 at 9:35 PM, Juris Breidaks
<[hidden email]> wrote:

> I wanted to write one macros which can change variable names so variable
> name
>
> Now variables                     Variables after macros
> ievedums_pvn_2004M06              ievedums_1
> ievedums_pvn_2004M07              ievedums_2
> ievedums_pvn_2004M08              ievedums_3
> ievedums_pvn_2004M09              ievedums_4
> ievedums_pvn_2004M10              ievedums_5
> ievedums_pvn_2004M11              ievedums_6
> ievedums_pvn_2004M12              ievedums_7
>
> ievedums_pvn_2005M01              ievedums_8
> ievedums_pvn_2005M02              ievedums_9
> ievedums_pvn_2005M03              ievedums_10
> ievedums_pvn_2005M04              ievedums_11
> ievedums_pvn_2005M05              ievedums_12
> ievedums_pvn_2005M06              ievedums_13
> ievedums_pvn_2005M07              ievedums_14
> ievedums_pvn_2005M08              ievedums_15
> ievedums_pvn_2005M09              ievedums_16
> ievedums_pvn_2005M10              ievedums_17
> ievedums_pvn_2005M11              ievedums_18
> ievedums_pvn_2005M12              ievedums_19
>
> ievedums_pvn_2006M01              ievedums_20
> ievedums_pvn_2006M02              ievedums_21
> ievedums_pvn_2006M03              ievedums_22
> ievedums_pvn_2006M04              ievedums_23
> ievedums_pvn_2006M05              ievedums_24
> ievedums_pvn_2006M06              ievedums_25
> ievedums_pvn_2006M07              ievedums_26
> ievedums_pvn_2006M08              ievedums_27
> ievedums_pvn_2006M09              ievedums_28
> ievedums_pvn_2006M10              ievedums_29
> ievedums_pvn_2006M11              ievedums_30
> ievedums_pvn_2006M12              ievedums_31
>
> ievedums_pvn_2007M01              ievedums_32
> ievedums_pvn_2007M02              ievedums_33
> ievedums_pvn_2007M03              ievedums_34
> ievedums_pvn_2007M04              ievedums_35
> ievedums_pvn_2007M05              ievedums_36
> ievedums_pvn_2007M06              ievedums_37
> ievedums_pvn_2007M07              ievedums_38
> ievedums_pvn_2007M08              ievedums_39
> ievedums_pvn_2007M09              ievedums_40
> ievedums_pvn_2007M10              ievedums_41
> ievedums_pvn_2007M11              ievedums_42
> ievedums_pvn_2007M12              ievedums_43
>
> ievedums_pvn_2008M01              ievedums_44
> ievedums_pvn_2008M02              ievedums_45
> ievedums_pvn_2008M03              ievedums_46
> ievedums_pvn_2008M04              ievedums_47
> ievedums_pvn_2008M05              ievedums_48
> ievedums_pvn_2008M06              ievedums_49
> ievedums_pvn_2008M07              ievedums_50
> ievedums_pvn_2008M08              ievedums_51
> ievedums_pvn_2008M09              ievedums_52
> ievedums_pvn_2008M10              ievedums_53
> ievedums_pvn_2008M11              ievedums_54
> ievedums_pvn_2008M12              ievedums_55
>
> =====================
> 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
Loading...