Hi Everyone,
I have question regarding a histogram.
I have file with multiple occurrence fields.
Something like this
01 TEST VIEW OF TEST
02 A (A5) D
M 02 GROUP
03 B (A2)
03 C (A7)
02 D (N8)
01 KEY (A9)
02 B (A2)
02 C (A7)
The multiple occurrence fields range from 1 to 99
Now I have to read over 600000 records to and filter on b
So I have a program that does the following
DEFINE DATA
LOCAL
01 TEST-HIST OF TEST
02 A
02 B
02 C
02 D
*
01 #SEARCH-KEY (A2)
END-DEFINE
#SEARCH-KEY := 'D'
*
HS1.
HISTOGRAM TEST KEY STARTING FROM #SEARCH-KEY
*
iF #KEY NE #SEARCH-KEY
ESCAPE BOTTOM(HS1.)
END-IF
*
DO FIND KEY ON RECORD USING HS1 KEY
CALCULATE VALUE
*
END-HISTOGRAM
END
My question is the following:
is it possible to get different result depending if the program is run in batch or online?
Must the histogram not always have a full key?
Can the result differ from read results?
(Example of read program)
DEFINE DATA
LOCAL
01 TEST-VIEW OF TEST
02 A
02 C*GROUP
02 GROUP (1:99)
03 B
03 C
02 D
*
01 #SEARCH-KEY (A2)
01 #INDEX (N2)
END-DEFINE
*
#SEARCH-KEY := 'D'
*
RD1.
READ TEST-VIEW BY A
*
#INDEX := RD1.C?*GROUP
*
IF RD1.B(#INDEX) EQ 'D'
*
CALCULATE VALUE
*
END-IF
*
END-READ
END