1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
* How can I run a macro for each value contained in a parameter file.
* Ray 2002/10/27.

DATA LIST LIST /StockID(F8)  CoName(A12).
BEGIN DATA
2343                  'Systex'
2301                  'Guanbou'
2302                  'Company 1'
2303                  'Company 2'
2304                  'Company 3'
END DATA.
LIST.

SAVE OUTFILE='c:\\temp\\stockid.sav'.


DEFINE  !stkana (stkid =!TOKEN(1))
/* do whatever is needed */
COMPUTE stk=!stkid.
/* end of whatever is needed */
!ENDDEFINE.


*** start job ***.
GET FILE='c:\\temp\\stockid.sav'.
WRITE OUTFILE='c:\\temp\\code.sps' 
	/'!stkana stkid='stockid'.'.
EXECUTE.

SET MPRINT=yes.
INCLUDE 'c:\\temp\\code.sps'.