Login  Register

Re: Creation of New Groups of variables that correspond to the old groups

Posted by David Marso on Mar 09, 2013; 1:05pm
URL: http://spssx-discussion.165.s1.nabble.com/Creation-of-New-Groups-of-variables-that-correspond-to-the-old-groups-tp5718485p5718507.html

SEE:
DEFINE !ENDDEFINE (!DO) and NUMERIC commands.
Edit:  Also SORT VARIABLES command.
--
georgeb wrote
I have a long set of variables, titled SU1a, SU1b, SU1c, SU1d, SU1e all the way through SU40a, SU40b etc.  I am trying to create new variables with a similar naming scheme, but with "_p" added to the end.  Further, I need to put the groupings of variables next to each corresponding group, i.e. SU1a, SU1b, SU1c, SU1d, SU1e, SU1a_p, SU1b_p, SU1c_p, SU1d_p, SU1e_p, SU2a, SU2b...

I could grunt my way through this and create them by hand, or write the syntax for every variable, but it seems like I should be able to create a looping function or a macro that uses "SU1" or "SU2" etc as a starting point for creation, correct naming, and relocating the new variables. The things I have tried so far have not gotten me anywhere.

Any ideas?
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?"