how to move long variable labels to new custom attribute

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

how to move long variable labels to new custom attribute

Art Kendall
A data set has the original questions as the variable labels.
These labels make messy tables.   How would I create a new custom attribute
named "Question"  that has the contents of the "Label" attribute?

Then I would go back and put in new VAR LABELS by syntax.



-----
Art Kendall
Social Research Consultants
--
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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: how to move long variable labels to new custom attribute

Jon Peck
Piece of cake.

begin program python3.
import spssaux
    
vardict = spssaux.VariableDict()
for v in vardict:
   spssaux.createAttribute(v.VariableName, "Question", v.VariableLabel)
end program.

On Fri, Oct 16, 2020 at 1:52 PM Art Kendall <[hidden email]> wrote:
A data set has the original questions as the variable labels.
These labels make messy tables.   How would I create a new custom attribute
named "Question"  that has the contents of the "Label" attribute?

Then I would go back and put in new VAR LABELS by syntax.



-----
Art Kendall
Social Research Consultants
--
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


--
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 move long variable labels to new custom attribute

Art Kendall
Thanks.

Much easier than pasting in a word processing program and writing syntax.



-----
Art Kendall
Social Research Consultants
--
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
Art Kendall
Social Research Consultants