1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
*(Q) My string variable has a variable number of 4 character items separated by '/'
* for instance C206/E210/F210 contains C206 E210 and F210.
* How can I asssign each of these elements to a different variable?

(A) by Raynald Levesque 2002/04/30.


DATA LIST LIST /a(A70).
BEGIN DATA
C206/E210/F210
E206/P206/F210/G210/X210
END DATA.
LIST.

VECTOR B(7A4).

DO REPEAT v=b1 TO b5 /b=1 6 11 16 21 /e=4 9 14 19 24.
COMPUTE v=SUBSTR(a,b,e).
END REPEAT PRINT.
EXECUTE.