I have a data set with 40 sets of 32 variables each. Each set of variables has the same 32 variables, named only by a different index: So, one set has A1_Themes1 A1_Themes2 ...; the next set has A2_Themes1 A2_Themes2 ...; and so on to A40_Themes1 A40_Themes2 .... (There is also a set of varibles Course1 to Course 40, which are index variables where each set came from: the A1 set is from Course1, etc).
For the end result, I want to end up with a data set with 32 variables -- Themes1 Themes2, etc (plus one more indicating the Course number each observation came from) and 40 observations. So, I need a VarsToCases command, but I am trying to avoid having to have 32 different /Make statements. I tried Do Repeat, but apparently you can't use VarsToCases in a Do Repeat loop.
Ideas?--
Update:
I got the following program to run.
define doLongVTC (vlist = !CMDEND)
!DO !vname !IN (!vlist)
varstocases
/make !vname from !DO !i=1 !to 40 !CONCAT("A", !I, "_", !vname) !DOEND
/INDEX = !CONCAT("i_", !vname) (!vname)
/NULL = KEEP.
!DOEND
!enddefine.
* SET MPRINT = on.
doLongVTC vlist =Themes_1 Themes_2 Themes_3 Themes_4 Themes_5 Themes_6 Themes_7 ThemesComm Content_1 Content_2 Content_3 Content_4 ContentComm Inquiry_CritThinking_1
Inquiry_CritThinking_2 Inquiry_CritThinking_3 Inquiry_CritThinking_4 SciCritThinkingComm Values_1 Values_2 Values_3 ValuesComm Comm_Literacy_Tech_1 Comm_Literacy_Tech_2
Comm_Literacy_Tech_3 Comm_Literacy_Tech_4 CommLitTechComm Pers_ProfDevelopmnt_1 Pers_ProfDevelopmnt_2 Pers_ProfDevelopmnt_3 Pers_ProfDevelopmnt_4 Pers_ProfDevelopmnt_5
Pers_ProfDevelopmnt_6 PersProfDevComm.
This creates the new variables, but as far as I can tell, the variables have no values in them, although it seems to be creating over 35 million cases.
Here's an image of the status bar when it was at only 13 million...

You can look at the dataset and the program here: https://pmaileiu-my.sharepoint.com/:f:/g/personal/sjscher_eiu_edu/EtAdAMutmaNGlONCj097a-oBPfkHHdvI9SvermfyzPXNxw?e=zYQyMy
You can use an SPSS macro to do this type of thing. The macro manipulates text in order to create syntax. creating the command would be simpler if the variables were contiguous in the file, then you could use
course1 to course40andA1_Themes1 to A1_Themes40, but the following macro doesn't assume this and calls each column separately so this should work even if the are not contiguous: