How to rename variables names automatically?

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

How to rename variables names automatically?

88videos
Hello,

After some analysis I have 500 variables.

It looks like this. Data for example.

INPUT PROGRAM.
loop #i=1 to 500.
compute id=#i.
end case.
 end loop.
end file.
END INPUT PROGRAM.
execute.
dataset name example.

dataset activate example.

do repeat i=@1 to @500.
compute i=RV.UNIFORM(1, 10).
end repeat.
EXECUTE.


I want to rename their names., but in command 'rename variables' i can't use 'to'.
This command will cause error
Rename variables
@1 to v500=var1 to var500.

I don 't want to use CTRL+F to find every '@' and replace it with 'var'.

 How to do this?

Thank you in advance.
 








Wolny od wirusów. www.avast.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: How to rename variables names automatically?

Jon Peck
This will work.  Added parentheses and corrected left-hand-side typo.

Rename variables
(@1 to @500=var1 to var500).

On Mon, Jun 19, 2017 at 11:15 AM, 88Videoclips . <[hidden email]> wrote:
Hello,

After some analysis I have 500 variables.

It looks like this. Data for example.

INPUT PROGRAM.
loop #i=1 to 500.
compute id=#i.
end case.
 end loop.
end file.
END INPUT PROGRAM.
execute.
dataset name example.

dataset activate example.

do repeat i=@1 to @500.
compute i=RV.UNIFORM(1, 10).
end repeat.
EXECUTE.


I want to rename their names., but in command 'rename variables' i can't use 'to'.
This command will cause error
Rename variables
@1 to v500=var1 to var500.

I don 't want to use CTRL+F to find every '@' and replace it with 'var'.

 How to do this?

Thank you in advance.
 








Wolny od wirusów. www.avast.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



--
Jon K Peck
[hidden email]

===================== 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: How to rename variables names automatically?

Rick Oliver

The command syntax reference show the parentheses as required elements in the syntax chart but the overview does not indicate the parentheses are required. A little experimentation suggests that the parentheses are required if you are specifying a list of variables to rename, with or without using TO.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, June 19, 2017 12:27 PM
To: [hidden email]
Subject: Re: How to rename variables names automatically?

 

This will work.  Added parentheses and corrected left-hand-side typo.

 

Rename variables

(@1 to @500=var1 to var500).

 

On Mon, Jun 19, 2017 at 11:15 AM, 88Videoclips . <[hidden email]> wrote:

Hello,

After some analysis I have 500 variables.


It looks like this. Data for example.

INPUT PROGRAM.
loop #i=1 to 500.
compute id=#i.
end case.
 end loop.
end file.
END INPUT PROGRAM.
execute.
dataset name example.

dataset activate example.

do repeat i=@1 to @500.
compute i=RV.UNIFORM(1, 10).
end repeat.
EXECUTE.


I want to rename their names., but in command 'rename variables' i can't use 'to'.

This command will cause error

Rename variables

@1 to v500=var1 to var500.

I don 't want to use CTRL+F to find every '@' and replace it with 'var'.

 How to do this?

Thank you in advance.
 



 

 

 

https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif

Wolny od wirusów. www.avast.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



 

--

Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: How to rename variables names automatically?

David Marso
Administrator
In reply to this post by 88videos
Why not just use var1 to var500 in the DO REPEAT rather than @1 to @500?
You say "After some analysis I have 500 variables.".
Is there something relevant about the post state of affairs "after some analysis" which you are omitting?
---
88videos wrote
Hello,

After some analysis I have 500 variables.

It looks like this. Data for example.

INPUT PROGRAM.
loop #i=1 to 500.
compute id=#i.
end case.
 end loop.
end file.
END INPUT PROGRAM.
execute.
dataset name example.

dataset activate example.

do repeat i=@1 to @500.
compute i=RV.UNIFORM(1, 10).
end repeat.
EXECUTE.


I want to rename their names., but in command 'rename variables' i can't
use 'to'.
This command will cause error
Rename variables
@1 to v500=var1 to var500.

I don 't want to use CTRL+F to find every '@' and replace it with 'var'.

 How to do this?

Thank you in advance.









<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Wolny
od wirusów. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: How to rename variables names automatically?

88videos
In reply to this post by Jon Peck
Jon Peck, Rich Olivier

thanks:) That was easier than I thought.

 

2017-06-19 19:26 GMT+02:00 Jon Peck <[hidden email]>:
This will work.  Added parentheses and corrected left-hand-side typo.

Rename variables
(@1 to @500=var1 to var500).

On Mon, Jun 19, 2017 at 11:15 AM, 88Videoclips . <[hidden email]> wrote:
Hello,

After some analysis I have 500 variables.

It looks like this. Data for example.

INPUT PROGRAM.
loop #i=1 to 500.
compute id=#i.
end case.
 end loop.
end file.
END INPUT PROGRAM.
execute.
dataset name example.

dataset activate example.

do repeat i=@1 to @500.
compute i=RV.UNIFORM(1, 10).
end repeat.
EXECUTE.


I want to rename their names., but in command 'rename variables' i can't use 'to'.
This command will cause error
Rename variables
@1 to v500=var1 to var500.

I don 't want to use CTRL+F to find every '@' and replace it with 'var'.

 How to do this?

Thank you in advance.
 








Wolny od wirusów. www.avast.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



--
Jon K Peck
[hidden email]


===================== 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: How to rename variables names automatically?

John F Hall
In reply to this post by 88videos
Just an afterthought: you can always highlight the name column and use ctrl+H to replace all the @ in one pass.
John F Hall [Retired academic survey researcher]

Website:    Journeys in Survey Research
        http://surveyresearch.weebly.com/ 
Teaching:      Survey Analysis Workshop
        http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html   
Research:  Subjective Social Indicators (Quality of Life)
        http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html 



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso
Sent: 19 June 2017 23:23
To: [hidden email]
Subject: Re: How to rename variables names automatically?

Why not just use var1 to var500 in the DO REPEAT rather than @1 to @500?
You say "After some analysis I have 500 variables.".
Is there something relevant about the post state of affairs "after some analysis" which you are omitting?
---

88videos wrote

> Hello,
>
> After some analysis I have 500 variables.
>
> It looks like this. Data for example.
>
> INPUT PROGRAM.
> loop #i=1 to 500.
> compute id=#i.
> end case.
>  end loop.
> end file.
> END INPUT PROGRAM.
> execute.
> dataset name example.
>
> dataset activate example.
>
> do repeat i=@1 to @500.
> compute i=RV.UNIFORM(1, 10).
> end repeat.
> EXECUTE.
>
>
> I want to rename their names., but in command 'rename variables' i
> can't use 'to'.
> This command will cause error
> Rename variables
> @1 to v500=var1 to var500.
>
> I don 't want to use CTRL+F to find every '@' and replace it with 'var'.
>
>  How to do this?
>
> Thank you in advance.
>
>
>
>
>
>
>
>
>
> &lt;https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=li
> nk&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
> Wolny
> od wirusów. www.avast.com
> &lt;https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=li
> nk&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-rename-variables-names-automatically-tp5734442p5734447.html
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