So for 200 records you would get something like this:
Code: Select all
Form # # of Occurrences
12344 100
26351 10
85963 10
63693 2
98745 78
74582 100
Total number of records = 200
Thank You!!!!
Code: Select all
Form # # of Occurrences
12344 100
26351 10
85963 10
63693 2
98745 78
74582 100
Total number of records = 200
Code: Select all
DEFINE DATA LOCAL
1 #M (I4) CONST <20> /* Maximum number of forms
1 #TBL (0:#M)
2 #FORM (A5)
2 #COUNT (I4)
1 #WRK
2 #FORM (A5)
1 #E (I4)
1 #I (I4)
END-DEFINE
READ WORK 1 #WRK
EXAMINE #TBL.#FORM (0:#E) FOR #WRK.#FORM GIVING INDEX #I
IF #I = 0
THEN
ADD 1 TO #E
ASSIGN #I = #E
ASSIGN #TBL.#FORM (#I) = #WRK.#FORM
END-IF
ADD 1 TO #TBL.#COUNT (#I)
END-WORK
DISPLAY #TBL.#FORM (1:#E)
#TBL.#COUNT (1:#E)
END