There is an array with 300 occurrences and I need to sort the values there
in ascending position ignoring the duplicate values.
The array can contain 5 occurrences or 280 or 290. I will never know before…
Basically…
it’s a (n4/1:300)
let’s suppose that I have
4 (1)
5 (2)
9 (3)
120 (4)
4 (5)
6 (6)
130 (7)
I need it like this…
4(1)
5(2)
6(3)
9(4)
120(5)
130(6)
Long time ago, I use to have a cake’s receipt for it…but I tried to find everywhere
and I couldn’t…
DEFINE DATA LOCAL
1 #T(N4/1:10) INIT <4>
1 #I(I2)
1 #N(N4)
END-DEFINE
FOR #I 1 10
IF #T(#I) NE 0 #N := #T(#I)
END-IF
END-ALL
SORT BY #N USING KEY
AT START OF DATA
RESET #I#T()
END-START
AT BREAK OF #N #I := #I + 1 #T(#I) := OLD(#N)
END-BREAK
END-SORT
DISPLAY #T()
END