Syntax to Copy Variable Labels and Properties

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

Syntax to Copy Variable Labels and Properties

Björn Türoque
I cross tab the same 12 variables by different variables quite frequently
so have adapted some syntax to run the appropriate functions. I have set
up some syntax to create a new variable that is essentially a copy of
whatever variable I want to cross my 12 variables by. This way I only have
to point the syntax at one variable instead of changing the variable 12
times in the syntax document.

The only problem is that when I copy the variable, it does not copy the
properties and when the crosstabs are run it labels everything with the
values 1,2,3, etc instead of the category names that were in the original
variable. I am wondering if there is a way to use some syntax to copy the
labels from one variable to another or a way to change the way my
crosstabs are run without having to change the name of the variable in the
syntax 12 times.

I am a bit of a novice at syntax, so the simplest way possible would be
great, thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Syntax to Copy Variable Labels and Properties

Antoon Smulders
Hello Don,

I haven't seen an answer to your question, though if I understand you well,
and if your version of SPSS supports the APLY DICTIONARY command the
solution is rather simple. Try something like:

APPLY DICTIONARY FROM * /SOURCE VARIABLES = OriginalVariable /TARGET
VARIABLES = DuplicateVariable.

Good luck

Antoon Smulders

-----Oorspronkelijk bericht-----
Van: SPSSX(r) Discussion [mailto:[hidden email]] Namens Don Asay
Verzonden: donderdag 18 januari 2007 23:44
Aan: [hidden email]
Onderwerp: Syntax to Copy Variable Labels and Properties

I cross tab the same 12 variables by different variables quite frequently
so have adapted some syntax to run the appropriate functions. I have set
up some syntax to create a new variable that is essentially a copy of
whatever variable I want to cross my 12 variables by. This way I only have
to point the syntax at one variable instead of changing the variable 12
times in the syntax document.

The only problem is that when I copy the variable, it does not copy the
properties and when the crosstabs are run it labels everything with the
values 1,2,3, etc instead of the category names that were in the original
variable. I am wondering if there is a way to use some syntax to copy the
labels from one variable to another or a way to change the way my
crosstabs are run without having to change the name of the variable in the
syntax 12 times.

I am a bit of a novice at syntax, so the simplest way possible would be
great, thanks!