Login  Register

Re: VARS TO CASES With Unknown Number of Variables

Posted by Jon K Peck on Jan 31, 2014; 12:21am
URL: http://spssx-discussion.165.s1.nabble.com/VARS-TO-CASES-With-Unknown-Number-of-Variables-tp5724242p5724253.html

However, doing this through Python programmability would be a piece of cake.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Andy W <[hidden email]>
To:        [hidden email],
Date:        01/30/2014 03:46 PM
Subject:        Re: [SPSSX-L] VARS TO CASES With Unknown Number of Variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




One way is if you know that date.1 to date.n are at the end of the variable
list, you can add a filler variable and then drop it after the VARSTOCASES.

numeric @ (ADATE10).
VARSTOCASES  /MAKE date FROM date.1 to @ /INDEX id (date).
SELECT IF id <> "@".

If you have other variables (or the date.? variables are not at the end of
the list) this trick won't work.





-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/VARS-TO-CASES-With-Unknown-Number-of-Variables-tp5724242p5724252.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