I am new to SPSS macros. I intend on automating CTables production. In the ctables everything remains the same except the variable.
My command is:
CTABLES
/VLABELS VARIABLES=usevar anzahl gesamt F0passthrough DISPLAY=LABEL
/TABLE usevar [C][COLPCT.VALIDN '' PCT40.1] + anzahl [C][COUNT '' F40.0] BY gesamt + F0passthrough
/SLABELS POSITION=ROW
/CATEGORIES VARIABLES=usevar anzahl ORDER=A KEY=VALUE EMPTY=INCLUDE
/CATEGORIES VARIABLES=gesamt F0passthrough ORDER=A KEY=VALUE EMPTY=EXCLUDE.
filter off.
usevar is the variable I aim on exchanging with the macro. (my variables for example are F5 F6 F7)
so i tried:
DEFINE !usevar()
F1 F5
!ENDDEFINE.
CTABLES
/VLABELS VARIABLES=usevar anzahl gesamt F0passthrough DISPLAY=LABEL
/TABLE usevar [C][COLPCT.VALIDN '' PCT40.1] + anzahl [C][COUNT '' F40.0] BY gesamt + F0passthrough
/SLABELS POSITION=ROW
/CATEGORIES VARIABLES=usevar anzahl ORDER=A KEY=VALUE EMPTY=INCLUDE
/CATEGORIES VARIABLES=gesamt F0passthrough ORDER=A KEY=VALUE EMPTY=EXCLUDE.
filter off.
Any help is much appreciated - did not provide sample data. Just need a hint in the right direction.