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
* Разбить текстовую строку на части, соответствующие истцу и ответчику (в каком-либо процессе).
* Разделение идёт по символу v (vs, vs., v.) - versus - "против". - А.Б.

DATA LIST FIXED /a 1-80 (A).
BEGIN DATA
STAPF V US
BUNTEN VS CUMBERLAND T ATTY
PIPER V. USA
MCCAMMON JR VS. US BOARD OF PAROLES
END DATA.
LIST.

STRING part1 part2(A80).
DO IF INDEX(a," VS. ")>0.
+	COMPUTE part1=SUBSTR(a,1,INDEX(a," VS. ")).
+	COMPUTE part2=SUBSTR(a,INDEX(a," VS. ")+5).
ELSE IF INDEX(a," VS ")>0.
+	COMPUTE part1=SUBSTR(a,1,INDEX(a," VS ")).
+	COMPUTE part2=SUBSTR(a,INDEX(a," VS ")+4).
ELSE IF INDEX(a," V. ")>0.
+	COMPUTE part1=SUBSTR(a,1,INDEX(a," V. ")).
+	COMPUTE part2=SUBSTR(a,INDEX(a," V. ")+4).
ELSE IF INDEX(a," V ")>0.
+	COMPUTE part1=SUBSTR(a,1,INDEX(a," V ")).
+	COMPUTE part2=SUBSTR(a,INDEX(a," V ")+3).
END IF.

EXECUTE.