1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
* Example of how to include 200 sps file by macro.

* Posted by Ray to SPSS newsgroup on 2002/04/10.
* http://pages.infinit.net/rlevesqu/index.htm

SET MPRINT=no.

*//////////////////////.
DEFINE !runall (stem=!TOKENS(1) /nb=!TOKENS(1))
!LET !totlen=!LENGTH(!stem)

!DO !cnt=1 !TO !nb

!LET !c1=!LENGTH(!SUBSTR(!stem,!LEN(!CONCAT(!cnt," "))))
/* stem1 is the portion of stem that we want to keep */
!LET !stem1=!SUBSTR(!stem,1,!c1)
INCLUDE !QUOTE(!CONCAT('c:\\path\\',!stem1,!cnt,'.sps.')).
!DOEND
!ENDDEFINE.
*//////////////////////.

* Now call the macro to generate the 200 syntax calls.
SET MPRINT=yes.
!runall stem=question0000 nb=12.