I'm trying to write SPSS syntax that counts a number of results (means, tables etc.) from a data matrix. The syntax is written in order to directly retrieve the data from an Excel matrix. I receive a new Excel matrix of of fresh data every two months or so, and the same statistics should be calculated. The problem is, that is not just the variable values that are changing in the source Excel matrix. The number of observations per case is growing steadily: it's n in January and, say, n + 14 in March. One observation consists of the date for the observation and 5 separate variable values (such as feeling of security, feeling of competence etc.). I'd like to keep my syntax as unchanged as possible from month to month - but how can I make it read the change in the number of observations without manually altering the syntax every single time? Is there a way to make the syntax recognise the change in the amount of a series of variables and adjust to it automatically? Can the changing number of variables be nested in the code?