Login  Register

Re: VARS TO CASES With Unknown Number of Variables

Posted by Andy W on Jan 30, 2014; 10:45pm
URL: http://spssx-discussion.165.s1.nabble.com/VARS-TO-CASES-With-Unknown-Number-of-Variables-tp5724242p5724252.html

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
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/